/* 智慧價值 AIV · AI 作業平台 假介面 Demo — 樣式（無外部資源） */
:root {
  --ink: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --line: #e2e8f0;
  --bg: #f8fafc;
  --card: #ffffff;
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --brand-l: #dbeafe;
  --ok: #16a34a;
  --warn: #ea580c;
  --bad: #dc2626;
  --taskbar: 44px;
  --font: "PingFang TC", "Noto Sans TC", "Noto Sans CJK TC", "Heiti TC", "Hiragino Sans CNS", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  overflow: hidden;
  background: #0f172a;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select { font-family: inherit; font-size: inherit; }
h1, h2, h3, h4, p { margin: 0; }
svg { display: block; }

/* ===== 桌面 ===== */
#app { position: fixed; inset: 0; }
.desktop {
  position: absolute; inset: 0 0 var(--taskbar) 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  overflow: hidden;
}
.desktop::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(circle at 78% 18%, rgba(96,165,250,.18), transparent 38%),
    radial-gradient(circle at 12% 88%, rgba(56,189,248,.10), transparent 40%);
}
.wm {
  position: absolute; left: 24px; top: 18px; color: rgba(255,255,255,.72);
  font-size: 12px; letter-spacing: .08em;
}
.tiles-big {
  position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  display: flex; gap: 36px;
}
.tile-big {
  width: 190px; height: 200px; border-radius: 22px; background: #fff; border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  box-shadow: 0 10px 30px rgba(2,6,23,.35);
  transition: transform .15s ease, box-shadow .15s ease;
  color: var(--ink); font-weight: 600; font-size: 17px;
}
.tile-big:hover { transform: translateY(-6px); box-shadow: 0 16px 36px rgba(2,6,23,.45); }
.tile-big:active { transform: translateY(-2px) scale(.98); }
.tile-big .ic { width: 84px; height: 84px; }
.tile-big small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-3); margin-top: 4px; text-align: center; }
.welcome {
  position: absolute; left: 50%; top: calc(46% + 150px); transform: translateX(-50%);
  color: rgba(255,255,255,.65); font-size: 13px; letter-spacing: .06em; white-space: nowrap;
}
.tiles-small { position: absolute; right: 28px; bottom: 28px; display: flex; gap: 16px; }
.tile-small {
  width: 118px; height: 112px; border-radius: 18px; background: rgba(255,255,255,.96); border: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 8px 22px rgba(2,6,23,.32);
  transition: transform .15s ease; color: var(--ink); font-weight: 600; font-size: 13px;
}
.tile-small:hover { transform: translateY(-4px); }
.tile-small:active { transform: scale(.97); }
.tile-small .ic { width: 44px; height: 44px; }

