/* AI 工作台 · 深色工作台风格 · 无外部依赖 (2026-09-17) */
:root {
  --bg: #0f1117; --surface: #161922; --elev: #1d212b; --hover: #232835; --input: #12151d;
  --border: rgba(255,255,255,.08); --border-strong: rgba(255,255,255,.16);
  --text: rgba(255,255,255,.88); --muted: rgba(255,255,255,.58); --faint: rgba(255,255,255,.34);
  --accent: #4f8cff; --accent-h: #6ea0ff; --accent-soft: rgba(79,140,255,.16); --accent-line: rgba(79,140,255,.45);
  --ok: #34d399; --ok-soft: rgba(52,211,153,.14); --warn: #fbbf24; --warn-soft: rgba(251,191,36,.14);
  --danger: #f87171; --danger-soft: rgba(248,113,113,.14);
  --r: 12px; --r-sm: 8px; --nav-w: 84px; --shadow: 0 12px 32px -8px rgba(0,0,0,.55);
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "PingFang SC", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 8px; border: 2px solid var(--bg); } ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.2); }
h1, h2, h3 { margin: 0; font-weight: 600; } h1 { font-size: 20px; } h2 { font-size: 16px; } h3 { font-size: 14px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .mono { font-family: var(--mono); font-size: 12.5px; }
.row { display: flex; align-items: center; gap: 8px; } .col { display: flex; flex-direction: column; gap: 8px; } .grow { flex: 1; min-width: 0; } .wrap { flex-wrap: wrap; }
.hidden { display: none !important; }

/* ---------- buttons / inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--border-strong); background: var(--elev); color: var(--text); cursor: pointer; transition: background .12s ease, border-color .12s ease, transform .12s ease; white-space: nowrap; user-select: none; }
.btn:hover { background: var(--hover); border-color: rgba(255,255,255,.22); } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; font-weight: 600; } .btn.primary:hover { background: var(--accent-h); }
.btn.danger { color: var(--danger); } .btn.danger:hover { background: var(--danger-soft); border-color: rgba(248,113,113,.4); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); } .btn.ghost:hover { background: var(--hover); color: var(--text); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; } .btn.xs { height: 26px; padding: 0 8px; font-size: 12px; border-radius: 6px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 15px; }
.btn.icon { width: 36px; padding: 0; } .btn.icon.sm { width: 30px; } .btn.icon.xs { width: 26px; }
.input, textarea.input, select.input { width: 100%; height: 38px; padding: 0 12px; background: var(--input); border: 1px solid var(--border-strong); border-radius: var(--r-sm); color: var(--text); outline: none; transition: border-color .12s ease, box-shadow .12s ease; }
textarea.input { height: auto; min-height: 92px; padding: 10px 12px; resize: vertical; line-height: 1.55; }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.err { border-color: var(--danger); } .field-err { color: var(--danger); font-size: 12px; margin-top: 4px; }
.input::placeholder { color: var(--faint); }
label.lbl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
.seg { display: inline-flex; background: var(--input); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { height: 28px; padding: 0 10px; border: 0; background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; transition: background .12s, color .12s; font-size: 13px; }
.seg button:hover { color: var(--text); } .seg button.on { background: var(--accent-soft); color: var(--accent-h); font-weight: 600; }
.seg.full { display: flex; } .seg.full button { flex: 1; }
input[type=range] { width: 100%; accent-color: var(--accent); }
.chip { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px; background: var(--elev); border: 1px solid var(--border); color: var(--muted); font-size: 12px; cursor: pointer; transition: all .12s; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: var(--border-strong); } .chip.on { background: var(--accent-soft); color: var(--accent-h); border-color: var(--accent-line); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; background: var(--elev); color: var(--muted); border: 1px solid var(--border); }
.pill { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.queued { background: var(--warn-soft); color: var(--warn); } .pill.running { background: var(--accent-soft); color: var(--accent-h); }
.pill.completed { background: var(--ok-soft); color: var(--ok); } .pill.failed { background: var(--danger-soft); color: var(--danger); } .pill.cancelled { background: var(--elev); color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); display: inline-block; } .dot.ok { background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); } .dot.bad { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); } .dot.warn { background: var(--warn); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.card.pad { padding: 20px; }
.divider { height: 1px; background: var(--border); margin: 12px 0; }
kbd { font: 11px var(--mono); padding: 1px 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); }
.spin { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.2); border-top-color: var(--accent-h); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.progress { height: 6px; background: rgba(255,255,255,.08); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-h)); border-radius: 4px; transition: width .4s ease; }
.progress.indet > i { width: 40% !important; background: linear-gradient(90deg, transparent, var(--accent-h), transparent); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; }

/* ---------- toasts / modal ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 1000; }
.toast { min-width: 260px; max-width: 420px; padding: 12px 14px; background: var(--elev); border: 1px solid var(--border-strong); border-left: 3px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow); animation: fadeUp .2s ease; display: flex; gap: 10px; align-items: flex-start; }
.toast.ok { border-left-color: var(--ok); } .toast.err { border-left-color: var(--danger); } .toast.warn { border-left-color: var(--warn); }
.toast .t { font-weight: 600; margin-bottom: 2px; } .toast .m { color: var(--muted); font-size: 13px; word-break: break-all; }
#modal-root:empty { display: none; }
.modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px); z-index: 900; display: flex; align-items: center; justify-content: center; animation: fadeUp .15s ease; }
.modal { background: var(--surface); border: 1px solid var(--border-strong); border-radius: 16px; box-shadow: var(--shadow); width: min(920px, 92vw); max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.modal.sm { width: min(460px, 92vw); } .modal.lg { width: min(1200px, 94vw); }
.modal-h { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-b { padding: 20px; overflow: auto; } .modal-f { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
#drop-overlay { position: fixed; inset: 0; z-index: 950; display: none; background: rgba(79,140,255,.12); backdrop-filter: blur(2px); align-items: center; justify-content: center; pointer-events: none; }
#drop-overlay.on { display: flex; }
.drop-inner { padding: 28px 40px; border: 2px dashed var(--accent-line); border-radius: 16px; background: rgba(15,17,23,.85); text-align: center; font-size: 16px; color: var(--accent-h); }
.drop-icon { font-size: 34px; margin-bottom: 6px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; }
.nav { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; align-items: center; padding: 14px 0 12px; gap: 4px; }
.nav .logo { width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; margin-bottom: 14px; font-size: 16px; letter-spacing: -.5px; }
.nav a.item { width: 64px; padding: 9px 0 7px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--muted); font-size: 11px; cursor: pointer; transition: background .12s, color .12s; }
.nav a.item .ic { font-size: 20px; line-height: 1; }
.nav a.item:hover { background: var(--hover); color: var(--text); } .nav a.item.on { background: var(--accent-soft); color: var(--accent-h); }
.nav .spacer { flex: 1; }
.nav .status { display: flex; flex-direction: column; gap: 6px; align-items: center; margin-bottom: 10px; font-size: 10px; color: var(--faint); }
.nav .status .row { gap: 5px; }
.nav .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--elev); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-h); cursor: pointer; }
.main { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.topbar { height: 56px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; padding: 0 20px; flex-shrink: 0; }
.topbar h1 { font-size: 16px; } .topbar .sub { color: var(--muted); font-size: 12px; }
.view { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; overflow: auto; padding: 24px; }
.page.narrow { max-width: 900px; }

/* ---------- auth ---------- */
.auth-wrap { height: 100vh; display: flex; align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 20% -10%, rgba(79,140,255,.16), transparent 60%), radial-gradient(900px 500px at 100% 110%, rgba(139,92,246,.14), transparent 60%), var(--bg); }
.auth { width: 400px; padding: 32px; }
.auth .brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; } .auth .brand .logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, var(--accent), #8b5cf6); display: flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; font-size: 18px; }
.auth .tabs { display: flex; gap: 4px; margin-bottom: 18px; background: var(--input); padding: 3px; border-radius: 8px; } .auth .tabs button { flex: 1; height: 32px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); cursor: pointer; } .auth .tabs button.on { background: var(--elev); color: var(--text); font-weight: 600; }

