:root {
  --bg:#f5f7f2; --card:#fff; --text:#1f3a2f; --muted:#5d7468; --line:#dbe3dc; --accent:#2f7d5b; --danger:#b3412f; --accent-text:#fff;
  --soft:#eef3ee; --accent-soft:#e1efe7; --danger-soft:#f7e5e1; --warn:#8a6417; --warn-soft:#f6edd6; --focus:#1d6fb8;
  --shadow:0 1px 2px rgba(31,58,47,.06), 0 8px 24px rgba(31,58,47,.06);
  --menu-shadow:0 4px 16px rgba(31,58,47,.16);
  --touch:44px; /* 触摸控件最小尺寸；间距以 4/8px 为基础，常用 12/16/24px */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg:#14201a; --card:#1c2b23; --text:#e6efe9; --muted:#9ab0a4; --line:#2c3f35; --accent:#52b788; --danger:#e08a78; --accent-text:#10201a;
    --soft:#22332a; --accent-soft:#1f3a2e; --danger-soft:#3b2622; --warn:#e3c068; --warn-soft:#3a3320; --focus:#7db9ee;
    --shadow:0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --menu-shadow:0 4px 16px rgba(0,0,0,.45);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scrollbar-gutter: stable; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--text);
       font-family:system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif; font-size:15px; line-height:1.6; }
body.modal-open { overflow:hidden; }
:focus-visible { outline:3px solid var(--focus); outline-offset:2px; }
a { color:var(--accent); }
.sprite { position:absolute; width:0; height:0; overflow:hidden; }
.ico { width:20px; height:20px; flex:none; }
.sr-only { position:absolute; width:1px; height:1px; margin:-1px; padding:0; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap; border:0; }
.skip { position:absolute; left:16px; top:-48px; z-index:40; padding:8px 16px; border-radius:10px; background:var(--card); color:var(--text); border:1px solid var(--line); }
.skip:focus { top:8px; }
time, .usage .value, .choice-size, .job-sub { font-variant-numeric: tabular-nums; }

/* 顶栏 */
.top { position:sticky; top:0; z-index:10; background:var(--bg); border-bottom:1px solid var(--line); }
.top-inner { display:flex; align-items:center; justify-content:space-between; gap:12px; max-width:1180px; margin:0 auto;
             padding:8px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left)); }
.brand { display:flex; align-items:center; gap:8px; flex:none; }
.brand-mark { width:32px; height:32px; border-radius:10px; display:grid; place-items:center; font-size:16px; font-weight:700; background:var(--accent-soft); color:var(--accent); }
.brand-name { font-size:20px; font-weight:700; letter-spacing:.08em; white-space:nowrap; }
.who { display:flex; align-items:center; gap:8px; min-width:0; }
.menu-wrap { position:relative; }
.account-btn { display:flex; align-items:center; gap:8px; padding:4px 8px 4px 4px; background:transparent; border-color:var(--line); border-radius:999px; }
.account-avatar { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; background:var(--accent-soft); color:var(--accent); }
.nick { max-width:160px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:14px; color:var(--muted); }
.chev { width:16px; height:16px; color:var(--muted); }
.menu { position:absolute; top:calc(100% + 4px); z-index:30; min-width:200px; padding:4px; background:var(--card); border:1px solid var(--line); border-radius:12px; box-shadow:var(--menu-shadow); }
.menu.right, .more-wrap .menu { right:0; }
.menu-head { padding:8px 12px; border-bottom:1px solid var(--line); margin-bottom:4px; }
.menu-name { font-weight:600; overflow-wrap:anywhere; }
.menu-role { font-size:13px; color:var(--muted); }
.menu-item { display:flex; align-items:center; gap:8px; width:100%; min-height:var(--touch); padding:8px 12px; border:0; border-radius:8px;
             background:transparent; color:var(--text); font:inherit; font-size:15px; text-align:left; text-decoration:none; cursor:pointer; }
.menu-item:hover, .menu-item:focus-visible { background:var(--soft); }
.menu-item.danger { color:var(--danger); }
.menu-item.danger:hover { background:var(--danger-soft); }

/* 通用控件：触摸目标不小于 44px */
button { min-height:var(--touch); padding:8px 16px; border:1px solid transparent; border-radius:10px; background:var(--soft); color:var(--text);
         font:inherit; font-size:15px; cursor:pointer; }
