:root {
  color-scheme: light;
  --bg: #f4f8f9;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --line: #dfe8eb;
  --line-strong: #cfdddf;
  --text: #263332;
  --muted: #71807f;
  --faint: #9aa7a7;
  --brand: #14a38b;
  --brand-dark: #0d7f6c;
  --brand-soft: #dff1ee;
  --cyan: #159caf;
  --danger: #c93f58;
  --danger-soft: #fff0f3;
  --warning: #9a6313;
  --warning-soft: #fff7e7;
  --shadow: 0 18px 50px rgba(31, 58, 57, 0.08);
}

* { 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;
  overflow-x: hidden;
  color: var(--text);
  background: linear-gradient(180deg, #f9fbfb 0, #f2f7f8 58%, #eef5f6 100%);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, -apple-system, 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,
input:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(20, 163, 139, 0.24);
  outline-offset: 3px;
}

.page-glow {
  position: fixed;
  z-index: -1;
  pointer-events: none;
  border-radius: 999px;
  filter: blur(90px);
}

.page-glow-top {
  top: -180px;
  left: 50%;
  width: min(880px, 90vw);
  height: 390px;
  transform: translateX(-50%);
  background: rgba(20, 163, 139, 0.13);
}

.page-glow-bottom {
  right: -170px;
  bottom: -160px;
  width: 480px;
  height: 390px;
  background: rgba(21, 156, 175, 0.08);
}

.site-header {
  position: relative;
  z-index: 5;
  border-bottom: 1px solid rgba(207, 221, 223, 0.72);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 2px 10px rgba(34, 61, 60, 0.025);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(860px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; min-width: 0; gap: 12px; }
.brand-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(20, 163, 139, 0.23);
}
.brand-icon svg { width: 20px; height: 20px; }
.brand-copy { display: flex; align-items: center; min-width: 0; gap: 8px; }
.brand-copy strong { overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.brand-copy span {
  padding: 3px 7px;
  flex: 0 0 auto;
  border-radius: 999px;
  color: var(--brand-dark);
  background: var(--brand-soft);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .02em;
}

.ready-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  flex: 0 0 auto;
  border: 1px solid #cde5e1;
  border-radius: 999px;
  color: var(--brand-dark);
  background: rgba(223, 241, 238, .76);
  font-size: 12px;
  font-weight: 750;
}
.ready-badge span { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px rgba(20, 163, 139, .09); }

.main-shell {
  width: min(720px, calc(100% - 32px));
  margin: auto;
  padding: 44px 0 34px;
}

.site-notice {
  width: min(520px, 100%);
  min-height: 50px;
  margin: 0 auto 18px;
  padding: 12px 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #b9dfd9;
  border-radius: 16px;
  color: #0c7867;
  background: #dfeeed;
  box-shadow: 0 5px 18px rgba(31, 111, 98, .06);
  text-align: center;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
}
.site-notice[href]:hover { color: #086352; background: #d2e9e6; transform: translateY(-1px); }
.site-notice svg { width: 16px; height: 16px; flex: 0 0 auto; }

.tool-tabs {
  width: min(520px, 100%);
  min-height: 52px;
  margin: 0 auto 22px;
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  border: 1px solid #dce5e7;
  border-radius: 16px;
  background: rgba(226, 233, 235, .78);
  box-shadow: inset 0 1px 3px rgba(26, 53, 52, .05);
}

.tool-tab {
  min-width: 0;
  padding: 10px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 11px;
  color: #5c6969;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}
.tool-tab svg { width: 16px; height: 16px; flex: 0 0 auto; }
.tool-tab:hover { color: var(--text); }
.tool-tab.is-active { color: var(--brand-dark); background: #fff; box-shadow: 0 3px 10px rgba(32, 58, 57, .08); }

.tool-panel {
  padding: clamp(25px, 5vw, 40px);
  border: 1px solid rgba(213, 225, 227, .9);
  border-radius: 28px;
  background: rgba(255, 255, 255, .96);
  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: 800 10px ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.panel-heading h1, .panel-heading h2 { margin: 0; color: #21302f; letter-spacing: -.035em; }
.panel-heading h1 { font-size: clamp(25px, 5vw, 34px); }
.panel-heading h1 span { color: var(--faint); font-size: .58em; letter-spacing: .01em; }
.panel-heading h2 { font-size: clamp(24px, 5vw, 31px); }
.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 #edf1f2; }
.secure-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #cae5e0;
  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: #354443; font-size: 13px; font-weight: 850; }
.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: 800; }
.text-button:hover { color: #075e50; }
.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: #92a2a3; 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: #f8fafb;
  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: #9ba8aa; font-family: inherit; letter-spacing: .015em; }
input:focus { border-color: rgba(20, 163, 139, .72); background: #fff; box-shadow: 0 0 0 4px rgba(20, 163, 139, .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: #7c8b8a; background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; }
.clear-button:hover { color: var(--text); background: #edf2f3; }

.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: 850;
  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(20, 163, 139, .2); }
.primary-button:hover:not(:disabled) { background: #0d8d78; transform: translateY(-1px); }
.secondary-button { border: 1px solid #dce5e7; color: #4d5b5a; background: #f5f8f9; }
.secondary-button:hover:not(:disabled) { color: #263332; background: #eaf0f1; 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 { margin-top: 17px; padding: 13px 15px; border: 1px solid #d8e8e5; border-radius: 13px; color: #49605d; background: #f0f8f6; font-size: 13px; line-height: 1.55; }
.status.error { border-color: #f3c9d1; color: var(--danger); background: var(--danger-soft); }
.status.success { border-color: #bfe2db; color: var(--brand-dark); background: #ebf8f5; }
.status.warning { border-color: #f0deb8; color: var(--warning); background: var(--warning-soft); }

.check-result { margin-top: 17px; padding: 15px 17px; border: 1px solid #cde5e1; border-radius: 15px; background: rgba(223, 241, 238, .55); }
.check-result-main { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; font-weight: 800; }
.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 rgba(173, 211, 204, .6); color: var(--muted); font-size: 11px; }
.check-result-meta strong { color: #40504e; }

.result { margin-top: 24px; padding-top: 24px; border-top: 1px solid #e8edef; }
.result-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.success-label { color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .09em; }
.result h2 { margin: 5px 0 0; color: #253332; font-size: 21px; letter-spacing: -.02em; }
.countdown { padding: 7px 9px; border-radius: 9px; color: #596967; background: #eff4f4; 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 #dfe7e9; border-radius: 15px; color: #344240; background: #f8fafb; 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: #263534; 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: #eaf7f4; background: #152725; }
.markdown-content code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.markdown-content :not(pre) > code { padding: 2px 5px; border-radius: 5px; color: #136f60; background: #e4f2ef; }
.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 #bfe0db; border-radius: 12px; color: var(--brand-dark); background: #e9f7f4; cursor: pointer; font-size: 12px; font-weight: 850; }
.detected-2fa:hover { background: #def1ed; }
.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 #cae4df; border-radius: 17px; background: linear-gradient(135deg, #eff9f7, #f8fbfb); }
.twofa-code-card > div { min-width: 0; }
.twofa-code-card span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; }
.twofa-code-card output { margin-top: 6px; display: block; color: #173f39; 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: #86cec4; }
.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: #e4ebec; }
.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: 850; }
.privacy-note { margin-top: 20px; padding: 13px 15px; display: flex; align-items: flex-start; gap: 9px; border-radius: 13px; color: #5f716f; background: #f3f7f7; 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 #e7edef; }
.faq-list details:last-child { border-bottom: 0; }
.faq-list summary { position: relative; padding: 19px 34px 19px 2px; color: #344240; cursor: pointer; list-style: none; font-size: 14px; font-weight: 850; }
.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: #ecf6f4; 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: 18px 18px 26px; color: #99a6a6; text-align: center; font-size: 10px; letter-spacing: .015em; }

.confirm-dialog {
  width: min(430px, calc(100% - 32px));
  padding: 28px;
  border: 1px solid #dbe5e6;
  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: #263432; 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: min(100% - 24px, 860px); height: 62px; }
  .brand-icon { width: 35px; height: 35px; border-radius: 11px; }
  .brand-copy strong { font-size: 14px; }
  .brand-copy span { display: none; }
  .ready-badge { padding: 7px 9px; font-size: 10px; }
  .main-shell { width: min(100% - 24px, 720px); padding: 28px 0 24px; }
  .site-notice { margin-bottom: 14px; padding: 10px 13px; border-radius: 14px; font-size: 12px; }
  .tool-tabs { min-height: 49px; margin-bottom: 15px; padding: 5px; border-radius: 14px; }
  .tool-tab { padding: 9px 4px; gap: 5px; border-radius: 10px; font-size: 11px; }
  .tool-tab svg { width: 14px; height: 14px; }
  .tool-panel { padding: 24px 19px; border-radius: 22px; }
  .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; }
}
