:root{--gray-010:#f7f4ff;--gray-020:#ffffff;--gray-630:#f7f7f9;--gray-580:#f1effa;--violet-260:#211a2a;--blue-210:#6a4fde;--gray-060:#efeaff;--violet-010:#ece5ff;--violet-020:#d9ccff;--violet-270:#171321;--green-280:#237a45;--gray-830:#dff5e1;--blue-250:#3b82c4;--gray-610:#e4e9fa;--orange-640:#b97e14;--orange-140:#fdf3e0;--red-300:#c0392b;--red-010:#fde3e3;--green-190:#2e9e5b;--orange-090:#ffe08a;--gray-280:#fbfbfe;--blue-120:#b7a3f5;--violet-240:#2b2140;--gray-980:#e3def0;--blue-100:#bbdefb;--blue-160:#5c9ded;--blue-260:#a79fc0;--gray-1120:#d8d2c8;--gray-1180:#999999;--gray-340:#fdf0f0;--gray-350:#fdf4e7;--gray-540:#fbe9f2;--gray-890:#edf3e4;--gray-900:#f3ede4;--gray-910:#eceaf3;--green-070:#c8e6c9;--green-130:#66bb6a;--green-150:#8fae7c;--green-310:#5f7052;--orange-010:#ffe1a8;--orange-120:#fdf0d5;--orange-230:#f5a623;--orange-460:#e8a33d;--orange-480:#e8862e;--orange-490:#e5a83b;--orange-690:#b4653f;--orange-730:#b39a86;--orange-810:#946812;--orange-910:#7a7268;--orange-920:#7a4a12;--red-210:#d9534f;--red-230:#d64545;--red-330:#b03a2e;--violet-120:#d1c4e9;--violet-130:#9575cd;--violet-140:#a89fc0;--violet-200:#6e637f;}
/* base.css - 工作台通用样式（令牌与首页 index.html 对齐，见 DESIGN.md） */
:root {
  --bg: var(--gray-010); --paper: var(--gray-020); --soft: var(--gray-630); --soft2: var(--gray-580);
  --ink: var(--violet-260); --ink70: rgba(33,26,42,.72); --ink55: rgba(33,26,42,.55); --ink40: rgba(33,26,42,.4);
  --brand: var(--blue-210); --brand-soft: var(--gray-060); --lav: var(--violet-010); --lav2: var(--violet-020);
  --dark: var(--violet-270); --line: rgba(33,26,42,.09);
  /* 状态色定版（V1 改版第 1 批，全站唯一一套，不许各页另写）：
     完成/通过 绿 / 进行中 蓝 / 待处理 琥珀 / 失败 红，各带浅底。 */
  --green: #237a45; --green-bg: #edf7f1;
  --blue: #2f6fad; --blue-bg: #eaf2fa;
  --amber: #b97e14; --amber-bg: #fdf3e0;
  --red: #c0392b; --red-bg: #fdecec;
  --radius-l: 16px; --radius-m: 12px;
  --shadow-s: 0 10px 30px rgba(33,26,42,.08);
  --sans: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { overscroll-behavior: none; font-family: var(--sans); background: var(--soft); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.dash { display: flex; min-height: 100vh; }

/* ===== 左侧边栏（结构在 sidebar.css） ===== */
.dash-side { width: 240px; flex-shrink: 0; display: flex; flex-direction: column; background: var(--paper); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; }

/* ===== 右侧主区 ===== */
.dash-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dash-head { padding: 28px 36px 24px; background: var(--paper); border-bottom: 1px solid var(--line); }
.dash-docs { padding: 28px 36px 40px; flex: 1; }
.subpage { padding: 28px 36px 40px; flex: 1; animation: fadeIn .3s ease; }

/* ===== 余额胶囊（点头部） ===== */
.balance-pill { display: flex; align-items: center; gap: 8px; background: var(--paper); border-radius: 999px; padding: 10px 18px; font-size: 14px; cursor: pointer; box-shadow: var(--shadow-s); border: 1px solid var(--line); color: var(--ink); }
.balance-pill:hover { border-color: var(--brand); }
.balance-pill .coin { font-size: 18px; }
.balance-pill .bal-label { color: var(--ink55); font-size: 12px; }
.balance-pill b { font-size: 16px; color: var(--brand); }
.balance-pill .more { color: var(--ink40); }

/* ===== 状态徽标 ===== */
.status { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 4px 14px; white-space: nowrap; }
.status.doing { color: var(--blue); background: var(--blue-bg); }
.status.review { color: var(--amber); background: var(--amber-bg); }
.status.done { color: var(--green); background: var(--green-bg); }
.status.draft { color: var(--amber); background: var(--amber-bg); }
.status.failed { color: var(--red); background: var(--red-bg); }

/* ===== 子页面通用 ===== */
.page-title { margin-bottom: 24px; }
.page-title h2 { font-size: 22px; font-weight: 600; margin-bottom: 6px; }
.page-title p { font-size: 13px; color: var(--ink55); margin-bottom: 20px; }
.sec-title { font-size: 16px; font-weight: 800; margin-bottom: 14px; }

/* ===== 步骤条 ===== */
.steps { display: flex; align-items: center; margin-bottom: 24px; padding: 0 10px; }
.step { display: flex; align-items: center; gap: 8px; }
.step.done .step-num { background: var(--green); color: var(--gray-020); }
.step.done .step-label { color: var(--green); }
.step.cur .step-num { background: var(--brand); color: var(--gray-020); }
.step.cur .step-label { color: var(--brand); }

/* ===== AIGC 通用卡（细样式在 aigc.css） ===== */
.aigc-card { background: var(--paper); border-radius: var(--radius-l); padding: 22px; border: 1px solid var(--line); margin-bottom: 18px; }
.btn-chip { border: 1px solid var(--line); background: var(--brand-soft); border-radius: 999px; padding: 8px 20px; font-size: 13px; font-weight: 700; color: var(--brand); cursor: pointer; white-space: nowrap; }
.btn-chip:hover { border-color: var(--brand); }
.ai-paras-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.ai-paras-head b { font-size: 14px; }
.ai-paras-head span { font-size: 12px; color: var(--ink55); display: flex; align-items: center; gap: 6px; }
.hl-dot { width: 12px; height: 12px; border-radius: 4px; background: var(--orange-090); display: inline-block; }
.ai-para { font-size: 14px; line-height: 2; color: var(--ink); background: var(--gray-280); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.ai-para .hl { background: var(--orange-090); border-radius: 4px; padding: 1px 2px; }
.up-icon { font-size: 40px; margin-bottom: 10px; }
.src-idx { width: 26px; height: 26px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 13px; font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.src-title { font-size: 14px; width: 90px; flex-shrink: 0; }
.src-bar { flex: 1; height: 8px; background: var(--soft2); border-radius: 4px; overflow: hidden; }
.src-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--lav2), var(--brand)); border-radius: 4px; }
.src-row b { font-size: 14px; width: 48px; text-align: right; }
.src-arrow { color: var(--lav3, var(--blue-120)); }

/* ===== 模板页签 ===== */
.tpl-tabs { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
/* 页签药丸本体（原 templates.css 一份、plag/aigc 各复制一份，现统一收在此处，
   子页懒加载只带自己的 CSS，共用类必须放常驻的 base.css） */
.tpl-tabs span { padding: 9px 22px; border-radius: 999px; background: var(--gray-020); border: 1px solid var(--gray-980); font-size: 14px; font-weight: 700; color: var(--violet-220); cursor: pointer; }
.tpl-tabs span.active { background: var(--blue-210); border-color: var(--blue-210); color: var(--gray-020); }
.tpl-tabs .tab-cnt { font-weight: 800; font-variant-numeric: tabular-nums; margin-left: 5px; }

/* ===== 子页页头（线性 SVG 图标 + 标题） ===== */
.page-title.has-ic { display: flex; align-items: flex-start; gap: 14px; }
.pt-ic { width: 44px; height: 44px; border-radius: var(--radius-m); background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.pt-ic svg { width: 22px; height: 22px; display: block; }

/* ===== 额度/状态卡行（R2 公式：与 home.css .v1-card/.seg 同件，此处只补行容器） ===== */
.stat-row { display: grid; gap: 16px; margin-bottom: 16px; }
.stat-row.c2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 900px) { .stat-row.c2 { grid-template-columns: 1fr; } }

/* ===== 检测主按钮（V1 定版墨底，原 plag/aigc 两份渐变定义与 fmt .fc-go 渐变版统一收口） ===== */
.btn-detect { margin-left: auto; border: 1px solid var(--dark); border-radius: 999px; padding: 10px 32px; font-size: 14px; font-weight: 800; color: var(--gray-020); background: var(--dark); cursor: pointer; white-space: nowrap; }
.btn-detect:disabled { opacity: .6; cursor: wait; }

/* ===== 查重/AIGC 共用件（原 plagcheck.css 与 aigc.css 约九成同源，现只存这一份） ===== */
.gauge-wrap { position: relative; flex-shrink: 0; }
.gauge-wrap svg { display: block; }
.gauge-num { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; line-height: 1.1; }
.gauge-num b { font-size: 16px; display: block; }
.gauge-num i { font-style: normal; font-size: 9px; color: var(--violet-200); }
.aigc-card h3 { font-size: 16px; margin-bottom: 14px; }
.aigc-card textarea { width: 100%; border: 1px solid var(--gray-980); border-radius: 12px; padding: 14px; font-size: 14px; font-family: inherit; resize: vertical; background: var(--gray-280); }
.aigc-card textarea:focus { outline: none; border-color: var(--blue-210); }
.aigc-input-foot { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.aigc-input-foot > div { display: flex; gap: 10px; }
.aigc-input-foot span { font-size: 12px; color: var(--violet-200); }
.aigc-result { display: flex; gap: 28px; align-items: center; }
.verdict b { font-size: 15px; color: var(--green); }
.verdict p { font-size: 13px; color: var(--violet-220); margin-top: 6px; line-height: 1.7; }
.aigc-textarea { width: 100%; min-height: 140px; border: 1px solid var(--gray-980); border-radius: 12px; padding: 14px; font-size: 14px; resize: vertical; font-family: inherit; }
.aigc-textarea:focus { outline: none; border-color: var(--blue-210); }
.aigc-input-foot .input-btns { display: flex; gap: 10px; }
.aigc-input-foot .char-count { font-size: 12px; color: var(--violet-200); white-space: nowrap; }
.aigc-result .verdict { flex: 1; }
.aigc-result .verdict b { font-size: 15px; }
.aigc-result .btn-report { flex-shrink: 0; margin-left: auto; }
.btn-report { background: var(--gray-020); border: 1px solid var(--blue-210); font-size: 14px; padding: 10px 28px; white-space: nowrap; }
.tier-note { font-size: 12.5px; color: var(--ink55); line-height: 1.7; margin-top: 14px; }
.seg-strip { display: flex; align-items: flex-end; gap: 2px; height: 64px; padding: 8px 10px 0; background: var(--gray-280); border: 1px solid var(--gray-910); border-radius: 12px; margin-top: 16px; width: 100%; box-sizing: border-box; }
.strip-bar { flex: 1; height: 100%; display: flex; align-items: flex-end; cursor: pointer; }
.strip-fill { width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; }
.strip-bar:hover .strip-fill { filter: brightness(1.15); }
.seg-panel { margin-top: 18px; width: 100%; box-sizing: border-box; }
.seg-head { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.seg-head b { font-size: 13px; color: var(--violet-220); }
.seg-head span { font-size: 12px; color: var(--violet-200); }
.seg-list { margin-top: 10px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.heat-para { position: relative; border-radius: 12px; padding: 12px 78px 12px 14px; margin-bottom: 10px; font-size: 13.5px; line-height: 1.75; color: var(--violet-220); white-space: pre-wrap; word-break: break-word; }
.heat-para .para-no { color: var(--violet-200); font-size: 12px; margin-right: 8px; }
.heat-para .para-tag { position: absolute; top: 10px; right: 12px; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: var(--gray-020); }
.tint-g { background: rgba(35,122,69,.08); }
.tint-a { background: rgba(185,126,20,.13); }
.tint-r { background: rgba(192,57,43,.10); }
.heat-para.flash { outline: 2px solid var(--blue-210); outline-offset: 1px; }
.hist-list { display: flex; flex-direction: column; }
.hist-item { display: flex; gap: 10px; align-items: center; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; }
.hist-item:last-child { border-bottom: none; }
.hist-item:hover { background: var(--gray-280); }
.hist-item .seg-chip { flex-shrink: 0; min-width: 56px; text-align: center; color: var(--gray-020); font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 8px; }
.hist-main { flex: 1; min-width: 0; }
.hist-preview { font-size: 13px; color: var(--violet-220); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hist-meta { font-size: 11.5px; color: var(--violet-200); margin-top: 2px; }
.hist-del { flex-shrink: 0; border: 1px solid var(--gray-980); background: var(--gray-020); color: var(--violet-200); font-size: 12px; border-radius: 999px; padding: 4px 12px; cursor: pointer; }
.hist-del:hover { color: var(--red); border-color: var(--red); }
.aigc-mask { position: fixed; inset: 0; background: rgba(33,26,42,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.aigc-modal { position: relative; background: var(--gray-020); border-radius: var(--radius-l); padding: 28px 30px; width: 380px; max-width: calc(100vw - 40px); text-align: center; box-shadow: var(--shadow-s); }
.aigc-x { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 20px; color: var(--violet-200); cursor: pointer; }
.aigc-modal-title { font-size: 17px; font-weight: 800; margin-bottom: 12px; }
.aigc-modal p { font-size: 13.5px; color: var(--violet-220); line-height: 1.8; }
.aigc-modal-btn { margin: 18px auto 0; display: block; }
/* 我的论文检测率行（查重/AIGC 两页同款） */
.doc-rate-row { display: flex; align-items: center; gap: 10px; padding: 9px 2px; border-bottom: 1px dashed var(--orange-360); font-size: 13.5px; }
.doc-rate-row:last-child { border-bottom: none; }
.doc-rate-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-rate-val { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--gray-630); color: var(--violet-200); border: 1px solid var(--gray-980); white-space: nowrap; }
.doc-rate-val.ai-high { background: var(--red-bg); border-color: var(--red-bg); color: var(--red); }
.doc-rate-val.ai-mid { background: var(--amber-bg); border-color: var(--amber-bg); color: var(--amber); }
.doc-rate-val.ai-low { background: var(--green-bg); border-color: var(--green-bg); color: var(--green); }
.doc-rate-val.ai-blocked { background: var(--amber-bg); border-color: var(--amber-bg); color: var(--amber); }
.doc-rate-go { color: var(--orange-570); font-size: 13px; white-space: nowrap; }
.aigc-tabs { margin-bottom: 20px; }
.aigc-docs-note { color: var(--violet-200); font-size: 12px; margin: -6px 0 8px; line-height: 1.7; }
.aigc-empty { color: var(--violet-200); font-size: 13px; padding: 14px 2px; line-height: 1.7; }

/* ===== 结构重排共用件（子页 1-4 样张结构：卡内页签/文档行/唯一主按钮/行表） ===== */
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h3 { margin: 0; }
.in-tabs { display: inline-flex; gap: 4px; flex-wrap: wrap; background: #ECEAF3; border-radius: 999px; padding: 4px; }
.in-tabs > span { padding: 7px 16px; border-radius: 999px; background: transparent; border: none; font-size: 13.5px; font-weight: 700; color: var(--violet-200); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; }
.in-tabs > span.active { background: var(--gray-020); color: var(--dark); box-shadow: 0 1px 4px rgba(23,19,33,.14); }
.in-tabs .tab-cnt { font-size: 11.5px; font-weight: 800; color: #6A4FDE; background: #EFEAFF; border-radius: 999px; padding: 1px 7px; margin-left: 7px; font-variant-numeric: tabular-nums; }
.drow { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: none; }
.drow-ic { width: 44px; height: 52px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; flex: none; }
.drow-ic svg { width: 20px; height: 20px; display: block; }
.drow-main { flex: 1; min-width: 0; }
.drow-ttl { font-size: 14.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow-sub { font-size: 12px; color: var(--ink55); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow-cell { font-size: 12.5px; color: var(--ink55); white-space: nowrap; }
.drow-cell b { color: var(--ink); font-size: 13px; }
.btn-main { border-radius: 999px; padding: 9px 24px; font-size: 13.5px; font-weight: 700; border: 1px solid var(--dark); background: var(--dark); color: var(--gray-020); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; font-family: inherit; }
.btn-main.ol { background: var(--gray-020); color: var(--ink); border-color: var(--gray-980); }
.btn-main.red { background: var(--gray-020); color: var(--red); border-color: var(--red); }
.btn-main:disabled { opacity: .55; cursor: wait; }
.row-menu { position: relative; flex: none; }
.row-menu-btn { border: none; background: none; font-size: 17px; line-height: 1; color: var(--ink40); cursor: pointer; padding: 6px 8px; letter-spacing: 2px; font-family: inherit; }
.row-menu-pop { position: absolute; right: 0; top: 36px; background: var(--gray-020); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-s); padding: 4px; z-index: 40; min-width: 128px; display: flex; flex-direction: column; }
.row-menu-pop button { border: none; background: none; text-align: left; padding: 8px 12px; border-radius: 8px; font-size: 13px; cursor: pointer; color: var(--ink); font-family: inherit; white-space: nowrap; }
.row-menu-pop button:hover { background: var(--soft); }
.row-menu-pop button.danger { color: var(--red); }
.sec-head2 { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 22px 0 12px; }
.sec-head2 h3 { font-size: 16.5px; font-weight: 800; }
.sec-head2 .tag { font-size: 12px; color: var(--ink55); white-space: nowrap; }
.rows-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-l); padding: 6px 22px; margin-bottom: 18px; }
.srcbar-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; margin-top: 9px; }
.srcbar-row .nm { width: 34%; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--violet-220); }
.srcbar-row .srcbar { flex: 1; }
.srcbar-row b { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .drow { flex-wrap: wrap; }
  .rows-card { padding: 6px 14px; }
}

/* ===== 钱包横幅兜底（细样式在 wallet.css，后加载覆盖） ===== */
.wallet-balance { background: linear-gradient(135deg, var(--violet-240), var(--brand)); border-radius: 20px; padding: 28px 32px; display: flex; justify-content: space-between; align-items: center; color: var(--gray-020); margin-bottom: 24px; box-shadow: 0 12px 28px -10px rgba(106,79,222,.5); }
.btn-recharge { border: none; border-radius: 999px; padding: 9px 30px; font-size: 13px; font-weight: 800; color: var(--ink); background: var(--gray-020); cursor: pointer; }

/* ===== 设置通用 ===== */
.set-card { background: var(--paper); border-radius: var(--radius-l); border: 1px solid var(--line); margin-bottom: 16px; overflow: hidden; }
.chev { color: var(--ink40); font-size: 20px; }
.switch { width: 46px; height: 26px; border-radius: 999px; background: var(--gray-980); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; }
.switch i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--gray-020); transition: left .2s; box-shadow: 0 2px 4px rgba(33,26,42,.15); }
.switch.on { background: var(--brand); }
.switch.on i { left: 23px; }

/* ===== toast ===== */
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: rgba(33,26,42,.92); color: var(--gray-020); padding: 12px 28px; border-radius: 999px; font-size: 14px; z-index: 20000; box-shadow: 0 8px 24px rgba(33,26,42,.2); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  .ts-grid, .done-grid { grid-template-columns: 1fr; }
  .dash { flex-direction: column; }
  .dash-head, .dash-docs, .subpage { padding-left: 16px; padding-right: 16px; }
}