button:hover:not(:disabled) { filter:brightness(.97); }
button:disabled { opacity:.5; cursor:default; }
button.primary { background:var(--accent); color:var(--accent-text); font-weight:600; padding:8px 24px; }
button.ghost { background:transparent; color:var(--muted); border-color:var(--line); padding:8px 16px; font-size:14px; }
button.ghost:hover:not(:disabled) { background:var(--soft); color:var(--text); }
button.ghost[aria-pressed="true"] { background:var(--accent-soft); color:var(--accent); border-color:var(--accent); }
button.ghost.wide { width:100%; display:flex; align-items:center; justify-content:center; gap:8px; }
button.danger { background:transparent; color:var(--danger); border-color:var(--danger); }
button.danger.solid { background:var(--danger); color:var(--card); border-color:var(--danger); font-weight:600; }
button.small { padding:8px 16px; font-size:14px; }
textarea, select, input[type="search"] { width:100%; min-height:var(--touch); padding:8px 12px; border:1px solid var(--line); border-radius:10px;
                   background:var(--bg); color:var(--text); font:inherit; font-size:15px; }
textarea { resize:vertical; }
input[type="radio"], input[type="checkbox"] { width:22px; height:22px; margin:0; accent-color:var(--accent); flex:none; }
.check { display:inline-flex; align-items:center; gap:8px; min-height:var(--touch); cursor:pointer; }
.back { display:inline-flex; align-items:center; gap:4px; margin-bottom:12px; }

