:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --ink: #292d2a;
  --muted: #656963;
  --line: #c8cac3;
  --accent: #5c6a60;
  --accent-dark: #4b584e;
  --panel: rgba(239, 238, 233, 0.92);
  --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: #858981;
}

body {
  min-width: 320px;
  min-height: 100vh;
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: #858981;
}

.background-layer {
  position: fixed;
  z-index: 0;
  inset: 0;
  background-color: #858981;
  background-image: url("https://t.alcy.cc/ycy");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  pointer-events: none;
}

.background-layer::after {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(42, 45, 41, 0.38);
}

button {
  font: inherit;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid #435b4b;
  outline-offset: 3px;
}

::selection {
  color: #20251f;
  background: #c4cec2;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  display: grid;
  place-items: center;
}

.panel {
  width: min(100%, 700px);
  overflow: hidden;
  border: 1px solid rgba(224, 224, 216, 0.82);
  border-top: 3px solid var(--accent);
  border-radius: 5px;
  background: var(--panel);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: panel-enter 0.28s ease-out both;
}

@keyframes panel-enter {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel-header {
  padding: 36px 38px 30px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
}

.mono-label,
.meta-label,
.version-label {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.11em;
  line-height: 1.5;
}

.mono-label {
  margin: 0 0 13px;
  color: #626a62;
}

.panel-header h1,
.invalid-view h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  font-weight: 580;
  line-height: 1.2;
  letter-spacing: -0.045em;
}

.version-label {
  min-width: 78px;
  min-height: 40px;
  padding: 9px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #aeb4ab;
  border-radius: 2px;
  color: #4f5c52;
  background: rgba(247, 247, 242, 0.52);
  text-align: center;
  white-space: nowrap;
}

.session-meta {
  margin: 0 38px;
  padding: 20px 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.session-meta-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.expiry-item {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.meta-label {
  color: #72766f;
  letter-spacing: 0.06em;
}

#session-status {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

#session-status.is-pending {
  color: #59675c;
}

#session-status.is-completed {
  color: #465d4d;
}

#session-status.is-error {
  color: #8a4d48;
}

#session-expiry {
  color: #38473d;
  font-family: var(--mono);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.25;
}

#session-expiry.is-expiring {
  color: #886744;
}

#session-expiry.is-expired {
  color: #8a4d48;
  font-size: 15px;
}

.captcha-workspace {
  padding: 28px 38px 30px;
}

.workspace-heading {
  margin-bottom: 22px;
}

.workspace-heading .mono-label {
  margin-bottom: 8px;
}

#captcha-help {
  margin: 0;
  color: #515750;
  font-size: 14px;
  line-height: 1.7;
}

.captcha-container {
  margin-bottom: 18px;
  border-radius: 3px;
}

.captcha-container:empty {
  display: none;
}

.captcha-container:not(:empty) {
  padding: 10px;
  border: 1px solid #c6c9c1;
  background: rgba(250, 250, 246, 0.72);
}

.captcha-container > * {
  max-width: 100%;
}

.captcha-container input {
  font-size: 16px !important;
}

.captcha-container img {
  max-width: 100%;
}

