:root {
  color-scheme: dark;
  --bg: #080a0d;
  --panel: #111419;
  --panel-2: #171b21;
  --line: #292f38;
  --muted: #8d96a4;
  --text: #f4f7fb;
  --accent: #65e6b2;
  --accent-dark: #102b22;
  --warning: #f9c86b;
  --danger: #ff8c8c;
  --radius: 20px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 12%, rgba(101,230,178,.08), transparent 26rem),
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 48px 48px, 48px 48px, auto;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button, select { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 70px;
  padding: 0 clamp(20px, 5vw, 72px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: rgba(8,10,13,.78);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { color: var(--text); text-decoration: none; font-weight: 750; letter-spacing: -.02em; display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 28px; height: 28px; border: 2px solid var(--accent); border-radius: 8px; display: grid; place-items: center; transform: rotate(8deg); }
.brand-mark span { width: 8px; height: 8px; background: var(--accent); border-radius: 2px; }
.privacy-badge { color: #c9d0da; font-size: .83rem; display: flex; align-items: center; gap: 8px; }
.privacy-badge span { width: 7px; height: 7px; background: var(--accent); border-radius: 50%; box-shadow: 0 0 0 5px rgba(101,230,178,.1); }
.privacy-badge b { font-weight: 500; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: flex; padding: 3px; background: #15191f; border: 1px solid var(--line); border-radius: 9px; }
.lang-switch button { min-width: 32px; height: 27px; padding: 0 7px; color: var(--muted); background: transparent; border: 0; border-radius: 6px; font-size: .72rem; font-weight: 750; }
.lang-switch button.active { color: #07110d; background: var(--accent); }

.shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.intro { padding: clamp(54px, 8vw, 100px) 0 42px; max-width: 760px; }
.eyebrow { margin: 0 0 19px; color: var(--accent); font: 700 .75rem/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .18em; }
h1 { margin: 0; font-size: clamp(2.65rem, 6vw, 5.4rem); line-height: .98; letter-spacing: -.065em; font-weight: 780; }
h1 em { color: var(--muted); font-style: normal; font-weight: 530; }
.lede { max-width: 650px; margin: 27px 0 0; color: #abb3bf; line-height: 1.8; font-size: 1.02rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, .8fr); border: 1px solid var(--line); border-radius: 25px; overflow: hidden; background: rgba(15,18,23,.94); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.workspace-main { min-height: 510px; padding: clamp(18px, 3vw, 30px); border-right: 1px solid var(--line); }
.drop-zone { min-height: 450px; height: 100%; border: 1px dashed #414955; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(145deg, rgba(255,255,255,.025), rgba(255,255,255,.005)); transition: .2s ease; outline: none; text-align: center; padding: 28px; }
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-dragging { border-color: var(--accent); background: rgba(101,230,178,.045); transform: translateY(-1px); }
.upload-icon { width: 72px; height: 72px; border-radius: 22px; display: grid; place-items: center; background: var(--accent-dark); color: var(--accent); margin-bottom: 22px; }
.upload-icon svg { width: 34px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.drop-zone h2 { font-size: 1.3rem; margin: 0 0 8px; }
.drop-zone p { color: var(--muted); margin: 0 0 18px; }
.limit-note { font-size: .75rem; color: #707986; padding: 7px 10px; border: 1px solid #2b313a; border-radius: 999px; }
.batch-drop.compact { min-height: 150px; height: auto; flex-direction: row; gap: 14px; padding: 18px; justify-content: flex-start; }
.batch-drop.compact .upload-icon { width: 48px; height: 48px; margin: 0; border-radius: 14px; flex: 0 0 auto; }
.batch-drop.compact .upload-icon svg { width: 24px; }
.batch-drop.compact h2 { margin: 0; font-size: 1rem; }
.batch-drop.compact p { margin: 0; }
.batch-drop.compact .limit-note { margin-left: auto; }
.queue-section { margin-top: 18px; }
.queue-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 11px; }
.queue-header > div { display: flex; align-items: baseline; gap: 10px; }
.queue-header strong { font-size: .93rem; }
.queue-header span { color: var(--muted); font-size: .73rem; }
.queue-header .text-button { position: static; color: var(--muted); background: transparent; padding: 6px 9px; }
.queue-list { display: grid; gap: 9px; }
.queue-item { min-width: 0; display: grid; grid-template-columns: 64px minmax(0,1fr) auto; gap: 13px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: #0d1014; }
.queue-item.status-done { border-color: rgba(101,230,178,.25); }
.queue-item.status-failed { border-color: rgba(255,140,140,.25); }
.queue-thumb { width: 64px; height: 54px; border-radius: 8px; object-fit: cover; background: #080a0d; }
.queue-info { min-width: 0; }
.queue-name, .queue-meta, .queue-output { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-name { font-size: .83rem; margin-bottom: 5px; }
.queue-meta, .queue-output { color: var(--muted); font-size: .68rem; line-height: 1.5; }
.queue-output { color: #9ad8be; margin-top: 2px; }
.queue-output.is-error { color: var(--danger); }
.queue-actions { display: flex; align-items: center; gap: 7px; }
.status-chip { color: #b5bdc8; background: #1b2027; border-radius: 7px; padding: 6px 8px; font-size: .66rem; white-space: nowrap; }
.status-done .status-chip { color: var(--accent); background: var(--accent-dark); }
.status-failed .status-chip { color: var(--danger); background: rgba(255,140,140,.1); }
.status-processing .status-chip { color: var(--warning); background: rgba(249,200,107,.1); }
.mini-button, .remove-button, .add-more-button { border: 1px solid var(--line); color: #cbd2dc; background: #171b21; border-radius: 8px; }
.mini-button { padding: 6px 8px; font-size: .68rem; }
.remove-button { width: 29px; height: 29px; padding: 0; color: var(--muted); font-size: 1rem; }
.mini-button:hover, .remove-button:hover, .add-more-button:hover { border-color: #46505c; color: var(--text); }
.add-more-button { width: 100%; padding: 11px; margin-top: 9px; display: flex; align-items: center; justify-content: center; gap: 7px; color: var(--muted); font-size: .76rem; border-style: dashed; }

.editor { height: 100%; display: flex; flex-direction: column; gap: 18px; }
.preview-frame { min-height: 385px; flex: 1; border-radius: 17px; background-color: #090b0e; background-image: linear-gradient(45deg,#11151a 25%,transparent 25%),linear-gradient(-45deg,#11151a 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#11151a 75%),linear-gradient(-45deg,transparent 75%,#11151a 75%); background-size: 22px 22px; background-position: 0 0,0 11px,11px -11px,-11px 0; overflow: hidden; position: relative; display: grid; place-items: center; }
.preview-frame img { max-width: 100%; max-height: 440px; object-fit: contain; display: block; }
.preview-topline { position: absolute; inset: 14px 14px auto; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.file-name, .text-button { background: rgba(8,10,13,.78); backdrop-filter: blur(12px); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 8px 11px; font-size: .78rem; }
.file-name { max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.text-button { color: var(--text); }
.file-stats { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.file-stats div { padding: 14px 16px; border-right: 1px solid var(--line); }
.file-stats div:last-child { border: 0; }
.file-stats span, .result-grid span { display: block; font-size: .72rem; color: var(--muted); margin-bottom: 5px; }
.file-stats strong { font-size: .92rem; }

.control-panel { padding: 28px; background: var(--panel); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 31px; font-weight: 700; }
.target-chip { color: var(--accent); background: var(--accent-dark); padding: 6px 9px; border-radius: 7px; font-size: .73rem; font-family: ui-monospace, monospace; }
.field-label { display: block; color: #b6bec9; font-size: .82rem; margin-bottom: 9px; }
.select-wrap { position: relative; margin-bottom: 14px; }
.select-wrap::after { content: "⌄"; position: absolute; right: 14px; top: 11px; pointer-events: none; color: var(--muted); }
select { width: 100%; appearance: none; color: var(--text); background: var(--panel-2); border: 1px solid #303741; border-radius: 10px; padding: 13px 38px 13px 13px; outline: none; }
select:focus { border-color: var(--accent); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.setting-title, .setting-copy { display: block; }
.setting-title { font-size: .88rem; margin-bottom: 5px; }
.setting-copy { font-size: .72rem; color: var(--muted); line-height: 1.5; }
.check-mark { width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 8px; background: var(--accent-dark); color: var(--accent); font-weight: 800; font-size: .8rem; }
.primary-button, .download-button { width: 100%; border: 0; border-radius: 11px; display: flex; justify-content: center; align-items: center; gap: 10px; font-weight: 750; transition: .18s ease; }
.primary-button { margin-top: 24px; padding: 15px; color: #07110d; background: var(--accent); box-shadow: 0 10px 30px rgba(101,230,178,.12); }
.primary-button svg, .download-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.primary-button:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.06); }
.primary-button:disabled { cursor: not-allowed; opacity: .35; box-shadow: none; }
.progress-area { margin-top: 22px; }
.progress-label { display: flex; justify-content: space-between; color: #c6cdd6; font-size: .77rem; margin-bottom: 9px; }
.progress-track { height: 5px; background: #252b33; border-radius: 99px; overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: var(--accent); transition: width .2s ease; }
.result-card { margin-top: 20px; padding: 17px; border-radius: 14px; border: 1px solid rgba(101,230,178,.28); background: rgba(101,230,178,.05); }
.result-head { display: flex; align-items: center; gap: 9px; font-size: .9rem; margin-bottom: 16px; }
.success-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(101,230,178,.1); }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.result-grid .wide { grid-column: 1 / -1; }
.result-grid strong { font: 700 .92rem/1.4 ui-monospace, monospace; }
.result-note { color: #9da7b4; font-size: .72rem; line-height: 1.55; margin: 13px 0; }
.download-button { padding: 13px; color: var(--text); background: #242b32; }
.download-button:hover { background: #303942; }
.error-message { color: var(--danger); font-size: .8rem; line-height: 1.6; margin: 17px 0 0; }

.trust-row { display: grid; grid-template-columns: repeat(3, 1fr); margin: 24px 0; border: 1px solid var(--line); border-radius: 18px; background: rgba(15,18,23,.75); }
.trust-row > div { display: flex; gap: 15px; padding: 21px 23px; border-right: 1px solid var(--line); }
.trust-row > div:last-child { border: 0; }
.step-no { color: var(--accent); font: 700 .74rem/1.5 ui-monospace, monospace; }
.trust-row strong { font-size: .87rem; }
.trust-row p { margin: 5px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.notice { display: flex; gap: 15px; margin: 0 0 70px; padding: 20px 22px; border: 1px solid rgba(249,200,107,.22); border-radius: 15px; background: rgba(249,200,107,.045); }
.notice svg { width: 21px; min-width: 21px; fill: none; stroke: var(--warning); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.notice strong { display: block; color: #e8d8b5; font-size: .85rem; margin-bottom: 5px; }
.notice p { margin: 0; color: #9f9a8f; font-size: .78rem; line-height: 1.65; }
footer { border-top: 1px solid rgba(255,255,255,.07); min-height: 82px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; color: #68717e; font-size: .73rem; }

@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; }
  .workspace-main { border-right: 0; border-bottom: 1px solid var(--line); min-height: 430px; }
  .drop-zone { min-height: 390px; }
  .trust-row { grid-template-columns: 1fr; }
  .trust-row > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .trust-row > div:last-child { border: 0; }
}

@media (max-width: 540px) {
  .shell { width: min(100% - 24px, 1180px); }
  .topbar { height: 62px; padding: 0 15px; }
  .privacy-badge { font-size: .7rem; }
  .header-actions { gap: 8px; }
  .lang-switch button { min-width: 28px; }
  .intro { padding-top: 45px; }
  .lede { font-size: .94rem; }
  .workspace { border-radius: 18px; }
  .workspace-main { padding: 12px; min-height: 375px; }
  .drop-zone { min-height: 345px; }
  .control-panel { padding: 23px 18px; }
  .batch-drop.compact { display: grid; grid-template-columns: 48px 1fr; min-height: 118px; }
  .batch-drop.compact .limit-note { display: none; }
  .queue-item { grid-template-columns: 52px minmax(0,1fr); }
  .queue-thumb { width: 52px; height: 48px; }
  .queue-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .file-stats { grid-template-columns: 1fr 1fr; }
  .file-stats div { border-bottom: 1px solid var(--line); }
  .file-stats div:nth-child(2) { border-right: 0; }
  .file-stats div:last-child { grid-column: 1/-1; border-bottom: 0; }
  footer { flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}
