/* WuJie-AI storefront: neutral surfaces, dark actions and pill navigation. */
:root {
  color-scheme: light;
  --bg: #f3f4f6;
  --surface: #fff;
  --surface-soft: #f9fafb;
  --line: #e5e7eb;
  --line-strong: #d1d5db;
  --text: #202123;
  --muted: #6b7280;
  --faint: #9ca3af;
  --brand: #111827;
  --brand-dark: #030712;
  --brand-soft: #f3f4f6;
  --cyan: #4b5563;
  --danger: #c93f58;
  --danger-soft: #fff0f3;
  --warning: #9a6313;
  --warning-soft: #fff7e7;
  --shadow: 0 4px 20px rgba(17, 24, 39, .04);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; color: var(--text); background: var(--bg); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
button, summary, a { -webkit-tap-highlight-color: transparent; }
button { border: 0; }
svg { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid #9ca3af; outline-offset: 3px; }
.site-header { background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.header-inner { width: min(1200px, calc(100% - 64px)); min-height: 72px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--brand); text-decoration: none; flex-shrink: 0; }
.brand-logo { display: block; width: 44px; height: 44px; object-fit: contain; }
.brand-copy { display: flex; align-items: center; gap: 12px; }
.brand-copy strong { font-size: 19px; letter-spacing: -.04em; }
.brand-copy span { border-left: 1px solid var(--line-strong); padding-left: 12px; font-size: 12px; color: var(--muted); }
.header-nav { display: flex; gap: 8px; }
.header-nav a { padding: 10px 14px; border-radius: 8px; color: var(--brand); text-decoration: none; font-size: 13px; font-weight: 550; }
.header-nav a:hover { background: #f3f4f6; }
.main-shell { width: min(800px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 54px; flex: 1; }
.site-notice { min-height: 50px; margin: 0 0 32px; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--line); border-radius: 16px; color: var(--brand); background: #fff; box-shadow: 0 2px 8px rgba(17,24,39,.03); text-decoration: none; font-size: 13px; font-weight: 550; line-height: 1.6; overflow-wrap: anywhere; }
.site-notice[href]:hover { border-color: var(--line-strong); background: #fafafa; }
.site-notice svg { width: 16px; height: 16px; flex: 0 0 auto; }
.page-intro { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 26px; }
.page-intro h1 { margin: 0; color: var(--brand); font-size: clamp(26px, 4vw, 32px); letter-spacing: -.04em; font-weight: 650; }
.page-intro > div > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.ready-badge { display: flex; align-items: center; gap: 7px; flex-shrink: 0; color: var(--muted); font-size: 11px; }
.ready-badge span { width: 6px; height: 6px; border-radius: 50%; background: #16a34a; }
.tool-tabs { display: flex; gap: 10px; margin: 0 0 22px; }
.tool-tab { min-width: 0; min-height: 40px; padding: 10px 22px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 999px; color: #374151; background: #e9eaec; cursor: pointer; font-size: 13px; font-weight: 600; transition: color .16s ease, background .16s ease; }
.tool-tab svg { width: 16px; height: 16px; flex: 0 0 auto; }
.tool-tab:hover { background: #e1e3e6; }
.tool-tab.is-active { color: #fff; background: var(--brand); box-shadow: 0 4px 10px rgba(17,24,39,.15); }
.tool-panel { padding: clamp(24px, 4vw, 36px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: var(--shadow); animation: panel-in .2s ease-out; }
@keyframes panel-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 22px; }
.eyebrow { margin: 0 0 8px; color: var(--brand); font: 500 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.panel-heading h1, .panel-heading h2 { margin: 0; color: #111827; letter-spacing: -.035em; }
.panel-heading h1 { font-size: 24px; }
.panel-heading h1 span { color: var(--faint); font-size: .58em; letter-spacing: .01em; }
.panel-heading h2 { font-size: 24px; font-weight: 600; }
.panel-heading h2 span { color: var(--faint); font-size: 15px; }
.panel-heading > div > p:last-child { max-width: 550px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.compact-heading { padding-bottom: 24px; border-bottom: 1px solid #e5e7eb; }
.secure-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #e5e7eb;
  border-radius: 13px;
  color: var(--brand);
  background: var(--brand-soft);
}
.secure-mark svg { width: 19px; height: 19px; }

.redeem-form { margin-top: 29px; }
.field-label-row { min-height: 28px; display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.field-label-row label { display: flex; align-items: center; gap: 7px; color: #111827; font-size: 13px; font-weight: 600; }
.field-label-row label svg { width: 15px; height: 15px; color: var(--brand); }
.text-button { padding: 6px 2px; display: inline-flex; align-items: center; gap: 6px; color: var(--brand-dark); background: transparent; cursor: pointer; font-size: 12px; font-weight: 600; }
.text-button:hover { color: #111827; }
.text-button svg { width: 14px; height: 14px; }

.input-wrap { position: relative; margin-top: 9px; }
.input-wrap > svg { position: absolute; left: 17px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); color: #6b7280; pointer-events: none; }
input {
  width: 100%;
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 15px;
  outline: 0;
  color: var(--text);
  background: #f9fafb;
  box-shadow: inset 0 1px 4px rgba(24, 46, 45, .035);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 16px;
  letter-spacing: .035em;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
.input-wrap input { padding-left: 49px; padding-right: 64px; text-transform: uppercase; }
input::placeholder { color: #6b7280; font-family: inherit; letter-spacing: .015em; }
input:focus { border-color: rgba(17, 24, 39, .72); background: #fff; box-shadow: 0 0 0 4px rgba(17, 24, 39, .10); }
input:disabled { opacity: .65; cursor: wait; }
.clear-button { position: absolute; top: 50%; right: 11px; padding: 7px 8px; transform: translateY(-50%); border-radius: 8px; color: #6b7280; background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.clear-button:hover { color: var(--text); background: #f9fafb; }

.button-row, .result-actions, .dialog-actions { display: grid; grid-template-columns: 1fr 1.08fr; gap: 11px; }
.button-row { margin-top: 15px; }
.primary-button, .secondary-button, .copy-code-button {
  min-height: 50px;
  padding: 13px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: transform .14s ease, color .14s ease, background .14s ease, opacity .14s ease;
}
.primary-button { color: #fff; background: var(--brand); box-shadow: 0 7px 16px rgba(17, 24, 39, .2); }
.primary-button:hover:not(:disabled) { background: #111827; transform: translateY(-1px); }
.secondary-button { border: 1px solid #e5e7eb; color: #6b7280; background: #f9fafb; }
.secondary-button:hover:not(:disabled) { color: #111827; background: #f9fafb; transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled, .copy-code-button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; }
.primary-button svg, .secondary-button svg, .copy-code-button svg { width: 17px; height: 17px; flex: 0 0 auto; }
.is-busy svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.status { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 17px; padding: 13px 15px; border: 1px solid #e5e7eb; border-radius: 13px; color: #6b7280; background: #f9fafb; font-size: 13px; line-height: 1.55; }
.status.error { border-color: #f3c9d1; color: var(--danger); background: var(--danger-soft); }
.status.success { border-color: #e5e7eb; color: var(--brand-dark); background: #f9fafb; }
.status.warning { border-color: #f0deb8; color: var(--warning); background: var(--warning-soft); }

.check-result { margin-top: 17px; padding: 15px 17px; border: 1px solid #e5e7eb; border-radius: 15px; background: #f9fafb; }
.check-result-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 600; }
.check-result-main strong { padding: 6px 10px; border-radius: 999px; color: var(--brand-dark); background: #fff; font-size: 11px; }
.check-result.is-expired { border-color: #f0deb8; background: var(--warning-soft); }
.check-result.is-expired .check-result-main strong { color: var(--warning); }
.check-result-meta { margin-top: 12px; padding-top: 11px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 16px; border-top: 1px solid #e5e7eb; color: var(--muted); font-size: 11px; }
.check-result-meta strong { color: #111827; }

.result { margin-top: 24px; padding-top: 24px; border-top: 1px solid #e5e7eb; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.success-label { color: var(--brand); font-size: 11px; font-weight: 700; letter-spacing: .09em; }
.result h2 { margin: 5px 0 0; color: #111827; font-size: 21px; letter-spacing: -.02em; }
.countdown { padding: 7px 9px; border-radius: 9px; color: #6b7280; background: #f9fafb; font: 700 11px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.countdown.is-expired { color: var(--warning); background: var(--warning-soft); }
.markdown-content { margin-top: 18px; padding: 18px; overflow-wrap: anywhere; border: 1px solid #e5e7eb; border-radius: 15px; color: #111827; background: #f9fafb; font-size: 14px; line-height: 1.75; }
.markdown-content > :first-child { margin-top: 0; }
.markdown-content > :last-child { margin-bottom: 0; }
.markdown-content h1, .markdown-content h2, .markdown-content h3 { color: #111827; line-height: 1.35; }
.markdown-content a { color: var(--brand-dark); font-weight: 750; text-underline-offset: 3px; }
.markdown-content pre { max-width: 100%; overflow-x: auto; padding: 13px; border-radius: 10px; color: #f9fafb; background: #111827; }
.markdown-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-content :not(pre) > code { padding: 2px 5px; border-radius: 5px; color: #111827; background: #f9fafb; }
.markdown-content blockquote { margin-left: 0; padding-left: 14px; border-left: 3px solid var(--brand); color: var(--muted); }
.detected-2fa { width: 100%; margin-top: 12px; padding: 12px 15px; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #e5e7eb; border-radius: 12px; color: var(--brand-dark); background: #f9fafb; cursor: pointer; font-size: 12px; font-weight: 600; }
.detected-2fa:hover { background: #f9fafb; }
.detected-2fa svg { width: 16px; height: 16px; }
.result-actions { margin-top: 12px; grid-template-columns: 1fr 1fr; }
.result-actions button { min-height: 44px; }

.twofa-form { margin-top: 24px; }
.twofa-form > input { margin-top: 8px; text-transform: uppercase; }
.field-error { margin: 8px 2px 0; color: var(--danger); font-size: 12px; }
.twofa-code-card { margin-top: 18px; padding: 20px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border: 1px solid #e5e7eb; border-radius: 17px; background: #f9fafb; }
.twofa-code-card > div { min-width: 0; }
.twofa-code-card > div > span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.twofa-code-card output { margin-top: 6px; display: block; color: #111827; font: 900 clamp(28px, 7vw, 38px) ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .15em; white-space: nowrap; }
.copy-code-button { min-height: 43px; flex: 0 0 auto; color: #fff; background: var(--brand); }
.copy-code-button:not(:disabled):hover { background: var(--brand-dark); }
.copy-code-button:disabled { opacity: 1; color: #fff; background: #6b7280; }
.twofa-timer { margin-top: 15px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.timer-track { height: 6px; overflow: hidden; border-radius: 999px; background: #e5e7eb; }
.timer-track span { width: 100%; height: 100%; display: block; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--cyan)); transition: width .3s linear; }
.twofa-timer p { margin: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }
.twofa-timer p span { color: var(--brand-dark); font-weight: 600; }
.privacy-note { margin-top: 20px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 9px; border-radius: 13px; color: #6b7280; background: #f9fafb; font-size: 12px; line-height: 1.55; }
.privacy-note svg { width: 17px; height: 17px; flex: 0 0 auto; color: var(--brand); }

.faq-list { margin-top: 8px; }
.faq-list details { border-bottom: 1px solid #e5e7eb; }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary { position: relative; padding: 19px 34px 19px 2px; color: #111827; cursor: pointer; list-style: none; font-size: 14px; font-weight: 600; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; top: 15px; right: 4px; display: grid; place-items: center; width: 25px; height: 25px; border-radius: 50%; color: var(--brand-dark); background: #f9fafb; font-size: 18px; font-weight: 500; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list p { margin: -4px 34px 19px 2px; color: var(--muted); font-size: 13px; line-height: 1.75; }

.site-footer { padding: 26px 20px 20px; border-top: 1px solid var(--line); background: #fff; color: var(--muted); text-align: center; font-size: 12px; }
.footer-brand { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; }
.footer-brand img { object-fit: contain; }
.footer-brand strong { color: var(--brand); font-size: 14px; }
.footer-brand span { margin-left: 6px; }
.site-footer nav { display: flex; justify-content: center; gap: 24px; margin: 16px 0; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.site-footer p { margin: 0; color: #9ca3af; font-size: 11px; }

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  color: var(--text);
  background: #fff;
  box-shadow: 0 30px 80px rgba(20, 42, 40, .2);
}
.confirm-dialog::backdrop { background: rgba(25, 42, 41, .38); backdrop-filter: blur(4px); }
.confirm-icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; color: var(--brand); background: var(--brand-soft); }
.confirm-icon svg { width: 22px; height: 22px; }
.confirm-dialog h2 { margin: 18px 0 0; color: #111827; font-size: 21px; }
.confirm-dialog p { margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.7; }
.dialog-actions { margin-top: 23px; grid-template-columns: 1fr 1.18fr; }
.dialog-actions button { min-height: 45px; }

@media (max-width: 620px) {
  .header-inner { width: calc(100% - 32px); min-height: 64px; flex-wrap: wrap; justify-content: center; padding: 12px 0; gap: 10px; }
  .brand-logo { width: 36px; height: 36px; }
  .brand-copy strong { font-size: 17px; }
  .header-nav { justify-content: center; gap: 10px; }
  .header-nav a { padding: 7px 12px; font-size: 12px; }
  .main-shell { width: calc(100% - 32px); padding: 26px 0 32px; }
  .site-notice { margin-bottom: 24px; padding: 12px 16px; font-size: 12px; }
  .page-intro { align-items: flex-start; flex-direction: column; gap: 12px; margin-bottom: 22px; }
  .tool-tabs { gap: 8px; margin-bottom: 18px; }
  .tool-tab { flex: 1; padding: 10px 8px; gap: 5px; font-size: 12px; }
  .tool-tab svg { width: 14px; height: 14px; }
  .tool-panel { padding: 24px 20px; border-radius: 16px; }
  .panel-heading { gap: 12px; }
  .panel-heading > div > p:last-child { font-size: 12px; }
  .secure-mark { width: 35px; height: 35px; border-radius: 11px; }
  .button-row { grid-template-columns: 1fr; }
  .button-row button { min-height: 48px; }
  .result-heading { flex-direction: column; gap: 10px; }
  .result-actions { grid-template-columns: 1fr; }
  .twofa-code-card { padding: 17px; flex-direction: column; align-items: stretch; }
  .twofa-code-card output { letter-spacing: .11em; }
  .copy-code-button { width: 100%; }
  .twofa-timer { grid-template-columns: 1fr; gap: 8px; }
  .twofa-timer p { text-align: right; }
  .dialog-actions { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
  .ready-badge { border: 0; background: transparent; }
  .ready-badge span { display: none; }
  .tool-tab { font-size: 10px; }
  .tool-tab svg { display: none; }
  .field-label-row { align-items: flex-start; }
  .text-button { font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
