:root {
  color-scheme: dark;
  --bg: #101116;
  --panel: #181a22;
  --panel-soft: #20232d;
  --line: #2d303b;
  --line-strong: #3a3e4b;
  --text: #f3f4f7;
  --muted: #a0a5b4;
  --faint: #757b8b;
  --accent: #7ea7ff;
  --accent-strong: #5588f7;
  --accent-tint: #202d4b;
  --green: #6dd5a1;
  --orange: #e8b46f;
  --danger: #ff9b9b;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--bg); scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: radial-gradient(ellipse at 50% -20%, #20253a 0, var(--bg) 42rem); color: var(--text); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app-shell { width: min(1180px, 100%); margin: 0 auto; padding: 24px 24px 18px; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 8px 0 27px; border-bottom: 1px solid rgba(150, 159, 186, .12); }
.brand-mark { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; background: linear-gradient(135deg, #7ba5ff, #826bdf); color: #fff; font-weight: 800; font-size: 21px; box-shadow: 0 8px 24px rgba(98, 125, 235, .23); }
.brand-copy { display: flex; flex-direction: column; gap: 2px; }
.brand-name { font-size: 15px; letter-spacing: .02em; font-weight: 750; }
.brand-subtitle { font-size: 11px; color: var(--muted); }
.local-badge { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; padding: 7px 10px; border: 1px solid rgba(109, 213, 161, .2); border-radius: 999px; background: rgba(109, 213, 161, .07); color: #a5e9c5; font-size: 11px; white-space: nowrap; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 10px rgba(109, 213, 161, .5); }
.hero { padding: 34px 0 27px; }
.eyebrow, .section-kicker { color: var(--accent); text-transform: uppercase; letter-spacing: .17em; font-size: 10px; font-weight: 800; }
h1 { font-size: clamp(25px, 4vw, 35px); letter-spacing: -.04em; margin: 10px 0 9px; line-height: 1.15; }
.hero p { color: var(--muted); font-size: 14px; margin: 0; line-height: 1.7; }
.hero-note { margin-top: 8px !important; color: #8692ad !important; font-size: 11px !important; }
.layout-grid { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(330px, .84fr); gap: 18px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: 19px; background: linear-gradient(180deg, rgba(27, 29, 39, .96), rgba(21, 23, 30, .98)); box-shadow: 0 20px 50px rgba(0, 0, 0, .12); overflow: hidden; }
.config-panel, .result-panel { padding: 23px; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 23px; }
.panel-heading h2 { margin: 6px 0 0; font-size: 20px; letter-spacing: -.025em; }
.step-chip, .type-badge { border: 1px solid var(--line-strong); background: rgba(255,255,255,.025); color: var(--muted); padding: 6px 9px; border-radius: 8px; font-size: 10px; white-space: nowrap; }
.type-badge { color: #b5c7ff; border-color: rgba(126,167,255,.22); background: rgba(126,167,255,.09); font-weight: 800; letter-spacing: .07em; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 17px 14px; }
.field { display: flex; min-width: 0; flex-direction: column; gap: 8px; color: #d4d7e0; font-size: 12px; }
.field-wide { grid-column: 1 / -1; }
.field span, .field legend, .field-topline label { font-weight: 650; }
.field em { color: var(--faint); font-style: normal; font-weight: 450; margin-left: 5px; font-size: 10px; }
.field input, .field select, .uri-details textarea { width: 100%; min-width: 0; color: var(--text); background: #12141b; border: 1px solid #323542; border-radius: 10px; padding: 12px 13px; outline: none; transition: border-color .18s ease, box-shadow .18s ease; }
.field input::placeholder { color: #626878; }
.field input:focus, .field select:focus, .uri-details textarea:focus { border-color: #7298f4; box-shadow: 0 0 0 3px rgba(126,167,255,.09); }
.field select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #9299aa 50%), linear-gradient(135deg, #9299aa 50%, transparent 50%); background-position: calc(100% - 17px) 17px, calc(100% - 12px) 17px; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.field-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.text-button { border: 0; color: var(--accent); background: transparent; padding: 2px 0; font-size: 11px; white-space: nowrap; }
.text-button:hover { color: #b8cdff; }
.secret-row { display: flex; gap: 8px; }
.secret-row input { min-width: 0; flex: 1; letter-spacing: .035em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.icon-button { width: 44px; flex: 0 0 44px; border: 1px solid #323542; background: #232631; color: #d4d9e8; border-radius: 10px; font-size: 19px; }
.icon-button:hover { border-color: #566487; }
.field-help { color: var(--faint); font-size: 10px; line-height: 1.6; }
.type-field { padding: 0; margin: 0; border: 0; }
.type-field legend { margin-bottom: 8px; }
.segmented-control { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; gap: 4px; border: 1px solid #30333f; background: #111319; border-radius: 11px; }
.segment { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 53px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #9a9fb0; font-weight: 800; font-size: 12px; }
.segment small { font-size: 9px; font-weight: 500; color: #757b8b; }
.segment.active { background: #252e45; border-color: #35476e; color: #e2e9ff; }
.segment.active small { color: #a8b9e7; }
.inline-note { display: flex; gap: 10px; padding: 12px 13px; border: 1px solid rgba(126,167,255,.15); border-radius: 10px; background: rgba(126,167,255,.055); color: #aeb7ce; font-size: 10px; line-height: 1.65; }
.note-icon { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border: 1px solid #667ba7; color: #a9c0ff; border-radius: 50%; font-size: 10px; font-family: Georgia, serif; font-weight: 700; }
.panel-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding-top: 20px; margin-top: 20px; border-top: 1px solid rgba(150,159,186,.12); }
.button { min-height: 40px; border-radius: 10px; padding: 10px 13px; font-size: 11px; font-weight: 750; transition: transform .12s ease, border-color .18s ease, background .18s ease; }
.button:active, .copy-code-button:active { transform: translateY(1px); }
.button-primary { border: 1px solid #6d92ec; background: linear-gradient(180deg, #6b92f1, #4c74d9); color: #fff; box-shadow: 0 6px 16px rgba(76,116,217,.2); }
.button-primary:hover { background: linear-gradient(180deg, #7ba1ff, #587ee3); }
.button-secondary { border: 1px solid #3a3e4b; background: #242731; color: #e3e6ef; }
.button-secondary:hover, .button-quiet:hover { border-color: #5d6680; }
.button-quiet { border: 1px solid transparent; color: #aeb4c5; background: transparent; }
.result-panel { padding-bottom: 18px; }
.otp-card { padding: 19px 18px 14px; border: 1px solid #303c57; border-radius: 15px; background: radial-gradient(ellipse at 50% -10%, rgba(96,125,201,.16), transparent 70%), #121722; }
.otp-caption { color: #7f8ca8; font-size: 9px; letter-spacing: .18em; font-weight: 800; text-align: center; }
.otp-code { color: #f4f7ff; text-align: center; font-size: clamp(34px, 4.8vw, 46px); letter-spacing: .12em; font-weight: 750; font-variant-numeric: tabular-nums; margin: 10px 0 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.otp-bottom-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.otp-status { color: #a2b0cc; font-size: 10px; }
.otp-button-group { display: flex; align-items: center; gap: 6px; }
.copy-code-button { border: 1px solid #3a4358; border-radius: 8px; background: #222a3b; color: #dfe7ff; padding: 7px 9px; font-size: 10px; font-weight: 750; white-space: nowrap; }
.progress-track { height: 4px; margin: 16px 0 10px; overflow: hidden; border-radius: 99px; background: #303648; }
.progress-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #7298f3, #93b3ff); border-radius: inherit; transition: width .25s linear; }
.timer-row { display: flex; justify-content: space-between; color: #79849b; font-size: 10px; }
.timer-row strong { color: #bfcfff; font-variant-numeric: tabular-nums; }
.qr-area { padding: 23px 0 18px; }
.qr-copy h3 { margin: 0 0 5px; font-size: 14px; }
.qr-copy p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.qr-frame { position: relative; display: grid; place-items: center; width: min(100%, 218px); aspect-ratio: 1; margin: 17px auto 11px; padding: 8px; background: #fff; border: 1px solid #e4e7ef; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.22); }
#qr-canvas { display: block; width: 100%; height: 100%; image-rendering: pixelated; object-fit: contain; }
.qr-placeholder { position: absolute; inset: 8px; display: grid; place-items: center; color: #565b66; text-align: center; font-size: 11px; padding: 12px; background: #fff; }
.qr-label { text-align: center; color: #c9cedb; font-weight: 750; font-size: 12px; overflow-wrap: anywhere; }
.qr-actions { display: grid; grid-template-columns: 1.1fr 1fr; gap: 8px; margin-top: 16px; }
.uri-details { margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(150,159,186,.12); }
.uri-details summary { color: #aab3c9; cursor: pointer; font-size: 11px; }
.uri-details textarea { margin-top: 10px; display: block; resize: vertical; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.warning-box { display: flex; gap: 10px; padding: 13px; border-radius: 11px; border: 1px solid rgba(232,180,111,.2); background: rgba(232,180,111,.055); }
.warning-icon { display: grid; place-items: center; width: 19px; height: 19px; flex: 0 0 19px; border-radius: 50%; background: rgba(232,180,111,.13); color: var(--orange); font-weight: 800; font-size: 11px; }
.warning-box strong { display: block; color: #e8c798; font-size: 11px; margin: 0 0 4px; }
.warning-box p { margin: 0; color: #b2a48f; font-size: 10px; line-height: 1.65; }
.privacy-strip { display: flex; align-items: center; gap: 13px; padding: 16px 18px; margin-top: 18px; border: 1px solid rgba(109,213,161,.15); background: rgba(109,213,161,.035); border-radius: 13px; }
.privacy-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: rgba(109,213,161,.09); color: #94dbb7; font-size: 23px; }
.privacy-strip strong { font-size: 11px; }
.privacy-strip p { margin: 3px 0 0; color: #8f9a9d; font-size: 10px; line-height: 1.5; }
.privacy-tag { margin-left: auto; color: #89cbaa; font-size: 9px; font-weight: 800; letter-spacing: .13em; white-space: nowrap; }
.footer { display: flex; justify-content: space-between; gap: 12px; margin: 23px 2px 0; color: #686d7b; font-size: 10px; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translate(-50%, 12px); opacity: 0; pointer-events: none; background: #e9edf8; color: #242a38; border-radius: 10px; padding: 11px 15px; box-shadow: 0 12px 40px rgba(0,0,0,.34); font-size: 12px; font-weight: 750; max-width: calc(100vw - 32px); transition: opacity .2s ease, transform .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.hidden { display: none !important; }
@media (max-width: 900px) {
  .app-shell { padding: 18px 16px 15px; }
  .layout-grid { grid-template-columns: minmax(0, 1fr); }
  .result-panel { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
  .result-panel > .panel-heading { grid-column: 1 / -1; }
  .otp-card { align-self: start; }
  .qr-area { padding: 0 0 18px; }
  .warning-box { grid-column: 1 / -1; }
  .qr-frame { width: min(100%, 180px); margin-top: 12px; }
}
@media (max-width: 600px) {
  .app-shell { padding: 12px 12px 20px; }
  .topbar { padding-bottom: 18px; }
  .brand-mark { width: 35px; height: 35px; border-radius: 11px; }
  .brand-name { font-size: 14px; }
  .brand-subtitle { font-size: 10px; }
  .local-badge { font-size: 10px; padding: 6px 8px; }
  .hero { padding: 27px 2px 22px; }
  h1 { font-size: 28px; }
  .hero p { font-size: 12px; }
  .layout-grid { gap: 13px; }
  .config-panel, .result-panel { padding: 17px 15px; border-radius: 15px; }
  .panel-heading { margin-bottom: 19px; }
  .panel-heading h2 { font-size: 18px; }
  .form-grid { gap: 15px 10px; }
  .field { font-size: 11px; }
  .field input, .field select { padding: 12px 10px; font-size: 13px; }
  .field em { display: block; margin: 3px 0 0; }
  .field-topline { align-items: flex-start; }
  .field-topline label { max-width: 55%; }
  .text-button { font-size: 10px; }
  .panel-actions { align-items: center; flex-wrap: wrap; }
  .button { min-height: 39px; padding: 10px; font-size: 10px; }
  .result-panel { display: block; }
  .otp-code { font-size: clamp(34px, 10vw, 44px); }
  .qr-area { padding: 22px 0 16px; }
  .qr-frame { width: min(100%, 218px); }
  .qr-actions { grid-template-columns: 1fr; }
  .privacy-strip { align-items: flex-start; padding: 13px; gap: 10px; }
  .privacy-icon { width: 30px; height: 30px; flex-basis: 30px; }
  .privacy-tag { display: none; }
  .footer { flex-direction: column; gap: 6px; }
}