.shell { max-width:1180px; margin:0 auto; padding:16px max(16px, env(safe-area-inset-right)) calc(48px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
.shell:focus { outline:none; }
.trial { margin:0 0 12px; color:var(--muted); font-size:13px; }
.card { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:16px; margin-bottom:16px; box-shadow:var(--shadow); }
.section-title { margin:0 0 8px; font-size:16px; font-weight:700; }
.sub-title { margin:24px 0 8px; font-size:14px; color:var(--muted); font-weight:600; }
.row { display:flex; align-items:center; gap:8px; margin-top:12px; flex-wrap:wrap; }
.row.end { justify-content:flex-end; }
.msg { font-size:14px; color:var(--muted); margin:8px 0; min-height:0; }
.msg:empty { margin:0; }
.msg.error { color:var(--danger); }
.muted { color:var(--muted); font-size:14px; margin:8px 0; }
.tiny { font-size:13px; }

/* 识别区：没有记录时是主角；选中记录后桌面端收成一条 */
.paste-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.paste-head .section-title { margin:0 0 8px; }
.paste-lead { display:none; margin:0 0 12px; color:var(--muted); font-size:14px; }
.kbd-hint { color:var(--muted); font-size:13px; }
.msg-inline { margin:0; }
.shell[data-hero="true"] .paste { max-width:640px; margin:24px auto; padding:24px; }
.shell[data-hero="true"] .paste-lead { display:block; }
.shell[data-hero="true"] .paste .section-title { font-size:20px; }
.shell[data-hero="true"] .layout { display:none; }
@media (pointer: coarse) { .kbd-hint { display:none; } }
@media (min-width: 900px) {
  .paste[data-compact="true"] { padding:8px 16px; }
  .paste[data-compact="true"] .paste-head .section-title { margin:0; font-size:14px; color:var(--muted); }
  .paste[data-compact="true"] #paste-body { display:none; }
}

/* 双栏 */
.layout { display:grid; grid-template-columns:minmax(0,1fr); gap:16px; align-items:start; }
.pane { background:var(--card); border:1px solid var(--line); border-radius:16px; padding:16px; box-shadow:var(--shadow); min-width:0; }
.layout[data-view="list"] .detail-pane { display:none; }
.layout[data-view="detail"] .list-pane { display:none; }
@media (max-width: 899px) {
  #paste-toggle { display:none !important; }
  .shell[data-view="detail"] .paste, .shell[data-view="detail"] .trial { display:none; }
}
@media (min-width: 900px) {
  .layout { grid-template-columns:minmax(320px,400px) minmax(0,1fr); }
  .layout[data-view="list"] .detail-pane, .layout[data-view="detail"] .list-pane { display:block; }
  .back, .again-wrap { display:none; }
  .list-pane { position:sticky; top:76px; max-height:calc(100vh - 92px); overflow:auto; }
}

/* 记录列表 */
.pane-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.pane-head .section-title { margin:0; }
.head-actions { display:flex; gap:8px; }
.toolbar { display:grid; grid-template-columns:minmax(0,1fr) 136px; gap:8px; margin:12px 0; }
.manage-bar { display:flex; align-items:center; gap:12px; padding:4px 12px; margin-bottom:8px; background:var(--soft); border-radius:10px; flex-wrap:wrap; }
.manage-bar .muted { margin:0; flex:1; }
.records { list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.record { display:flex; align-items:stretch; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.record.selected { border-color:var(--accent); background:var(--accent-soft); }
.record.deleting { opacity:.55; }
.record .pick { display:flex; align-items:center; justify-content:center; width:var(--touch); flex:none; cursor:pointer; }
.record-main { flex:1; min-width:0; display:block; text-align:left; background:transparent; border:0; padding:12px; border-radius:12px; color:var(--text); width:100%; }
.record-body, .record-title, .record-sub { display:block; }
.record-title { font-weight:600; line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere; }
.record-sub { display:flex; align-items:center; gap:8px; margin-top:8px; color:var(--muted); font-size:13px; min-height:24px; }
.record-sub time { white-space:nowrap; }
.who-name { min-width:0; max-width:10em; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.plat { display:inline-flex; align-items:center; flex:none; }
.plat-logo { width:18px; height:18px; border-radius:5px; background:#fff; padding:1px; }
.plat-text { font-size:12px; line-height:1.6; padding:0 8px; border-radius:999px; background:var(--soft); color:var(--muted); white-space:nowrap; }
.rec-media { margin-left:auto; display:inline-flex; align-items:center; gap:8px; flex:none; }
.mi { position:relative; display:inline-grid; place-items:center; width:26px; height:26px; border-radius:8px; color:var(--muted); background:var(--soft); }
.mi .ico { width:16px; height:16px; }
.mi.ready { color:var(--accent); background:var(--accent-soft); }
.mi.active { color:var(--warn); background:var(--warn-soft); animation:breathe 1.6s ease-in-out infinite; }
.mi.failed { color:var(--danger); background:var(--danger-soft); }
.mi.expired { opacity:.45; }
.mi-flag { position:absolute; right:-5px; top:-5px; width:13px; height:13px; border-radius:50%; background:var(--card); color:var(--danger); }
@keyframes breathe { 0%,100% { opacity:1; } 50% { opacity:.55; } }
.skeleton { height:84px; border-radius:12px; background:linear-gradient(90deg,var(--soft),var(--line),var(--soft)); background-size:200% 100%; animation:shimmer 1.4s linear infinite; }
@keyframes shimmer { from { background-position:200% 0; } to { background-position:-200% 0; } }
.empty { text-align:center; padding:48px 16px; color:var(--muted); }
.empty-mark { width:56px; height:56px; margin:0 auto 12px; border-radius:16px; display:grid; place-items:center; font-size:24px; font-weight:700;
              background:var(--accent-soft); color:var(--accent); }
.empty-text { margin:0; font-size:14px; }

/* 详情 */
.detail-title { margin:0 0 4px; font-size:19px; line-height:1.4; }
.title-btn { display:block; width:100%; min-height:var(--touch); padding:8px 0; border:0; border-radius:8px; background:transparent; color:var(--text);
             font:inherit; font-size:19px; font-weight:700; line-height:1.4; text-align:left; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
.title-btn.expanded { white-space:normal; overflow-wrap:anywhere; max-height:10em; overflow-y:auto; }
.meta { display:flex; flex-wrap:wrap; align-items:center; gap:4px 16px; color:var(--muted); font-size:14px; margin:0 0 4px; }
.meta .who-name { max-width:14em; }
.meta-plat { display:inline-flex; align-items:center; gap:8px; }
.create { margin-top:16px; }
.extract-bar { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.extract { display:inline-flex; align-items:center; gap:8px; padding:8px 16px; font-weight:600; background:transparent; color:var(--accent); border-color:var(--accent); }
.extract.video { background:var(--accent); color:var(--accent-text); }
.extract.audio.active { background:var(--accent-soft); }
.extract.video.active { box-shadow:0 0 0 3px var(--accent-soft); }
.more-wrap { margin-left:auto; }
.more-btn { width:var(--touch); padding:0; display:grid; place-items:center; background:transparent; border-color:var(--line); color:var(--muted); }
.extract-panel { margin-top:12px; padding:16px; border-radius:12px; background:var(--soft); }
.panel-text { margin:0; }
.qualities { border:0; padding:0; margin:0; min-width:0; }
.qualities legend { font-size:14px; color:var(--muted); padding:0; margin-bottom:8px; }
.choice { display:flex; align-items:center; gap:12px; min-height:var(--touch); padding:8px 12px; margin-bottom:8px; border:1px solid var(--line); border-radius:10px; background:var(--card); cursor:pointer; }
.choice:has(input:checked) { border-color:var(--accent); background:var(--accent-soft); }
.choice-text { flex:1; min-width:0; display:flex; flex-wrap:wrap; align-items:center; gap:4px 8px; }
.choice-name { font-weight:600; }
.choice-size { margin-left:auto; color:var(--muted); font-size:13px; }
.choice-size.unknown { opacity:.8; }
.tag { font-size:12px; line-height:1.6; padding:0 8px; border-radius:999px; background:var(--warn-soft); color:var(--warn); }
.notice { display:flex; align-items:flex-start; gap:12px; margin-top:16px; padding:12px 16px; border-radius:12px; background:var(--accent-soft); color:var(--text); }
.notice p { margin:0; }
.notice .ico { margin-top:2px; color:var(--accent); }
.jobs, .usage { list-style:none; margin:0; padding:0; }
.again-wrap { margin-top:24px; }

/* 任务卡片：左侧媒体图标，中间两行，右侧操作 */
.job { display:flex; align-items:center; gap:12px; padding:12px; margin-bottom:8px; border:1px solid var(--line); border-radius:12px; background:var(--card); }
.job-ico { width:28px; height:28px; flex:none; display:grid; place-items:center; color:var(--muted); }
.job-ico .ico { width:26px; height:26px; }
.job.ready .job-ico { color:var(--accent); }
.job.active .job-ico { color:var(--warn); }
.job.failed .job-ico { color:var(--danger); }
.job.expired { opacity:.65; }
.job-info { flex:1; min-width:0; }
.job-title { font-weight:600; }
.job-sub { font-size:13px; color:var(--muted); overflow-wrap:anywhere; }
.job.failed .job-sub { color:var(--danger); }
.job-action { flex:none; }
.flow { height:4px; margin-top:8px; border-radius:2px; background:var(--soft); overflow:hidden; }
.flow-bar { display:block; width:40%; height:100%; border-radius:2px; background:var(--accent); animation:flow 1.6s ease-in-out infinite; }
@keyframes flow { from { transform:translateX(-100%); } to { transform:translateX(260%); } }
.round-btn { width:var(--touch); height:var(--touch); padding:0; border-radius:50%; display:grid; place-items:center; background:var(--accent); color:var(--accent-text); }
.just-done { animation:done 1.4s ease-out 1; }
@keyframes done { 0% { box-shadow:0 0 0 0 var(--accent); background:var(--accent-soft); } 100% { box-shadow:0 0 0 12px transparent; background:var(--card); } }

/* 弹层 */
.scrim { position:fixed; inset:0; z-index:50; display:grid; place-items:center; padding:16px; background:rgba(10,20,15,.5); overscroll-behavior:contain; }
.modal { width:100%; max-width:460px; max-height:90vh; overflow:auto; overscroll-behavior:contain; background:var(--card); color:var(--text); border:1px solid var(--line); border-radius:16px; padding:24px; box-shadow:var(--shadow); }
.modal:focus { outline:none; }
.modal.small { max-width:380px; }
.modal-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.modal-head .section-title { margin:0; }

/* 使用情况 */
.usage-item { padding:12px 0; border-top:1px solid var(--line); font-size:14px; }
.usage-item:first-child { border-top:0; }
.usage .line { display:flex; justify-content:space-between; align-items:baseline; gap:12px; }
.usage .name { color:var(--muted); }
.usage .value { text-align:right; font-weight:600; font-size:15px; }
.usage .sub { margin-top:4px; font-size:13px; color:var(--muted); }
.meter { display:flex; height:8px; margin-top:8px; border-radius:4px; background:var(--soft); overflow:hidden; }
.meter-used { width:var(--w, 0%); background:var(--accent); }
.meter-reserved { width:var(--w, 0%); background:var(--warn); opacity:.55; }

@media (max-width: 480px) {
  .nick, .chev { display:none; }
  .account-btn { padding:4px; }
  .toolbar { grid-template-columns:minmax(0,1fr) 120px; }
  .brand-name { font-size:18px; }
  .extract { flex:1 1 0; justify-content:center; padding:8px; }
}
@media (prefers-reduced-motion: reduce) {
  .skeleton, .mi.active, .just-done { animation:none; }
  .flow-bar { animation:none; width:100%; opacity:.5; }
}