.button {
  min-height: 48px;
  padding: 12px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.button-primary {
  width: 100%;
  min-height: 52px;
  color: #f4f5f1;
  background: var(--accent);
}

.button-primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.button-primary:active:not(:disabled) {
  background: #414d44;
}

.button-secondary {
  color: #424b44;
  border-color: #aeb4ab;
  background: rgba(249, 249, 244, 0.66);
}

.button-secondary:hover:not(:disabled) {
  border-color: #818c82;
  background: #f3f3ed;
}

.button:disabled {
  color: #eceee8;
  background: #929a91;
  cursor: not-allowed;
  opacity: 0.72;
}

.button-spinner {
  width: 16px;
  height: 16px;
  display: none;
  flex: 0 0 auto;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.button.is-loading .button-spinner {
  display: block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.status-message {
  margin-top: 14px;
  padding: 11px 13px;
  border-left: 2px solid #758177;
  border-radius: 2px;
  color: #4d5b50;
  background: rgba(220, 225, 217, 0.68);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.status-message.is-error {
  color: #7d4743;
  border-left-color: #a66d66;
  background: rgba(234, 220, 215, 0.72);
}

.status-message.is-success {
  color: #455d4c;
  border-left-color: #647c69;
  background: rgba(216, 226, 215, 0.74);
}

.status-message.is-loading {
  color: #555e56;
}

.workspace-footer {
  margin-top: 18px;
  padding-top: 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
}

.workspace-footer > span {
  color: #747870;
  font-size: 11px;
  line-height: 1.6;
}

.text-button {
  min-width: 84px;
  min-height: 44px;
  padding: 8px 4px;
  flex: 0 0 auto;
  border: 0;
  border-bottom: 1px solid #8c978d;
  border-radius: 0;
  color: #4c5e51;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.text-button:hover:not(:disabled) {
  color: #283e30;
  border-bottom-color: #405847;
}

.text-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.session-error {
  margin: 28px 38px 34px;
  padding: 24px;
  border: 1px solid #cbb7b0;
  border-left: 3px solid #9a6b63;
  border-radius: 3px;
  background: rgba(239, 229, 223, 0.72);
}

.session-error .mono-label {
  margin-bottom: 10px;
  color: #825d55;
}

.session-error h2 {
  margin: 0 0 9px;
  font-size: 20px;
  font-weight: 600;
}

#session-error-message {
  margin: 0 0 20px;
  color: #6f5550;
  font-size: 14px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.completion-panel {
  min-height: 190px;
  padding: 46px 38px;
  display: grid;
  place-items: center;
  text-align: center;
}

#completion-message {
  max-width: 480px;
  margin: 0;
  color: #3f5245;
  font-size: clamp(20px, 4vw, 27px);
  font-weight: 540;
  line-height: 1.65;
  letter-spacing: -0.025em;
  white-space: pre-line;
  text-wrap: balance;
}

.invalid-view {
  width: min(100%, 580px);
  padding: 42px 38px 44px;
}

.invalid-view .mono-label {
  margin-bottom: 18px;
}

.invalid-view h1 {
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(28px, 5vw, 38px);
}

.invalid-view > p:last-child {
  margin: 24px 0 0;
  color: #555c55;
  font-size: 16px;
  line-height: 1.75;
}

.noscript-message {
  position: fixed;
  z-index: 3;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  left: max(16px, env(safe-area-inset-left));
  max-width: 560px;
  margin: auto;
  padding: 18px 20px;
  border: 1px solid #b9aaa2;
  border-radius: 4px;
  color: #654d47;
  background: rgba(239, 234, 227, 0.96);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

@supports not ((-webkit-backdrop-filter: blur(6px)) or (backdrop-filter: blur(6px))) {
  .panel {
    background: rgba(239, 238, 233, 0.98);
  }
}

@media (min-width: 900px) {
  .verify-view {
    width: min(100%, 740px);
  }

  .panel-header {
    padding-top: 42px;
  }
}

@media (max-width: 560px) {
  .page-shell {
    padding-top: max(18px, env(safe-area-inset-top));
    padding-right: max(14px, env(safe-area-inset-right));
    padding-bottom: max(18px, env(safe-area-inset-bottom));
    padding-left: max(14px, env(safe-area-inset-left));
  }

  .panel-header {
    padding: 27px 21px 23px;
    gap: 14px;
  }

  .panel-header h1 {
    font-size: 30px;
  }

  .version-label {
    min-width: 60px;
    min-height: 36px;
    padding: 7px 8px;
    font-size: 10px;
  }

  .session-meta {
    margin: 0 21px;
    padding: 17px 0;
    gap: 15px;
  }

  .expiry-item {
    padding-left: 15px;
  }

  #session-status {
    font-size: 13px;
  }

  #session-expiry {
    font-size: 19px;
  }

  .captcha-workspace {
    padding: 24px 21px 23px;
  }

  .workspace-footer {
    align-items: flex-start;
    gap: 12px;
  }

  .workspace-footer > span {
    max-width: 190px;
  }

  .session-error {
    margin: 23px 21px 25px;
    padding: 20px;
  }

  .completion-panel {
    min-height: 210px;
    padding: 38px 24px;
  }

  .invalid-view {
    padding: 32px 24px 34px;
  }
}

@media (max-width: 360px) {
  .panel-header {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .version-label {
    justify-self: start;
  }

  .workspace-footer {
    flex-direction: column;
  }

  .workspace-footer > span {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
