:root {
  color-scheme: light;
  --ink: #20262a;
  --muted: #625c54;
  --paper: #fffaf0;
  --desk: #f4eddf;
  --line: #20262a;
  --lime: #c8ef62;
  --coral: #ff6b5b;
  --yellow: #ffd166;
  --aqua: #6ed7d5;
  --shadow: 8px 8px 0 var(--ink);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--desk);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }

.site-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; padding-bottom: 64px; }
.site-header { display: flex; align-items: center; justify-content: space-between; min-height: 86px; border-bottom: 3px solid var(--ink); }
.brand-lockup, .section-heading, .history-header, .account-actions { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark, .section-mark { display: inline-grid; place-items: center; background: var(--ink); color: var(--paper); font-weight: 900; }
.brand-mark { width: 42px; height: 42px; transform: rotate(-6deg); }
.brand-kicker, .eyebrow, .section-index { margin: 0; color: var(--coral); font-size: 11px; font-weight: 900; letter-spacing: .12em; }
.site-header h1 { margin: 1px 0 0; font-size: 24px; line-height: 1; }
.session-badge, .heading-tag { padding: 8px 11px; border: 2px solid var(--ink); background: var(--yellow); font-size: 11px; font-weight: 900; }

.intro-band { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding: 64px 0 46px; }
.intro-band h2 { max-width: 700px; margin: 12px 0 12px; font-size: 54px; line-height: 1.02; letter-spacing: 0; }
.intro-copy, .account-note { color: var(--muted); line-height: 1.65; }
.intro-copy { margin: 0; font-size: 16px; }
.intro-stamp { flex: 0 0 auto; padding: 16px; border: 3px solid var(--ink); background: var(--aqua); box-shadow: 5px 5px 0 var(--coral); font-size: 12px; font-weight: 900; line-height: 1.5; transform: rotate(3deg); }
.intro-stamp strong { color: var(--coral); }

.main-tabs { display: flex; gap: 5px; padding: 6px; margin-bottom: 34px; background: var(--ink); box-shadow: 7px 7px 0 var(--coral); }
.main-tab { flex: 1; padding: 15px 18px; border: 0; background: transparent; color: var(--paper); font-weight: 900; }
.main-tab.active { background: var(--lime); color: var(--ink); transform: rotate(-1deg); }
.view { display: none; }
.view.active { display: block; }
.section-heading { justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.section-heading h2 { margin: 6px 0 0; font-size: 34px; }

.tool-panel, .task-panel, .empty-state { border: 3px solid var(--ink); background: var(--paper); box-shadow: var(--shadow); }
.tool-panel { padding: 28px; }
.panel-title { display: flex; align-items: center; gap: 11px; font-size: 20px; font-weight: 900; }
.panel-title.compact { display: block; margin-top: 26px; font-size: 15px; }
.section-mark { width: 34px; height: 34px; font-size: 15px; transform: rotate(-5deg); }
.section-mark.yellow { background: var(--yellow); color: var(--ink); }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; margin-top: 22px; }
.mode-card { min-height: 132px; padding: 17px; border: 3px solid var(--ink); background: var(--desk); box-shadow: 4px 4px 0 var(--ink); text-align: left; }
.mode-card:nth-child(2) { transform: rotate(1deg); }
.mode-card:nth-child(3) { transform: rotate(-1deg); }
.mode-card.active { background: var(--lime); box-shadow: 4px 4px 0 var(--coral); }
.mode-icon { display: block; margin-bottom: 14px; color: var(--coral); font-size: 27px; font-weight: 900; }
.mode-card strong, .mode-card small { display: block; }
.mode-card strong { font-size: 16px; }
.mode-card small { margin-top: 7px; color: var(--muted); font-size: 12px; }
.quality-row, .format-row { display: flex; align-items: end; gap: 12px; }
.quality-row { margin-top: 13px; }
.quality-choice, select { border: 3px solid var(--ink); background: var(--desk); }
.quality-choice { flex: 1; padding: 11px; font-weight: 800; }
.quality-choice.active { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.drop-zone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 226px; padding: 34px 24px 26px; margin-top: 28px; border: 3px dashed var(--ink); background: var(--desk); }
.drop-zone:hover { background: #eaf7c9; }
.drop-tape { position: absolute; top: -16px; left: 22px; padding: 6px 13px; border: 2px solid var(--ink); background: var(--aqua); font-size: 11px; font-weight: 900; transform: rotate(-4deg); }
.drop-icon { font-size: 52px; line-height: 1; }
.drop-zone strong { margin-top: 12px; font-size: 19px; }
.drop-zone small { margin-top: 8px; color: var(--muted); }
.drop-note { position: absolute; right: 17px; bottom: 14px; color: var(--coral); font-size: 11px; font-weight: 900; transform: rotate(-4deg); }
.primary-action, .secondary-action { min-height: 48px; padding: 10px 18px; border: 3px solid var(--ink); font-weight: 900; }
.primary-action { width: 100%; margin-top: 22px; background: var(--lime); box-shadow: 5px 5px 0 var(--ink); }
.primary-action:disabled { color: #918b80; background: #ded6c8; box-shadow: none; }
.secondary-action { background: var(--desk); }

.task-panel { margin-top: 27px; padding: 24px; background: var(--aqua); }
.task-panel.hidden { display: none; }
.hidden { display: none !important; }
.task-top, .task-meta, .progress-label { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.task-top strong { font-size: 19px; }
.task-status { padding: 6px 10px; border: 2px solid var(--ink); background: var(--lime); font-size: 12px; font-weight: 900; }
.task-status.failed { color: var(--paper); background: var(--coral); }
.task-id, .task-meta { margin-top: 7px; color: var(--muted); font-size: 12px; }
.progress-track { height: 17px; margin-top: 24px; overflow: hidden; border: 3px solid var(--ink); background: var(--paper); }
.progress-fill { height: 100%; background: var(--coral); transition: width .25s ease; }
.progress-label { margin-top: 9px; color: var(--ink); font-size: 12px; }
.task-actions { display: flex; gap: 10px; margin-top: 18px; }
.task-actions button { width: auto; margin: 0; }

.format-row { margin-top: 20px; }
.format-row label { flex: 1; color: var(--muted); font-size: 12px; font-weight: 800; }
select { display: block; width: 100%; padding: 12px 10px; margin-top: 7px; color: var(--ink); font-weight: 800; }
.format-arrow { padding-bottom: 10px; color: var(--coral); font-size: 25px; font-weight: 900; }

.account-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 22px; }
.account-note { margin: 18px 0; font-size: 13px; }
.token-label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 900; }
.password-label { margin-top: 14px; }
.token-input { width: 100%; padding: 13px; border: 3px solid var(--ink); background: #fff; outline: 0; }
.token-input:focus { box-shadow: 4px 4px 0 var(--coral); }
.account-actions { gap: 12px; margin-top: 16px; }
.small-action { width: auto; margin: 0; }
.api-origin { margin: 20px 0 0; color: var(--muted); font-size: 11px; word-break: break-all; }
.account-status-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 250px; text-align: center; background: var(--yellow); }
.status-orbit { display: grid; place-items: center; width: 70px; height: 70px; margin-bottom: 18px; border: 3px solid var(--ink); background: var(--coral); color: var(--paper); font-weight: 900; transform: rotate(-7deg); }
.account-status-panel strong { font-size: 20px; }
.account-status-panel p { max-width: 260px; margin: 10px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.history-header { justify-content: space-between; margin: 45px 0 17px; }
.text-action { border: 0; background: transparent; font-weight: 900; }
.history-list { display: grid; gap: 12px; }
.history-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 17px 20px; border: 3px solid var(--ink); background: var(--paper); box-shadow: 4px 4px 0 var(--ink); }
.history-item:nth-child(even) { transform: rotate(.4deg); }
.history-item:nth-child(odd) { transform: rotate(-.4deg); }
.history-item button { flex: 0 0 auto; padding: 8px 11px; border: 2px solid var(--ink); background: var(--lime); font-size: 12px; font-weight: 900; }
.history-title { font-weight: 900; }
.history-meta { margin-top: 6px; color: var(--muted); font-size: 12px; }
.history-status { flex: 0 0 auto; padding: 6px 9px; border: 2px solid var(--ink); background: var(--lime); font-size: 11px; font-weight: 900; }
.history-status.failed { color: var(--paper); background: var(--coral); }
.empty-state { padding: 42px 20px; color: var(--muted); box-shadow: none; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 30px; z-index: 5; max-width: min(90vw, 520px); padding: 12px 16px; border: 3px solid var(--ink); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); font-size: 13px; font-weight: 800; opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 700px) {
  .site-shell { width: min(100% - 24px, 560px); }
  .site-header { min-height: 72px; }
  .session-badge { max-width: 140px; font-size: 10px; }
  .intro-band { align-items: start; flex-direction: column; padding: 44px 0 34px; }
  .intro-band h2 { font-size: 38px; }
  .intro-stamp { align-self: end; }
  .tool-panel { padding: 22px 18px; }
  .mode-grid { grid-template-columns: 1fr; gap: 10px; }
  .mode-card { min-height: 0; padding: 14px; }
  .mode-icon { display: inline-block; width: 30px; margin: 0 8px 0 0; font-size: 22px; }
  .mode-card small { display: inline; margin-left: 8px; }
  .account-grid { grid-template-columns: 1fr; }
  .history-item { align-items: start; flex-wrap: wrap; }
  .history-status { margin-left: auto; }
  .task-meta { align-items: start; flex-direction: column; gap: 4px; }
}