/* ===== 工作列 ===== */
.taskbar {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--taskbar);
  background: #0b1220; border-top: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: stretch; color: #e2e8f0; z-index: 50; font-size: 13px;
}
.start {
  display: flex; align-items: center; gap: 8px; padding: 0 18px; background: transparent; border: 0;
  color: #fff; font-weight: 700; letter-spacing: .08em;
}
.start:hover { background: rgba(255,255,255,.08); }
.start .dot { width: 16px; height: 16px; border-radius: 5px; background: linear-gradient(135deg, #60a5fa, #2563eb); }
.tb-mid { flex: 1; display: flex; align-items: center; padding: 0 8px; gap: 6px; }
.tb-app {
  height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border-radius: 8px;
  background: rgba(255,255,255,.14); border: 0; border-bottom: 2px solid #60a5fa; color: #fff;
}
.tb-app.min { background: rgba(255,255,255,.06); border-bottom-color: transparent; color: #94a3b8; }
.tb-app:hover { background: rgba(255,255,255,.22); }
.tb-app .ic { width: 18px; height: 18px; }
.tb-right {
  display: flex; align-items: center; gap: 4px; padding: 0 10px; background: transparent; border: 0; color: #cbd5e1;
}
.tb-right:hover { background: rgba(255,255,255,.08); }
.chip { padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.08); font-size: 12px; white-space: nowrap; }
.chip.ok { color: #86efac; }
.chip.model { color: #93c5fd; }
.clock { margin-left: 8px; font-variant-numeric: tabular-nums; min-width: 72px; text-align: right; line-height: 1.15; font-size: 12px; }

/* ===== 應用程式視窗 ===== */
.win-layer { position: absolute; inset: 0 0 var(--taskbar) 0; pointer-events: none; z-index: 20; }
.win {
  position: absolute; left: 50%; top: 50%;
  width: min(1100px, calc(100vw - 48px)); height: min(700px, calc(100vh - var(--taskbar) - 24px));
  transform: translate(-50%, -50%);
  background: var(--card); border-radius: 12px; overflow: hidden;
  box-shadow: 0 30px 80px rgba(2,6,23,.55), 0 0 0 1px rgba(255,255,255,.08);
  display: flex; flex-direction: column; pointer-events: auto;
  animation: pop .18s ease;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, -48%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.win.max { left: 0; top: 0; width: 100%; height: 100%; transform: none; border-radius: 0; animation: none; }
.win.hidden { display: none; }
.win-title {
  height: 42px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 8px 0 14px;
  background: #f1f5f9; border-bottom: 1px solid var(--line); font-weight: 600; user-select: none;
}
.win-title .ic { width: 22px; height: 22px; }
.win-title .sp { flex: 1; }
.wbtn {
  width: 34px; height: 28px; border-radius: 6px; border: 0; background: transparent; color: var(--ink-2);
  display: flex; align-items: center; justify-content: center;
}
.wbtn:hover { background: #e2e8f0; }
.wbtn:active { background: #cbd5e1; }
.wbtn.close:hover { background: #ef4444; color: #fff; }
.win-body { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; background: var(--bg); }

/* 分頁 */
.tabs { flex: none; display: flex; gap: 4px; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); }
.tab {
  height: 44px; padding: 0 18px; border: 0; background: transparent; color: var(--ink-3); font-weight: 600;
  border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--ink); background: #f8fafc; }
.tab.on { color: var(--brand); border-bottom-color: var(--brand); }
.pane { flex: 1; min-height: 0; display: flex; }
.scroll { overflow: auto; }

/* 按鈕 */
.btn {
  height: 34px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 600; transition: background .12s, transform .08s, box-shadow .12s;
}
.btn:hover { background: #f1f5f9; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-d); }
.btn.ghost { background: transparent; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.danger { background: #fff; color: var(--bad); border-color: #fecaca; }

/* pill */
.pill { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 20px; }
.c-red { background: #fee2e2; color: #b91c1c; }
.c-orange { background: #ffedd5; color: #c2410c; }
.c-amber { background: #fef3c7; color: #a16207; }
.c-blue { background: #dbeafe; color: #1d4ed8; }
.c-indigo { background: #e0e7ff; color: #4338ca; }
.c-purple { background: #f3e8ff; color: #7e22ce; }
.c-green { background: #dcfce7; color: #15803d; }
.c-teal { background: #ccfbf1; color: #0f766e; }
.c-gray { background: #e2e8f0; color: #475569; }

/* ===== 郵件助理 ===== */
.mail { flex: 1; min-height: 0; display: flex; }
.m-cats { width: 176px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 12px 8px; overflow: auto; }
.m-cat {
  width: 100%; display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 0; background: transparent;
  border-radius: 8px; text-align: left; color: var(--ink-2); font-weight: 600; margin-bottom: 2px;
}
.m-cat:hover { background: #f1f5f9; }
.m-cat.on { background: var(--brand-l); color: var(--brand-d); }
.m-cat .gl { width: 14px; font-size: 11px; opacity: .7; }
.m-cat .nm { flex: 1; }
.m-cat .num { font-size: 12px; background: #e2e8f0; color: #475569; border-radius: 999px; padding: 0 8px; line-height: 20px; font-variant-numeric: tabular-nums; }
.m-cat.on .num { background: var(--brand); color: #fff; }
.m-cat.hot .num { background: #fee2e2; color: #b91c1c; }
.m-cat.hot.on .num { background: var(--brand); color: #fff; }
.m-list { width: 340px; flex: none; border-right: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; min-height: 0; }
.m-list-h { padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 700; display: flex; justify-content: space-between; align-items: baseline; }
.m-list-h small { color: var(--ink-3); font-weight: 400; font-size: 12px; }
.m-items { flex: 1; overflow: auto; }
.m-item { padding: 10px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer; border-left: 3px solid transparent; }
.m-item:hover { background: #f8fafc; }
.m-item.on { background: var(--brand-l); border-left-color: var(--brand); }
.m-r1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.m-from { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-from span { font-weight: 400; color: var(--ink-3); font-size: 12px; }
.m-time { font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.m-subj { margin: 2px 0 5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-r3 { display: flex; gap: 8px; align-items: center; }
.m-sum { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.m-detail { flex: 1; min-width: 0; overflow: auto; padding: 14px 18px; background: var(--bg); }
.md-h h3 { font-size: 16px; line-height: 1.4; }
.md-meta { margin-top: 4px; color: var(--ink-3); font-size: 12px; }
.md-body { margin: 8px 0 10px; padding: 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; line-height: 1.65; font-size: 13px; color: var(--ink-2); }
.md-body p + p { margin-top: 2px; }
.box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 10px; }
.box h4 { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; letter-spacing: .04em; }
.ai-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.conf { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.bar { width: 96px; height: 7px; background: #e2e8f0; border-radius: 99px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.reason { color: var(--ink-2); line-height: 1.55; font-size: 13px; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.draft { background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 8px; padding: 8px 12px; line-height: 1.6; font-size: 13px; color: var(--ink-2); }
.draft b { display: block; font-size: 12px; color: var(--ink-3); margin-bottom: 2px; font-weight: 600; }

/* 表格 */
.tbl-wrap { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 12px; color: var(--ink-3); background: #f8fafc; padding: 10px 14px; border-bottom: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
td { padding: 7px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #f8fafc; }
.page { padding: 18px 22px; flex: 1; min-height: 0; overflow: auto; }
.page-h { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.page-h h3 { font-size: 16px; }
.page-h small { color: var(--ink-3); font-size: 12px; margin-left: 8px; font-weight: 400; }

/* 開關 */
.sw { width: 40px; height: 22px; border-radius: 99px; border: 0; background: #cbd5e1; position: relative; transition: background .15s; padding: 0; flex: none; }
.sw::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.sw.on { background: var(--ok); }
.sw.on::after { transform: translateX(18px); }
.sw:hover { filter: brightness(.95); }

/* 今日報告 */
.report { max-width: 860px; margin: 0 auto; }
.rep-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 10px rgba(15,23,42,.05); margin-bottom: 18px; }
.rep-head { padding: 16px 22px; background: linear-gradient(135deg, #0f172a, #1e3a5f); color: #fff; display: flex; justify-content: space-between; align-items: center; }
.rep-head h3 { font-size: 17px; }
.rep-head span { font-size: 13px; opacity: .8; }
.rep-stats { display: grid; grid-template-columns: repeat(4, 1fr); }
.rep-stat { padding: 18px 22px; border-right: 1px solid var(--line); }
.rep-stat:last-child { border-right: 0; }
.rep-stat .v { font-size: 34px; font-weight: 800; color: var(--brand-d); font-variant-numeric: tabular-nums; }
.rep-stat .v small { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 4px; }
.rep-stat .l { color: var(--ink-3); font-size: 13px; margin-top: 2px; }
.rep-stat.warn .v { color: var(--warn); }
.rep-time { padding: 16px 22px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 18px; background: #f0fdf4; }
.rep-time .lab { font-weight: 700; color: #166534; }
.rep-time .from { font-size: 22px; color: var(--ink-3); text-decoration: line-through; font-weight: 700; }
.rep-time .arrow { font-size: 22px; color: var(--ok); }
.rep-time .to { font-size: 30px; font-weight: 800; color: var(--ok); }
.note-h { font-weight: 700; margin: 0 0 10px; font-size: 15px; }
.note { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; align-items: flex-start; }
.note .t { font-weight: 700; margin-bottom: 2px; }
.note .x { color: var(--ink-3); line-height: 1.6; }

/* 成員 */
.searchbox { position: relative; display: inline-block; }
.searchbox svg { position: absolute; left: 10px; top: 9px; width: 16px; height: 16px; pointer-events: none; }
.search {
  height: 34px; width: 260px; padding: 0 12px 0 34px; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.search:focus, .field:focus { outline: 2px solid var(--brand-l); border-color: var(--brand); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-l); color: var(--brand-d); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; margin-right: 8px; vertical-align: middle; }
.role-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.role-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.role-card h3 { display: flex; justify-content: space-between; align-items: center; font-size: 17px; margin-bottom: 4px; }
.role-card .d { color: var(--ink-3); margin-bottom: 12px; font-size: 13px; line-height: 1.5; min-height: 38px; }
.perm { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid #f1f5f9; color: var(--ink-2); }
.perm .ck { width: 18px; height: 18px; border-radius: 5px; background: var(--ok); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.perm.no { color: #94a3b8; }
.perm.no .ck { background: #e2e8f0; color: #94a3b8; }
.import-grid { display: grid; grid-template-columns: 300px 1fr; gap: 18px; }
.file-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.file-ic { width: 56px; height: 56px; border-radius: 12px; background: #dcfce7; color: #15803d; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; margin-bottom: 12px; }
.file-card .fn { font-weight: 700; margin-bottom: 4px; }
.file-card .fs { color: var(--ink-3); font-size: 13px; margin-bottom: 14px; }
.lnk { color: var(--brand); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-size: 13px; }
.lnk:hover { color: var(--brand-d); }
.note-box { margin-top: 14px; padding: 12px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; color: #92400e; line-height: 1.7; }
.import-foot { margin-top: 14px; display: flex; align-items: center; gap: 16px; }
.progress { flex: 1; height: 10px; background: #e2e8f0; border-radius: 99px; overflow: hidden; visibility: hidden; }
.progress.show { visibility: visible; }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3b82f6, #22c55e); transition: width .12s linear; }

/* 聊天 */
.chat { flex: 1; min-height: 0; display: flex; }
.c-side { width: 236px; flex: none; background: #fff; border-right: 1px solid var(--line); padding: 12px 10px; overflow: auto; }
.c-new { width: 100%; margin-bottom: 12px; }
.c-grp { font-size: 12px; color: var(--ink-3); padding: 8px 8px 4px; font-weight: 600; }
.c-item { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 10px; border-radius: 8px; color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-item:hover { background: #f1f5f9; }
.c-item.on { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.c-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.c-top { height: 46px; flex: none; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; background: #fff; border-bottom: 1px solid var(--line); }
.c-top .ttl { font-weight: 700; }
.badge-local { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; padding: 4px 12px; border-radius: 999px; }
.badge-local::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #10b981; }
.c-msgs { flex: 1; overflow: auto; padding: 14px 24px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.msg.user .av { background: #cbd5e1; color: #334155; }
.msg.ai .av { background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff; }
.bub { padding: 9px 14px; border-radius: 14px; line-height: 1.65; background: #fff; border: 1px solid var(--line); }
.msg.user .bub { background: var(--brand); color: #fff; border-color: var(--brand); }
.bub ul { margin: 6px 0 0; padding-left: 20px; }
.bub li { margin: 3px 0; }
.src { display: block; margin-top: 6px; font-size: 12px; color: var(--brand); text-decoration: underline; cursor: pointer; background: none; border: 0; padding: 0; }
.src:hover { color: var(--brand-d); }
.draftbox { margin-top: 6px; padding: 8px 14px; background: #f8fafc; border-left: 3px solid #8b5cf6; border-radius: 6px; color: var(--ink-2); }
.bub .acts { margin: 8px 0 0; }
.typing span { display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%; background: #94a3b8; animation: bl 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bl { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.c-input { flex: none; padding: 12px 20px 16px; background: #fff; border-top: 1px solid var(--line); display: flex; gap: 10px; }
.field { flex: 1; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; min-width: 0; }
.c-input .btn { height: 42px; padding: 0 22px; }

/* 知識庫 */
.doc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.doc-card { text-align: left; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; transition: transform .12s, box-shadow .12s, border-color .12s; }
.doc-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(15,23,42,.1); border-color: #bfdbfe; }
.doc-card:active { transform: scale(.98); }
.doc-ic { width: 42px; height: 52px; border-radius: 6px; background: linear-gradient(160deg, #fbbf24, #f59e0b); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; position: relative; }
.doc-ic::after { content: ""; position: absolute; right: 0; top: 0; border-width: 0 12px 12px 0; border-style: solid; border-color: transparent #fde68a transparent transparent; }
.doc-card h4 { font-size: 15px; margin-bottom: 6px; }
.doc-card .meta { color: var(--ink-3); font-size: 12px; line-height: 1.7; }
.drawer-wrap { position: absolute; inset: 0; z-index: 5; }
.drawer-mask { position: absolute; inset: 0; background: rgba(15,23,42,.18); animation: fade .15s ease; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: 420px; background: #fff; border-left: 1px solid var(--line); box-shadow: -10px 0 30px rgba(15,23,42,.14); display: flex; flex-direction: column; z-index: 5; animation: slide .18s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-h { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-h h3 { font-size: 17px; }
.drawer-h small { display: block; color: var(--ink-3); font-weight: 400; font-size: 12px; margin-top: 2px; }
.drawer-b { padding: 16px 18px; overflow: auto; flex: 1; }
.drawer-b p { line-height: 1.85; padding: 5px 0; color: var(--ink-2); border-bottom: 1px dotted #e2e8f0; }
.sum-line { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; border-radius: 10px; padding: 12px 16px; font-weight: 600; margin-bottom: 14px; }
.ok-tx { color: var(--ok); font-weight: 600; }

/* 設定精靈 */
.setup {
  position: absolute; inset: 0; background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  display: flex; align-items: center; justify-content: center; overflow: auto;
}
.setup .wm { position: absolute; }
.s-card { width: 880px; max-width: calc(100vw - 48px); height: 780px; max-height: calc(100vh - 60px); background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(2,6,23,.55); display: flex; flex-direction: column; overflow: hidden; }
.s-steps { display: flex; padding: 22px 34px 18px; gap: 0; border-bottom: 1px solid var(--line); background: #f8fafc; }
.s-step { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 0; text-align: left; color: var(--ink-3); font-weight: 600; position: relative; }
.s-step .n { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #e2e8f0; color: #64748b; font-weight: 800; flex: none; }
.s-step.on { color: var(--brand-d); }
.s-step.on .n { background: var(--brand); color: #fff; box-shadow: 0 0 0 4px var(--brand-l); }
.s-step.done .n { background: var(--ok); color: #fff; }
.s-step.done { color: var(--ink-2); }
.s-step:not(:last-child)::after { content: ""; flex: 1; height: 2px; background: #e2e8f0; margin: 0 14px; }
.s-step.done:not(:last-child)::after { background: var(--ok); }
.s-body { flex: 1; padding: 28px 44px; overflow: auto; }
.s-body h2 { font-size: 22px; margin-bottom: 6px; }
.s-body .sub { color: var(--ink-3); margin-bottom: 20px; }
.s-foot { flex: none; padding: 16px 34px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; background: #f8fafc; }
.s-foot .btn { height: 40px; padding: 0 26px; }
.drop { border: 2px dashed #93c5fd; background: #eff6ff; border-radius: 14px; padding: 26px; text-align: center; color: var(--brand-d); margin-bottom: 14px; }
.drop .big { font-size: 15px; font-weight: 700; }
.drop .small { color: var(--ink-3); font-size: 13px; margin-top: 4px; }
.chosen { margin-bottom: 12px; font-weight: 600; color: var(--ok); }
.row { display: flex; gap: 12px; align-items: center; }
.test-res { display: flex; align-items: center; gap: 10px; margin-top: 18px; font-weight: 700; min-height: 36px; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid #bfdbfe; border-top-color: var(--brand); animation: sp .8s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }
.tick { width: 28px; height: 28px; border-radius: 50%; background: var(--ok); display: flex; align-items: center; justify-content: center; }
.lbl { display: block; font-weight: 600; margin-bottom: 6px; color: var(--ink-2); }
.model-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.model-card { text-align: left; background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 20px; position: relative; transition: border-color .12s, box-shadow .12s, transform .12s; }
.model-card:hover { border-color: #93c5fd; transform: translateY(-2px); }
.model-card.on { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-l); background: #f8fbff; }
.model-card h4 { font-size: 18px; margin: 10px 0 12px; }
.model-card .spd { font-weight: 700; color: var(--brand-d); margin-bottom: 8px; }
.model-card .fit { color: var(--ink-3); line-height: 1.65; font-size: 13px; }
.model-card .radio { position: absolute; right: 16px; top: 18px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #cbd5e1; }
.model-card.on .radio { border-color: var(--brand); background: radial-gradient(circle, var(--brand) 0 5px, #fff 6px); }
.done-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; text-align: center; gap: 18px; }
.done-check { width: 112px; height: 112px; border-radius: 50%; background: #dcfce7; display: flex; align-items: center; justify-content: center; }
.done-check div { width: 84px; height: 84px; border-radius: 50%; background: var(--ok); display: flex; align-items: center; justify-content: center; }
.done-wrap p { max-width: 560px; line-height: 1.8; font-size: 16px; color: var(--ink-2); }
.done-wrap .btn { height: 44px; padding: 0 34px; font-size: 15px; }

/* 彈出面板、modal、toast */
#layer-popover, #layer-modal, #layer-toast { position: fixed; z-index: 100; }
.status-panel {
  position: fixed; right: 12px; bottom: calc(var(--taskbar) + 10px); width: 380px; background: #fff; color: var(--ink);
  border-radius: 14px; box-shadow: 0 20px 50px rgba(2,6,23,.5); overflow: hidden; z-index: 101; animation: up .15s ease;
}
@keyframes up { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sp-h { padding: 14px 18px; background: #0f172a; color: #fff; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.sp-h .live { font-size: 12px; font-weight: 600; color: #86efac; }
.sp-row { display: flex; justify-content: space-between; gap: 14px; padding: 11px 18px; border-bottom: 1px solid #f1f5f9; }
.sp-row .k { color: var(--ink-3); white-space: nowrap; }
.sp-row .v { font-weight: 600; text-align: right; }
.sp-row .v em { font-style: normal; color: var(--ok); }
.sp-foot { padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; background: #f8fafc; }
.sp-foot span { font-weight: 600; }
.mask { position: fixed; inset: 0; background: rgba(2,6,23,.5); display: flex; align-items: center; justify-content: center; z-index: 200; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal { width: 440px; max-width: calc(100vw - 40px); background: #fff; border-radius: 14px; box-shadow: 0 30px 80px rgba(2,6,23,.55); overflow: hidden; }
.modal-h { padding: 16px 20px; font-weight: 700; font-size: 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.modal-b { padding: 18px 20px; line-height: 1.8; }
.modal-b .fg { margin-bottom: 14px; }
.modal-b select, .modal-b input { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.modal-f { padding: 12px 20px; display: flex; justify-content: flex-end; gap: 10px; background: #f8fafc; }
#layer-toast { left: 50%; top: 28px; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 10px 20px; border-radius: 10px; box-shadow: 0 10px 30px rgba(2,6,23,.45); font-weight: 600; animation: tin .2s ease; display: flex; gap: 10px; align-items: center; }
.toast::before { content: "✓"; width: 20px; height: 20px; border-radius: 50%; background: #22c55e; display: flex; align-items: center; justify-content: center; font-size: 12px; }
@keyframes tin { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* 影片播放器 */
.vp { width: 860px; max-width: calc(100vw - 40px); background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 30px 80px rgba(2,6,23,.6); }
.vp-h { height: 42px; padding: 0 8px 0 16px; display: flex; align-items: center; justify-content: space-between; background: #f1f5f9; font-weight: 600; border-bottom: 1px solid var(--line); }
.vp-main { display: flex; }
.vp-screen { flex: 1; background: #0b1220; position: relative; min-height: 388px; display: flex; align-items: center; justify-content: center; flex-direction: column; color: #cbd5e1; }
.vp-screen .ttl { position: absolute; left: 18px; top: 14px; font-size: 13px; opacity: .8; }
.play { width: 84px; height: 84px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); display: flex; align-items: center; justify-content: center; transition: transform .12s; }
.play:hover { transform: scale(1.08); }
.play:active { transform: scale(.95); }
.vp-ctrl { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 18px; display: flex; align-items: center; gap: 12px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.6)); }
.vp-bar { flex: 1; height: 5px; border-radius: 99px; background: rgba(255,255,255,.25); overflow: hidden; }
.vp-bar i { display: block; height: 100%; width: 0; background: #60a5fa; }
.vp-list { width: 250px; flex: none; border-left: 1px solid var(--line); background: #fff; max-height: 430px; overflow: auto; }
.vp-list h4 { padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-3); }
.chap { width: 100%; text-align: left; border: 0; background: transparent; padding: 10px 14px; display: flex; gap: 10px; border-bottom: 1px solid #f1f5f9; color: var(--ink-2); line-height: 1.5; }
.chap:hover { background: #f1f5f9; }
.chap.on { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.chap .t { color: var(--ink-3); font-variant-numeric: tabular-nums; flex: none; }

@media (max-width: 1320px) {
  .tiles-big { gap: 24px; }
  .tile-big { width: 168px; height: 184px; }
  .doc-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; }
  .chip.opt { display: none; }
}
