:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: rgba(13, 19, 32, 0.82);
  --panel-strong: #101827;
  --line: rgba(150, 176, 216, 0.14);
  --line-strong: rgba(94, 234, 212, 0.35);
  --text: #f4f8ff;
  --muted: #8d9bb2;
  --cyan: #52f2d0;
  --blue: #54a6ff;
  --violet: #9a7dff;
  --rose: #ff7c9e;
  --lime: #c5f06a;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body { margin: 0; min-height: 100vh; color: var(--text); background: radial-gradient(circle at 50% -20%, #112347 0, transparent 45%), linear-gradient(180deg, #070b14 0%, #080d18 100%); overflow-x: hidden; }
body::before { content: ""; position: fixed; inset: 0; z-index: -2; opacity: .28; background-image: linear-gradient(rgba(92, 122, 167, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(92, 122, 167, .08) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 85%); }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.hidden { display: none !important; }
.ambient { position: fixed; z-index: -1; width: 420px; height: 420px; border-radius: 50%; filter: blur(110px); opacity: .11; pointer-events: none; }
.ambient-one { background: #00e5ff; top: 8%; left: -180px; }
.ambient-two { background: #6f48ff; right: -180px; top: 45%; }

.site-header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; border-bottom: 1px solid var(--line); background: rgba(7, 11, 20, .66); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; font-size: 18px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 28px; height: 28px; border: 1px solid rgba(82, 242, 208, .4); display: grid; place-items: center; transform: rotate(45deg); border-radius: 6px; box-shadow: 0 0 25px rgba(82, 242, 208, .18); }
.brand-mark span { width: 10px; height: 10px; border: 2px solid var(--cyan); border-radius: 2px; }
.privacy-pill, .status-chip { display: inline-flex; align-items: center; gap: 7px; color: #b9c5d7; background: rgba(255,255,255,.035); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-size: 13px; }
.privacy-pill svg { width: 16px; fill: var(--cyan); }
.status-chip i { width: 7px; height: 7px; background: var(--cyan); border-radius: 50%; box-shadow: 0 0 12px var(--cyan); }

.app-shell { width: min(1180px, 91vw); margin: 0 auto; }
.intro { padding: 58px 0 34px; }
.eyebrow { margin: 0 0 15px; color: var(--cyan) !important; font-size: 12px !important; font-weight: 700; letter-spacing: .2em; display: flex; align-items: center; gap: 9px; }
.eyebrow span { width: 24px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
.intro h1 { margin: 0; max-width: 780px; font-size: clamp(34px, 5vw, 62px); line-height: 1.08; letter-spacing: -.045em; font-weight: 780; background: linear-gradient(100deg, #fff 5%, #bdc9dc 65%, #7a8da9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro > p { color: var(--muted); font-size: 16px; margin: 18px 0 0; }

.workspace { display: grid; grid-template-columns: 255px 1fr; border: 1px solid var(--line); background: rgba(8, 13, 23, .72); border-radius: 20px; overflow: hidden; box-shadow: 0 30px 90px rgba(0,0,0,.32); min-height: 570px; }
.tool-nav { padding: 18px 14px; border-right: 1px solid var(--line); background: rgba(9, 15, 26, .78); display: flex; flex-direction: column; gap: 8px; }
.tool-tab { width: 100%; text-align: left; display: flex; align-items: center; gap: 12px; border: 1px solid transparent; background: transparent; border-radius: 12px; padding: 12px; cursor: pointer; transition: .2s ease; }
.tool-tab:hover { background: rgba(255,255,255,.035); }
.tool-tab.active { border-color: rgba(82, 242, 208, .18); background: linear-gradient(100deg, rgba(82,242,208,.12), rgba(82,166,255,.04)); box-shadow: inset 3px 0 0 var(--cyan); }
.tool-tab strong { display: block; font-size: 14px; margin-bottom: 4px; }
.tool-tab small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; }
.tool-icon { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.tool-icon svg { width: 20px; fill: currentColor; }
.tool-icon.cyan { color: var(--cyan); background: rgba(82,242,208,.1); }
.tool-icon.violet { color: var(--violet); background: rgba(154,125,255,.11); }
.tool-icon.rose { color: var(--rose); background: rgba(255,124,158,.1); }
.tool-icon.lime { color: var(--lime); background: rgba(197,240,106,.1); }

.tool-stage { padding: 34px 40px 26px; display: flex; flex-direction: column; min-width: 0; }
.stage-heading { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 26px; }
.stage-kicker { display: block; color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .16em; margin-bottom: 8px; }
.stage-heading h2 { margin: 0; font-size: 25px; letter-spacing: -.02em; }
.tool-panel { flex: 1; animation: reveal .25s ease; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.drop-zone { min-height: 255px; border: 1px dashed rgba(122, 154, 201, .38); border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(145deg, rgba(82,242,208,.035), rgba(84,166,255,.025)); cursor: pointer; transition: .2s ease; padding: 30px; text-align: center; }
.drop-zone.compact { min-height: 210px; }
.drop-zone:hover, .drop-zone.dragging { border-color: var(--cyan); background: rgba(82,242,208,.06); box-shadow: inset 0 0 45px rgba(82,242,208,.025); }
.drop-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.upload-orbit { width: 58px; height: 58px; display: grid; place-items: center; border: 1px solid rgba(82,242,208,.28); border-radius: 50%; margin-bottom: 16px; color: var(--cyan); background: rgba(82,242,208,.06); box-shadow: 0 0 30px rgba(82,242,208,.08); }
.upload-orbit svg { width: 23px; fill: currentColor; }
.drop-zone strong { font-size: 17px; margin-bottom: 7px; }
.drop-zone > span:not(.upload-orbit) { color: var(--muted); font-size: 14px; }
.drop-zone small { margin-top: 13px; padding: 5px 10px; border-radius: 999px; color: #9facbf; background: rgba(255,255,255,.035); font-size: 11px; }
.file-card { display: flex; align-items: center; gap: 13px; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 12px; padding: 12px; margin-top: 15px; }
.file-card > div:nth-child(2) { flex: 1; min-width: 0; }
.file-card strong, .file-card span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card strong { font-size: 14px; }
.file-card span { color: var(--muted); font-size: 12px; margin-top: 4px; }
.file-badge { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 9px; color: var(--cyan); background: rgba(82,242,208,.08); font-size: 10px; font-weight: 800; }
.file-badge.purple { color: var(--violet); background: rgba(154,125,255,.1); }
.icon-button { width: 34px; height: 34px; border: 0; border-radius: 8px; color: var(--muted); background: transparent; font-size: 22px; cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.06); color: white; }
.action-row { min-height: 72px; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.action-row.end { justify-content: flex-end; }
.format-flow { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.format-flow span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 8px; }
.format-flow span.selected { color: var(--cyan); border-color: rgba(82,242,208,.3); background: rgba(82,242,208,.06); }
.format-flow b { color: #52637c; }
.primary-button, .secondary-button { min-height: 44px; border-radius: 10px; padding: 0 20px; font-weight: 700; font-size: 14px; cursor: pointer; transition: .18s ease; }
.primary-button { color: #04120f; border: 0; background: linear-gradient(110deg, var(--cyan), #73d8ff); box-shadow: 0 10px 25px rgba(82,242,208,.13); }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 13px 30px rgba(82,242,208,.2); }
.primary-button:disabled { opacity: .35; cursor: not-allowed; box-shadow: none; }
.secondary-button { color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.04); }
.progress-wrap { margin-top: 16px; }
.progress-copy { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.progress-copy b { color: var(--cyan); }
.progress-track { height: 6px; border-radius: 999px; overflow: hidden; background: rgba(255,255,255,.06); }
.progress-track span { display: block; height: 100%; width: 0%; border-radius: inherit; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 12px rgba(82,242,208,.4); transition: width .2s ease; }
.settings-grid { display: grid; grid-template-columns: 1fr 1.5fr; gap: 14px; margin-top: 15px; }
.settings-grid label, .qr-form label { color: #bbc6d7; font-size: 13px; font-weight: 650; }
select, textarea { width: 100%; color: var(--text); background: #0d1524; border: 1px solid var(--line); border-radius: 9px; outline: none; }
select { margin-top: 8px; height: 42px; padding: 0 12px; }
textarea { margin-top: 10px; padding: 13px; resize: vertical; line-height: 1.6; }
select:focus, textarea:focus { border-color: rgba(82,242,208,.45); box-shadow: 0 0 0 3px rgba(82,242,208,.06); }
.range-line { height: 42px; margin-top: 8px; display: flex; align-items: center; gap: 10px; }
.range-line input { flex: 1; accent-color: var(--cyan); }
.range-line output { min-width: 42px; color: var(--cyan); font-size: 12px; }
.pdf-list { margin-top: 14px; max-height: 165px; overflow: auto; border: 1px solid var(--line); border-radius: 11px; }
.pdf-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.pdf-item:last-child { border-bottom: 0; }
.pdf-item b { width: 25px; color: var(--rose); font-size: 12px; }
.pdf-item span { min-width: 0; flex: 1; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdf-item small { color: var(--muted); }
.qr-layout { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: center; padding-top: 15px; }
.qr-form .primary-button { width: 100%; margin-top: 15px; }
.qr-preview { aspect-ratio: 1; border: 1px dashed rgba(122,154,201,.35); border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,.018); padding: 20px; }
.qr-preview canvas { display: none; width: min(220px, 100%); height: auto; border-radius: 8px; background: white; padding: 8px; }
.qr-preview.ready canvas { display: block; }
.qr-preview.ready span { display: none; }
.qr-preview span { color: var(--muted); font-size: 13px; }
.notice { min-height: 20px; margin: 8px 0 0; color: #ffb67c; font-size: 13px; }
footer { min-height: 110px; display: flex; justify-content: space-between; align-items: center; color: #637189; font-size: 12px; }

@media (max-width: 820px) {
  .site-header { height: 62px; }
  .privacy-pill { padding: 7px 9px; }
  .privacy-pill svg { display: none; }
  .app-shell { width: min(94vw, 680px); }
  .intro { padding: 38px 2px 25px; }
  .intro h1 { font-size: clamp(32px, 10vw, 48px); }
  .workspace { grid-template-columns: 1fr; }
  .tool-nav { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; overflow-x: auto; padding: 10px; }
  .tool-tab { width: auto; min-width: 66px; justify-content: center; padding: 9px; }
  .tool-tab > span:last-child { display: none; }
  .tool-tab.active { box-shadow: inset 0 -3px 0 var(--cyan); }
  .tool-stage { padding: 26px 18px 20px; }
  .stage-heading { margin-bottom: 20px; }
  .drop-zone { min-height: 235px; padding: 22px; }
  .settings-grid, .qr-layout { grid-template-columns: 1fr; }
  .qr-preview { width: min(280px, 100%); margin: 0 auto; }
  footer { flex-direction: column; justify-content: center; gap: 8px; }
}

@media (max-width: 470px) {
  .brand { font-size: 15px; }
  .privacy-pill { font-size: 11px; }
  .intro > p { font-size: 14px; line-height: 1.7; }
  .status-chip { display: none; }
  .action-row { align-items: stretch; flex-direction: column; }
  .action-row .primary-button { width: 100%; }
  .format-flow { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