/* ---------- home ---------- */
.hero { margin-bottom: 22px; } .hero h1 { font-size: 24px; margin-bottom: 4px; } .hero p { margin: 0; color: var(--muted); }
.grid { display: grid; gap: 12px; } .grid.tasks { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.task-card { padding: 16px; cursor: pointer; transition: background .12s, transform .12s, border-color .12s; display: flex; flex-direction: column; gap: 6px; min-height: 112px; }
.task-card:hover { background: var(--elev); transform: translateY(-2px); border-color: var(--border-strong); }
.task-card .ic { font-size: 22px; } .task-card .t { font-weight: 600; } .task-card .d { color: var(--muted); font-size: 12px; line-height: 1.45; }
.task-card .model { margin-top: auto; font-size: 11px; color: var(--faint); }
.section-h { display: flex; align-items: center; gap: 10px; margin: 26px 0 12px; } .section-h h2 { font-size: 15px; } .section-h .muted { font-size: 12px; }

/* ---------- qwen ---------- */
.qwen { display: grid; grid-template-columns: 240px 1fr 380px; width: 100%; min-height: 0; }
.drawer-bg { display: none; }
.chatlist { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.chatlist .hd { padding: 12px; display: flex; gap: 8px; align-items: center; }
.chatlist .list { flex: 1; overflow: auto; padding: 0 8px 8px; }
.chatlist .it { padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.chatlist .it:hover { background: var(--hover); color: var(--text); } .chatlist .it.on { background: var(--accent-soft); color: var(--text); }
.chatlist .it .t { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .chatlist .it .x { opacity: 0; } .chatlist .it:hover .x { opacity: 1; }
.chatlist .group { font-size: 11px; color: var(--faint); padding: 10px 10px 4px; }
.chatmain { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.presets { padding: 10px 20px; border-bottom: 1px solid var(--border); display: flex; gap: 6px; overflow-x: auto; flex-shrink: 0; align-items: center; }
.presets .lbl-inline { font-size: 12px; color: var(--faint); margin-right: 4px; white-space: nowrap; }
.msgs { flex: 1; overflow: auto; padding: 20px 20px 8px; display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; animation: fadeUp .18s ease; max-width: 100%; }
.msg .av { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }
.msg.user .av { background: var(--elev); color: var(--accent-h); } .msg.assistant .av { background: linear-gradient(135deg, var(--accent), #8b5cf6); color: #fff; }
.msg .body { min-width: 0; flex: 1; } .msg .who { font-size: 12px; color: var(--faint); margin-bottom: 4px; display: flex; gap: 10px; align-items: center; }
.msg .who .tools { margin-left: auto; opacity: 0; transition: opacity .12s; } .msg:hover .who .tools { opacity: 1; }
.msg .txt { white-space: pre-wrap; word-break: break-word; line-height: 1.6; }
.msg .txt pre { background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; overflow: auto; font: 12.5px/1.5 var(--mono); white-space: pre; margin: 6px 0; position: relative; }
.msg .txt code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px; }
.msg .txt pre code { background: none; padding: 0; }
.msg .txt h1, .msg .txt h2, .msg .txt h3 { margin: 8px 0 4px; font-size: 14px; } .msg .txt ul { margin: 4px 0; padding-left: 20px; } .msg .txt li.sub { list-style: circle; margin-left: 16px; }
.msg .atts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.msg .atts .th { width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--input); cursor: pointer; position: relative; }
.msg .atts .th img, .msg .atts .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.msg .atts .th.on { outline: 2px solid var(--accent); }
.msg .meta { font-size: 11px; color: var(--faint); margin-top: 6px; display: flex; gap: 10px; }
.msg .err { color: var(--danger); background: var(--danger-soft); border: 1px solid rgba(248,113,113,.3); padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.cursor::after { content: "▍"; color: var(--accent-h); animation: blink 1s steps(2) infinite; } @keyframes blink { 50% { opacity: 0; } }
.composer { border-top: 1px solid var(--border); padding: 12px 20px 14px; flex-shrink: 0; }
.tray { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.tray .th { width: 72px; height: 72px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); position: relative; background: var(--input); }
.tray .th img, .tray .th video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tray .th .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: 0; cursor: pointer; font-size: 12px; line-height: 20px; padding: 0; }
.tray .th .k { position: absolute; left: 0; bottom: 0; right: 0; font-size: 10px; background: rgba(0,0,0,.6); color: #fff; text-align: center; padding: 1px 0; }
.tray .th .up { position: absolute; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; }
.tray .th.audio { display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); }
.tray .add { width: 72px; height: 72px; border-radius: 8px; border: 1px dashed var(--border-strong); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--faint); cursor: pointer; font-size: 11px; gap: 2px; }
.tray .add:hover { border-color: var(--accent-line); color: var(--accent-h); } .tray .add .plus { font-size: 20px; line-height: 1; }
.compose-box { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--input); padding: 10px 12px 8px; transition: border-color .12s, box-shadow .12s; }
.compose-box:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-box textarea { width: 100%; background: transparent; border: 0; outline: none; resize: none; min-height: 44px; max-height: 220px; line-height: 1.55; color: var(--text); padding: 0; }
.compose-box .bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; } .compose-box .bar .hint { margin-left: auto; font-size: 11px; color: var(--faint); }
.limits { font-size: 11px; color: var(--faint); margin-top: 6px; }
.sidepanel { border-left: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; overflow: auto; }
.sidepanel .sec { padding: 14px 16px; border-bottom: 1px solid var(--border); }
.sidepanel .sec h3 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.focus-media { position: relative; background: var(--input); border-radius: 10px; overflow: hidden; border: 1px solid var(--border); min-height: 120px; display: flex; align-items: center; justify-content: center; }
.focus-media img, .focus-media video { max-width: 100%; max-height: 420px; display: block; }
.focus-media canvas { position: absolute; left: 0; top: 0; pointer-events: none; }
.focus-media .empty { color: var(--faint); font-size: 12px; padding: 30px; text-align: center; }
.jsonbox { background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 10px; font: 12px/1.5 var(--mono); white-space: pre-wrap; word-break: break-all; max-height: 320px; overflow: auto; }
.boxlist { display: flex; flex-direction: column; gap: 4px; font-size: 12px; } .boxlist .b { display: flex; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: pointer; } .boxlist .b:hover { background: var(--hover); } .boxlist .sw { width: 10px; height: 10px; border-radius: 2px; }
.settings-pop { position: absolute; bottom: 44px; left: 0; width: 380px; padding: 14px; background: var(--elev); border: 1px solid var(--border-strong); border-radius: 12px; box-shadow: var(--shadow); z-index: 20; }
.empty-state { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); padding: 40px; gap: 8px; }
.empty-state .ic { font-size: 40px; opacity: .5; } .empty-state .t { font-size: 15px; color: var(--text); font-weight: 600; } .empty-state .d { font-size: 13px; max-width: 420px; }

/* ---------- h3 ---------- */
.h3 { display: grid; grid-template-columns: 400px 1fr; width: 100%; min-height: 0; }
.console { border-right: 1px solid var(--border); overflow: auto; padding: 16px 18px 24px; display: flex; flex-direction: column; gap: 14px; }
.functabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.functabs button { height: 44px; border-radius: 10px; border: 1px solid var(--border); background: var(--input); color: var(--muted); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: 12px; transition: all .12s; }
.functabs button .ic { font-size: 15px; } .functabs button:hover { color: var(--text); border-color: var(--border-strong); } .functabs button.on { background: var(--accent-soft); color: var(--accent-h); border-color: var(--accent-line); font-weight: 600; }
.func-desc { font-size: 12px; color: var(--muted); padding: 8px 10px; background: var(--surface); border-radius: 8px; border: 1px solid var(--border); line-height: 1.5; }
.slot { border: 1px dashed var(--border-strong); border-radius: 10px; padding: 10px; display: flex; gap: 10px; align-items: center; min-height: 84px; cursor: pointer; transition: border-color .12s, background .12s; position: relative; }
.slot:hover, .slot.over { border-color: var(--accent-line); background: var(--accent-soft); }
.slot .ph { color: var(--faint); font-size: 12px; display: flex; flex-direction: column; gap: 2px; } .slot .ph b { color: var(--muted); font-weight: 600; font-size: 13px; }
.slot .prev { width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--input); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 22px; color: var(--muted); }
.slot .prev img, .slot .prev video { width: 100%; height: 100%; object-fit: cover; }
.slot .info { flex: 1; min-width: 0; font-size: 12px; } .slot .info .n { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .slot .info .s { color: var(--faint); }
.slot .x { position: absolute; top: 6px; right: 6px; }
.slot.req::after { content: "必需"; position: absolute; top: -8px; left: 10px; font-size: 10px; background: var(--surface); color: var(--warn); padding: 0 6px; border-radius: 4px; }
.slot.opt::after { content: "可选"; position: absolute; top: -8px; left: 10px; font-size: 10px; background: var(--surface); color: var(--faint); padding: 0 6px; border-radius: 4px; }
.multi { display: flex; gap: 8px; flex-wrap: wrap; }
.param { display: flex; flex-direction: column; gap: 6px; } .param .lh { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); } .param .lh b { color: var(--text); font-weight: 600; }
details.adv { border: 1px solid var(--border); border-radius: 10px; padding: 0 12px; } details.adv summary { cursor: pointer; padding: 10px 0; color: var(--muted); font-size: 13px; list-style: none; display: flex; align-items: center; gap: 6px; } details.adv summary::-webkit-details-marker { display: none; } details.adv[open] summary { border-bottom: 1px solid var(--border); margin-bottom: 10px; }
details.adv .param { margin-bottom: 12px; }
.eta-hint { font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.gallery { display: flex; flex-direction: column; min-height: 0; }
.qbar { display: flex; align-items: center; gap: 14px; padding: 10px 20px; border-bottom: 1px solid var(--border); font-size: 12px; color: var(--muted); flex-shrink: 0; }
.qbar b { color: var(--text); }
.cards { flex: 1; overflow: auto; padding: 18px 20px; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; align-content: start; }
.vcard { display: flex; flex-direction: column; overflow: hidden; animation: fadeUp .18s ease; }
.vcard .media { position: relative; aspect-ratio: 16/9; background: var(--input); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.vcard .media video { width: 100%; height: 100%; object-fit: contain; background: #000; cursor: pointer; }
.vcard .media .ov { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 16px; text-align: center; }
.vcard .media .ov .big { font-size: 26px; font-weight: 700; color: var(--accent-h); } .vcard .media .ov .st { font-size: 12px; color: var(--muted); }
.vcard .media .ov .progress { width: 70%; }
.vcard .media .fail { color: var(--danger); font-size: 12px; }
.vcard .body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.vcard .prompt { font-size: 13px; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; cursor: pointer; }
.vcard .chips { display: flex; gap: 5px; flex-wrap: wrap; }
.vcard .acts { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.vcard.active { border-color: var(--accent-line); }
.dock { position: fixed; right: 20px; bottom: 20px; z-index: 800; }
.dock button { height: 40px; padding: 0 14px 0 12px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--elev); color: var(--text); box-shadow: var(--shadow); cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dock button:hover { background: var(--hover); }

/* ---------- history ---------- */
.filters { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.filters .input { width: 260px; }
.hgroup { margin-bottom: 22px; } .hgroup h3 { font-size: 12px; color: var(--faint); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .04em; }
.hgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.hitem { cursor: pointer; overflow: hidden; transition: transform .12s, border-color .12s; position: relative; }
.hitem:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.hitem .media { aspect-ratio: 16/9; background: var(--input); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.hitem .media video { width: 100%; height: 100%; object-fit: cover; }
.hitem .media .ic { font-size: 30px; opacity: .5; }
.hitem .b { padding: 10px 12px; } .hitem .t { font-size: 13px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; } .hitem .s { font-size: 11px; color: var(--faint); margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.hitem .ck { position: absolute; top: 8px; left: 8px; width: 20px; height: 20px; accent-color: var(--accent); z-index: 2; }
.batchbar { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--elev); border: 1px solid var(--border-strong); border-radius: 999px; padding: 8px 10px 8px 16px; display: flex; gap: 10px; align-items: center; box-shadow: var(--shadow); z-index: 700; }

/* ---------- account / admin ---------- */
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; font-size: 13px; } .kv .k { color: var(--muted); }
.keybox { display: flex; gap: 8px; align-items: center; } .keybox code { flex: 1; font: 12.5px var(--mono); background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; } table.tbl th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--border); } table.tbl td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.tbl tr:hover td { background: rgba(255,255,255,.02); }
.stat { padding: 14px 16px; } .stat .n { font-size: 22px; font-weight: 700; } .stat .l { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

/* ---------- detail modal ---------- */
.detail { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.detail video { width: 100%; max-height: 62vh; background: #000; border-radius: 10px; }
.detail .kv { font-size: 12.5px; }
.detail .prompt { background: var(--input); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: 13px; white-space: pre-wrap; max-height: 200px; overflow: auto; }
@media (max-width: 1200px) { .qwen { grid-template-columns: 220px 1fr; } .sidepanel { display: none; } .h3 { grid-template-columns: 360px 1fr; } }

/* ======================================================= 手机端(≤768px, 2026-09-17 晚) ======================================================= */
@media (max-width: 768px) {
  :root { --nav-w: 0px; }
  html, body { height: 100%; overscroll-behavior: none; }
  input.input, textarea, select.input { font-size: 16px; }   /* iOS 聚焦不放大 */
  .btn { min-height: 40px; } .btn.sm { min-height: 36px; } .btn.xs { min-height: 30px; }
  .app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
  .app > .nav { display: none; }
  .main { flex: 1; min-height: 0; }
  .tabbar { display: flex; height: calc(56px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: var(--surface); flex-shrink: 0; }
  .tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 11px; color: var(--muted); }
  .tabbar a .ic { font-size: 20px; line-height: 1; } .tabbar a.on { color: var(--accent-h); }
  .topbar { height: 52px; padding: 0 12px; gap: 8px; } .topbar h1 { font-size: 15px; white-space: nowrap; } .topbar .sub, .topbar .kbd-hint { display: none; }
  .topbar .mstatus { display: flex; gap: 8px; font-size: 10px; color: var(--faint); } .topbar .mstatus .row { gap: 4px; }
  .topbar .avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--elev); border: 1px solid var(--border-strong); display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent-h); font-size: 12px; }
  .page { padding: 16px; }
  #toasts { right: 12px; left: 12px; bottom: calc(66px + env(safe-area-inset-bottom)); } .toast { min-width: 0; max-width: none; }
  .dock { right: 12px; bottom: calc(68px + env(safe-area-inset-bottom)); }
  #drop-overlay { display: none !important; }
  .modal-bg { align-items: flex-end; } .modal, .modal.sm, .modal.lg { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; } .modal-b { padding: 16px; } .modal-h { padding: 14px 16px; }
  .detail { grid-template-columns: 1fr; gap: 14px; } .detail video { max-height: 45vh; }
  /* auth */
  .auth { width: 100%; max-width: 420px; padding: 24px 20px; margin: 0 16px; }
  /* home */
  .hero h1 { font-size: 20px; } .grid.tasks { grid-template-columns: 1fr 1fr; gap: 10px; } .task-card { padding: 14px; min-height: 0; } .task-card .d { display: none; }
  .hgrid { grid-template-columns: 1fr 1fr; gap: 10px; }
  /* qwen */
  .qwen { display: flex; flex-direction: column; position: relative; }
  .chatlist { position: fixed; left: 0; top: 0; bottom: 0; width: 82vw; max-width: 340px; z-index: 850; background: var(--surface); transform: translateX(-105%); transition: transform .2s ease; box-shadow: var(--shadow); border-right: 1px solid var(--border-strong); }
  .chatlist.open { transform: none; }
  .drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 840; display: none; } .drawer-bg.on { display: block; }
  .chatmain { flex: 1; min-height: 0; }
  .presets { padding: 8px 12px; } .msgs { padding: 14px 12px 8px; gap: 14px; }
  .msg .av { width: 26px; height: 26px; font-size: 12px; } .msg .who .tools { opacity: 1; }
  .msg .atts .th { width: 72px; height: 72px; }
  .composer { padding: 8px 12px calc(10px + env(safe-area-inset-bottom)); }
  .tray .th, .tray .add { width: 58px; height: 58px; }
  .compose-box .bar { flex-wrap: wrap; row-gap: 6px; } .compose-box .bar .hint { display: none; } .compose-box .bar .btn.sm { padding: 0 10px; }
  .compose-box .bar #c-target { order: -1; flex-basis: 100%; width: 100% !important; height: 36px !important; } .compose-box .bar #c-send, .compose-box .bar #c-stop { margin-left: auto; }
  .settings-pop { width: calc(100vw - 24px); left: -12px; bottom: 48px; }
  .limits { font-size: 10px; }
  .sidepanel { display: flex; position: fixed; left: 0; right: 0; bottom: 0; max-height: 80vh; z-index: 860; background: var(--surface); border: 0; border-top: 1px solid var(--border-strong); border-radius: 16px 16px 0 0; box-shadow: var(--shadow); transform: translateY(105%); transition: transform .22s ease; padding-bottom: env(safe-area-inset-bottom); }
  .sidepanel.open { transform: none; }
  .sidepanel .handle { height: 34px; display: flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; } .sidepanel .handle i { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); }
  .sidepanel .handle .btn { position: absolute; right: 6px; top: 0; height: 34px; min-height: 34px; width: 44px; z-index: 1; }
  .focus-media img, .focus-media video { max-height: 40vh; }
  #c-results { background: var(--accent-soft); color: var(--accent-h); border-color: var(--accent-line); }
  /* h3 */
  .h3 { display: flex; flex-direction: column; } .console { display: none; border: 0; padding: 14px 14px 24px; } .gallery { display: none; flex: 1; min-height: 0; }
  .cards { grid-auto-rows: max-content; } .vcard .media { flex-shrink: 0; aspect-ratio: auto; min-height: 150px; max-height: 70vh; } .vcard .media video { height: auto; max-height: 70vh; } .vcard .media .ov { position: absolute; inset: 0; } .vcard .media:has(.ov) { aspect-ratio: 16/9; }
  .tbl-hint { display: block; font-size: 11px; color: var(--faint); margin-bottom: 6px; }
  .h3[data-mtab=console] .console { display: flex; } .h3[data-mtab=gallery] .gallery { display: flex; }
  .mtabs { display: inline-flex; } .functabs { gap: 5px; } .functabs button { height: 42px; font-size: 11px; }
  .seg.full { flex-wrap: wrap; } .seg.full button { min-width: 30%; }
  .qbar { padding: 8px 12px; gap: 8px; flex-wrap: wrap; font-size: 11px; }
  .cards { grid-template-columns: 1fr; padding: 12px; gap: 12px; }
  .vcard .acts .btn.xs { min-height: 34px; padding: 0 10px; }
  /* history */
  .filters { gap: 8px; margin-bottom: 14px; } .filters .input { width: 100%; order: 3; }
  .hitem .b { padding: 8px 10px; } .hitem .t { font-size: 12px; } .hitem .s { flex-wrap: wrap; }
  .batchbar { bottom: calc(70px + env(safe-area-inset-bottom)); width: calc(100% - 24px); justify-content: center; }
  /* account / admin */
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; } .stat .n { font-size: 18px; }
  .card.pad { padding: 16px; } .kv { grid-template-columns: 90px 1fr; }
  .keybox { flex-wrap: wrap; } .keybox code { flex-basis: 100%; }
  .tbl-wrap { overflow: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; } table.tbl { min-width: 720px; }
  .page.narrow form { max-width: none !important; }
}
@media (max-width: 768px) and (orientation: landscape) { .tabbar { height: calc(44px + env(safe-area-inset-bottom)); } .tabbar a { flex-direction: row; gap: 6px; } }
