:root {
  --bg-page: #f4f5f7;
  --bg-surface: #ffffff;
  --bg-soft: #f8f9fb;
  --border: #e8eaed;
  --border-soft: #eef0f3;
  --text-1: #1f2937;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --accent: #0d9488;
  --accent-soft: #e6f4f3;
  --accent-text: #0a7c72;
  --blue: #2563eb;
  --blue-soft: #eaf1fe;
  --amber: #d97706;
  --amber-soft: #fdf3e2;
  --red: #dc2626;
  --red-soft: #fdeaea;
  --purple: #7c3aed;
  --purple-soft: #f1ebfd;
  --pink: #db2777;
  --pink-soft: #fce7f3;
  --green: #16a34a;
  --green-soft: #e7f6ec;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.12);
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text-1);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }

/* ===== Auth ===== */
.auth-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #e6f4f3 0%, #eaf1fe 100%); padding: 24px;
}
.auth-card {
  width: 100%; max-width: 400px; background: var(--bg-surface);
  border-radius: 16px; box-shadow: var(--shadow-lg); padding: 36px 32px;
}
.auth-logo { display:flex; align-items:center; gap:12px; justify-content:center; margin-bottom:8px; }
.auth-logo .mk { width:44px; height:44px; border-radius:12px; background:linear-gradient(135deg,#0d9488,#0891b2); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:20px; }
.auth-logo .tx { font-size:22px; font-weight:600; }
.auth-sub { text-align:center; color:var(--text-2); font-size:13px; margin-bottom:28px; }
.auth-tabs { display:flex; background:var(--bg-soft); border-radius:var(--radius-sm); padding:4px; margin-bottom:24px; }
.auth-tab { flex:1; padding:9px; border:none; background:none; border-radius:6px; font-size:13.5px; font-weight:500; color:var(--text-2); transition:all .15s; }
.auth-tab.active { background:var(--bg-surface); color:var(--text-1); box-shadow:var(--shadow); }
.field { margin-bottom:16px; }
.field label { display:block; font-size:12.5px; color:var(--text-2); margin-bottom:6px; font-weight:500; }
.field input {
  width:100%; padding:11px 14px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:14px; color:var(--text-1); outline:none; transition:border .15s; background:var(--bg-surface);
}
.field input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.field .hint { font-size:11.5px; color:var(--text-3); margin-top:5px; }
.btn-primary {
  width:100%; padding:12px; background:var(--accent); color:#fff; border:none;
  border-radius:var(--radius-sm); font-size:14.5px; font-weight:600; transition:background .15s; margin-top:4px;
}
.btn-primary:hover { background:var(--accent-text); }
.btn-primary:disabled { opacity:.6; cursor:not-allowed; }
.auth-error { background:var(--red-soft); color:var(--red); border-radius:var(--radius-sm); padding:10px 12px; font-size:12.5px; margin-bottom:14px; display:none; }
.auth-error.show { display:block; }

.account-result { background:var(--accent-soft); border:1px dashed var(--accent); border-radius:var(--radius); padding:20px; text-align:center; margin-bottom:18px; }
.account-result .lbl { font-size:12px; color:var(--accent-text); margin-bottom:8px; }
.account-result .num { font-size:32px; font-weight:700; color:var(--accent-text); letter-spacing:6px; font-family:ui-monospace,monospace; }
.account-result .tip { font-size:11.5px; color:var(--text-2); margin-top:8px; }

/* ===== App layout ===== */
.app { display:flex; min-height:100vh; }
.sidebar { width:var(--side-w,248px); background:var(--bg-surface); border-right:1px solid var(--border); display:flex; flex-direction:column; position:fixed; top:0; left:0; bottom:0; z-index:20; }
.logo { display:flex; align-items:center; gap:9px; height:64px; box-sizing:border-box; padding:0 14px 0 18px; border-bottom:1px solid var(--border-soft); flex:0 0 auto; }
.logo .mk { width:32px; height:32px; border-radius:9px; background:linear-gradient(135deg,#0d9488,#0891b2); display:flex; align-items:center; justify-content:center; color:#fff; font-weight:700; font-size:15px; }
.logo .tx { font-size:15px; font-weight:600; }
.side-section { padding:14px 16px 4px; display:flex; align-items:center; justify-content:space-between; }
.side-label { font-size:11px; color:var(--text-3); font-weight:500; letter-spacing:.3px; }
.btn-new { display:flex; align-items:center; gap:5px; font-size:12px; color:var(--accent-text); background:var(--accent-soft); border:none; border-radius:6px; padding:4px 9px; font-weight:500; }
.btn-new:hover { background:#d4ebe9; }
.btn-new svg { width:14px; height:14px; }
.proj-list { padding:4px 10px; flex:1; overflow-y:auto; }
.proj-item { display:flex; align-items:center; gap:9px; padding:9px 10px; border-radius:var(--radius-sm); cursor:pointer; margin-bottom:2px; border:none; background:none; width:100%; text-align:left; transition:background .12s; }
.proj-item:hover { background:var(--bg-soft); }
.proj-item.active { background:var(--accent-soft); }
.proj-item.active .pi-name { color:var(--accent-text); }
.pi-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.pi-name { font-size:13px; font-weight:500; color:var(--text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.pi-role { font-size:10.5px; color:var(--text-3); margin-left:auto; flex-shrink:0; }
.empty-side { padding:20px 16px; text-align:center; color:var(--text-3); font-size:12.5px; line-height:1.7; }
.sidebar-user { padding:14px 16px; border-top:1px solid var(--border-soft); display:flex; align-items:center; gap:10px; cursor:pointer; transition:background .12s; }
button.sidebar-user:hover { background:var(--bg-soft); }
.sidebar-user .u-info { flex:1; min-width:0; }
.avatar { width:36px; height:36px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-weight:600; font-size:13px; flex-shrink:0; }
.avatar.sm { width:28px; height:28px; font-size:11px; }
.avatar.xs { width:22px; height:22px; font-size:10px; }
.avatar.teal { background:var(--accent-soft); color:var(--accent-text); }
.avatar.blue { background:var(--blue-soft); color:var(--blue); }
.avatar.amber { background:var(--amber-soft); color:var(--amber); }
.avatar.purple { background:var(--purple-soft); color:var(--purple); }
.avatar.pink { background:var(--pink-soft); color:var(--pink); }
.avatar.green { background:var(--green-soft); color:var(--green); }
.avatar.gray { background:var(--bg-soft); color:var(--text-2); }
.sidebar-user .u-name { font-size:13px; font-weight:500; }
.sidebar-user .u-acc { font-size:11px; color:var(--text-3); font-family:ui-monospace,monospace; }
.btn-logout { margin-left:auto; width:30px; height:30px; border-radius:6px; border:1px solid var(--border); background:var(--bg-surface); display:flex; align-items:center; justify-content:center; }
.btn-logout:hover { background:var(--bg-soft); }
.btn-logout svg { width:16px; height:16px; color:var(--text-2); }

.main { flex:1; margin-left:var(--side-w,248px); min-width:0; }
.topbar { height:64px; background:var(--bg-surface); border-bottom:1px solid var(--border); display:flex; align-items:center; gap:14px; padding:0 28px; position:sticky; top:0; z-index:10; }
.topbar h1 { font-size:17px; font-weight:600; }
.topbar .crumb { font-size:17px; font-weight:600; color:var(--text-1); }
.topbar .crumb-sep { color:var(--text-3); font-weight:400; flex:none; }
.topbar .crumb-cur { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
/* 末级（单子标题）不是目录名，用更轻的字体与前面层级区分 */
.topbar .crumb-leaf { font-size:15px; font-weight:450; color:var(--text-2); }
.topbar .spacer { margin-left:auto; }
.content { padding:24px 28px 40px; max-width:1200px; }
/* AI 页：满宽紧凑布局，避免四周大片空白 */
.content.is-ai { padding:12px 14px 14px 12px; max-width:none; }
/* AI 页里的项目 tab 条：与下方面板贴紧 */
.content.is-ai .tabs-bar { margin-bottom:10px; }
/* AI 页整屏布局：顶栏 + 内容撑满一屏，聊天面板底部顶住边框 */
.main.is-ai { height:100vh; display:flex; flex-direction:column; }
.main.is-ai .topbar { flex:0 0 auto; }
.main.is-ai .content.is-ai { flex:1 1 auto; min-height:0; display:flex; flex-direction:column; overflow:hidden; }
.main.is-ai .content.is-ai .tabs-bar { flex:0 0 auto; }
.main.is-ai .ai-page { flex:1 1 auto; height:auto; min-height:0; }

/* project list (home) */
.home-hero { background:linear-gradient(135deg,#0d9488,#0891b2); border-radius:var(--radius); padding:28px 30px; color:#fff; margin-bottom:24px; }
.home-hero h2 { font-size:20px; font-weight:600; margin-bottom:6px; }
.home-hero p { font-size:13px; opacity:.92; }
.home-stats { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:26px; }
.home-stat { background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow); }
.home-stat .lbl { font-size:12.5px; color:var(--text-2); margin-bottom:8px; }
.home-stat .num { font-size:26px; font-weight:600; }
.proj-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:16px; }
/* 项目列表页页头（标题 + 视图切换） */
.page-head { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.page-head h3 { font-size:15px; font-weight:600; }
/* 项目列表模式 */
.proj-rows { background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; }
.proj-row { display:flex; align-items:center; gap:10px; width:100%; padding:12px 16px; border:none; background:none; text-align:left; cursor:pointer; border-bottom:1px solid var(--border-soft); transition:background .12s; }
.proj-row:last-child { border-bottom:none; }
.proj-row:hover { background:var(--bg-soft); }
.pr-ic { width:30px; height:30px; border-radius:8px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pr-ic svg { width:16px; height:16px; }
.pr-nm { font-size:14px; font-weight:500; color:var(--text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.proj-row .pr-meta { display:flex; align-items:center; gap:4px; font-size:12px; color:var(--text-3); flex-shrink:0; }
.proj-row .pr-meta svg { width:13px; height:13px; }
.proj-row .pr-meta:first-of-type { margin-left:auto; }
.proj-row .tag-owner { font-size:10.5px; background:var(--accent-soft); color:var(--accent-text); padding:2px 7px; border-radius:5px; font-weight:500; flex-shrink:0; }
.proj-row .tag-member { font-size:10.5px; background:var(--blue-soft); color:var(--blue); padding:2px 7px; border-radius:5px; font-weight:500; flex-shrink:0; }
.proj-card { background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius); padding:18px 20px; box-shadow:var(--shadow); cursor:pointer; transition:transform .12s, box-shadow .12s; border:none; text-align:left; width:100%; }
.proj-card:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.proj-card .top { display:flex; align-items:center; gap:10px; margin-bottom:10px; }
.proj-card .ic { width:38px; height:38px; border-radius:10px; display:flex; align-items:center; justify-content:center; }
.proj-card .ic svg { width:18px; height:18px; }
.proj-card .nm { font-size:15px; font-weight:600; }
.proj-card .meta { display:flex; gap:14px; font-size:12px; color:var(--text-3); margin-top:8px; }
.proj-card .meta span { display:flex; align-items:center; gap:4px; }
.proj-card .meta svg { width:13px; height:13px; }
.proj-card .tag-owner { font-size:10.5px; background:var(--accent-soft); color:var(--accent-text); padding:2px 7px; border-radius:5px; font-weight:500; }
.proj-card .tag-member { font-size:10.5px; background:var(--blue-soft); color:var(--blue); padding:2px 7px; border-radius:5px; font-weight:500; }
.empty-home { text-align:center; padding:60px 20px; color:var(--text-3); }
.empty-home svg { width:56px; height:56px; margin-bottom:14px; opacity:.5; }
.empty-home h3 { font-size:15px; color:var(--text-2); margin-bottom:6px; font-weight:500; }
.empty-home p { font-size:13px; }

/* project detail tabs */
.tabs-bar { display:flex; align-items:stretch; gap:0; border-bottom:1px solid var(--border-soft); margin-bottom:22px; }
/* 标签之间的小竖线；首个标签与靠右的刷新按钮不画 */
.tabs-bar > * { position:relative; }
.tabs-bar > *:not(:first-child):not(.refresh-btn)::after { content:''; position:absolute; left:0; top:50%; transform:translateY(-50%); width:1px; height:15px; background:var(--text-3); opacity:.42; pointer-events:none; }
.tab-btn { padding:10px 16px; font-size:13.5px; font-weight:500; color:var(--text-2); border:none; background:none; border-bottom:2px solid transparent; margin-bottom:-1px; transition:all .15s; }
.tab-btn:hover { color:var(--text-1); }
.tab-btn.active { color:var(--accent-text); border-bottom-color:var(--accent); }
/* 项目 AI 助手 tab：图标 + 文字 */
.tab-btn.tab-ai { display:inline-flex; align-items:center; gap:5px; }
.tab-btn.tab-ai svg { width:15px; height:15px; flex:0 0 auto; }

/* task list */
.card { background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow); overflow:hidden; margin-bottom:20px; }
.card-head { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border-soft); }
.card-head h3 { font-size:15px; font-weight:600; display:flex; align-items:center; gap:8px; }
.card-head .cnt { font-size:12px; color:var(--text-3); font-weight:400; }
/* 小标题后的未解决进度条 */
.hd-prog { display:inline-flex; align-items:center; gap:8px; margin-left:12px; font-size:12px; color:var(--text-2); font-weight:400; white-space:nowrap; }
.hd-prog .hp-bar { position:relative; width:96px; height:5px; border-radius:3px; background:var(--border); overflow:hidden; }
.hd-prog .hp-bar i { position:absolute; left:0; top:0; bottom:0; border-radius:3px; background:var(--amber); transition:width .2s; }
.hd-prog .hp-nm { color:var(--text-3); }
.task { display:flex; align-items:center; gap:14px; padding:14px 20px; border-bottom:1px solid var(--border-soft); transition:background .12s; }
.task:hover { background:var(--bg-soft); }
.task:last-child { border-bottom:none; }
.check { width:20px; height:20px; border:1.5px solid var(--border); border-radius:6px; flex-shrink:0; display:flex; align-items:center; justify-content:center; transition:all .15s; background:var(--bg-surface); }
.check:hover { border-color:var(--accent); }
.check.done { background:var(--accent); border-color:var(--accent); }
.check.done svg { display:block; }
.check svg { width:12px; height:12px; color:#fff; display:none; }
.task-body { flex:1; min-width:0; }
.task-title { font-size:13.5px; font-weight:500; }
.task.done .task-title { color:var(--text-3); text-decoration:line-through; }
.task-meta { display:flex; align-items:center; gap:8px; margin-top:4px; flex-wrap:wrap; }
.task-by { font-size:11.5px; color:var(--text-3); }
.task-del { width:26px; height:26px; border-radius:6px; border:none; background:none; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .12s; }
.task:hover .task-del { opacity:1; }
.task-del:hover { background:var(--red-soft); }
.task-del svg { width:14px; height:14px; color:var(--red); }
.add-task-row { display:flex; gap:10px; padding:14px 20px; align-items:center; }
.add-task-row input { flex:1; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13.5px; outline:none; transition:border .15s; }
.add-task-row input:focus { border-color:var(--accent); }
.add-task-btn { padding:10px 16px; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); font-size:13px; font-weight:500; }
.add-task-btn:hover { background:var(--accent-text); }

/* members */
.member-row { display:flex; align-items:center; gap:12px; padding:14px 20px; border-bottom:1px solid var(--border-soft); }
.member-row:last-child { border-bottom:none; }
.member-row .info { flex:1; }
.member-row .nm { font-size:13.5px; font-weight:500; }
.member-row .acc { font-size:12px; color:var(--text-3); font-family:ui-monospace,monospace; }
.member-role { font-size:11.5px; padding:2px 9px; border-radius:5px; font-weight:500; }
.role-owner { background:var(--accent-soft); color:var(--accent-text); }
.role-me { background:var(--blue-soft); color:var(--blue); }
.role-admin { background:var(--purple-soft); color:var(--purple); }
.role-member { background:var(--bg-soft); color:var(--text-3); }
/* 项目管理员授权 / 收回 */
.btn-role { font-size:12px; background:none; border-radius:6px; padding:5px 10px; white-space:nowrap; }
.btn-role.grant { color:var(--purple); border:1px solid var(--purple-soft); }
.btn-role.grant:hover { background:var(--purple-soft); }
.btn-role.revoke { color:var(--text-2); border:1px solid var(--border); }
.btn-role.revoke:hover { background:var(--bg-soft); }
.btn-role:disabled { opacity:.5; }
.btn-remove { font-size:12px; color:var(--red); background:none; border:1px solid var(--red-soft); border-radius:6px; padding:5px 10px; }
.btn-remove:hover { background:var(--red-soft); }
.invite-box { background:var(--bg-soft); border-radius:var(--radius); padding:16px 20px; margin-bottom:8px; }
.invite-box .ti { font-size:12.5px; color:var(--text-2); margin-bottom:10px; font-weight:500; }
.invite-row { display:flex; gap:10px; }
.invite-row input { flex:1; padding:10px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13.5px; outline:none; font-family:ui-monospace,monospace; letter-spacing:1px; }
.invite-row input:focus { border-color:var(--accent); }
.invite-row button { padding:10px 18px; background:var(--accent); color:#fff; border:none; border-radius:var(--radius-sm); font-size:13px; font-weight:500; }
.invite-row button:hover { background:var(--accent-text); }
.invite-hint { font-size:11.5px; color:var(--text-3); margin-top:8px; }

/* settings */
.setting-row { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid var(--border-soft); }
.setting-row:last-child { border-bottom:none; }
.setting-row .lbl { font-size:13.5px; font-weight:500; }
.setting-row .val { font-size:12.5px; color:var(--text-3); }
.setting-row .val.edit-name { display:flex; gap:8px; align-items:center; }
.setting-row .val.edit-name input { width:170px; padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px; color:var(--text-1); outline:none; }
.setting-row .val.edit-name input:focus { border-color:var(--accent); }
.btn-danger { font-size:13px; color:#fff; background:var(--red); border:none; border-radius:var(--radius-sm); padding:9px 16px; font-weight:500; }
.btn-danger:hover { background:#b91c1c; }
.btn-ghost { font-size:13px; color:var(--text-2); background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:9px 16px; font-weight:500; }
.btn-ghost:hover { background:var(--bg-soft); }

/* modal */
.modal-mask { position:fixed; inset:0; background:rgba(31,41,55,.45); z-index:100; display:flex; align-items:center; justify-content:center; padding:24px; }
.modal { width:100%; max-width:420px; background:var(--bg-surface); border-radius:16px; box-shadow:var(--shadow-lg); padding:28px 26px; }
.modal h3 { font-size:17px; font-weight:600; margin-bottom:18px; }
.modal .field { margin-bottom:14px; }
/* 宽式弹窗：表单字段较多时用 */
.modal.wide { max-width:620px; }
/* 内容过高时弹窗内部滚动，不顶破屏幕 */
.modal { max-height:calc(100vh - 48px); overflow-y:auto; }
.modal-actions { display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }

/* toast */
.toast { position:fixed; top:20px; left:50%; transform:translateX(-50%) translateY(-60px); background:#1f2937; color:#fff; padding:11px 20px; border-radius:var(--radius-sm); font-size:13px; z-index:200; opacity:0; transition:all .25s; pointer-events:none; box-shadow:var(--shadow-lg); }
.toast.show { opacity:1; transform:translateX(-50%) translateY(0); }
.toast.ok { background:var(--green); }
.toast.err { background:var(--red); }

/* ===== sidebar nav ===== */
.side-nav { padding:8px 10px 10px; flex:1; min-height:0; overflow-y:auto; }
.nav-item { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius-sm); cursor:pointer; margin-bottom:2px; border:none; background:none; width:100%; text-align:left; transition:background .12s; font-size:13px; font-weight:500; color:var(--text-2); }
.nav-item:hover { background:var(--bg-soft); color:var(--text-1); }
.nav-item.active { background:var(--accent-soft); color:var(--accent-text); }
.nav-item.active .nav-ic svg { color:var(--accent-text); }
.nav-ic { width:18px; height:18px; display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.nav-ic svg { width:17px; height:17px; color:var(--text-3); transition:color .12s; }
.nav-item:hover .nav-ic svg { color:var(--text-2); }
.nav-tx { flex:1; }
.nav-badge { font-size:11px; font-weight:600; background:#e5e7eb; color:#4b5563; border-radius:10px; padding:1px 7px; min-width:18px; text-align:center; }
.nav-item.active .nav-badge { background:#e5e7eb; color:#4b5563; }
.side-divider { height:1px; background:var(--border-soft); margin:8px 16px; }
.nav-divider { height:1px; background:var(--border-soft); margin:7px 8px; }

/* ===== 侧栏项目目录树 ===== */
.nav-caret { width:16px; height:16px; display:flex; align-items:center; justify-content:center; flex-shrink:0; color:var(--text-3); transition:transform .15s; }
.nav-caret svg { width:14px; height:14px; }
.nav-caret.open { transform:rotate(90deg); }
.nav-item.is-tree .nav-tx { flex:1; }
.nav-sub { display:none; }
.nav-sub.open { display:block; padding:1px 0 3px; }
.proj-item.is-sub { padding:7px 10px 7px 34px; position:relative; }
.proj-item.is-sub::before { content:''; position:absolute; left:19px; top:0; bottom:0; width:1px; background:var(--border-soft); }
.nav-sub-empty { padding:5px 10px 6px 34px; font-size:12px; color:var(--text-3); }
.nav-item-new { display:flex; align-items:center; gap:10px; padding:9px 10px; border-radius:var(--radius-sm); cursor:pointer; margin:2px 0; border:none; background:none; width:100%; text-align:left; transition:background .12s; font-size:13px; font-weight:500; color:var(--accent-text); }
.nav-item-new:hover { background:var(--accent-soft); }
.nav-item-new .nav-ic svg { color:var(--accent-text); }

/* home stat clickable */
.home-stat.nav-stat { cursor:pointer; transition:transform .12s, box-shadow .12s; }
.home-stat.nav-stat:hover { transform:translateY(-2px); box-shadow:var(--shadow-lg); }
.home-stats { grid-template-columns:repeat(3,1fr); }
@media (max-width:1200px) { .home-stats { grid-template-columns:repeat(2,1fr); } }

/* ===== notes ===== */
.notes-input-wrap { background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow); margin-bottom:20px; overflow:hidden; }
.notes-input-wrap textarea { width:100%; border:none; outline:none; resize:vertical; padding:14px 18px; font-size:14px; line-height:1.6; font-family:inherit; color:var(--text-1); background:var(--bg-surface); min-height:60px; }
.note-input-bar { display:flex; align-items:center; justify-content:space-between; padding:8px 14px 12px; border-top:1px solid var(--border-soft); }
.note-colors { display:flex; gap:7px; }
.note-color-pick { width:22px; height:22px; border-radius:50%; border:2px solid transparent; cursor:pointer; transition:all .15s; }
.note-color-pick.sel { border-color:var(--text-1); transform:scale(1.1); }
.notes-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(220px,1fr)); gap:14px; }
.note-card { border-radius:var(--radius); padding:16px 18px; display:flex; flex-direction:column; gap:12px; min-height:100px; transition:transform .12s; }
.note-card:hover { transform:translateY(-2px); }
.note-content { font-size:13.5px; line-height:1.6; color:var(--text-1); white-space:pre-wrap; word-break:break-word; flex:1; }
.note-foot { display:flex; align-items:center; justify-content:space-between; }
.note-time { font-size:11px; color:var(--text-3); }
.note-del { width:24px; height:24px; border-radius:6px; border:none; background:none; display:flex; align-items:center; justify-content:center; opacity:0; transition:opacity .12s; }
.note-card:hover .note-del { opacity:1; }
.note-del:hover { background:rgba(0,0,0,.06); }
.note-del svg { width:13px; height:13px; color:var(--red); }

/* ===== todo filter ===== */
.todo-filter { display:flex; gap:4px; border-bottom:1px solid var(--border-soft); margin-bottom:22px; }

/* ===== schedules ===== */
.sched-form { display:flex; flex-direction:column; gap:14px; }
.sched-input-main { width:100%; padding:11px 14px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:14px; outline:none; transition:border .15s; background:var(--bg-surface); color:var(--text-1); }
.sched-input-main:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.sched-form-row { display:flex; gap:12px; align-items:flex-end; flex-wrap:wrap; }
.sched-form-row .field label { display:block; font-size:11.5px; color:var(--text-3); margin-bottom:4px; font-weight:500; }
.sched-form-row .field input { width:100%; padding:9px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px; outline:none; color:var(--text-1); background:var(--bg-surface); }
.sched-form-row .field input:focus { border-color:var(--accent); }
.sched-list { display:flex; flex-direction:column; gap:20px; }
.sched-group { display:flex; gap:18px; }
.sched-date { width:64px; text-align:center; flex-shrink:0; padding-top:4px; }
.sched-date .sched-d-num { font-size:26px; font-weight:700; color:var(--text-1); line-height:1; }
.sched-date .sched-d-wk { font-size:11px; color:var(--text-3); margin-top:4px; }
.sched-date.today .sched-d-num { color:var(--accent-text); }
.sched-date.today .sched-d-wk { color:var(--accent-text); font-weight:500; }
.sched-items { flex:1; display:flex; flex-direction:column; gap:8px; border-left:2px solid var(--border-soft); padding-left:18px; }
.sched-item { display:flex; align-items:center; gap:14px; padding:12px 16px; background:var(--bg-surface); border:1px solid var(--border-soft); border-radius:var(--radius-sm); box-shadow:var(--shadow); transition:transform .12s; }
.sched-item:hover { transform:translateX(2px); }
.sched-time { font-size:12px; color:var(--accent-text); font-weight:600; font-family:ui-monospace,monospace; width:100px; flex-shrink:0; }
.sched-body { flex:1; min-width:0; }
.sched-title { font-size:13.5px; font-weight:500; }

@media (max-width:920px) {
  .home-stats { grid-template-columns:1fr; }
  .notes-grid { grid-template-columns:1fr; }
  .sched-form-row { flex-direction:column; align-items:stretch; }
  .sched-form-row .field { width:100% !important; }
}

/* ===== 需求 / 缺陷 列表 ===== */
.item-row { display: flex; align-items: flex-start; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); transition: background .15s; }
.item-row:hover { background: var(--bg-soft); }
.item-row:last-child { border-bottom: none; }
.item-row.is-done { opacity: .55; }
.item-row.is-done .item-title { text-decoration: line-through; }
.item-body { flex: 1; min-width: 0; }
.item-title { font-size: 14px; color: var(--text-1); line-height: 1.5; word-break: break-word; }
.item-meta { display: flex; align-items: center; gap: 6px; margin-top: 6px; }

.tag { flex-shrink: 0; margin-top: 2px; padding: 2px 8px; border-radius: 5px; font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap; }
.tag.pri-high { background: var(--red-soft); color: var(--red); }
.tag.pri-mid { background: var(--amber-soft); color: var(--amber); }
.tag.pri-low { background: var(--bg-soft); color: var(--text-2); }
.tag.sev-critical { background: var(--red-soft); color: var(--red); }
.tag.sev-normal { background: var(--blue-soft); color: var(--blue); }
.tag.sev-minor { background: var(--bg-soft); color: var(--text-2); }

.st-sel { flex-shrink: 0; padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px; background: var(--bg-surface); color: var(--text-2); font-size: 12px; cursor: pointer; outline: none; transition: border-color .15s; }
.st-sel:hover, .st-sel:focus { border-color: var(--accent); }
.st-sel option.opt-del { color: var(--red); font-weight: 600; }

.empty-tip { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.ai-placeholder { padding: 64px 30px; }

/* AI helper */
.ai-page { display:flex; gap:0; height:calc(100vh - 90px); min-height:420px;
  background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; }
/* 项目内的 AI 助手：顶部还有 tab 条，高度要再扣掉一段 */
.ai-page.in-proj { height:calc(100vh - 145px); min-height:380px; }
.ai-side { position:relative; width:196px; flex:0 0 196px; display:flex; flex-direction:column; gap:8px; background:var(--bg-surface); padding:10px; }
/* 分割竖线：上下留空，不顶到头 */
.ai-side::after { content:''; position:absolute; right:0; top:56px; bottom:56px; width:1px; background:var(--border); }
.ai-new { width:100%; justify-content:center; }
.ai-conv-list { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:6px; padding:2px 1px; }
.ai-side-tip { color:var(--text-3); font-size:12.5px; text-align:center; padding:18px 6px; }
/* 列表底部：全部删除 */
.ai-clear-all {
  flex:0 0 auto; display:flex; align-items:center; justify-content:center; gap:6px;
  margin-top:2px; padding:8px 10px; width:100%;
  border:1px solid var(--border-soft); border-radius:10px;
  background:var(--bg-surface); color:var(--text-3);
  font-size:12.5px; font-family:inherit; cursor:pointer;
  transition:color .15s, border-color .15s, background .15s;
}
.ai-clear-all svg { width:14px; height:14px; }
.ai-clear-all:hover { color:var(--red); border-color:rgba(220,38,38,.35); background:var(--red-soft); }
/* 对话项：每条独立气泡卡片 */
.ai-conv-item {
  display:flex; align-items:center; gap:6px; padding:8px 10px;
  border:1px solid var(--border-soft); border-radius:12px;
  background:var(--bg-surface); cursor:pointer;
  transition:background .12s, border-color .12s, box-shadow .12s, transform .12s;
}
.ai-conv-item:hover { background:var(--bg-soft); border-color:var(--border); box-shadow:0 1px 4px rgba(0,0,0,.05); }
.ai-conv-item.active { background:var(--accent-soft); border-color:var(--accent); }
.ai-conv-tx { flex:1; font-size:12.5px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.ai-conv-item.active .ai-conv-tx { color:var(--text-1); font-weight:600; }
.ai-conv-del { border:none; background:none; color:var(--text-3); font-size:16px; line-height:1; cursor:pointer; padding:0 2px; opacity:0; transition:opacity .12s, color .12s; }
.ai-conv-item:hover .ai-conv-del { opacity:1; }
.ai-conv-del:hover { color:var(--red); }

.ai-main { flex:1; min-width:0; display:flex; flex-direction:column; background:var(--bg-surface); overflow:hidden; }
/* 滚动区外层：给「回到最底」按钮一个定位参系 */
.ai-scroll-wrap { position:relative; flex:1; min-height:0; display:flex; }
.ai-scroll { flex:1; overflow-y:auto; padding:18px 20px; display:flex; flex-direction:column; gap:14px; }

/* 回到最底：只在用户上划离开底部时浮现 */
.ai-jump {
  position:absolute; left:50%; bottom:14px; z-index:5;
  width:34px; height:34px; padding:0;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--border); border-radius:50%;
  background:var(--bg-surface); color:var(--text-2);
  box-shadow:var(--shadow); cursor:pointer;
  opacity:0; visibility:hidden;
  transform:translate(-50%, 8px) scale(.92);
  transition:opacity .16s ease, transform .16s ease, visibility .16s;
}
.ai-jump.show { opacity:1; visibility:visible; transform:translate(-50%, 0) scale(1); }
.ai-jump:hover { color:var(--accent); border-color:var(--accent); }
/* 生成中且不在底部：右上角给个小圆点，提示下面还在写 */
.ai-jump-new { position:absolute; top:-1px; right:-1px; width:9px; height:9px;
  border:2px solid var(--bg-surface); border-radius:50%; background:var(--accent);
  opacity:0; transform:scale(.5); transition:opacity .16s, transform .16s; }
.ai-jump-new.on { opacity:1; transform:scale(1); }

.ai-msg { display:flex; flex-direction:column; gap:5px; max-width:82%; }
.ai-msg.is-me { align-self:flex-end; align-items:flex-end; }
.ai-msg.is-ai { align-self:flex-start; }
.ai-who { font-size:11.5px; color:var(--text-3); display:flex; align-items:center; gap:7px; }
.ai-tok { font-size:10.5px; color:var(--text-3); background:var(--bg-soft); border-radius:8px; padding:1px 6px; }
.ai-bubble { padding:11px 14px; border-radius:12px; font-size:13.5px; line-height:1.7; color:var(--text-1); word-break:break-word; }
.ai-msg.is-me .ai-bubble { background:var(--accent); color:#fff; border-bottom-right-radius:4px; }
.ai-msg.is-ai .ai-bubble { background:var(--bg-soft); border:1px solid var(--border-soft); border-bottom-left-radius:4px; }
.ai-msg.is-failed .ai-bubble { background:var(--red-soft); border-color:rgba(220,38,38,.2); color:var(--red); }

/* 流式输出末尾的光标：用与「AI 思考中」一致的三点流动，比闪动竖线柔和 */
.ai-caret { display:inline-flex; gap:4px; align-items:center; height:14px;
  margin-left:4px; vertical-align:-2px; }
.ai-caret::before, .ai-caret::after, .ai-caret > i {
  content:''; width:6px; height:6px; border-radius:50%;
  background:var(--accent); opacity:.25;
  animation:aiDot 1.2s ease-in-out infinite;
}
.ai-caret::after { animation-delay:.15s; }
.ai-caret > i { animation-delay:.3s; }
.ai-typing { display:inline-flex; gap:4px; align-items:center; height:14px; }
.ai-typing i { width:6px; height:6px; border-radius:50%; background:var(--text-3); animation:aiDot 1.2s ease-in-out infinite; }
.ai-typing i:nth-child(2) { animation-delay:.15s; }
.ai-typing i:nth-child(3) { animation-delay:.3s; }
@keyframes aiDot { 0%,60%,100% { opacity:.25; transform:translateY(0); } 30% { opacity:1; transform:translateY(-3px); } }

.ai-welcome { margin:auto; text-align:center; padding:20px; }
.ai-wel-title { font-size:19px; font-weight:700; color:var(--text-1); margin-bottom:7px; }
.ai-wel-sub { font-size:12.5px; color:var(--text-3); margin-bottom:20px; }
.ai-sug-list { display:flex; flex-direction:column; gap:9px; align-items:center; }
.ai-sug { border:1px solid var(--border); background:var(--bg-surface); color:var(--text-2); border-radius:20px; padding:9px 18px; font-size:12.5px; font-family:inherit; cursor:pointer; transition:border-color .12s, color .12s, background .12s; }
.ai-sug:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }

/* 输入区：整体圆角卡片，文本在上、工具条在下 */
.ai-composer { padding:12px 14px 14px; background:var(--bg-surface); }
.ai-input-bar {
  display:flex; flex-direction:column; gap:2px;
  border:1px solid var(--border); border-radius:22px;
  background:var(--bg-surface); padding:6px 6px 6px 8px;
  transition:border-color .15s, box-shadow .15s;
}
.ai-input-bar:focus-within { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.ai-input {
  width:100%; min-height:38px; max-height:190px; padding:9px 10px 4px;
  border:none; background:none; font-size:14px; font-family:inherit; line-height:1.6;
  color:var(--text-1); resize:none;
}
.ai-input:focus { outline:none; }
.ai-input:disabled { color:var(--text-3); }
.ai-input::placeholder { color:var(--text-3); }
.ai-tools { display:flex; align-items:center; gap:9px; padding:0 2px 0 0; }
.ai-tools-hint { flex:1; min-width:0; font-size:11.5px; color:var(--text-3); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-tools-right { flex:0 0 auto; display:flex; align-items:center; gap:7px; }
.ai-send {
  width:34px; height:34px; min-height:0; flex:0 0 auto; padding:0;
  display:inline-flex; align-items:center; justify-content:center;
  border:none; border-radius:50%; background:var(--accent); color:#fff;
  cursor:pointer; transition:opacity .15s, transform .12s, background .15s;
}
.ai-send:hover:not(:disabled) { transform:translateY(-1px); }
.ai-send:disabled { background:var(--border); color:var(--text-3); cursor:not-allowed; transform:none; }
.ai-send-spin {
  width:15px; height:15px; border-radius:50%;
  border:2px solid rgba(255,255,255,.45); border-top-color:#fff;
  animation:aiSpin .7s linear infinite;
}
.ai-send:disabled .ai-send-spin { border-color:rgba(0,0,0,.12); border-top-color:var(--text-3); }
@keyframes aiSpin { to { transform:rotate(360deg); } }

/* 生成中：发送键变停止键，用中性深色区分于主色发送 */
.ai-send.is-stop { background:var(--text-1); }
.ai-send.is-stop:hover:not(:disabled) { background:#000; }

/* 被用户中断的回答：左侧加练标记，与正常回答区分 */
.ai-msg.is-stopped .ai-bubble {
  border-left:2px solid var(--border);
  color:var(--text-2);
}

/* ===== 聊天附件：图片缩略图 + 文件卡片（对齐微信的展示习惯） ===== */
.ai-attach-btn {
  flex:0 0 auto; width:34px; height:34px; border-radius:50%;
  display:inline-flex; align-items:center; justify-content:center; padding:0;
  border:1px solid var(--border); background:var(--bg-surface);
  color:var(--text-2); line-height:1; cursor:pointer;
  transition:border-color .15s, color .15s, background .15s;
}
.ai-attach-btn:hover:not(:disabled) { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.ai-attach-btn:disabled { opacity:.5; cursor:not-allowed; }
.ai-file-input { display:none; }

/* 待发送区 */
.ai-pending { padding:2px 4px 10px; }

/* 消息里的附件区 */
.ai-attach { margin-bottom:6px; }
.is-me .ai-attach { display:flex; flex-direction:column; align-items:flex-end; }

/* 图片九宫格 */
.ai-img-grid { display:flex; flex-wrap:wrap; gap:7px; }
.ai-img-box {
  position:relative; width:96px; height:96px; border-radius:8px; overflow:hidden;
  border:1px solid var(--border); background:var(--bg-soft);
}
.ai-img-box img { width:100%; height:100%; object-fit:cover; cursor:zoom-in; display:block; }

/* 文件卡片：只显示名称 + 格式 + 大小 */
.ai-file-list { display:flex; flex-direction:column; gap:6px; margin-top:7px; }
.ai-file-card {
  position:relative; display:flex; align-items:center; gap:10px;
  max-width:320px; padding:9px 11px; text-decoration:none;
  border:1px solid var(--border); border-radius:9px; background:var(--bg-surface);
  transition:all .15s;
}
.ai-file-card:hover { border-color:var(--accent); background:var(--accent-soft); }
.ai-file-ic {
  flex:0 0 auto; width:34px; height:34px; border-radius:7px;
  display:flex; align-items:center; justify-content:center;
  background:var(--accent); color:#fff; font-size:10px; font-weight:700; letter-spacing:.2px;
}
.ai-file-meta { min-width:0; display:flex; flex-direction:column; gap:2px; }
.ai-file-nm {
  font-size:13px; color:var(--text-1); font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:230px;
}
.ai-file-sz { font-size:11.5px; color:var(--text-3); }

/* 移除按钮 */
.ai-file-x {
  position:absolute; top:-6px; right:-6px; width:20px; height:20px;
  border:none; border-radius:50%; background:rgba(15,23,42,.72); color:#fff;
  font-size:14px; line-height:1; cursor:pointer; z-index:2;
}
.ai-file-x:hover { background:var(--red); }
.ai-img-box .ai-file-x { top:3px; right:3px; }

/* 拖拽高亮 */
.ai-main.is-drop { outline:2px dashed var(--accent); outline-offset:-6px; }

@media (max-width: 720px) {
  .ai-img-box { width:78px; height:78px; }
  .ai-file-card { max-width:100%; }
  .ai-file-nm { max-width:180px; }
  .ai-attach-btn { width:32px; height:32px; }
  .ai-send { width:32px; height:32px; }
  .ai-composer { padding:10px 10px 12px; }
}

@media (max-width: 920px) {
  .ai-page { flex-direction:column; height:calc(100vh - 146px); gap:0; }
  .ai-page.in-proj { height:calc(100vh - 190px); }
  .ai-side { width:100%; flex:0 0 auto; flex-direction:row; align-items:center; gap:9px; padding:9px 10px; }
  .ai-side::after { right:14px; left:14px; top:auto; bottom:0; width:auto; height:1px; }
  .ai-new { width:auto; flex:0 0 auto; }
  .ai-conv-list { flex-direction:row; overflow-x:auto; overflow-y:hidden; gap:7px; }
  .ai-conv-item { flex:0 0 auto; max-width:150px; }
  .ai-clear-all { width:auto; flex:0 0 auto; margin-top:0; padding:8px 10px; }
  .ai-clear-all span { display:none; }
  .ai-conv-del { opacity:1; }
  .ai-msg { max-width:92%; }
  .ai-scroll { padding:14px; }
}

/* ===== \u5355\u636e\u8be6\u60c5\u9875 ===== */
.item-page { display: flex; flex-direction: column; gap: 14px; }
.btn-back { align-self: flex-start; padding: 6px 12px; background: none; border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: all .15s; }
.btn-back:hover { border-color: var(--accent); color: var(--accent-text); }

.item-hd { padding: 18px 20px 14px; border-bottom: 1px solid var(--border-soft); }
.item-hd-tags { display: flex; gap: 6px; margin-bottom: 8px; }
.item-h2 { font-size: 19px; font-weight: 600; color: var(--text-1); line-height: 1.45; margin: 0 0 10px; word-break: break-word; }
.item-hd-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); }

.item-ctrl { display: flex; flex-wrap: wrap; gap: 22px; padding: 14px 20px 16px; }
.ctrl-cell { display: flex; flex-direction: column; gap: 7px; }
.ctrl-lbl { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.assignee-box { display: flex; align-items: center; gap: 7px; }
.assignee-nm { font-size: 13.5px; color: var(--text-1); font-weight: 500; }
.row-btns { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.btn-mini { padding: 6px 13px; background: var(--bg-surface); border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: all .15s; }
.btn-mini:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-mini.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-mini.primary:hover { background: var(--accent-text); color: #fff; }
.file-lbl { display: inline-block; }

.card-pad { padding: 16px 20px 18px; }
.desc-text { font-size: 14px; color: var(--text-1); line-height: 1.7; word-break: break-word; white-space: pre-wrap; }
.desc-text.empty { color: var(--text-3); font-size: 13px; }
.desc-input { width: 100%; min-height: 96px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; font-family: inherit; line-height: 1.65; color: var(--text-1); resize: vertical; outline: none; box-sizing: border-box; transition: border-color .15s; }
.desc-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.img-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 11px; }
.img-box { position: relative; width: 108px; height: 108px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-soft); }
.img-box img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.img-x { position: absolute; top: 4px; right: 4px; width: 21px; height: 21px; border: none; border-radius: 50%; background: rgba(17,24,39,.72); color: #fff; font-size: 15px; line-height: 1; cursor: pointer; }
.img-x:hover { background: var(--red); }
.img-viewer { max-width: 92vw; max-height: 92vh; }
.img-viewer img { max-width: 92vw; max-height: 92vh; border-radius: 10px; display: block; }

.cmt-list { border-top: 1px solid var(--border-soft); }
.cmt { display: flex; gap: 11px; padding: 14px 20px; border-bottom: 1px solid var(--border-soft); }
.cmt:last-child { border-bottom: none; }
.cmt-main { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.cmt-name { font-size: 13px; font-weight: 600; color: var(--text-1); }
.cmt-time { font-size: 11.5px; color: var(--text-3); }
.cmt-body { font-size: 13.5px; color: var(--text-1); line-height: 1.65; word-break: break-word; white-space: pre-wrap; }
.cmt.sys { align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); background: var(--bg-soft); padding: 10px 20px; }
.cmt.sys b { color: var(--text-2); font-weight: 600; }
.sys-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.cmt-editor { padding: 14px 20px 18px; border-top: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }

.task-title.link, .item-title.link { cursor: pointer; }
.task-title.link:hover, .item-title.link:hover { color: var(--accent-text); text-decoration: underline; }
.mini-badge { padding: 1px 7px; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border-soft); color: var(--text-2); font-size: 11px; margin-left: 4px; white-space: nowrap; }
.tag.st-plain { background: var(--bg-soft); color: var(--text-2); }

@media (max-width: 720px) {
  .item-ctrl { flex-direction: column; gap: 14px; }
}

/* ===== \u5371\u9669\u64cd\u4f5c\u5f39\u7a97\uff08\u89e3\u6563\u9879\u76ee\uff09 ===== */
.modal-text { font-size: 13.5px; color: var(--text-2); line-height: 1.7; margin-bottom: 20px; }

.danger-modal { max-width: 460px; border-top: 4px solid var(--red); }
.danger-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.danger-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--red); color: #fff; font-size: 21px; font-weight: 700; display: flex; align-items: center; justify-content: center; line-height: 1; }
.danger-title { font-size: 17px; font-weight: 600; color: var(--red); margin: 0 0 2px; }
.danger-step { font-size: 11.5px; color: var(--text-3); }

.danger-alert { padding: 13px 15px; background: var(--red-soft); border: 1px solid rgba(220,38,38,.28); border-left: 3px solid var(--red); border-radius: 9px; font-size: 13.5px; color: #991b1b; line-height: 1.7; margin-bottom: 14px; }
.danger-alert b { color: var(--red); font-weight: 700; }
.danger-alert.strong { background: #fee2e2; border-color: rgba(220,38,38,.45); font-size: 14px; }

.danger-list { margin: 0 0 20px; padding-left: 20px; }
.danger-list li { font-size: 13px; color: var(--text-2); line-height: 1.9; }
.danger-list b { color: var(--red); font-weight: 600; }

.slide-lbl { font-size: 12px; color: var(--text-3); margin-bottom: 9px; text-align: center; }
.slide-track { position: relative; height: 50px; border-radius: 25px; background: var(--bg-soft); border: 1px solid rgba(220,38,38,.3); overflow: hidden; user-select: none; margin-bottom: 18px; }
.slide-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, #fca5a5, var(--red)); }
.slide-hint { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; color: #b91c1c; font-weight: 500; pointer-events: none; transition: opacity .1s; }
.slide-thumb { position: absolute; left: 3px; top: 3px; width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff; display: flex; align-items: center; justify-content: center; cursor: grab; box-shadow: 0 2px 8px rgba(220,38,38,.4); z-index: 2; }
.slide-thumb svg { width: 20px; height: 20px; }
.slide-thumb.active { cursor: grabbing; transform-origin: center; }
.slide-track.done { border-color: var(--red); }
.slide-track.done .slide-fill { width: 100% !important; }
.slide-track.done .slide-thumb { cursor: default; }

/* ===== \u901a\u7528\u5220\u9664\u786e\u8ba4\u5f39\u7a97 ===== */
.confirm-modal { max-width: 400px; }
.confirm-head { display: flex; align-items: center; gap: 11px; margin-bottom: 14px; }
.confirm-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 50%; background: var(--red-soft); color: var(--red); display: flex; align-items: center; justify-content: center; }
.confirm-icon svg { width: 18px; height: 18px; }
.confirm-title { font-size: 16.5px; font-weight: 600; color: var(--text-1); margin: 0; }
.confirm-target { padding: 11px 14px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; font-size: 13.5px; color: var(--text-1); line-height: 1.6; word-break: break-word; margin-bottom: 12px; }
.confirm-target:empty { display: none; }
.confirm-tip { font-size: 12.5px; color: var(--text-2); line-height: 1.7; margin: 0 0 20px; }

.refresh-btn { margin-left: auto; color: var(--text-3); }
.refresh-btn:hover { color: var(--accent-text); }

/* 面包屑可点击的「我的」 */
.topbar .crumb-link {
  background: none;
  border: none;
  padding: 2px 4px;
  margin-left: -4px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text-1);
  cursor: pointer;
  border-radius: 5px;
  font-family: inherit;
  transition: color .15s, background .15s;
}
.topbar .crumb-link:hover {
  color: var(--accent);
  background: var(--accent-soft);
}
.topbar .crumb-link {
  flex: none;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 修订留痕 */
.desc-text .desc-line { min-height: 1.7em; white-space: pre-wrap; word-break: break-word; }
.desc-text .desc-line.dead {
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  color: var(--text-3);
  opacity: .72;
}
.hist-run { margin: 0 0 2px; }
.hist-run.para {
  border-left: 2px solid var(--border);
  padding: 4px 0 4px 10px;
  margin: 4px 0 8px;
}
.hist-lbl { font-size: 11.5px; color: var(--text-3); opacity: .8; margin-bottom: 1px; }
.item-h2.dead {
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  color: var(--text-3);
  opacity: .7;
  font-weight: 500;
  margin: 0 0 2px;
}

/* 标题编辑 */
.title-row { display: flex; align-items: flex-start; gap: 10px; }
.title-row .item-h2 { flex: 1; }
.title-row .btn-mini { flex: none; margin-top: 2px; }
.title-edit { margin: 0 0 10px; }
.title-inp { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 16px; font-weight: 600; font-family: inherit; color: var(--text-1); outline: none; box-sizing: border-box; margin-bottom: 8px; transition: border-color .15s; }
.title-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* 评论：编辑 / 回复 */
.cmt-act { margin-left: auto; background: none; border: none; color: var(--text-3); font-size: 11.5px; cursor: pointer; padding: 2px 4px; border-radius: 4px; font-family: inherit; }
.cmt-act:hover { color: var(--accent); background: var(--accent-soft); }
.cmt-head .cmt-act ~ .cmt-act { margin-left: 0; }
.cmt-quote { font-size: 12px; color: var(--text-3); background: var(--bg-soft); border-left: 2px solid var(--border); padding: 6px 9px; border-radius: 0 6px 6px 0; margin-bottom: 6px; word-break: break-word; }
.cmt-quote b { color: var(--text-2); font-weight: 600; }
.cmt-quote.gone { font-style: italic; }
.reply-bar { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); background: var(--bg-soft); border-radius: 7px; padding: 7px 10px; }
.reply-bar b { color: var(--text-2); font-weight: 600; }
.reply-bar > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.reply-bar .cmt-act { margin-left: 0; flex: none; }
.cmt-body .desc-line { min-height: 1.65em; white-space: pre-wrap; word-break: break-word; }
.cmt-body .desc-line.dead { text-decoration: line-through; text-decoration-color: var(--text-3); color: var(--text-3); opacity: .72; }

/* 随手记：点开编辑 */
.note-open { cursor: text; }
.note-acts { display: flex; align-items: center; gap: 2px; }
.note-act { width: 24px; height: 24px; border-radius: 6px; border: none; background: none; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s; cursor: pointer; }
.note-card:hover .note-act { opacity: 1; }
.note-act:hover { background: rgba(0,0,0,.06); }
.note-act svg { width: 13px; height: 13px; color: var(--text-2); }
.note-card.editing { transform: none; }
.note-edit-input { width: 100%; flex: 1; background: rgba(255,255,255,.6); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; font-size: 13.5px; font-family: inherit; line-height: 1.6; color: var(--text-1); resize: vertical; outline: none; box-sizing: border-box; }
.note-edit-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.note-card.editing .row-btns { justify-content: flex-end; }
.private-tip { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 5px; margin-bottom: 12px; }
.private-tip svg { width: 13px; height: 13px; }

/* 列表标题行右侧新增按钮 */
.head-acts { margin-left: auto; display: flex; align-items: center; gap: 7px; }

/* 新增 / 快速新增 弹窗 */
.item-add { max-width: 720px; padding: 30px 32px; }
.item-add.quick-add-modal { max-width: 560px; }
.item-add h3 { font-size: 18px; margin-bottom: 10px; }
.item-add .modal-text { margin-bottom: 20px; }
.item-add .field { margin-bottom: 16px; }
.item-add .field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.item-add .field input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; color: var(--text-1); outline: none; box-sizing: border-box; transition: border-color .15s; }
.item-add .field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.item-add .desc-input { min-height: 160px; }
.item-add .st-sel { width: 100%; }
.item-add .modal-actions {
  align-items: center;
  gap: 10px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
}
/* 弹窗底部按钮：统一高度、不换行、不被主按钮挤压 */
.item-add .modal-actions > * { flex: none; white-space: nowrap; }
.item-add .modal-actions .btn-soft { margin-right: auto; }
.item-add .modal-actions .btn-ghost,
.item-add .modal-actions .btn-soft,
.item-add .modal-actions .btn-primary {
  height: 40px;
  padding: 0 20px;
  border-radius: 9px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
.item-add .modal-actions .btn-primary {
  width: auto;
  min-width: 120px;
  margin-top: 0;
  font-weight: 600;
}
/* 带图标的次级按钮（选图片） */
.btn-soft {
  gap: 7px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-2);
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.btn-soft:hover { border-color: var(--accent); color: var(--accent-text); background: var(--accent-soft); }
.btn-soft svg { width: 15px; height: 15px; flex: none; }

/* 快速新增弹窗：只有取消/确认，靠右排列 */
.item-add.quick-add-modal .modal-actions { justify-content: flex-end; }

/* 正文/评论里的小号选图片按钮 */
.btn-soft-sm {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 7px;
  font-size: 12.5px;
  white-space: nowrap;
}
.btn-soft-sm svg { width: 14px; height: 14px; }
.row-btns .btn-soft-sm { flex: none; }

/* ===== 四列看板 ===== */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 14px 16px 16px; align-items: start; }
.board-col { background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 10px; min-width: 0; display: flex; flex-direction: column; }
.board-col-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--border-soft); }
.board-col-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.board-col-head .cnt { font-size: 11px; color: var(--text-3); background: var(--bg-surface); border-radius: 10px; padding: 1px 7px; }
.board-col.stage-todo .board-col-title { color: var(--text-2); }
.board-col.stage-doing .board-col-title { color: var(--blue); }
.board-col.stage-testing .board-col-title { color: var(--amber); }
.board-col.stage-done .board-col-title { color: var(--green); }
.board-col-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; min-height: 60px; }
.board-empty { padding: 16px 4px; text-align: center; color: var(--text-3); font-size: 12px; }
.board-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: 9px; padding: 10px; display: flex; flex-direction: column; gap: 7px; transition: border-color .15s, box-shadow .15s; }
.board-card:hover { border-color: var(--accent); }
.board-card.is-done { opacity: .6; }
.board-card.is-done .bc-title { text-decoration: line-through; }
.bc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 20px; }
.bc-title { font-size: 13.5px; color: var(--text-1); line-height: 1.5; word-break: break-word; }
.bc-meta { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-3); }
.bc-badges { display: flex; flex-wrap: wrap; gap: 5px; }
.board-card .stage-sel { width: 100%; }
.tag.st-todo { background: var(--bg-soft); color: var(--text-2); }
.tag.st-doing { background: var(--blue-soft); color: var(--blue); }
.tag.st-testing { background: var(--amber-soft); color: var(--amber); }
.tag.st-done { background: var(--green-soft); color: var(--green); }
@media (max-width: 1100px) { .board { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 620px) { .board { grid-template-columns: 1fr; } }

/* ===== 列表 / 卡片 视图开关 ===== */
.view-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; }
.vs-btn { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; background: none; border: none; border-radius: 6px; color: var(--text-3); font-size: 12px; font-family: inherit; font-weight: 500; line-height: 1.6; white-space: nowrap; cursor: pointer; transition: background .15s, color .15s; }
.vs-btn svg { width: 14px; height: 14px; flex: none; }
.vs-btn:hover { color: var(--text-1); }
.vs-btn.active { background: var(--bg-surface); color: var(--accent-text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.card-head .head-acts { margin-left: auto; }

/* 列表模式容器 */
.item-list { display: flex; flex-direction: column; }
.item-list .item-row { align-items: center; }
.item-list .item-row .item-body { min-width: 0; }
@media (max-width: 620px) {
  .vs-btn span { display: none; }
  .vs-btn { padding: 4px 8px; }
}

/* ===== 回收站 ===== */
.trash-tip { padding: 12px 16px; margin: 0 16px 4px; background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 8px; color: var(--text-3); font-size: 12px; line-height: 1.7; }
.trash-row { align-items: center; gap: 10px; }
.trash-row .item-title.dead { color: var(--text-3); text-decoration: line-through; }
.trash-row .btn-mini { flex: none; }
.btn-mini.danger { border-color: var(--red-soft); color: var(--red); }
.btn-mini.danger:hover { background: var(--red-soft); border-color: var(--red); }
.tag.kind-tasks { background: var(--accent-soft); color: var(--accent-text); }
.tag.kind-reqs { background: var(--blue-soft); color: var(--blue); }
.tag.kind-bugs { background: var(--red-soft); color: var(--red); }

/* ===== 数据统计 ===== */
.home-stat .stat-sub { margin-top: 6px; font-size: 11.5px; color: var(--text-3); line-height: 1.6; }
.trend-wrap { display: flex; flex-direction: column; gap: 18px; padding: 16px; }
.trend-block { border: 1px solid var(--border-soft); border-radius: 10px; padding: 12px 14px; background: var(--bg-soft); }
.trend-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.trend-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.trend-chart { display: flex; align-items: flex-end; gap: 2px; height: 96px; padding: 0 2px; }
.tc-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 3px; }
.tc-bar { width: 100%; max-width: 22px; min-height: 2px; border-radius: 3px 3px 0 0; transition: opacity .15s; }
.tc-col:hover .tc-bar { opacity: .75; }
.tc-val { font-size: 9.5px; color: var(--text-3); line-height: 1; height: 10px; }
.trend-axis { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--text-3); }
.stat-cell { flex: none; display: flex; flex-direction: column; gap: 3px; min-width: 78px; text-align: right; }
.stat-cell .sc-lbl { font-size: 10.5px; color: var(--text-3); }
.stat-cell .sc-val { font-size: 12.5px; color: var(--text-2); }
.tag[class*="ev-"] { background: var(--bg-soft); color: var(--text-2); }
.tag.ev-register, .tag.ev-project_create, .tag.ev-item_create { background: var(--accent-soft); color: var(--accent-text); }
.tag.ev-login { background: var(--blue-soft); color: var(--blue); }
.tag.ev-item_trash, .tag.ev-project_trash { background: var(--amber-soft); color: var(--amber); }
.tag.ev-item_purge, .tag.ev-project_purge { background: var(--red-soft); color: var(--red); }
@media (max-width: 720px) {
  .stat-cell { display: none; }
}


/* ==================== 移动端适配 ==================== */
/* 汉堡按钮与遮罩：桌面端不显示 */
.btn-burger { display:none; align-items:center; justify-content:center; width:38px; height:38px; margin-left:-6px; border:1px solid var(--border); border-radius:9px; background:var(--bg-surface); color:var(--text-2); cursor:pointer; flex:none; }
.btn-burger:active { background:var(--bg-soft); }
.btn-burger svg { width:19px; height:19px; }
.drawer-mask { position:fixed; inset:0; background:rgba(31,41,55,.45); z-index:19; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .22s, visibility .22s; }
.drawer-mask.show { opacity:1; visibility:visible; pointer-events:auto; }
.mobile-tabbar { display:none; }
.sidebar-close { display:none; }

@media (max-width: 920px) {
  /* --- 骨架：侧边栏变抽屉 --- */
  .sidebar {
    width: 82vw; max-width: 320px;
    transform: translateX(-100%);
    transition: transform .24s ease;
    box-shadow: none;
  }
  .sidebar.open { transform: translateX(0); box-shadow: 0 0 40px rgba(0,0,0,.22); }
  .main { margin-left: 0; }
  .btn-burger { display: flex; }
  .sidebar-close { display:flex; align-items:center; justify-content:center; position:absolute; top:14px; right:12px; width:32px; height:32px; border:none; border-radius:8px; background:var(--bg-soft); color:var(--text-2); font-size:20px; line-height:1; cursor:pointer; }

  /* --- 顶栏更紧凑，标题可省略 --- */
  .topbar { height: 56px; padding: 0 14px; gap: 10px; }
  .logo { height: 56px; padding: 0 14px 0 16px; }
  .topbar h1 { font-size: 15.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .topbar .crumb { font-size: 15.5px; flex: none; }
  .topbar .crumb-link { font-size: 15.5px; max-width: 96px; }
  .topbar .crumb-sep { margin: 0 -2px; }
  .topbar .crumb-cur { flex: 1 1 auto; min-width: 0; }
  .topbar .crumb-leaf { font-size: 13.5px; }
  .content { padding: 16px 14px 84px; }
  .content.is-ai { padding: 12px 12px 78px; }
  .ai-page.in-proj { height:calc(100vh - 202px); min-height:340px; }

  /* --- 底部标签栏 --- */
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 18;
    background: var(--bg-surface); border-top: 1px solid var(--border);
    padding-bottom: env(safe-area-inset-bottom);
    box-shadow: 0 -2px 12px rgba(0,0,0,.06);
  }
  .tabbar-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px 7px; border: none; background: none;
    color: var(--text-3); font-size: 10.5px; font-family: inherit; cursor: pointer;
    min-height: 54px;
  }
  .tabbar-btn svg { width: 21px; height: 21px; }
  .tabbar-btn.active { color: var(--accent-text); }
  .tabbar-btn.active svg { color: var(--accent-text); }
  .tabbar-badge { position:absolute; transform:translate(14px,-8px); min-width:15px; padding:0 4px; height:15px; line-height:15px; border-radius:8px; background:var(--red); color:#fff; font-size:9.5px; font-weight:600; text-align:center; }

  /* --- 卡片/内容通用瘦身 --- */
  .card-head { flex-wrap: wrap; gap: 8px; padding: 14px 15px; }
  .card-head h3 { font-size: 15px; }
  .card-head .cnt { font-size: 11.5px; }
  .hd-prog { margin-left:0; font-size:11.5px; gap:6px; }
  .hd-prog .hp-bar { width:64px; }
  .card-head .head-acts { margin-left: auto; }
  .card-pad { padding: 14px 15px 16px; }
  .home-hero { padding: 20px 18px; border-radius: 12px; }
  .home-hero h2 { font-size: 17px; }
  .proj-grid { grid-template-columns: 1fr; }

  /* --- 触控目标放大（Apple/Google 建议 >=44px） --- */
  .nav-item { padding: 12px 12px; font-size: 14px; }
  .proj-item { padding: 12px 10px; }
  .proj-item.is-sub { padding: 11px 10px 11px 36px; }
  .proj-item.is-sub::before { left: 21px; }
  .nav-sub-empty { padding-left: 36px; }
  .nav-item-new { padding: 12px 12px; font-size: 14px; }
  .page-head { flex-wrap: wrap; }
  .proj-row { padding: 12px 14px; }
  .btn-mini { padding: 9px 14px; font-size: 13px; min-height: 38px; }
  .btn-primary, .btn-ghost, .btn-danger { padding: 12px 18px; font-size: 14px; min-height: 44px; }
  .st-sel, .stage-sel, select { min-height: 40px; font-size: 13.5px; }
  input, textarea, select { font-size: 16px; }  /* >=16px 防 iOS 聚焦自动放大 */
  .desc-input { font-size: 16px; }

  /* --- 悬停才显示的操作按钮：触屏没有 hover，改为常显 --- */
  .task-del, .note-del, .note-act { opacity: 1; }

  /* --- 单据列表：纵向堆叠，避免挤压 --- */
  .item-row { padding: 13px 14px; gap: 9px; }
  .item-meta { flex-wrap: wrap; gap: 6px; }
  .item-list .item-row { align-items: flex-start; }

  /* --- 看板：横向滑动，一屏看多列 --- */
  .board {
    display: flex; gap: 10px;
    overflow-x: auto; scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px; margin: 0 -14px; padding-left: 14px; padding-right: 14px;
  }
  .board > * { flex: 0 0 78vw; max-width: 300px; scroll-snap-align: start; }

  /* --- 弹窗：底部抽屉式，避免键盘遮挡 --- */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: none; width: 100%;
    border-radius: 16px 16px 0 0;
    padding: 22px 18px calc(22px + env(safe-area-inset-bottom));
    max-height: 92vh; overflow-y: auto;
  }
  .modal h3 { font-size: 16px; }
  .modal-actions { gap: 10px; }
  .modal-actions button { flex: 1; }
  .danger-modal { max-width: none; }

  /* --- 图片查看器占满屏 --- */
  .img-viewer, .img-viewer img { max-width: 100vw; max-height: 88vh; }
  .img-box { width: 96px; height: 96px; }

  /* --- 表单行改纵向 --- */
  .item-ctrl { flex-direction: column; align-items: stretch; gap: 12px; }
  .sched-group { gap: 10px; }
  .sched-date { width: 46px; }
  .sched-items { padding-left: 12px; }
  .sched-item { flex-wrap: wrap; gap: 8px; padding: 12px 13px; }
  .sched-time { width: auto; }

  /* --- 数据统计：图表与表格瘦身 --- */
  .trend-wrap { padding: 12px; gap: 14px; }
  .trend-chart { height: 76px; }
  .tc-val { display: none; }
  .stat-cell { min-width: 64px; }
}

/* 更窄屏（多数手机竖屏） */
@media (max-width: 600px) {
  .topbar h1 { font-size: 15px; }
  .home-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-stat { padding: 14px 14px; }
  .home-stat .num { font-size: 21px; }
  .home-stat .lbl { font-size: 11.5px; }
  .board > * { flex: 0 0 84vw; }
  .tabbar-btn { font-size: 10px; }
  .cmt { padding: 12px 14px; gap: 9px; }
  .cmt-editor { padding: 12px 14px 16px; }
  .item-row { flex-wrap: wrap; }
  .trash-tip { margin: 0 14px 4px; }
}

/* 横屏矮屏：弹窗别顶满 */
@media (max-width: 920px) and (max-height: 480px) {
  .modal { max-height: 96vh; padding-top: 16px; }
}


/* ===== 问题反馈 ===== */
/* 左上角入口按钮 */
.btn-feedback { display:flex; align-items:center; gap:4px; margin-left:auto; padding:4px 7px; border:1px solid var(--border); border-radius:7px; background:var(--bg-surface); color:var(--text-2); font-size:11.5px; font-family:inherit; font-weight:500; line-height:1.5; white-space:nowrap; cursor:pointer; transition:all .15s; flex:none; }
.btn-feedback:hover { border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft); }
.btn-feedback svg { width:13px; height:13px; flex:none; }
.btn-feedback .fb-dot { margin-left:2px; }

/* 提交弹窗 */
.modal-fb { max-width: 560px; }
.fb-tip { font-size:12.5px; color:var(--text-3); line-height:1.7; margin-bottom:16px; }
.modal .field label .req { color:var(--red); font-weight:700; }
.modal-fb .desc-input { min-height:130px; }
.fb-imgs-wrap { margin-bottom:18px; }
.fb-imgs-head { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
.fb-imgs-cnt { font-size:11.5px; color:var(--text-3); }

/* 详情 */
.fb-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; font-size:11.5px; color:var(--text-3); margin-bottom:14px; }
.fb-code { padding:2px 8px; border-radius:5px; background:var(--accent-soft); color:var(--accent-text); font-family:ui-monospace,monospace; font-weight:600; }
.fb-detail-body { font-size:13.5px; color:var(--text-1); line-height:1.75; white-space:pre-wrap; word-break:break-word; padding:13px 15px; background:var(--bg-soft); border:1px solid var(--border-soft); border-radius:9px; margin-bottom:12px; max-height:40vh; overflow-y:auto; }
.fb-noimg { font-size:12px; color:var(--text-3); margin-bottom:12px; }

/* 气泡条列表：每条仅两行，超出用省略号且不换行 */
.fb-list { display:flex; flex-direction:column; gap:9px; padding:14px 16px 18px; }
.fb-bubble { display:flex; flex-direction:column; gap:4px; width:100%; padding:12px 15px; border:1px solid transparent; border-radius:11px; text-align:left; font-family:inherit; cursor:pointer; transition:transform .12s, box-shadow .12s, filter .15s; }
.fb-bubble:hover { transform:translateY(-1px); box-shadow:var(--shadow); filter:brightness(.98); }
.fb-l1 { font-size:13.5px; font-weight:700; color:var(--text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fb-l2 { font-size:12.5px; font-weight:400; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* 未读：彩色 */
.fb-bubble.c0 { background:var(--accent-soft); border-color:rgba(13,148,136,.25); }
.fb-bubble.c1 { background:var(--blue-soft); border-color:rgba(37,99,235,.22); }
.fb-bubble.c2 { background:var(--amber-soft); border-color:rgba(217,119,6,.22); }
.fb-bubble.c3 { background:var(--purple-soft); border-color:rgba(147,51,234,.22); }
.fb-bubble.c4 { background:var(--pink-soft); border-color:rgba(219,39,119,.22); }
/* 已读：灰色 */
.fb-bubble.is-read { background:var(--bg-soft); border-color:var(--border-soft); }
.fb-bubble.is-read .fb-l1 { color:var(--text-2); font-weight:600; }
.fb-bubble.is-read .fb-l2 { color:var(--text-3); }

/* 反馈对话：管理员与用户往来消息 */
.fb-thread { display:flex; flex-direction:column; gap:10px; max-height:44vh; overflow-y:auto; padding:4px 2px 2px; margin-bottom:14px; }
.fb-msg { max-width:86%; padding:10px 13px; border-radius:11px; border:1px solid var(--border-soft); background:var(--bg-soft); }
.fb-msg.is-mine { align-self:flex-end; background:var(--accent-soft); border-color:rgba(13,148,136,.25); }
.fb-msg.is-admin { align-self:flex-start; background:var(--blue-soft); border-color:rgba(37,99,235,.22); }
.fb-msg-head { display:flex; align-items:center; gap:7px; flex-wrap:wrap; margin-bottom:5px; }
.fb-msg-who { font-size:12px; font-weight:700; color:var(--text-1); }
.fb-msg-at { font-size:11px; color:var(--text-3); margin-left:auto; }
.fb-badge-admin { font-size:10.5px; font-weight:600; padding:1px 6px; border-radius:4px; background:var(--blue); color:#fff; }
.fb-badge-first { font-size:10.5px; font-weight:600; padding:1px 6px; border-radius:4px; background:var(--bg-surface); border:1px solid var(--border); color:var(--text-3); }
.fb-msg-body { font-size:13px; color:var(--text-1); line-height:1.7; white-space:pre-wrap; word-break:break-word; }
.fb-reply-input { min-height:76px; }
/* 列表上的未读红点与回复计数 */
.fb-dot { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; margin-left:6px; padding:0 4px; border-radius:8px; background:var(--red,#dc2626); color:#fff; font-size:10.5px; font-weight:700; vertical-align:middle; }
.fb-rcnt { margin-left:7px; padding:1px 6px; border-radius:4px; background:var(--bg-surface); border:1px solid var(--border); color:var(--text-3); font-size:10.5px; font-weight:600; }

/* 问题反馈弹窗：左侧历史列表 + 右侧聊天，类似 AI 对话界面 */
.modal-fb2 { position:relative; max-width:960px; width:100%; height:min(680px, 86vh); padding:0; display:flex; overflow:hidden; }
.fb2-x { position:absolute; top:10px; right:14px; z-index:3; width:28px; height:28px; border:none; background:transparent; border-radius:7px; color:var(--text-3); font-size:21px; line-height:1; cursor:pointer; }
.fb2-x:hover { background:var(--bg-soft); color:var(--text-1); }

/* 左栏 */
.fb2-side { width:270px; flex:none; display:flex; flex-direction:column; border-right:1px solid var(--border-soft); background:var(--bg-soft); }
.fb2-side-head { padding:18px 16px 12px; border-bottom:1px solid var(--border-soft); }
.fb2-side-title { display:flex; align-items:center; font-size:14px; font-weight:700; color:var(--text-1); margin-bottom:11px; }
.fb2-new { display:flex; align-items:center; justify-content:center; gap:6px; width:100%; padding:9px 12px; border:1px dashed var(--border); border-radius:9px; background:var(--bg-surface); color:var(--text-2); font-size:12.5px; font-weight:600; font-family:inherit; cursor:pointer; transition:all .15s; }
.fb2-new svg { width:14px; height:14px; flex:none; }
.fb2-new:hover { border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft); }
.fb2-new.is-active { border-style:solid; border-color:var(--accent); background:var(--accent-soft); color:var(--accent-text); }
.fb2-list { flex:1; overflow-y:auto; display:flex; flex-direction:column; gap:8px; padding:12px 12px 16px; }
.fb2-item { display:flex; flex-direction:column; gap:4px; width:100%; padding:10px 12px; border:1px solid transparent; border-radius:10px; text-align:left; font-family:inherit; cursor:pointer; transition:transform .12s, box-shadow .12s, filter .15s; }
.fb2-item:hover { transform:translateY(-1px); box-shadow:var(--shadow); filter:brightness(.98); }
.fb2-item .fb-l1 { font-size:13px; font-weight:700; color:var(--text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fb2-item .fb-l2 { font-size:11.5px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.fb2-item.c0 { background:var(--accent-soft); border-color:rgba(13,148,136,.25); }
.fb2-item.c1 { background:var(--blue-soft); border-color:rgba(37,99,235,.22); }
.fb2-item.c2 { background:var(--amber-soft); border-color:rgba(217,119,6,.22); }
.fb2-item.c3 { background:var(--purple-soft); border-color:rgba(147,51,234,.22); }
.fb2-item.c4 { background:var(--pink-soft); border-color:rgba(219,39,119,.22); }
.fb2-item.is-active { border-color:var(--accent); box-shadow:0 0 0 2px var(--accent-soft); }
.fb2-empty { padding:22px 8px; text-align:center; font-size:12.5px; color:var(--text-3); line-height:1.9; }

/* 右栏 */
.fb2-main { flex:1; min-width:0; display:flex; flex-direction:column; }
.fb2-main-head { padding:18px 22px 13px; border-right:0; border-bottom:1px solid var(--border-soft); padding-right:52px; }
.fb2-title { font-size:15.5px; font-weight:700; color:var(--text-1); line-height:1.5; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fb2-sub { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin-top:5px; font-size:11.5px; color:var(--text-3); line-height:1.7; }
.fb2-body { flex:1; overflow-y:auto; padding:18px 22px; }
.fb2-body .field { margin-bottom:14px; }
.fb2-body .desc-input { min-height:150px; }
.fb2-chat { display:flex; flex-direction:column; gap:11px; background:var(--bg-soft); }
.fb2-chat .fb-msg { max-width:78%; }
.fb2-imgs { align-self:stretch; margin-top:4px; }
.fb2-foot { flex:none; padding:14px 22px 18px; border-top:1px solid var(--border-soft); display:flex; justify-content:flex-end; gap:10px; }
.fb2-compose { align-items:flex-end; }
.fb2-compose .desc-input { flex:1; min-height:62px; max-height:150px; resize:vertical; }
.fb2-compose .btn-primary { flex:none; width:auto; padding:10px 20px; }

@media (max-width: 920px) {
  .modal-fb2 { flex-direction:column; height:88vh; max-width:none; padding:0; overflow:hidden; border-radius:16px 16px 0 0; }
  .modal-fb2 .fb2-foot { padding-bottom:calc(14px + env(safe-area-inset-bottom)); }
  .fb2-side { width:auto; flex:none; max-height:38%; border-right:none; border-bottom:1px solid var(--border-soft); }
  .fb2-side-head { padding:14px 14px 10px; padding-right:48px; }
  .fb2-list { flex-direction:row; overflow-x:auto; overflow-y:hidden; padding:10px 12px 12px; }
  .fb2-item { width:auto; min-width:180px; max-width:220px; flex:none; }
  .fb2-main-head { padding:14px 16px 11px; padding-right:16px; }
  .fb2-body { padding:14px 16px; }
  .fb2-chat .fb-msg { max-width:92%; }
  .fb2-foot { padding:12px 16px 14px; }
}

/* Tab 标题右上角未读角标 */
.tab-title-badge { display:inline-block; position:relative; top:-7px; margin-left:1px; min-width:15px; padding:0 4px; border-radius:8px; background:var(--red); color:#fff; font-size:10px; font-weight:700; line-height:15px; text-align:center; vertical-align:baseline; }

/* Tab 未读角标 */
.tab-badge { display:inline-block; min-width:16px; padding:0 5px; margin-left:2px; border-radius:9px; background:var(--red); color:#fff; font-size:10.5px; font-weight:600; line-height:16px; text-align:center; }

@media (max-width: 920px) {
  .btn-feedback span:not(.fb-dot) { display:none; }
  .btn-feedback { padding:6px; }
  .modal-fb { max-width:none; }
  .fb-list { padding:12px 14px 16px; }
  .fb-detail-body { max-height:34vh; }
  .fb-thread { max-height:38vh; }
  .fb-msg { max-width:94%; }
}

/* ===== AI 额度条（AI 助手页顶部） ===== */
.ai-quota-bar {
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:9px 14px; margin-bottom:12px;
  border:1px solid var(--border); border-radius:var(--radius);
  background:var(--bg-surface); box-shadow:var(--shadow);
  font-size:12.5px; color:var(--text-2);
}
.ai-quota-bar.is-ok { border-color:#cfe9e6; background:linear-gradient(90deg,var(--accent-soft),var(--bg-surface) 60%); }
.ai-quota-bar.is-warn { border-color:#f4dcae; background:linear-gradient(90deg,var(--amber-soft),var(--bg-surface) 60%); }
.ai-quota-bar.is-bad { border-color:#f3c6c6; background:linear-gradient(90deg,var(--red-soft),var(--bg-surface) 60%); }
.ai-quota-bar.is-admin { border-color:#d9cdfa; background:linear-gradient(90deg,var(--purple-soft),var(--bg-surface) 60%); }
.aq-tag {
  flex:0 0 auto; padding:3px 9px; border-radius:20px;
  font-size:11.5px; font-weight:600; letter-spacing:.2px;
  background:var(--bg-soft); color:var(--text-2); border:1px solid var(--border);
}
.is-ok .aq-tag { background:var(--accent); color:#fff; border-color:transparent; }
.is-warn .aq-tag { background:var(--amber); color:#fff; border-color:transparent; }
.is-bad .aq-tag { background:var(--red); color:#fff; border-color:transparent; }
.is-admin .aq-tag { background:var(--purple); color:#fff; border-color:transparent; }
.aq-txt { flex:1 1 auto; min-width:180px; }
.aq-txt b { color:var(--text-1); font-weight:600; }
.aq-meter {
  flex:0 0 120px; height:6px; border-radius:4px; overflow:hidden;
  background:#d6dae1;
}
/* 进度条语义：填充部分 = 未使用（绿），底色 = 已用掉（灰） */
.aq-meter i { display:block; height:100%; background:var(--accent); transition:width .3s; }
.is-warn .aq-meter i { background:var(--amber); }
.is-bad .aq-meter i { background:var(--red); }
.aq-act { flex:0 0 auto; display:flex; align-items:center; gap:6px; }
.aq-input {
  width:190px; padding:5px 9px; font-size:12px; font-family:inherit;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-surface); color:var(--text-1); outline:none;
}
.aq-input:focus { border-color:var(--accent); }
/* 额度条左侧的「添加秘钥」 */
.aq-addkey {
  flex:0 0 auto; margin-right:2px; white-space:nowrap;
  border:1px solid var(--border); border-radius:20px;
  background:var(--bg-surface); color:var(--text-2);
}
.aq-addkey:hover { border-color:var(--accent); color:var(--accent); }
.topbar .in-topbar .aq-addkey { padding:4px 10px; font-size:11.5px; }

/* 额度绿块的套餐气泡：悬停/聚焦时展开 */
.aq-tag.has-pop { position:relative; cursor:default; outline:none; }
.aq-pop {
  position:absolute; top:calc(100% + 8px); left:0; z-index:60;
  min-width:250px; padding:9px 11px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-surface); box-shadow:0 6px 20px rgba(15,23,42,.14);
  color:var(--text-2); font-size:12px; font-weight:400; letter-spacing:0;
  opacity:0; visibility:hidden; transform:translateY(-3px);
  transition:opacity .16s, transform .16s, visibility .16s;
  pointer-events:none; text-align:left; white-space:nowrap;
}
.aq-pop::before {
  content:''; position:absolute; top:-5px; left:16px;
  width:8px; height:8px; background:var(--bg-surface);
  border-left:1px solid var(--border); border-top:1px solid var(--border);
  transform:rotate(45deg);
}
.aq-tag.has-pop:hover .aq-pop,
.aq-tag.has-pop:focus-visible .aq-pop {
  opacity:1; visibility:visible; transform:translateY(0);
}
/* 气泡首行的「已激活」胶囊标签 */
.aqp-head { padding:0 0 6px; margin-bottom:5px; border-bottom:1px solid var(--border-soft); }
.aqp-badge {
  display:inline-block; padding:2px 8px; border-radius:10px;
  background:var(--accent-soft); color:var(--accent);
  font-size:10.5px; font-weight:600; letter-spacing:.3px;
}
.aqp-row { display:flex; align-items:center; gap:7px; padding:3px 0; }
.aqp-name { flex:0 0 auto; color:var(--text-1); font-weight:600; }
.aqp-date { flex:0 0 auto; color:var(--text-2); }
.aqp-left { flex:0 0 auto; margin-left:auto; color:var(--text-1); font-weight:600; }
.aqp-meter {
  flex:0 0 68px; height:5px; border-radius:4px; overflow:hidden;
  background:#d6dae1;
}
.aqp-meter i { display:block; height:100%; background:var(--accent); transition:width .3s; }
.aqp-meter.is-warn i { background:var(--amber); }
.aqp-meter.is-bad i { background:var(--red); }
/* 顶栏靠右时气泡不超出可视区 */
.topbar .in-topbar .aq-pop { left:0; right:auto; }

.aq-hist { margin-top:12px; border-top:1px solid var(--border-soft); padding-top:10px; }
.aq-hist-row { display:flex; align-items:center; gap:8px; padding:5px 0; font-size:12.5px; }
.aq-hist-tx { flex:1; color:var(--text-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.aq-hist-af { color:var(--green); font-weight:600; font-size:12px; }

/* 顶栏内嵌变体：跟在面包屑右侧，仅 AI 助手页出现 */
.topbar .ai-quota-bar.in-topbar {
  flex:0 1 auto; min-width:0; max-width:min(62%, 780px);
  margin:0 0 0 auto; padding:6px 12px; gap:8px;
  flex-wrap:nowrap; box-shadow:none; font-size:12px;
}
.topbar .ai-quota-bar.in-topbar .aq-txt {
  min-width:0; flex:0 1 auto;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.topbar .ai-quota-bar.in-topbar .aq-meter { flex:0 0 84px; }
.topbar .ai-quota-bar.in-topbar .aq-input { width:172px; }
.topbar.has-quota .spacer { margin-left:0; }

/* 工具调用中的提示气泡 */
.ai-tool-tip {
  display:inline-flex; align-items:center; gap:7px;
  font-size:13px; color:var(--text-2); font-style:normal;
}
.ai-tool-tip::before {
  content:''; width:11px; height:11px; border-radius:50%;
  border:2px solid var(--accent); border-top-color:transparent;
  animation:aq-spin .7s linear infinite;
}
@keyframes aq-spin { to { transform:rotate(360deg); } }

/* AI 写操作确认卡：未选方案并点确认前不会落库 */
.ai-op-card {
  margin:10px 0 4px; padding:14px 16px;
  background:var(--bg-surface); border:1px solid var(--accent);
  border-left:3px solid var(--accent);
  border-radius:var(--radius); box-shadow:var(--shadow);
}
.ai-op-card.is-danger { border-color:var(--red); border-left-color:var(--red); }
.ai-op-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; }
.ai-op-tag {
  padding:2px 9px; border-radius:999px; font-size:12px; font-weight:600;
  background:var(--accent-soft); color:var(--accent-text);
}
.ai-op-card.is-danger .ai-op-tag { background:var(--red-soft); color:var(--red); }
.ai-op-proj { font-size:12.5px; color:var(--text-3); }
.ai-op-desc { font-size:14px; color:var(--text-1); line-height:1.6; }
.ai-op-body {
  margin-top:8px; padding:9px 11px; border-radius:var(--radius-sm);
  background:var(--bg-soft); font-size:13px; color:var(--text-2); line-height:1.65;
  max-height:220px; overflow:auto;
}
.ai-op-opts { display:flex; flex-direction:column; gap:6px; margin:11px 0 9px; }
.ai-op-opt {
  display:flex; align-items:center; gap:8px; cursor:pointer;
  padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius-sm);
  font-size:13px; color:var(--text-1); transition:border-color .15s, background .15s;
}
.ai-op-opt:hover { border-color:var(--accent); }
.ai-op-opt.active { border-color:var(--accent); background:var(--accent-soft); }
.ai-op-note {
  width:100%; padding:8px 10px; font:inherit; font-size:13px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-soft); color:var(--text-1); resize:vertical;
}
.ai-op-note:focus { outline:none; border-color:var(--accent); }
.ai-op-acts { display:flex; justify-content:flex-end; gap:8px; margin-top:10px; }
.ai-op-tip { margin-top:7px; font-size:12px; color:var(--text-3); text-align:right; }
/* 输入框工具条：写操作确认模式三档选择（自定义下拉，深色主题下也统一） */
.ai-mode { position:relative; flex:0 0 auto; }
.ai-mode-btn {
  display:inline-flex; align-items:center; gap:6px;
  height:26px; padding:0 8px; border-radius:20px;
  border:1px solid var(--border); background:var(--bg-surface);
  color:var(--text-2); font-size:12px; line-height:1; cursor:pointer;
  transition:border-color .15s, color .15s, background .15s;
}
.ai-mode-btn:hover { border-color:var(--accent); color:var(--text-1); }
.ai-mode-btn svg { opacity:.55; transition:transform .16s; }
.ai-mode.is-open .ai-mode-btn { border-color:var(--accent); color:var(--text-1); }
.ai-mode.is-open .ai-mode-btn svg { transform:rotate(180deg); }
.ai-mode-dot { width:6px; height:6px; border-radius:50%; background:var(--text-3); flex:0 0 auto; }
.ai-mode-btn.is-auto .ai-mode-dot, .ai-mode-item.is-auto .ai-mode-dot { background:var(--blue); }
.ai-mode-btn.is-trust .ai-mode-dot, .ai-mode-item.is-trust .ai-mode-dot { background:var(--amber); }
.ai-mode-btn.is-auto { color:var(--blue); border-color:color-mix(in srgb, var(--blue) 45%, var(--border)); }
.ai-mode-btn.is-trust { color:var(--amber); border-color:color-mix(in srgb, var(--amber) 45%, var(--border)); }

.ai-mode-pop {
  position:absolute; bottom:calc(100% + 8px); left:0; z-index:60;
  min-width:214px; padding:5px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-surface); box-shadow:var(--shadow-lg);
  animation:aiModeIn .14s ease-out;
}
@keyframes aiModeIn { from { opacity:0; transform:translateY(4px); } to { opacity:1; transform:none; } }
.ai-mode-item {
  display:flex; align-items:flex-start; gap:8px; width:100%;
  padding:7px 9px; border:0; border-radius:7px;
  background:transparent; color:var(--text-2); text-align:left; cursor:pointer;
  transition:background .13s;
}
.ai-mode-item + .ai-mode-item { margin-top:1px; }
.ai-mode-item:hover { background:var(--bg-soft); }
.ai-mode-item .ai-mode-dot { margin-top:5px; }
.ai-mode-txt { display:flex; flex-direction:column; gap:2px; min-width:0; }
.ai-mode-txt b { font-size:12.5px; font-weight:600; color:var(--text-1); }
.ai-mode-txt em { font-size:11px; font-style:normal; color:var(--text-3); line-height:1.45; }
.ai-mode-item.active { background:var(--accent-soft); }
.ai-mode-item.active .ai-mode-txt b { color:var(--accent); }

/* 后台 AI 任务提示条：切到其他作用域时提醒任务仍在跑 */
.ai-bg-bar { display:flex; align-items:center; gap:8px; margin:0 0 8px; padding:8px 12px;
  border:1px solid var(--accent); border-radius:10px; background:var(--accent-weak,rgba(13,148,136,.08));
  font-size:13px; color:var(--text-1); }
.ai-bg-dot { flex:none; width:8px; height:8px; border-radius:50%; background:var(--accent);
  animation:aiBgPulse 1.2s ease-in-out infinite; }
@keyframes aiBgPulse { 0%,100% { opacity:1; transform:scale(1); } 50% { opacity:.35; transform:scale(.7); } }
.ai-bg-bar > span:nth-child(2) { flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-bg-go { flex:none; padding:4px 10px; border:1px solid var(--accent); border-radius:7px;
  background:transparent; color:var(--accent); font-size:12px; cursor:pointer; }
.ai-bg-go:hover { background:var(--accent); color:#fff; }

/* ===== AI 管理页 ===== */
.aim-alert {
  padding:10px 14px; margin-bottom:12px; border-radius:var(--radius);
  font-size:12.5px; line-height:1.6; border:1px solid var(--border);
  background:var(--bg-surface);
}
.aim-alert.is-ok { border-color:#bfe3d8; background:var(--green-soft); color:#14663c; }
.aim-alert.is-warn { border-color:#f4dcae; background:var(--amber-soft); color:#8a5406; }
.aim-alert.is-bad { border-color:#f3c6c6; background:var(--red-soft); color:#a01c1c; }

.aim-form { padding:4px 0 6px; }
.aim-row {
  display:flex; align-items:center; gap:12px;
  padding:9px 2px; border-bottom:1px solid var(--border-soft);
}
.aim-row:last-child { border-bottom:none; }
.aim-lbl { flex:0 0 92px; font-size:13px; color:var(--text-1); font-weight:500; }
.aim-in {
  flex:1 1 auto; min-width:0; padding:7px 10px; font-size:13px; font-family:inherit;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-surface); color:var(--text-1); outline:none;
}
.aim-in:focus { border-color:var(--accent); }
.aim-in.sm { flex:0 0 130px; }
.aim-tip { flex:1 1 200px; font-size:11.5px; color:var(--text-3); line-height:1.5; }

/* 开关 */
.switch { position:relative; display:inline-block; width:40px; height:22px; flex:0 0 auto; cursor:pointer; }
.switch input { opacity:0; width:0; height:0; position:absolute; }
.switch span {
  position:absolute; inset:0; border-radius:22px;
  background:var(--border); transition:background .2s;
}
.switch span::before {
  content:''; position:absolute; left:3px; top:3px;
  width:16px; height:16px; border-radius:50%;
  background:#fff; transition:transform .2s; box-shadow:0 1px 3px rgba(0,0,0,.2);
}
.switch input:checked + span { background:var(--accent); }
.switch input:checked + span::before { transform:translateX(18px); }

/* 抵扣系数覆盖 */
.aim-fac { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:8px 16px; padding:4px 0; }
.aim-fac-row { display:flex; align-items:center; gap:8px; padding:5px 0; }
.aim-fac-n { flex:1 1 auto; font-size:12.5px; color:var(--text-1); font-family:ui-monospace,SFMono-Regular,Menlo,monospace; }
.aim-fac-d { flex:0 0 auto; font-size:11.5px; color:var(--text-3); }
.aim-fac-i {
  flex:0 0 78px; padding:5px 8px; font-size:12px; font-family:inherit;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg-surface); color:var(--text-1); outline:none;
}
.aim-fac-i:focus { border-color:var(--accent); }

.aim-actions { display:flex; justify-content:flex-end; gap:10px; margin:4px 0 20px; }

/* 激活码 */
.aim-code {
  padding:2px 7px; border-radius:5px; cursor:pointer;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:12.5px;
  background:var(--bg-soft); border:1px solid var(--border); color:var(--text-1);
  transition:background .15s;
}
.aim-code:hover { background:var(--accent-soft); border-color:var(--accent); }
.aim-newcodes { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.aim-quota { font-size:11.5px; color:var(--text-3); font-weight:400; margin-left:4px; }

/* KPI 卡片 */
.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:12px; }
.kpi { text-align:center; padding:12px 8px; border-radius:var(--radius-sm); background:var(--bg-soft); }
.kpi-v { font-size:19px; font-weight:600; color:var(--text-1); line-height:1.3; }
.kpi-l { font-size:11.5px; color:var(--text-3); margin-top:4px; }

/* 小号弹窗与内联勾选 */
.modal.sm { max-width:420px; }
label.inline { display:flex; align-items:center; gap:7px; font-size:13px; cursor:pointer; }
label.inline input { width:auto; margin:0; }
.btn-ghost.danger { color:var(--red); border-color:#f3c6c6; }
.btn-ghost.danger:hover { background:var(--red-soft); }

@media (max-width: 720px) {
  .ai-quota-bar { padding:8px 11px; gap:7px; font-size:12px; }
  .topbar.has-quota { height:auto; flex-wrap:wrap; padding-bottom:9px; row-gap:8px; }
  .topbar .ai-quota-bar.in-topbar {
    flex:1 1 100%; max-width:none; order:9; margin:0; flex-wrap:wrap;
  }
  .topbar .ai-quota-bar.in-topbar .aq-txt { flex:1 1 100%; white-space:normal; }
  .topbar .ai-quota-bar.in-topbar .aq-meter { flex:1 1 auto; }
  .topbar .ai-quota-bar.in-topbar .aq-input { flex:1 1 auto; width:auto; }
  .aq-txt { min-width:100%; order:3; }
  .aq-meter { flex:1 1 auto; order:4; }
  .aq-act { order:5; width:100%; }
  .aq-input { flex:1 1 auto; width:auto; }
  .aim-row { flex-wrap:wrap; gap:7px 10px; }
  .aim-lbl { flex:0 0 76px; }
  .aim-in, .aim-in.sm { flex:1 1 140px; }
  .aim-tip { flex:1 1 100%; order:9; }
  .aim-fac { grid-template-columns:1fr; }
  .aim-actions { justify-content:stretch; }
  .aim-actions button { flex:1; }
}

/* ===== 深色主题：整套变量覆盖 + 少量硬编码修正 ===== */
html[data-theme="dark"] {
  --bg-page: #14181e;
  --bg-surface: #1d222a;
  --bg-soft: #242a33;
  --border: #333b46;
  --border-soft: #2b323c;
  --text-1: #e6e9ee;
  --text-2: #9aa4b2;
  --text-3: #717b88;
  --accent: #14b8a6;
  --accent-soft: #123531;
  --accent-text: #5eead4;
  --blue: #60a5fa;
  --blue-soft: #16253c;
  --amber: #fbbf24;
  --amber-soft: #332810;
  --red: #f87171;
  --red-soft: #3a1e1e;
  --purple: #a78bfa;
  --purple-soft: #281f3e;
  --pink: #f472b6;
  --pink-soft: #3a1d2d;
  --green: #4ade80;
  --green-soft: #123021;
  --shadow: 0 1px 3px rgba(0,0,0,.45), 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 10px 30px rgba(0,0,0,.55);
  color-scheme: dark;
}
html[data-theme="dark"] .auth-wrap { background: linear-gradient(135deg, #10201f 0%, #141c2c 100%); }
html[data-theme="dark"] .home-hero { background: linear-gradient(135deg, #0f5f58, #0b5f70); }
html[data-theme="dark"] .toast { background: #e6e9ee; color: #1a1f27; }
html[data-theme="dark"] .modal-mask { background: rgba(0,0,0,.62); }
html[data-theme="dark"] .nav-badge,
html[data-theme="dark"] .nav-item.active .nav-badge { background: #333b46; color: #cbd5e1; }
html[data-theme="dark"] .btn-new:hover,
html[data-theme="dark"] .nav-item-new:hover { background: #1a4a45; }
html[data-theme="dark"] .btn-danger { background: #b91c1c; color: #fff; }
html[data-theme="dark"] .btn-danger:hover { background: #991b1b; }
html[data-theme="dark"] .danger-alert { color: #fca5a5; }
html[data-theme="dark"] .danger-alert.strong { background: #3f1d1d; }
html[data-theme="dark"] .slide-hint { color: #fca5a5; }
html[data-theme="dark"] .note-del:hover,
html[data-theme="dark"] .note-act:hover { background: rgba(255,255,255,.09); }
html[data-theme="dark"] .ai-send:disabled .ai-send-spin { border-color: rgba(255,255,255,.16); }
html[data-theme="dark"] .ai-send.is-stop:hover:not(:disabled) { background: #0b0e12; }
html[data-theme="dark"] .ai-quota-bar.is-ok { border-color: #1d5049; }
html[data-theme="dark"] .ai-quota-bar.is-warn { border-color: #5c4715; }
html[data-theme="dark"] .ai-quota-bar.is-bad { border-color: #5c2626; }
html[data-theme="dark"] .vs-btn.active { box-shadow: 0 1px 2px rgba(0,0,0,.5); }
html[data-theme="dark"] img { filter: brightness(.94); }

/* 主题开关（侧欄底部，退出登录左侧） */
.btn-theme { margin-left:auto; width:30px; height:30px; border-radius:6px; border:1px solid var(--border); background:var(--bg-surface); display:flex; align-items:center; justify-content:center; flex-shrink:0; transition:background .12s, border-color .12s; }
.btn-theme:hover { background:var(--bg-soft); border-color:var(--accent); }
.btn-theme svg { width:16px; height:16px; color:var(--text-2); }
.btn-theme:hover svg { color:var(--accent-text); }
.btn-logout { margin-left:6px; }


/* ===== 项目标签栏编辑 ===== */
.tab-wrap { position:relative; display:inline-flex; align-items:center; }
.tab-wrap.editing { cursor:grab; }
.tab-wrap.editing .tab-btn { pointer-events:none; }
.tab-wrap.dragging { opacity:.4; }
.tab-wrap.drop-to::before { content:''; position:absolute; left:-1px; top:6px; bottom:6px; width:2px; background:var(--accent); border-radius:2px; }
.tab-badge { position:absolute; top:1px; right:-2px; width:17px; height:17px; border-radius:50%; border:none; display:flex; align-items:center; justify-content:center; font-size:13px; line-height:1; font-weight:700; cursor:pointer; padding:0; z-index:2; box-shadow:0 1px 3px rgba(0,0,0,.16); }
.tab-badge.minus { background:var(--red); color:#fff; }
.tab-badge.plus { background:var(--accent); color:#fff; }
.tab-badge:hover { filter:brightness(1.1); transform:scale(1.12); }
.tab-btn.tab-edit { color:var(--text-3); }
.tab-btn.tab-edit:hover { color:var(--accent-text); }
.tab-btn.tab-edit.on { color:var(--accent-text); font-weight:600; }
.tabs-bar.editing { padding-top:6px; }

.tab-pool { border:1px dashed var(--border); border-radius:var(--radius); padding:12px 14px; margin:-10px 0 20px; background:var(--bg-soft); }
.tab-pool .tp-head { display:flex; flex-direction:column; gap:3px; margin-bottom:10px; }
.tab-pool .tp-t { font-size:12.5px; font-weight:600; color:var(--text-1); }
.tab-pool .tp-d { font-size:11.5px; color:var(--text-3); line-height:1.6; }
.tab-pool .tp-list { display:flex; flex-wrap:wrap; gap:12px 16px; }
.tab-pool .tp-empty { font-size:12px; color:var(--text-3); }
.tab-chip { position:relative; display:inline-flex; align-items:center; background:var(--bg-surface); border:1px solid var(--border); border-radius:var(--radius-sm); padding:6px 12px; }
.tab-chip .tc-nm { font-size:12.5px; color:var(--text-2); }
.tab-chip .tab-badge { top:-6px; right:-6px; }

.tab-soon { display:flex; flex-direction:column; align-items:center; text-align:center; gap:10px; padding:44px 24px 50px; }
.tab-soon .ts-ico { width:46px; height:46px; border-radius:50%; background:var(--accent-soft); display:flex; align-items:center; justify-content:center; }
.tab-soon .ts-ico svg { width:24px; height:24px; color:var(--accent-text); }
.tab-soon .ts-t { font-size:14.5px; font-weight:600; color:var(--text-1); }
.tab-soon .ts-d { font-size:12.5px; color:var(--text-3); line-height:1.8; max-width:420px; }

/* 设置子页面包屑返回 */
.sub-head { display:flex; align-items:center; gap:10px; margin-bottom:14px; }
.sub-back { background:var(--card); border:1px solid var(--border-soft); border-radius:7px; padding:5px 11px; font-size:12.5px; color:var(--text-3); cursor:pointer; }
.sub-back:hover { color:var(--accent-text); border-color:var(--accent-text); }
.sub-head .sub-t { font-size:13.5px; font-weight:600; }
.setting-row .val .btn-mini { font-size:12.5px; }
/* 内联编辑：点文本进入编辑态 */
.val.inline-edit { display:inline-flex; align-items:center; gap:6px; cursor:pointer; border-radius:6px; padding:3px 7px; margin:-3px -7px; transition:background .15s,color .15s; }
.val.inline-edit:hover { background:var(--hover); color:var(--accent-text); }
.val.inline-edit .ie-pen { width:13px; height:13px; opacity:0; transition:opacity .15s; flex:0 0 auto; }
.val.inline-edit:hover .ie-pen { opacity:.75; }
.val.inline-editing { display:inline-flex; align-items:center; gap:8px; }
.val.inline-editing input { width:190px; padding:5px 9px; font-size:13px; border:1px solid var(--accent-text); border-radius:7px; background:var(--card); color:var(--text-1); outline:none; }
.btn-mini.primary { background:var(--accent-text); border-color:var(--accent-text); color:#fff; }
.btn-mini.primary:hover { filter:brightness(1.08); }
@media (max-width:700px) {
  .val.inline-editing { flex-wrap:wrap; justify-content:flex-end; }
  .val.inline-editing input { width:150px; }
}

/* ===== Markdown 正文渲染 ===== */
.md-body { white-space: normal; }
.md-body > *:first-child { margin-top: 0; }
.md-body > *:last-child { margin-bottom: 0; }
.md-p { margin: 0 0 8px; line-height: 1.75; word-break: break-word; }
.md-h { margin: 14px 0 7px; line-height: 1.45; font-weight: 700; color: var(--text-1); word-break: break-word; }
.md-h1 { font-size: 1.32em; padding-bottom: 5px; border-bottom: 1px solid var(--border-soft); }
.md-h2 { font-size: 1.2em; padding-bottom: 4px; border-bottom: 1px solid var(--border-soft); }
.md-h3 { font-size: 1.1em; }
.md-h4 { font-size: 1.02em; }
.md-h5, .md-h6 { font-size: 1em; color: var(--text-2); }
.md-ul, .md-ol { margin: 0 0 8px; padding-left: 1.5em; }
.md-ul { list-style: disc; }
.md-ol { list-style: decimal; }
.md-ul .md-ul { list-style: circle; }
.md-ul .md-ul .md-ul { list-style: square; }
.md-li { margin: 2px 0; line-height: 1.7; word-break: break-word; }
.md-li > .md-ul, .md-li > .md-ol { margin: 3px 0 0; }
.md-li.has-task { list-style: none; margin-left: -1.25em; }
.md-task {
  display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px;
  border: 1.5px solid var(--text-3); border-radius: 3px; box-sizing: border-box;
}
.md-task.done { background: var(--accent); border-color: var(--accent); position: relative; }
.md-task.done::after {
  content: ''; position: absolute; left: 2.5px; top: 0.5px; width: 4px; height: 7px;
  border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg);
}
.md-code {
  padding: 1.5px 5px; border-radius: 4px; background: var(--bg-soft); border: 1px solid var(--border-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .89em; word-break: break-all;
}
.md-pre-wrap {
  position: relative; margin: 8px 0; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-soft); overflow: hidden;
}
.md-pre-lang {
  padding: 4px 11px; font-size: 11px; font-weight: 600; color: var(--text-3);
  background: var(--bg-surface); border-bottom: 1px solid var(--border-soft); letter-spacing: .3px;
}
.md-pre {
  margin: 0; padding: 10px 12px; overflow-x: auto; white-space: pre;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6;
  color: var(--text-1);
}
.md-pre code { font: inherit; background: none; border: none; padding: 0; }
.md-quote {
  margin: 8px 0; padding: 2px 0 2px 11px; border-left: 3px solid var(--border);
  color: var(--text-2);
}
.md-hr { margin: 12px 0; border: none; border-top: 1px solid var(--border); }
.md-link { color: var(--accent); text-decoration: none; }
.md-link:hover { text-decoration: underline; }
.md-img { max-width: 100%; border-radius: 6px; margin: 4px 0; }
.md-table-wrap { margin: 8px 0; overflow-x: auto; }
.md-table { border-collapse: collapse; font-size: .95em; }
.md-table th, .md-table td { padding: 5px 10px; border: 1px solid var(--border); text-align: left; }
.md-table th { background: var(--bg-soft); font-weight: 600; }
.desc-text .md-body, .cmt-body .md-body, .ai-bubble .md-body,
.fb-msg-body .md-body, .ai-op-body .md-body { white-space: normal; }
.ai-msg.is-me .ai-bubble .md-code,
.ai-msg.is-me .ai-bubble .md-pre-wrap { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.24); }
.ai-msg.is-me .ai-bubble .md-pre-lang { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: rgba(255,255,255,.8); }
.ai-msg.is-me .ai-bubble .md-pre, .ai-msg.is-me .ai-bubble .md-code { color: #fff; }
.ai-msg.is-me .ai-bubble .md-link { color: #fff; text-decoration: underline; }
.ai-msg.is-me .ai-bubble .md-h1, .ai-msg.is-me .ai-bubble .md-h2 { border-bottom-color: rgba(255,255,255,.28); }
.ai-msg.is-me .ai-bubble .md-quote { border-left-color: rgba(255,255,255,.4); color: rgba(255,255,255,.9); }
.ai-msg.is-me .ai-bubble .md-h5, .ai-msg.is-me .ai-bubble .md-h6 { color: rgba(255,255,255,.85); }
.ai-msg.is-me .ai-bubble .md-table th, .ai-msg.is-me .ai-bubble .md-table td { border-color: rgba(255,255,255,.28); }
.ai-msg.is-me .ai-bubble .md-table th { background: rgba(255,255,255,.12); }

/* ===== 复制按钮（代码块 / 消息气泡） ===== */
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; padding: 0;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-3);
  cursor: pointer; transition: color .15s, background .15s, border-color .15s, opacity .15s;
}
.cp-btn:hover { color: var(--text-1); background: var(--bg-soft); border-color: var(--border-soft); }
.cp-btn .cp-i { width: 14px; height: 14px; }
.cp-btn .cp-i-ok { display: none; }
.cp-btn.is-done { color: var(--green, #16a34a); }
.cp-btn.is-done .cp-i-copy { display: none; }
.cp-btn.is-done .cp-i-ok { display: block; }

.md-pre-wrap { position: relative; }
.md-pre-wrap > .md-copy {
  position: absolute; top: 5px; right: 5px; z-index: 2;
  opacity: 0; background: var(--bg-1); border-color: var(--border-soft);
}
.md-pre-wrap:hover > .md-copy, .md-pre-wrap > .md-copy.is-done { opacity: 1; }

.ai-msg-foot { display: flex; align-items: center; gap: 4px; padding: 0 2px; min-height: 20px; }
.ai-msg.is-me .ai-msg-foot { justify-content: flex-end; }
.ai-msg-at { font-size: 11px; color: var(--text-3); }
.ai-msg-foot .ai-copy { opacity: 0; }
.ai-msg:hover .ai-msg-foot .ai-copy, .ai-msg-foot .ai-copy.is-done { opacity: 1; }

.ai-msg.is-me .ai-bubble .md-pre-wrap > .md-copy {
  background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.28); color: #fff;
}
.ai-msg.is-me .ai-bubble .md-pre-wrap > .md-copy:hover { background: rgba(255,255,255,.3); }

/* ===== 图片查看器（独立图层，盖在弹窗之上） ===== */
.imgv-mask {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(12,16,22,.86);
  display: flex; align-items: center; justify-content: center;
  padding: 56px 24px 24px;
}
.imgv-stage { max-width: 100%; max-height: 100%; overflow: auto; display: flex; align-items: center; justify-content: center; }
.imgv-img { max-width: 92vw; max-height: 84vh; border-radius: 10px; display: block; cursor: zoom-in; background: #fff; }
.imgv-img.is-zoom { max-width: none; max-height: none; cursor: zoom-out; border-radius: 0; }
.imgv-bar { position: absolute; top: 14px; right: 18px; display: flex; align-items: center; gap: 8px; }
.imgv-btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.24); background: rgba(255,255,255,.12);
  color: #f3f5f8; font-size: 12.5px; line-height: 1;
}
.imgv-btn:hover { background: rgba(255,255,255,.22); }
.imgv-btn:disabled { cursor: default; opacity: .75; }
.imgv-btn .cp-i { width: 14px; height: 14px; }
.imgv-btn .cp-i-ok { display: none; }
.imgv-btn.is-done { color: #86efac; border-color: rgba(134,239,172,.5); }
.imgv-btn.is-done .cp-i-copy { display: none; }
.imgv-btn.is-done .cp-i-ok { display: block; }
.imgv-btn.imgv-x { padding: 0; width: 32px; justify-content: center; font-size: 19px; }
@media (max-width: 720px) {
  .imgv-mask { padding: 52px 8px 8px; }
  .imgv-img { max-width: 100vw; max-height: 80vh; }
  .imgv-bar { top: 10px; right: 10px; }
}

/* AI 操作卡：同一轮多步时的进度徐标 */
.ai-op-seq{
  margin-left:auto; flex:none;
  font-size:12px; line-height:18px; padding:0 8px;
  border-radius:9px; color:var(--muted);
  background:var(--bg2); border:1px solid var(--line);
}
/* ===== 项目仪表盘 ===== */
.dash-wrap { display:flex; flex-direction:column; gap:14px; padding:16px 20px 20px; }
.dash-kpis { display:grid; grid-template-columns:repeat(6,1fr); gap:10px; }
.dash-kpi { border:1px solid var(--border-soft); border-radius:10px; background:var(--bg-soft); padding:12px 13px; }
.dash-kpi .dk-v { font-size:22px; font-weight:600; line-height:1.2; }
.dash-kpi .dk-l { font-size:12.5px; color:var(--text-2); margin-top:3px; }
.dash-kpi .dk-s { font-size:11px; color:var(--text-3); margin-top:2px; }
.dash-card { border:1px solid var(--border-soft); border-radius:10px; background:var(--bg-soft); padding:14px 16px; }
.dash-ch { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:12px; }
.dash-ch .dc-t { font-size:13px; font-weight:600; }
.dash-ch .dc-s { font-size:11.5px; color:var(--text-3); }
.dash-sub { font-size:11.5px; color:var(--text-3); margin:10px 0 6px; }
.dash-sub:first-of-type { margin-top:0; }
.dash-grid { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.dash-empty, .ds-empty { font-size:12px; color:var(--text-3); padding:6px 0; }
/* 状态分布堆叠条 */
.dash-srow + .dash-srow { margin-top:14px; }
.ds-hd { display:flex; align-items:baseline; justify-content:space-between; margin-bottom:6px; }
.ds-hd .ds-nm { font-size:12.5px; font-weight:500; }
.ds-hd .ds-tot { font-size:11.5px; color:var(--text-3); }
.ds-bar { display:flex; height:8px; border-radius:4px; overflow:hidden; background:var(--border); }
.ds-bar i { display:block; height:100%; }
.ds-nums { display:flex; flex-wrap:wrap; gap:12px; margin-top:7px; font-size:11.5px; color:var(--text-2); }
.ds-nums .dsn { display:inline-flex; align-items:center; gap:5px; }
.ds-nums .dsn b { width:7px; height:7px; border-radius:2px; display:inline-block; }
/* 30 天趋势 */
.dt-chart { display:flex; align-items:flex-end; gap:3px; height:92px; }
.dt-chart .dt-col { flex:1; height:100%; display:flex; align-items:flex-end; }
.dt-chart .dt-col i { display:block; width:100%; border-radius:2px 2px 0 0; background:var(--accent); min-height:0; }
.dt-axis { display:flex; justify-content:space-between; margin-top:6px; font-size:11px; color:var(--text-3); }
/* 横向条形榜 */
.dash-bars { display:flex; flex-direction:column; gap:8px; }
.db-row { display:grid; grid-template-columns:118px 1fr 30px; align-items:center; gap:10px; }
.db-nm { display:flex; align-items:center; gap:6px; font-size:12px; color:var(--text-2); overflow:hidden; }
.db-nm .db-tx { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.db-nm .db-tx.dim { color:var(--text-3); }
.db-track { height:7px; border-radius:4px; background:var(--border); overflow:hidden; }
.db-track i { display:block; height:100%; border-radius:4px; }
.db-v { font-size:12px; color:var(--text-2); text-align:right; }
/* 停滞单据 */
.dash-stale { display:flex; flex-direction:column; }
.dst-row { display:flex; align-items:center; gap:8px; padding:8px 0; border-top:1px solid var(--border-soft); }
.dst-row:first-child { border-top:none; padding-top:0; }
.dst-t { flex:1; font-size:13px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.dst-d { font-size:11.5px; color:var(--text-3); white-space:nowrap; }
/* 空态 */
.dash-blank { padding:44px 24px; text-align:center; }
.dash-blank-t { font-size:14px; font-weight:600; margin-bottom:6px; }
.dash-blank-d { font-size:12.5px; color:var(--text-3); max-width:420px; margin:0 auto; line-height:1.7; }
@media (max-width: 1180px) {
  .dash-kpis { grid-template-columns:repeat(3,1fr); }
}
@media (max-width: 920px) {
  .dash-wrap { padding:12px 15px 16px; gap:12px; }
  .dash-kpis { grid-template-columns:repeat(2,1fr); }
  .dash-grid { grid-template-columns:1fr; }
  .db-row { grid-template-columns:92px 1fr 28px; }
}
/* ===== 项目 Wiki ===== */
.wk-card { padding: 0; overflow: hidden; }
.wk-wrap { display: grid; grid-template-columns: 248px 1fr; min-height: 520px; }
.wk-side {
  border-right: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 12px 10px;
  display: flex; flex-direction: column; gap: 8px;
  min-width: 0;
}
.wk-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wk-side-t { font-size: 13px; font-weight: 700; color: var(--text-1); letter-spacing: .3px; }
.wk-search {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-1);
  border-radius: 7px; padding: 6px 9px; font-size: 12.5px; outline: none;
}
.wk-search:focus { border-color: var(--accent); }
.wk-tree { overflow: auto; max-height: 620px; margin: 0 -4px; padding: 0 4px; }
.wk-node { min-width: 0; }
.wk-row {
  display: flex; align-items: center; gap: 2px;
  border-radius: 7px; min-width: 0;
}
.wk-row:hover { background: var(--bg-page); }
.wk-row.active { background: var(--accent-soft); }
.wk-caret {
  flex: 0 0 16px; width: 16px; height: 24px;
  border: 0; background: none; cursor: pointer;
  color: var(--text-3); font-size: 10px; line-height: 1;
  transition: transform .15s;
}
.wk-caret.open { transform: rotate(90deg); }
.wk-caret.ph { cursor: default; }
.wk-name {
  flex: 1 1 auto; min-width: 0;
  display: flex; align-items: center; gap: 6px;
  border: 0; background: none; cursor: pointer;
  padding: 5px 2px; text-align: left;
  font-size: 12.8px; color: var(--text-2);
}
.wk-row.active .wk-name { color: var(--accent); font-weight: 600; }
.wk-ico { flex: 0 0 14px; display: inline-flex; color: var(--text-3); }
.wk-ico svg { width: 14px; height: 14px; }
.wk-row.active .wk-ico { color: var(--accent); }
.wk-tx { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wk-add {
  flex: 0 0 20px; width: 20px; height: 20px;
  border: 0; background: none; cursor: pointer; color: var(--text-3);
  border-radius: 5px; opacity: 0; display: inline-flex; align-items: center; justify-content: center;
}
.wk-add svg { width: 13px; height: 13px; }
.wk-row:hover .wk-add { opacity: 1; }
.wk-add:hover { background: var(--bg-surface); color: var(--accent); }
.wk-kids { position: relative; }

.wk-main { min-width: 0; padding: 16px 20px 22px; }
.wk-doc { min-width: 0; }
.wk-hint { color: var(--text-3); font-size: 12.5px; padding: 10px 2px; }

.wk-read-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.wk-crumbs { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.wk-cs { color: var(--text-3); font-size: 12px; }
.wk-cb {
  border: 0; background: none; cursor: pointer;
  font-size: 12px; color: var(--text-3); padding: 2px 3px; border-radius: 5px;
}
.wk-cb:hover { color: var(--accent); }
.wk-cb.cur { color: var(--text-2); font-weight: 600; cursor: default; }
.wk-read-acts { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.wk-h1 {
  margin: 4px 0 6px; font-size: 22px; font-weight: 700;
  color: var(--text-1); line-height: 1.35;
}
.wk-meta { font-size: 11.8px; color: var(--text-3); margin-bottom: 14px; }
.wk-outline {
  border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-soft); padding: 10px 12px; margin-bottom: 16px;
}
.wo-t { font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; letter-spacing: .3px; }
.wo-i { font-size: 12.5px; color: var(--text-2); padding: 2px 0; }
.wo-i.lv2 { padding-left: 14px; color: var(--text-3); }
.wo-i.lv3 { padding-left: 28px; color: var(--text-3); font-size: 12px; }
.wk-body { font-size: 14px; line-height: 1.75; }
.wk-dim { color: var(--text-3); }
.wk-kidlist { margin-top: 22px; border-top: 1px solid var(--border); padding-top: 12px; }
.wkl-t { font-size: 11.5px; color: var(--text-3); margin-bottom: 7px; }
.wkl-i {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text-2);
  border-radius: 7px; padding: 5px 10px; font-size: 12.5px; cursor: pointer;
  margin: 0 6px 6px 0;
}
.wkl-i:hover { border-color: var(--accent); color: var(--accent); }

.wk-edit-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.wk-title-in {
  flex: 1 1 260px; min-width: 0;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-1);
  border-radius: 8px; padding: 9px 12px; font-size: 16px; font-weight: 600; outline: none;
}
.wk-title-in:focus { border-color: var(--accent); }
.wk-edit-acts { display: flex; align-items: center; gap: 6px; }
.wk-body-in {
  width: 100%; box-sizing: border-box; min-height: 430px; resize: vertical;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-1);
  border-radius: 9px; padding: 12px 14px; outline: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.7;
}
.wk-body-in:focus { border-color: var(--accent); }
.wk-prev {
  min-height: 430px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--bg-soft); padding: 14px 16px;
}
.wk-edit-tip { font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

.wk-blank { text-align: center; padding: 54px 20px; }
.wk-blank-i { color: var(--text-3); opacity: .5; }
.wk-blank-i svg { width: 40px; height: 40px; }
.wk-blank-t { font-size: 15px; font-weight: 600; color: var(--text-2); margin: 12px 0 6px; }
.wk-blank-d { font-size: 12.5px; color: var(--text-3); max-width: 460px; margin: 0 auto; line-height: 1.7; }
.wk-blank-b { margin-top: 18px; max-width: 220px; }

.wk-hist { max-width: 620px; width: 92vw; }
.wh-list { max-height: 56vh; overflow: auto; margin: 6px 0 4px; }
.wh-row { border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; background: var(--bg-soft); }
.wh-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wh-t { font-size: 13px; font-weight: 600; color: var(--text-1); }
.wh-m { font-size: 11.5px; color: var(--text-3); }
.wh-c {
  margin-top: 6px; font-size: 12px; color: var(--text-3); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word; max-height: 92px; overflow: hidden;
}

@media (max-width: 920px) {
  .wk-wrap { grid-template-columns: 1fr; }
  .wk-side { border-right: 0; border-bottom: 1px solid var(--border); }
  .wk-tree { max-height: 220px; }
  .wk-main { padding: 14px 14px 18px; }
  .wk-h1 { font-size: 19px; }
  .wk-body-in, .wk-prev { min-height: 300px; }
}

/* ===== Wiki 富文本编辑器 ===== */
.wk-wrap.has-toc { grid-template-columns: 248px minmax(0, 1fr) 176px; }
.wk-wrap.has-toc .wk-main { display: contents; }
.wk-wrap.has-toc .wk-main > .wk-doc { min-width: 0; padding: 16px 20px 22px; }
.wk-toc {
  border-left: 1px solid var(--border-soft);
  padding: 20px 12px 20px 14px;
  display: flex; flex-direction: column; gap: 2px;
  align-self: start; position: sticky; top: 0;
}
.wk-toc-t { font-size: 11.5px; color: var(--text-3); margin-bottom: 6px; letter-spacing: .5px; }
.wk-toc-i {
  background: none; border: 0; cursor: pointer; text-align: left;
  font-size: 12.5px; color: var(--text-2); padding: 4px 6px; border-radius: 6px;
  line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wk-toc-i:hover { color: var(--accent); background: var(--accent-soft); }
.wk-toc-i.lv2 { padding-left: 16px; font-size: 12px; }
.wk-toc-i.lv3 { padding-left: 26px; font-size: 12px; color: var(--text-3); }

.wk-tb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px;
  padding: 7px 8px; margin: 10px 0 0;
  border: 1px solid var(--border); border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--bg-soft);
}
.wk-tbg { display: flex; align-items: center; gap: 2px; }
.wk-tbg + .wk-tbg { margin-left: 4px; padding-left: 6px; border-left: 1px solid var(--border-soft); }
.wk-tbb {
  min-width: 26px; height: 26px; padding: 0 7px;
  border: 1px solid transparent; border-radius: 6px;
  background: transparent; color: var(--text-2);
  font-size: 12.5px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.wk-tbb:hover { background: var(--bg-surface); border-color: var(--border); color: var(--text-1); }
.wk-tbb:active { background: var(--accent-soft); color: var(--accent); }
.wk-tbb.f-b { font-weight: 800; }
.wk-tbb.f-i { font-style: italic; font-family: Georgia, serif; }
.wk-tbb.f-s { text-decoration: line-through; }

.wk-rich {
  min-height: 420px; max-height: 62vh; overflow: auto;
  border: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px; background: var(--bg-surface);
  font-size: 14px; line-height: 1.75; color: var(--text-1);
  outline: none;
}
.wk-rich:focus { border-color: var(--accent); }
.wk-rich:empty:before,
.wk-rich > p.md-p:only-child:empty:before {
  content: attr(data-ph); color: var(--text-3);
}
.wk-rich .md-h { margin-top: 18px; }
.wk-rich .md-pre { cursor: text; }
.wk-rich .md-table td, .wk-rich .md-table th { min-width: 56px; }
.wk-rich .md-task { cursor: pointer; }
.wk-editing .wk-title-in { font-size: 19px; font-weight: 700; }

/* ===== 发布计划 / 评审 / 项目日历 ===== */
.prm-hint { padding: 26px 4px; text-align: center; color: var(--text-3); font-size: 13px; }
.prm-hint.sm { padding: 14px 4px; font-size: 12.5px; }
.prm-blank { padding: 44px 24px; text-align: center; }
.prm-blank-t { font-size: 15px; font-weight: 600; color: var(--text-1); margin-bottom: 8px; }
.prm-blank-d { font-size: 13px; color: var(--text-3); line-height: 1.8; max-width: 560px; margin: 0 auto; }
.prm-blank-b { width: auto !important; padding: 9px 22px !important; margin-top: 18px; display: inline-block; }
.prm-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 2px 12px; }
.prm-chip { border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-2); border-radius: 999px;
  padding: 4px 12px; font-size: 12.5px; cursor: pointer; transition: .16s; }
.prm-chip b { font-weight: 600; color: var(--text-3); margin-left: 2px; }
.prm-chip:hover { border-color: var(--accent); color: var(--text-1); }
.prm-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.prm-chip.on b { color: rgba(255,255,255,.82); }
.prm-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.prm-pick { max-height: 220px; overflow: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 6px; background: var(--bg-soft); }
.prm-pick.short { max-height: 150px; }
.prm-pick-i { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; cursor: pointer; font-size: 13px; }
.prm-pick-i:hover { background: var(--bg-surface); }
.prm-pick-i input { width: 14px; height: 14px; flex: none; }
.prm-pick-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.prm-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.prm-link { display: inline-flex; align-items: center; gap: 6px; max-width: 340px; border: 1px solid var(--border);
  background: var(--bg-soft); border-radius: 999px; padding: 3px 10px 3px 4px; cursor: pointer; font-size: 12.5px; transition: .16s; }
.prm-link:hover { border-color: var(--accent); background: var(--accent-soft); }
.prm-link-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.prm-st { border: 1px solid var(--border); background: var(--bg-surface); color: var(--text-1);
  border-radius: 7px; padding: 5px 8px; font-size: 12.5px; cursor: pointer; }
.prm-acts { display: flex; gap: 6px; justify-content: flex-end; }
.modal-prm { max-width: 620px; }

.rel-list { display: flex; flex-direction: column; gap: 10px; }
.rel-row { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-surface); padding: 13px 15px; transition: .16s; }
.rel-row:hover { border-color: var(--border-soft); box-shadow: var(--shadow); }
.rel-row.settled { opacity: .72; }
.rel-main { flex: 1; min-width: 0; }
.rel-side { flex: none; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.rel-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.rel-ver { font-size: 12.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft);
  border-radius: 5px; padding: 2px 8px; letter-spacing: .3px; }
.rel-name { font-size: 14.5px; font-weight: 600; color: var(--text-1); }
.rel-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 7px; font-size: 12.5px; color: var(--text-3); }
.prm-day { color: var(--text-2); }
.prm-day.none { color: var(--text-3); }
.prm-day.soon { color: var(--amber); font-weight: 600; }
.prm-day.late { color: var(--red); font-weight: 600; }
.rel-prog { position: relative; height: 6px; border-radius: 999px; background: var(--bg-soft); margin-top: 10px; max-width: 460px; }
.rel-prog i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: var(--green); }
.rel-prog em { position: absolute; left: calc(100% + 8px); top: -6px; font-style: normal; font-size: 11.5px; color: var(--text-3); }
.rel-notes { margin-top: 9px; font-size: 13px; color: var(--text-2); line-height: 1.75; }
.rev-concl { margin-top: 9px; font-size: 13px; color: var(--text-2); line-height: 1.75;
  border-left: 3px solid var(--accent); background: var(--bg-soft); border-radius: 0 6px 6px 0; padding: 7px 12px; }
.rev-concl b { display: block; font-size: 12px; color: var(--text-3); margin-bottom: 2px; font-weight: 600; }
.tag.rel-planning { background: var(--blue-soft); color: var(--blue); }
.tag.rel-developing { background: var(--purple-soft); color: var(--purple); }
.tag.rel-testing { background: var(--amber-soft); color: var(--amber); }
.tag.rel-released { background: var(--green-soft); color: var(--green); }
.tag.rel-canceled { background: var(--bg-soft); color: var(--text-3); }
.tag.rev-req { background: var(--blue-soft); color: var(--blue); }
.tag.rev-design { background: var(--purple-soft); color: var(--purple); }
.tag.rev-code { background: var(--accent-soft); color: var(--accent); }
.tag.rev-test { background: var(--amber-soft); color: var(--amber); }
.tag.rev-other { background: var(--bg-soft); color: var(--text-3); }
.tag.revst-pending { background: var(--bg-soft); color: var(--text-3); }
.tag.revst-doing { background: var(--blue-soft); color: var(--blue); }
.tag.revst-passed { background: var(--green-soft); color: var(--green); }
.tag.revst-rejected { background: var(--red-soft); color: var(--red); }

.cal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 16px; align-items: start; }
.cal-box { min-width: 0; }
.cal-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.cal-title { font-size: 15px; font-weight: 600; color: var(--text-1); margin: 0 4px; }
.cal-legend { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--text-3); }
.cal-legend .lg { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 4px; }
.lg.event, .cal-dot.event { background: var(--purple); }
.lg.release, .cal-dot.release { background: var(--green); }
.lg.review, .cal-dot.review { background: var(--blue); }
.lg.item, .cal-dot.item { background: var(--amber); }
.cal-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-bottom: 6px; }
.cal-head span { text-align: center; font-size: 12px; color: var(--text-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-cell { min-height: 92px; border: 1px solid var(--border); border-radius: 9px; background: var(--bg-surface);
  padding: 5px 6px; cursor: pointer; overflow: hidden; transition: .14s; }
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.out { background: var(--bg-soft); border-style: dashed; cursor: default; }
.cal-cell.out:hover { border-color: var(--border); }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.today .cal-d { color: var(--accent); font-weight: 700; }
.cal-cell.sel { background: var(--accent-soft); border-color: var(--accent); }
.cal-d { font-size: 12px; color: var(--text-2); margin-bottom: 4px; }
.cal-ev { font-size: 11px; line-height: 1.5; border-radius: 4px; padding: 1px 5px; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-ev b { font-weight: 600; }
.cal-ev.event { background: var(--purple-soft); color: var(--purple); }
.cal-ev.release { background: var(--green-soft); color: var(--green); }
.cal-ev.review { background: var(--blue-soft); color: var(--blue); }
.cal-ev.item { background: var(--amber-soft); color: var(--amber); }
.cal-ev.done { text-decoration: line-through; opacity: .65; }
.cal-more { font-size: 10.5px; color: var(--text-3); padding-left: 5px; }
.cal-side { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-soft); padding: 12px; }
.cal-side-h { font-size: 13.5px; font-weight: 600; color: var(--text-1); padding-bottom: 9px;
  border-bottom: 1px solid var(--border); margin-bottom: 9px; }
.cal-side-l { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow: auto; }
.cal-row { border: 1px solid var(--border); border-radius: 8px; background: var(--bg-surface); padding: 8px 10px; }
.cal-row.done .cal-row-n { text-decoration: line-through; color: var(--text-3); }
.cal-row-h { display: flex; align-items: center; gap: 6px; }
.cal-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.cal-row-t { font-size: 11.5px; font-weight: 600; color: var(--text-2); }
.cal-row-n { flex: 1; min-width: 0; font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-row-s { font-size: 11.5px; color: var(--text-3); margin-top: 3px; padding-left: 13px; }
.cal-row-d { font-size: 12px; color: var(--text-2); margin-top: 5px; padding-left: 13px; line-height: 1.7; }
.cal-row-a { display: flex; gap: 6px; margin-top: 7px; padding-left: 13px; }
.cal-add { width: 100% !important; margin-top: 10px; }
@media (max-width: 1180px) {
  .cal-wrap { grid-template-columns: minmax(0, 1fr); }
  .prm-2col { grid-template-columns: 1fr; }
  .rel-row { flex-direction: column; }
  .rel-side { align-items: flex-start; flex-direction: row; }
}

/* ===== 侧栏宽度调整 / 折叠 ===== */
.side-resizer { position:absolute; top:0; bottom:0; right:-3px; width:7px; cursor:col-resize; z-index:26; background:none; border:none; padding:0; }
.side-resizer::after { content:""; position:absolute; top:0; bottom:0; left:3px; width:1px; background:transparent; transition:background .15s; }
.side-resizer:hover::after, body.sb-resizing .side-resizer::after { background:var(--accent); }
.side-toggle { position:fixed; top:50%; left:var(--side-w,248px); transform:translate(-50%,-50%); z-index:28;
  width:24px; height:24px; display:flex; align-items:center; justify-content:center; padding:0;
  border:1px solid var(--border); border-radius:50%; background:var(--bg-surface);
  color:var(--text-3); cursor:pointer; box-shadow:0 1px 4px rgba(0,0,0,.10);
  opacity:0; transition:opacity .18s, color .18s, border-color .18s, transform .18s; }
.side-toggle::before { content:""; position:absolute; inset:-10px -8px; }
.side-toggle svg { width:13px; height:13px; }
.sidebar:hover ~ .side-toggle,
.side-toggle:hover,
.side-toggle:focus-visible,
body.sb-resizing .side-toggle { opacity:1; }
.side-toggle:hover { color:var(--accent-text); border-color:var(--accent); transform:translate(-50%,-50%) scale(1.08); }
html[data-sbcol="1"] .side-toggle { left:0; transform:translate(0,-50%); border-radius:0 12px 12px 0; border-left:none;
  width:16px; height:34px; opacity:.55; }
html[data-sbcol="1"] .side-toggle:hover { opacity:1; transform:translate(0,-50%); width:20px; }
html[data-sbcol="1"] .sidebar { display:none; }
body.sb-resizing { cursor:col-resize; user-select:none; }
body.sb-resizing .sidebar, body.sb-resizing .main { transition:none !important; }

/* 测量最小宽度用的临时态（不会被绘制） */
.sidebar.sb-measure { width:2400px !important; }
.sidebar.sb-measure .logo,
.sidebar.sb-measure .side-nav,
.sidebar.sb-measure .proj-list,
.sidebar.sb-measure .sidebar-user,
.sidebar.sb-measure .side-section,
.sidebar.sb-measure .nav-item,
.sidebar.sb-measure .proj-item { width:max-content !important; max-width:none !important; }
.sidebar.sb-measure .nav-tx,
.sidebar.sb-measure .pi-name,
.sidebar.sb-measure .u-info { flex:none !important; min-width:0 !important; overflow:visible !important; text-overflow:clip !important; }
.sidebar.sb-measure .side-resizer { display:none; }

@media (max-width: 920px) {
  .side-toggle, .side-resizer { display:none !important; }
  html[data-sbcol="1"] .sidebar { display:flex; }
}﻿/* ===== 项目统计 & 报表 样式 ===== */
.ana-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 12px;
}
.ana-grid .ana-full { grid-column: 1 / -1; }
.ana-grid .ana-card { min-width: 0; }
@media (max-width: 800px) {
  .ana-grid { grid-template-columns: 1fr; }
}

.ana-kpis {
  gap: 10px !important;
  padding: 4px 6px 2px;
}
.ana-kpi {
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  min-width: 0;
}
.ak-v {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-1);
}
.ak-l {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.ak-s {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 2px;
  line-height: 1.4;
}

/* 柱状图 */
.ab-chart {
  display: flex;
  align-items: flex-end;
  height: 180px;
  gap: 2px;
  padding: 8px 4px 0;
  border-bottom: 1px solid var(--border);
}
.ab-col {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  position: relative;
}
.ab-col > i {
  display: block;
  width: 100%;
  max-width: 14px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
  transition: height 0.3s ease;
  min-height: 0;
}
.ab-col:hover > i { filter: brightness(1.1); }
.ab-axis {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px 0;
  font-size: 11px;
  color: var(--text-3);
}
.ab-mid { color: var(--text-2); font-weight: 500; }
.ab-legend {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--text-2);
}
.bl-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.bl-dot.dashed {
  background: transparent !important;
  border: 1px dashed currentColor;
}

/* 双柱图 */
.dual-chart .abc-wrap {
  display: flex;
  align-items: flex-end;
  gap: 1px;
  height: 100%;
  width: 100%;
  justify-content: center;
}
.dual-chart .abc-new,
.dual-chart .abc-fix {
  display: block;
  width: 50%;
  max-width: 7px;
  border-radius: 2px 2px 0 0;
}
.dual-chart .abc-new { background: var(--red); }
.dual-chart .abc-fix { background: var(--green); }

/* 燃尽图 */
.burndown-chart .bc-actual {
  position: absolute;
  bottom: 0;
  left: 20%;
  width: 60% !important;
  max-width: none !important;
  background: var(--red) !important;
  border-radius: 2px 2px 0 0;
}
.burndown-chart .bc-ideal {
  position: absolute;
  bottom: 0;
  left: 45%;
  width: 10% !important;
  max-width: none !important;
  background: transparent !important;
  border-left: 1px dashed var(--text-3);
  height: 100%;
}
.burndown-col {
  position: relative;
}

/* 堆叠条 */
.as-bar {
  height: 10px;
  background: var(--bg-2);
  border-radius: 5px;
  overflow: hidden;
  display: flex;
  margin: 6px 0;
}
.as-bar > i {
  height: 100%;
  transition: width 0.3s ease;
}
.as-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 11px;
  color: var(--text-2);
}
.asn b {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 4px;
  vertical-align: middle;
}
.as-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
}
.ana-sub {
  font-size: 12px;
  color: var(--text-2);
  margin: 12px 0 4px;
  font-weight: 500;
}

/* 环形图 */
.ad-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 8px 4px;
}
.ad-donut {
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.ad-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  background: var(--bg-1);
  width: 60%;
  height: 60%;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.adc-v { font-size: 18px; font-weight: 700; color: var(--text-1); }
.adc-l { font-size: 10px; color: var(--text-3); margin-top: 1px; }
.ad-legend {
  flex: 1;
  min-width: 0;
}
.adl-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-size: 12px;
  color: var(--text-2);
}
.adl-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}
.adl-nm {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.adl-v {
  flex-shrink: 0;
  color: var(--text-1);
  font-weight: 500;
}

/* 里程碑/计划进度列表 */
.ana-ms-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 2px;
}
.ams-row {
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.ams-h {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.ams-n {
  flex: 1;
  font-weight: 500;
  color: var(--text-1);
  font-size: 13px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ams-pct {
  font-weight: 700;
  color: var(--text-1);
  font-size: 13px;
  flex-shrink: 0;
}
.ams-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.ams-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.ams-m {
  font-size: 11px;
  color: var(--text-3);
  margin-top: 4px;
}

/* 统计表格 */
.ana-table-wrap {
  overflow-x: auto;
  margin-top: 4px;
}
.ana-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ana-table th,
.ana-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.ana-table th {
  background: var(--bg-2);
  font-weight: 600;
  color: var(--text-2);
  font-size: 12px;
  position: sticky;
  top: 0;
  z-index: 1;
}
.ana-table tr:hover td { background: var(--bg-2); }
.ana-table .tar { text-align: right; }
.ana-table .st-done { color: var(--green); }
.ana-table .st-doing { color: var(--blue); }
.ana-table .st-todo { color: var(--text-3); }

/* 子标签栏 */
.sub-tabs {
  margin: -12px -16px 12px;
  padding: 0 16px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  position: sticky;
  top: 0;
  background: var(--bg-1);
  z-index: 10;
}

/* 质量 KPI 列表 */
.ana-kpi-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 2px;
}
.akl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--bg-2);
  border-radius: 6px;
}
.akl-l { color: var(--text-2); font-size: 13px; }
.akl-v { font-weight: 600; color: var(--text-1); font-size: 15px; }

/* 报表模块 */
.rep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 4px 2px;
}
.rep-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.2s ease;
}
.rep-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.rep-ico {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.rep-ico svg { width: 22px; height: 22px; }
.rep-ico.rep-ico-items_all { background: linear-gradient(135deg, var(--accent), #667eea); }
.rep-ico.rep-ico-items_summary { background: linear-gradient(135deg, var(--blue), #4facfe); }
.rep-ico.rep-ico-milestone_prog { background: linear-gradient(135deg, #f093fb, #f5576c); }
.rep-ico.rep-ico-member_workload { background: linear-gradient(135deg, #4facfe, #00f2fe); }
.rep-ico.rep-ico-bug_trend { background: linear-gradient(135deg, #fa709a, #fee140); }
.rep-ico.rep-ico-test_summary { background: linear-gradient(135deg, #43e97b, #38f9d7); }
.rep-ico.rep-ico-test_detail { background: linear-gradient(135deg, #667eea, #764ba2); }
.rep-ico.rep-ico-full_project { background: linear-gradient(135deg, #f5576c, #f093fb); }
.rep-info { flex: 1; }
.rep-name {
  font-weight: 600;
  color: var(--text-1);
  font-size: 14px;
  margin-bottom: 4px;
}
.rep-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.5;
}
.rep-actions {
  display: flex;
  gap: 8px;
}
.rep-tip {
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin: 0 0 12px;
  line-height: 1.6;
}
.rep-desc-tip {
  padding: 10px 14px;
  background: var(--bg-2);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin: 0 0 12px;
  line-height: 1.6;
}
.rep-cap {
  font-size: 12px;
  color: var(--text-2);
  margin: 8px 2px 4px;
  font-weight: 500;
}
.rep-table table { font-size: 12px; }
.rep-table th,
.rep-table td { padding: 6px 8px; }

.rep-summary-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.rep-full-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.rfs-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: var(--bg-2);
  border-radius: 6px;
}
.rfs-k { color: var(--text-2); font-size: 12px; }
.rfs-v { font-weight: 600; color: var(--text-1); font-size: 14px; }

/* 返回按钮 */
.sub-back {
  background: none;
  border: none;
  color: var(--text-2);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  border-radius: 4px;
}
.sub-back:hover { background: var(--bg-2); color: var(--text-1); }﻿/* ===== AI 模型配置：Token 供应商记录 ===== */
.aim-cur {
  font-size: 13px;
  color: var(--text-1);
  font-weight: 600;
}
.aim-cur-none { color: var(--text-3); font-weight: 400; font-style: normal; }

.aim-tk-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.aim-tk-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--border);
  border-radius: 8px;
  background: var(--bg-1);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.aim-tk-row:hover { box-shadow: 0 2px 10px rgba(0, 0, 0, .06); }
.aim-tk-row.is-active {
  border-left-color: var(--accent);
  background: rgba(87, 106, 249, .04);
}
.aim-tk-row.is-ok { border-left-color: var(--green); }
.aim-tk-row.is-bad { border-left-color: var(--red); }
.aim-tk-row.is-active.is-ok { border-left-color: var(--accent); }

.aim-tk-main { flex: 1; min-width: 0; }
.aim-tk-line1 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 5px;
}
.aim-tk-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-1);
}
.aim-tk-model {
  font-family: monospace;
  font-size: 12px;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-2);
  color: var(--text-1);
}
.aim-tk-type {
  font-size: 11px;
  color: var(--text-3);
  padding: 2px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
}
.aim-tk-line2 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-3);
}
.aim-tk-url {
  font-family: monospace;
  max-width: 380px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aim-tk-key { font-family: monospace; }
.aim-tk-note {
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--bg-2);
}
.aim-tk-ok, .aim-tk-err {
  margin-top: 6px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 5px;
  line-height: 1.5;
  word-break: break-all;
}
.aim-tk-ok { color: var(--green); background: rgba(16, 185, 129, .08); }
.aim-tk-err { color: var(--red); background: rgba(239, 68, 68, .08); }

.aim-tk-acts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* 测试结果徽标 */
.aim-tst {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.aim-tst.none { color: var(--text-3); background: var(--bg-2); font-weight: 400; }
.aim-tst.ok { color: var(--green); background: rgba(16, 185, 129, .12); cursor: help; }
.aim-tst.bad { color: var(--red); background: rgba(239, 68, 68, .12); cursor: help; }
.aim-tst.loading { color: var(--amber); background: rgba(245, 158, 11, .12); }

.aim-sum-ok { color: var(--green); font-weight: 600; }
.aim-sum-bad { color: var(--red); font-weight: 600; }

/* 测试中的转圈 */
.aim-spin {
  display: inline-block;
  width: 9px;
  height: 9px;
  border: 1.5px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: aimSpin .6s linear infinite;
  margin-right: 4px;
}
@keyframes aimSpin { to { transform: rotate(360deg); } }

/* 编辑弹窗里的测试结果区 */
/* 列表里的模型芯片 */
.aim-mchips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.aim-mchip {
  font-family: monospace;
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-2);
  color: var(--text-2);
  cursor: help;
}
.aim-mchip.ok { border-color: rgba(16, 185, 129, .45); color: var(--green); background: rgba(16, 185, 129, .08); }
.aim-mchip.bad { border-color: rgba(239, 68, 68, .45); color: var(--red); background: rgba(239, 68, 68, .08); }
.aim-mchip.testing { border-color: rgba(245, 158, 11, .45); color: var(--amber); background: rgba(245, 158, 11, .08); }
.aim-mchip.using {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(87, 106, 249, .1);
  font-weight: 600;
}
.aim-tk-cnt { font-size: 11.5px; color: var(--text-3); }

/* 编辑弹窗：模型列表 */
.aim-pe-models {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.aim-pe-mhead {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.aim-pe-mhead b { font-size: 13px; margin-right: auto; }
.aim-pe-hint { display: block; margin-bottom: 10px; }
.aim-pe-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  border: 1px dashed var(--border);
  border-radius: 6px;
}
.aim-me-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-left: 3px solid transparent;
  border-radius: 6px;
  background: var(--bg-surface);
}
.aim-me-row.is-using {
  border-left-color: var(--accent);
  background: rgba(87, 106, 249, .05);
}
.aim-me-row input {
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-1);
  color: var(--text-1);
  outline: none;
  min-width: 0;
}
.aim-me-row input:focus { border-color: var(--accent); }
.aim-me-row .aim-me-id { flex: 1.6; font-family: monospace; }
.aim-me-row .aim-me-name { flex: 1; }
.aim-me-row .aim-tst { flex: 0 0 auto; }

.aim-pe-test:not(:empty) {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

@media (max-width: 900px) {
  .aim-tk-row { flex-direction: column; }
  .aim-tk-acts { width: 100%; justify-content: flex-end; }
  .aim-tk-url { max-width: 100%; }
}

/* ===== 系统通知（通知与反馈弹窗） ===== */
.fb2-side-top { padding:16px 14px 12px; border-bottom:1px solid var(--border-soft); }
.nt-entry { display:flex; align-items:center; gap:9px; width:100%; padding:10px 12px; border:1px solid var(--border); border-radius:10px; background:var(--bg-surface); color:var(--text-2); font-family:inherit; font-size:13px; font-weight:600; text-align:left; cursor:pointer; transition:all .15s; }
.nt-entry:hover { border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft); }
.nt-entry.is-active { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-text); box-shadow:0 0 0 2px var(--accent-soft); }
.nt-entry-ico { flex:none; display:inline-flex; align-items:center; justify-content:center; width:26px; height:26px; border-radius:8px; background:var(--bg-soft); color:var(--text-2); transition:all .15s; }
.nt-entry-ico svg { width:15px; height:15px; }
.nt-entry:hover .nt-entry-ico,
.nt-entry.is-active .nt-entry-ico { background:var(--accent); color:#fff; }
.nt-entry-txt { flex:1; min-width:0; }

/* 列表 */
.nt-list { display:flex; flex-direction:column; gap:10px; background:var(--bg-soft); }
.nt-item { position:relative; display:flex; gap:11px; padding:12px 14px 12px 15px; border:1px solid var(--border-soft); border-radius:11px; background:var(--bg-surface); box-shadow:var(--shadow); transition:transform .12s, box-shadow .12s; }
.nt-item::before { content:''; position:absolute; left:0; top:11px; bottom:11px; width:3px; border-radius:0 3px 3px 0; background:var(--text-3); }
.nt-item:hover { transform:translateY(-1px); box-shadow:var(--shadow-lg); }
.nt-item.is-read { background:var(--bg-soft); box-shadow:none; opacity:.72; }
.nt-item.is-read .nt-title { font-weight:500; color:var(--text-2); }
.nt-item.is-read::before { opacity:.45; }
.nt-ico { flex:none; display:inline-flex; align-items:center; justify-content:center; width:30px; height:30px; border-radius:9px; background:var(--bg-soft); color:var(--text-2); }
.nt-ico svg { width:16px; height:16px; }
.nt-body { flex:1; min-width:0; }
.nt-head { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.nt-tag { flex:none; padding:2px 8px; border-radius:20px; background:var(--bg-soft); border:1px solid var(--border-soft); color:var(--text-2); font-size:10.5px; font-weight:600; letter-spacing:.2px; }
.nt-title { font-size:13px; font-weight:700; color:var(--text-1); line-height:1.55; word-break:break-word; }
.nt-text { margin-top:5px; font-size:12px; color:var(--text-2); line-height:1.7; word-break:break-word; white-space:pre-wrap; }
.nt-meta { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:7px; font-size:11px; color:var(--text-3); }
.nt-go { padding:2px 9px; border:1px solid var(--border); border-radius:20px; background:transparent; color:var(--text-2); font-family:inherit; font-size:11px; cursor:pointer; transition:all .15s; }
.nt-go:hover { border-color:var(--accent); background:var(--accent-soft); color:var(--accent-text); }

/* 按来源着色 */
.nt-item.is-transfer::before { background:var(--blue); }
.nt-item.is-transfer .nt-ico { background:var(--blue-soft); color:var(--blue); }
.nt-item.is-transfer .nt-tag { background:var(--blue-soft); border-color:transparent; color:var(--blue); }
.nt-item.is-mention::before { background:var(--purple); }
.nt-item.is-mention .nt-ico { background:var(--purple-soft); color:var(--purple); }
.nt-item.is-mention .nt-tag { background:var(--purple-soft); border-color:transparent; color:var(--purple); }
.nt-item.is-announce::before { background:var(--accent); }
.nt-item.is-announce .nt-ico { background:var(--accent-soft); color:var(--accent-text); }
.nt-item.is-announce .nt-tag { background:var(--accent-soft); border-color:transparent; color:var(--accent-text); }
.nt-item.is-system::before { background:var(--amber); }
.nt-item.is-system .nt-ico { background:var(--amber-soft); color:var(--amber); }
.nt-item.is-system .nt-tag { background:var(--amber-soft); border-color:transparent; color:var(--amber); }

/* 底部操作条 */
.nt-acts { flex:none; display:flex; justify-content:flex-end; gap:9px; padding:12px 22px 16px; border-top:1px solid var(--border-soft); background:var(--bg-surface); }
.btn-mini.ghost { background:transparent; }
.btn-mini.ghost:hover { background:var(--bg-soft); }

/* 管理员发布公告 */
.nt-pub { padding:13px 14px 12px; margin-bottom:4px; border:1px dashed var(--border); border-radius:11px; background:var(--bg-surface); }
.nt-pub-head { display:flex; align-items:baseline; gap:8px; flex-wrap:wrap; margin-bottom:9px; }
.nt-pub-t { font-size:12.5px; font-weight:700; color:var(--text-1); }
.nt-pub-s { font-size:11px; color:var(--text-3); }
.nt-pub-in, .nt-pub-ta { width:100%; padding:8px 11px; border:1px solid var(--border); border-radius:8px; background:var(--bg-page); color:var(--text-1); font-family:inherit; font-size:12.5px; line-height:1.7; box-sizing:border-box; transition:border-color .15s, box-shadow .15s; }
.nt-pub-in:focus, .nt-pub-ta:focus { outline:none; border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-soft); }
.nt-pub-ta { margin-top:8px; resize:vertical; min-height:46px; }
.nt-pub-foot { display:flex; justify-content:flex-end; margin-top:9px; }

@media (max-width: 920px) {
  .fb2-side-top { padding:12px 14px 10px; padding-right:48px; }
  .nt-acts { padding:10px 16px 14px; }
  .nt-item { padding:11px 12px 11px 14px; }
}

/* ===== @ 提及联想面板 ===== */
.mention-pop{position:fixed;z-index:9999;background:var(--bg-surface);border:1px solid var(--border);border-radius:var(--radius-sm);box-shadow:var(--shadow-lg);padding:4px;max-height:238px;overflow-y:auto;min-width:180px}
.mention-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:6px;cursor:pointer;font-size:13px;color:var(--text-1);white-space:nowrap;transition:background .12s}
.mention-item.is-active{background:var(--accent-soft);color:var(--accent-text)}
.mention-nm{overflow:hidden;text-overflow:ellipsis}
.mention-tip{padding:5px 8px 3px;margin-top:3px;border-top:1px solid var(--border-soft);font-size:11px;color:var(--text-3);white-space:nowrap}

/* 未读通知行可点击标已读 */
.nt-item:not(.is-read){cursor:pointer}
.nt-item:not(.is-read) .nt-title::after{content:'';display:inline-block;width:6px;height:6px;margin-left:6px;border-radius:50%;background:var(--red);vertical-align:middle}

/* ===== 系统通知：分类页签 / 行内操作 / 详情弹窗 ===== */
.nt-tabs { flex:none; display:flex; gap:7px; padding:11px 22px 0; background:var(--bg-soft); }
.nt-tab { display:inline-flex; align-items:center; gap:5px; padding:5px 12px; border:1px solid var(--border-soft); border-radius:20px; background:var(--bg-surface); color:var(--text-2); font-family:inherit; font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; }
.nt-tab:hover { border-color:var(--accent); color:var(--accent-text); }
.nt-tab.is-on { border-color:transparent; background:var(--accent); color:#fff; box-shadow:0 1px 5px rgba(13,148,136,.28); }
.nt-tab-n { display:inline-flex; align-items:center; justify-content:center; min-width:16px; height:16px; padding:0 4px; border-radius:9px; background:var(--bg-soft); color:var(--text-3); font-size:10.5px; font-weight:700; }
.nt-tab.is-on .nt-tab-n { background:rgba(255,255,255,.26); color:#fff; }

.nt-item { cursor:pointer; }
.nt-item.is-pinned { border-color:var(--amber-soft); box-shadow:0 0 0 2px var(--amber-soft), var(--shadow); }
.nt-flag { flex:none; padding:2px 7px; border-radius:20px; font-size:10px; font-weight:700; letter-spacing:.2px; }
.nt-flag-pin { background:var(--amber-soft); color:var(--amber); }
.nt-flag-star { background:var(--pink-soft); color:var(--pink); }
.nt-open { color:var(--accent-text); font-weight:600; opacity:0; transition:opacity .15s; }
.nt-item:hover .nt-open { opacity:1; }
.nt-ops { flex:none; display:flex; flex-direction:column; gap:5px; }
.nt-op { display:inline-flex; align-items:center; justify-content:center; width:25px; height:25px; padding:0; border:1px solid transparent; border-radius:7px; background:transparent; color:var(--text-3); cursor:pointer; opacity:0; transition:all .15s; }
.nt-op svg { width:14px; height:14px; }
.nt-item:hover .nt-op, .nt-op.on { opacity:1; }
.nt-op:hover { background:var(--bg-soft); color:var(--text-1); }
.nt-op.on { color:var(--amber); background:var(--amber-soft); }
.nt-op[data-ntstar].on { color:var(--pink); background:var(--pink-soft); }

/* 详情浮层：盖在通知弹窗之上，比 modal-mask 高一层 */
.nt-d-mask { position:fixed; inset:0; z-index:150; display:flex; align-items:center; justify-content:center; padding:28px; background:rgba(31,41,55,.5); backdrop-filter:blur(2px); animation:ntdIn .16s ease-out; }
@keyframes ntdIn { from { opacity:0; } to { opacity:1; } }
.nt-d-card { display:flex; flex-direction:column; width:min(620px, 100%); max-height:min(80vh, 720px); border:1px solid var(--border); border-radius:16px; background:var(--bg-surface); box-shadow:var(--shadow-lg); overflow:hidden; animation:ntdUp .18s ease-out; }
@keyframes ntdUp { from { transform:translateY(10px) scale(.985); opacity:.4; } to { transform:none; opacity:1; } }
.nt-d-head { position:relative; flex:none; display:flex; gap:12px; padding:18px 52px 15px 20px; border-bottom:1px solid var(--border-soft); }
.nt-d-head .nt-ico { width:34px; height:34px; border-radius:10px; }
.nt-d-head .nt-ico svg { width:18px; height:18px; }
.nt-d-htxt { flex:1; min-width:0; }
.nt-d-hrow { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.nt-d-title { margin-top:6px; font-size:15px; font-weight:700; color:var(--text-1); line-height:1.55; word-break:break-word; }
.nt-d-meta { margin-top:5px; font-size:11.5px; color:var(--text-3); }
.nt-d-x { position:absolute; top:12px; right:14px; width:28px; height:28px; border:none; border-radius:7px; background:transparent; color:var(--text-3); font-size:21px; line-height:1; cursor:pointer; transition:all .15s; }
.nt-d-x:hover { background:var(--bg-soft); color:var(--text-1); }
.nt-d-body { flex:1; overflow-y:auto; padding:16px 20px; background:var(--bg-soft); display:flex; flex-direction:column; gap:12px; }
.nt-d-load { padding:60px 0; text-align:center; font-size:13px; color:var(--text-3); }
.nt-d-sec { padding:14px 15px; border:1px solid var(--border-soft); border-radius:12px; background:var(--bg-surface); }
.nt-d-sec-t { font-size:11.5px; font-weight:700; color:var(--text-3); letter-spacing:.3px; margin-bottom:8px; }
.nt-d-sec-m { margin-top:9px; font-size:11px; color:var(--text-3); }
.nt-d-sec.is-quote { border-left:3px solid var(--accent); }
.nt-d-quote { font-size:13.5px; color:var(--text-1); line-height:1.85; white-space:pre-wrap; word-break:break-word; }
.nt-d-itemt { font-size:14px; font-weight:700; color:var(--text-1); line-height:1.6; word-break:break-word; }
.nt-d-chips { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-top:9px; }
.nt-d-chip { padding:3px 9px; border-radius:20px; background:var(--bg-soft); border:1px solid var(--border-soft); color:var(--text-2); font-size:11px; font-weight:600; }
.nt-d-chip.st-todo { background:var(--bg-soft); color:var(--text-2); }
.nt-d-chip.st-doing { background:var(--blue-soft); border-color:transparent; color:var(--blue); }
.nt-d-chip.st-testing { background:var(--amber-soft); border-color:transparent; color:var(--amber); }
.nt-d-chip.st-done { background:var(--green-soft); border-color:transparent; color:var(--green); }
.nt-d-chip.is-pri { background:var(--purple-soft); border-color:transparent; color:var(--purple); }
.nt-d-chip.is-sev { background:var(--red-soft); border-color:transparent; color:var(--red); }
.nt-d-chip.is-del { background:var(--red-soft); border-color:transparent; color:var(--red); }
.nt-d-desc { margin-top:10px; padding-top:10px; border-top:1px dashed var(--border-soft); font-size:12.5px; color:var(--text-2); line-height:1.85; white-space:pre-wrap; word-break:break-word; }
.nt-d-desc.is-plain { margin-top:0; padding-top:0; border-top:none; }
.nt-d-desc.is-empty { color:var(--text-3); font-style:normal; }
.nt-d-warn { color:var(--red); font-weight:600; }
.nt-d-flow { display:flex; align-items:center; gap:9px; font-size:13px; color:var(--text-2); }
.nt-d-flow svg { width:17px; height:17px; color:var(--text-3); }
.nt-d-flow .is-me { padding:2px 9px; border-radius:20px; background:var(--accent-soft); color:var(--accent-text); font-weight:700; }
.nt-d-imgs { display:flex; gap:7px; flex-wrap:wrap; margin-top:10px; }
.nt-d-imgs img { width:70px; height:70px; object-fit:cover; border:1px solid var(--border-soft); border-radius:8px; cursor:zoom-in; transition:transform .12s; }
.nt-d-imgs img:hover { transform:scale(1.04); }
.nt-d-foot { flex:none; display:flex; align-items:center; justify-content:space-between; gap:10px; padding:12px 20px; border-top:1px solid var(--border-soft); background:var(--bg-surface); }
.nt-d-foot-l { display:flex; gap:8px; }
.nt-d-act { display:inline-flex; align-items:center; gap:6px; padding:7px 13px; border:1px solid var(--border); border-radius:9px; background:var(--bg-surface); color:var(--text-2); font-family:inherit; font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.nt-d-act svg { width:15px; height:15px; }
.nt-d-act:hover { border-color:var(--accent); color:var(--accent-text); background:var(--accent-soft); }
.nt-d-act.on { border-color:transparent; background:var(--amber-soft); color:var(--amber); }
.nt-d-act[data-ntd="star"].on { background:var(--pink-soft); color:var(--pink); }
.nt-d-go { width:auto; padding:8px 20px; }

@media (max-width: 920px) {
  .nt-d-mask { padding:0; align-items:flex-end; }
  .nt-d-card { width:100%; max-height:88vh; border-radius:16px 16px 0 0; }
  .nt-tabs { padding:10px 14px 0; overflow-x:auto; }
  .nt-op { opacity:1; }
}

/* ===== 我的 AI 书库 ===== */
.bk-loading { padding:60px 0; text-align:center; color:var(--text-3); font-size:13px; }
.bk-empty { padding:56px 20px; }
.bk-empty svg { width:52px; height:52px; opacity:.5; }
.bk-empty-btn { width:auto; margin-top:16px; padding:9px 22px; display:inline-flex; }
.bk-dim { color:var(--text-3); }

/* 统计条 */
.bk-stats { display:grid; grid-template-columns:repeat(8, minmax(0,1fr)); gap:10px; margin-bottom:16px; }
.bk-stats.is-load { display:block; padding:18px; border:1px solid var(--border-soft); border-radius:var(--radius); color:var(--text-3); font-size:13px; text-align:center; }
.bk-stat { padding:13px 10px; border:1px solid var(--border-soft); border-radius:var(--radius-sm); background:var(--bg-surface); text-align:center; transition:all .16s; }
.bk-stat:hover { border-color:var(--border); box-shadow:var(--shadow); transform:translateY(-1px); }
.bk-stat b { display:block; font-size:20px; font-weight:700; color:var(--text-1); line-height:1.2; letter-spacing:-.4px; }
.bk-stat span { display:block; margin-top:4px; font-size:11.5px; color:var(--text-3); }
.bk-stat.is-reading b { color:var(--blue); }
.bk-stat.is-done b { color:var(--green); }
.bk-stat.is-wish b { color:var(--purple); }
.bk-stat.is-year b { color:var(--accent-text); }
.bk-stat.is-star b { color:var(--amber); }

/* 工具栏 */
.bk-bar { display:flex; align-items:center; justify-content:space-between; gap:14px; flex-wrap:wrap; margin-bottom:12px; }
.bk-bar-r { display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.bk-seg { display:inline-flex; padding:3px; border:1px solid var(--border-soft); border-radius:10px; background:var(--bg-soft); gap:2px; }
.bk-seg-b { display:inline-flex; align-items:center; gap:5px; padding:6px 12px; border:none; border-radius:7px; background:transparent; color:var(--text-2); font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.bk-seg-b:hover { color:var(--text-1); }
.bk-seg-b.on { background:var(--bg-surface); color:var(--accent-text); box-shadow:var(--shadow); }
.bk-seg-b i { font-style:normal; font-size:11px; padding:1px 5px; border-radius:6px; background:var(--bg-page); color:var(--text-3); }
.bk-seg-b.on i { background:var(--accent-soft); color:var(--accent-text); }
.bk-search { position:relative; display:inline-flex; align-items:center; }
.bk-search svg { position:absolute; left:10px; width:14px; height:14px; color:var(--text-3); pointer-events:none; }
.bk-search input { width:210px; padding:8px 28px 8px 30px; border:1px solid var(--border); border-radius:9px; background:var(--bg-surface); color:var(--text-1); font-size:12.5px; outline:none; transition:all .15s; }
.bk-search input:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak,rgba(13,148,136,.08)); }
.bk-search-x { position:absolute; right:6px; width:20px; height:20px; border:none; border-radius:5px; background:transparent; color:var(--text-3); font-size:16px; line-height:1; cursor:pointer; }
.bk-search-x:hover { background:var(--bg-soft); color:var(--text-1); }
.bk-sel { padding:8px 10px; border:1px solid var(--border); border-radius:9px; background:var(--bg-surface); color:var(--text-2); font-size:12.5px; cursor:pointer; outline:none; }
.bk-sel:focus { border-color:var(--accent); }
.bk-view-sw { display:inline-flex; padding:3px; border:1px solid var(--border-soft); border-radius:9px; background:var(--bg-soft); gap:2px; }
.bk-vw { width:29px; height:27px; display:inline-flex; align-items:center; justify-content:center; border:none; border-radius:6px; background:transparent; color:var(--text-3); cursor:pointer; transition:all .15s; }
.bk-vw svg { width:15px; height:15px; }
.bk-vw:hover { color:var(--text-1); }
.bk-vw.on { background:var(--bg-surface); color:var(--accent-text); box-shadow:var(--shadow); }
.bk-add { width:auto; padding:8px 15px; display:inline-flex; align-items:center; gap:6px; }
.bk-add svg { width:15px; height:15px; }

/* 标签行 */
.bk-tags-bar { display:flex; align-items:center; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.bk-tag-b { padding:4px 11px; border:1px solid var(--border-soft); border-radius:20px; background:var(--bg-surface); color:var(--text-2); font-size:11.5px; cursor:pointer; transition:all .15s; }
.bk-tag-b:hover { border-color:var(--accent); color:var(--accent-text); }
.bk-tag-b.on { border-color:transparent; background:var(--accent); color:#fff; }
.bk-tag { display:inline-flex; align-items:center; gap:4px; padding:2px 8px; border-radius:20px; background:var(--bg-soft); color:var(--text-3); font-size:11px; }
.bk-tag.is-edit { background:var(--accent-soft); color:var(--accent-text); }
.bk-tag.is-edit button { border:none; background:transparent; color:inherit; font-size:14px; line-height:1; cursor:pointer; opacity:.65; padding:0; }
.bk-tag.is-edit button:hover { opacity:1; }

/* 封面 */
.bk-cover { position:relative; aspect-ratio:2/3; border-radius:8px; overflow:hidden; background:var(--bg-soft); box-shadow:0 2px 10px rgba(0,0,0,.14); }
.bk-cover-img { width:100%; height:100%; object-fit:cover; display:block; }
.bk-cover-ph { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:10px; text-align:center; }
.bk-ph-band { position:absolute; left:0; right:0; top:0; height:4px; background:rgba(255,255,255,.28); }
.bk-ph-word { font-size:34px; font-weight:800; color:rgba(255,255,255,.95); line-height:1; text-shadow:0 2px 8px rgba(0,0,0,.25); }
.bk-ph-name { margin-top:8px; font-size:10.5px; line-height:1.45; color:rgba(255,255,255,.82); max-height:3em; overflow:hidden; }
.bk-cover-spine { position:absolute; left:0; top:0; bottom:0; width:8px; background:linear-gradient(90deg, rgba(0,0,0,.24), rgba(0,0,0,.03)); }
.bk-cover-bar { position:absolute; left:0; right:0; bottom:0; height:4px; background:rgba(0,0,0,.3); }
.bk-cover-bar i { display:block; height:100%; background:var(--accent); }
.bk-cover.is-big { border-radius:10px; box-shadow:0 8px 26px rgba(0,0,0,.2); }
.bk-cover.is-big .bk-ph-word { font-size:46px; }

/* 封面墙 */
.bk-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(148px, 1fr)); gap:20px 16px; }
.bk-card { position:relative; cursor:pointer; outline:none; }
.bk-card .bk-cover { transition:transform .2s, box-shadow .2s; }
.bk-card:hover .bk-cover, .bk-card:focus-visible .bk-cover { transform:translateY(-4px); box-shadow:0 12px 26px rgba(0,0,0,.22); }
.bk-card:focus-visible .bk-cover { outline:2px solid var(--accent); outline-offset:2px; }
.bk-card-body { padding:9px 2px 0; }
.bk-card-title { font-size:13px; font-weight:650; color:var(--text-1); line-height:1.4; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.bk-card-sub { margin-top:3px; font-size:11.5px; color:var(--text-3); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.bk-card-foot { margin-top:6px; display:flex; align-items:center; gap:5px; flex-wrap:wrap; }
.bk-chip { padding:2px 8px; border-radius:20px; font-size:10.5px; font-weight:600; }
.bk-st-wish { background:var(--purple-soft); color:var(--purple); }
.bk-st-reading { background:var(--blue-soft); color:var(--blue); }
.bk-st-done { background:var(--green-soft); color:var(--green); }
.bk-st-dropped { background:var(--bg-soft); color:var(--text-3); }
.bk-mini { display:inline-flex; align-items:center; gap:3px; font-size:10.5px; color:var(--text-3); }
.bk-mini svg { width:11px; height:11px; }
.bk-mini-star { color:var(--amber); }
.bk-pin-flag { position:absolute; top:-5px; right:-5px; z-index:2; width:22px; height:22px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--amber); color:#fff; box-shadow:var(--shadow); }
.bk-pin-flag svg { width:12px; height:12px; }
.bk-card-hover { position:absolute; top:7px; left:7px; display:flex; flex-direction:column; gap:5px; opacity:0; transform:translateX(-4px); transition:all .18s; }
.bk-card:hover .bk-card-hover, .bk-card:focus-within .bk-card-hover { opacity:1; transform:none; }
.bk-hbtn { width:26px; height:26px; display:inline-flex; align-items:center; justify-content:center; border:none; border-radius:7px; background:rgba(255,255,255,.9); color:#374151; cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.18); transition:all .15s; }
.bk-hbtn svg { width:13px; height:13px; }
.bk-hbtn:hover { background:#fff; transform:scale(1.08); }
.bk-hbtn-del:hover { background:var(--red); color:#fff; }

/* 列表视图 */
.bk-list { display:flex; flex-direction:column; gap:8px; }
.bk-row { display:flex; align-items:center; gap:14px; padding:11px 14px; border:1px solid var(--border-soft); border-radius:var(--radius); background:var(--bg-surface); cursor:pointer; outline:none; transition:all .15s; }
.bk-row:hover { border-color:var(--border); box-shadow:var(--shadow); }
.bk-row:focus-visible { border-color:var(--accent); }
.bk-row-cv { flex:none; width:42px; }
.bk-row-main { flex:1; min-width:0; }
.bk-row-t { display:flex; align-items:center; gap:7px; flex-wrap:wrap; }
.bk-row-title { font-size:13.5px; font-weight:650; color:var(--text-1); }
.bk-row-pin { padding:1px 7px; border-radius:20px; background:var(--amber-soft); color:var(--amber); font-size:10.5px; font-weight:600; }
.bk-row-sub { margin-top:3px; font-size:11.5px; color:var(--text-3); }
.bk-row-tags { margin-top:5px; display:flex; gap:4px; flex-wrap:wrap; }
.bk-row-side { flex:none; width:150px; display:flex; flex-direction:column; align-items:flex-end; gap:4px; }
.bk-row-prog { display:flex; align-items:center; gap:6px; }
.bk-row-bar { width:64px; height:4px; border-radius:3px; background:var(--bg-soft); overflow:hidden; }
.bk-row-bar i { display:block; height:100%; background:var(--accent); }
.bk-row-time { font-size:10.5px; color:var(--text-3); }
.bk-row-ops { flex:none; display:flex; gap:5px; opacity:0; transition:opacity .15s; }
.bk-row:hover .bk-row-ops, .bk-row:focus-within .bk-row-ops { opacity:1; }
.bk-row-ops .bk-hbtn { background:var(--bg-soft); color:var(--text-2); box-shadow:none; }
.bk-row-ops .bk-hbtn:hover { background:var(--accent-soft); color:var(--accent-text); }
.bk-row-ops .bk-hbtn-del:hover { background:var(--red); color:#fff; }

/* 星级 */
.bk-stars { display:inline-flex; gap:2px; }
.bk-star { position:relative; width:16px; height:16px; color:var(--amber); }
.bk-star svg { width:16px; height:16px; display:block; }
.bk-star-fg { position:absolute; inset:0; width:0; overflow:hidden; }
.bk-star.full .bk-star-fg { width:100%; }
.bk-star.half .bk-star-fg { width:50%; }
.bk-stars.is-edit .bk-star { width:22px; height:22px; }
.bk-stars.is-edit .bk-star svg { width:22px; height:22px; }
.bk-star-hit { position:absolute; top:0; bottom:0; width:50%; border:none; background:transparent; cursor:pointer; padding:0; }
.bk-hit-l { left:0; }
.bk-hit-r { right:0; }
.bk-stars.is-edit:hover .bk-star { transform:scale(1.06); transition:transform .12s; }
/* 详情 / 编辑弹窗 */
.bk-d-mask { position:fixed; inset:0; z-index:160; display:flex; align-items:center; justify-content:center; padding:28px; background:rgba(31,41,55,.52); backdrop-filter:blur(3px); animation:bkdIn .16s ease-out; }
@keyframes bkdIn { from { opacity:0; } to { opacity:1; } }
.bk-d-card { position:relative; display:flex; flex-direction:column; width:min(760px, 100%); max-height:min(86vh, 860px); border:1px solid var(--border); border-radius:18px; background:var(--bg-surface); box-shadow:var(--shadow-lg); overflow:hidden; animation:bkdUp .2s ease-out; }
@keyframes bkdUp { from { transform:translateY(12px) scale(.985); opacity:.4; } to { transform:none; opacity:1; } }
.bk-d-load { padding:64px 0; text-align:center; color:var(--text-3); font-size:13px; }
.bk-d-x { position:absolute; top:12px; right:14px; z-index:3; width:30px; height:30px; border:none; border-radius:8px; background:var(--bg-surface); color:var(--text-3); font-size:22px; line-height:1; cursor:pointer; transition:all .15s; }
.bk-d-x:hover { background:var(--bg-soft); color:var(--text-1); }
.bk-d-top { flex:none; display:flex; gap:20px; padding:22px 52px 20px 22px; border-bottom:1px solid var(--border-soft); background:linear-gradient(180deg, var(--bg-soft), var(--bg-surface)); }
.bk-d-cv { flex:none; width:130px; }
.bk-d-cvimg { width:100%; aspect-ratio:2/3; object-fit:cover; border-radius:10px; box-shadow:0 8px 26px rgba(0,0,0,.2); cursor:zoom-in; display:block; }
.bk-d-info { flex:1; min-width:0; }
.bk-d-hrow { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.bk-flag-pin { padding:2px 8px; border-radius:20px; background:var(--amber-soft); color:var(--amber); font-size:10.5px; font-weight:600; }
.bk-d-title { margin:8px 0 0; font-size:19px; font-weight:700; color:var(--text-1); line-height:1.4; word-break:break-word; }
.bk-d-rate { margin-top:9px; display:flex; align-items:center; gap:9px; }
.bk-d-rate-n { font-size:12px; color:var(--text-3); }
.bk-d-rate-x { border:none; background:transparent; color:var(--text-3); font-size:11.5px; cursor:pointer; text-decoration:underline; padding:0; }
.bk-d-rate-x:hover { color:var(--red); }
.bk-d-chips { margin-top:11px; display:flex; gap:6px; flex-wrap:wrap; }
.bk-d-chip { padding:3px 9px; border-radius:7px; background:var(--bg-soft); color:var(--text-2); font-size:11.5px; }
.bk-d-chip i { font-style:normal; margin-right:5px; color:var(--text-3); }
.bk-d-nometa { margin-top:11px; font-size:11.5px; color:var(--text-3); }
.bk-d-prog { margin-top:14px; }
.bk-d-prog-hd { display:flex; align-items:center; justify-content:space-between; font-size:11.5px; color:var(--text-3); margin-bottom:6px; }
.bk-d-prog-n { color:var(--text-2); font-weight:600; }
.bk-d-prog-tip { font-size:11px; color:var(--text-3); }
.bk-range { width:100%; height:5px; border-radius:4px; background:var(--bg-soft); appearance:none; outline:none; cursor:pointer; }
.bk-range::-webkit-slider-thumb { appearance:none; width:15px; height:15px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-surface); box-shadow:var(--shadow); cursor:grab; }
.bk-range::-moz-range-thumb { width:13px; height:13px; border-radius:50%; background:var(--accent); border:2px solid var(--bg-surface); cursor:grab; }
.bk-d-flow { margin-top:14px; display:flex; gap:6px; flex-wrap:wrap; }
.bk-flow-b { padding:6px 14px; border:1px solid var(--border-soft); border-radius:20px; background:var(--bg-surface); color:var(--text-2); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; }
.bk-flow-b:hover { border-color:var(--accent); color:var(--accent-text); }
.bk-flow-b.on { border-color:transparent; }
.bk-flow-b.on.bk-st-wish { background:var(--purple); color:#fff; }
.bk-flow-b.on.bk-st-reading { background:var(--blue); color:#fff; }
.bk-flow-b.on.bk-st-done { background:var(--green); color:#fff; }
.bk-flow-b.on.bk-st-dropped { background:var(--text-3); color:#fff; }
.bk-d-body { flex:1; overflow-y:auto; padding:18px 22px 4px; }
.bk-d-sec { margin-bottom:20px; }
.bk-d-sec-hd { display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.bk-d-sec-hd h4 { margin:0; font-size:13px; font-weight:700; color:var(--text-1); }
.bk-d-sec-hd .cnt { font-size:11px; color:var(--text-3); }
.bk-d-text { font-size:13px; line-height:1.75; color:var(--text-2); white-space:pre-wrap; word-break:break-word; }
.bk-d-text.is-dim { color:var(--text-3); font-size:12px; }
.bk-note-add { padding:11px 12px; border:1px solid var(--border-soft); border-radius:var(--radius-sm); background:var(--bg-soft); margin-bottom:12px; }
.bk-note-add-r { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:8px; }
.bk-kind-sw { display:inline-flex; padding:2px; border-radius:8px; background:var(--bg-surface); gap:2px; }
.bk-kind { padding:5px 11px; border:none; border-radius:6px; background:transparent; color:var(--text-3); font-size:11.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.bk-kind.on { background:var(--accent-soft); color:var(--accent-text); }
.bk-note-pgin { width:74px; padding:6px 9px; border:1px solid var(--border); border-radius:7px; background:var(--bg-surface); color:var(--text-1); font-size:12px; outline:none; }
.bk-note-in { width:100%; padding:9px 11px; border:1px solid var(--border); border-radius:8px; background:var(--bg-surface); color:var(--text-1); font-size:12.5px; line-height:1.7; resize:vertical; outline:none; font-family:inherit; }
.bk-note-in:focus { border-color:var(--accent); box-shadow:0 0 0 3px var(--accent-weak,rgba(13,148,136,.08)); }
.bk-note-add-f { margin-top:8px; display:flex; justify-content:flex-end; }
.bk-notes { display:flex; flex-direction:column; gap:9px; }
.bk-note { position:relative; padding:10px 12px; border-radius:var(--radius-sm); border-left:3px solid var(--border); background:var(--bg-soft); }
.bk-note.is-quote { border-left-color:var(--amber); }
.bk-note.is-thought { border-left-color:var(--blue); }
.bk-note-hd { display:flex; align-items:center; gap:7px; margin-bottom:5px; }
.bk-note-kind { font-size:10.5px; font-weight:600; color:var(--text-2); }
.bk-note-pg { padding:1px 6px; border-radius:5px; background:var(--bg-surface); color:var(--text-3); font-size:10.5px; }
.bk-note-tm { flex:1; font-size:10.5px; color:var(--text-3); }
.bk-note-x { width:20px; height:20px; border:none; border-radius:5px; background:transparent; color:var(--text-3); font-size:15px; line-height:1; cursor:pointer; opacity:0; transition:all .15s; }
.bk-note:hover .bk-note-x { opacity:1; }
.bk-note-x:hover { background:var(--red-soft); color:var(--red); }
.bk-note-tx { font-size:12.5px; line-height:1.75; color:var(--text-1); white-space:pre-wrap; word-break:break-word; }
.bk-note.is-quote .bk-note-tx { font-style:italic; }
.bk-d-nonote { padding:16px 0; text-align:center; font-size:12px; color:var(--text-3); }
.bk-d-foot { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 20px; border-top:1px solid var(--border-soft); background:var(--bg-soft); }
.bk-d-foot-l { display:flex; gap:7px; flex-wrap:wrap; }
.bk-d-act { display:inline-flex; align-items:center; gap:6px; padding:7px 13px; border:1px solid var(--border-soft); border-radius:9px; background:var(--bg-surface); color:var(--text-2); font-size:12px; font-weight:600; cursor:pointer; transition:all .15s; }
.bk-d-act svg { width:14px; height:14px; }
.bk-d-act:hover { border-color:var(--accent); color:var(--accent-text); }
.bk-d-act.on { background:var(--amber-soft); border-color:transparent; color:var(--amber); }
.bk-d-act-del:hover { border-color:var(--red); background:var(--red-soft); color:var(--red); }
.bk-d-edit { width:auto; padding:8px 22px; }

/* 编辑弹窗 */
.bk-e-card { width:min(880px, 100%); }
.bk-e-head { flex:none; display:flex; align-items:center; justify-content:space-between; padding:17px 52px 15px 22px; border-bottom:1px solid var(--border-soft); }
.bk-e-head h3 { margin:0; font-size:15.5px; font-weight:700; color:var(--text-1); }
.bk-e-body { flex:1; overflow-y:auto; display:flex; gap:22px; padding:20px 22px; }
.bk-e-left { flex:none; width:158px; }
.bk-e-cvbox { position:relative; width:100%; aspect-ratio:2/3; border:1.5px dashed var(--border); border-radius:10px; overflow:hidden; cursor:pointer; background:var(--bg-soft); transition:all .15s; }
.bk-e-cvbox.is-drag { border-color:var(--accent); background:var(--accent-weak,rgba(13,148,136,.08)); }
.bk-e-cvimg { width:100%; height:100%; object-fit:cover; display:block; }
.bk-e-cvph { position:absolute; inset:0; }
.bk-e-cvmask { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(17,24,39,.5); color:#fff; font-size:11.5px; opacity:0; transition:opacity .15s; }
.bk-e-cvbox:hover .bk-e-cvmask, .bk-e-cvbox.is-drag .bk-e-cvmask { opacity:1; }
.bk-e-cvx { width:100%; margin-top:8px; padding:6px 0; font-size:11.5px; }
.bk-e-cvtip { margin-top:9px; font-size:11px; line-height:1.6; color:var(--text-3); }
.bk-e-right { flex:1; min-width:0; }
.bk-e-right .field { margin-bottom:13px; }
.bk-e-row { display:flex; gap:11px; }
.bk-e-row .field { flex:1; min-width:0; }
.bk-e-tags { display:flex; align-items:center; gap:5px; flex-wrap:wrap; padding:7px 9px; border:1px solid var(--border); border-radius:9px; background:var(--bg-surface); }
.bk-e-tags input { flex:1; min-width:110px; border:none; background:transparent; color:var(--text-1); font-size:12.5px; outline:none; padding:2px 0; }
.bk-e-rate { display:flex; align-items:center; gap:10px; }
.bk-e-foot { flex:none; display:flex; align-items:center; justify-content:space-between; gap:12px; padding:13px 22px; border-top:1px solid var(--border-soft); background:var(--bg-soft); }
.bk-e-tip { font-size:11.5px; color:var(--text-3); }
.bk-e-btns { display:flex; gap:9px; }
.bk-e-btns button { width:auto; padding:8px 20px; }

@media (max-width: 1100px) {
  .bk-stats { grid-template-columns:repeat(4, minmax(0,1fr)); }
}
@media (max-width: 920px) {
  .bk-stats { grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; }
  .bk-bar { gap:10px; }
  .bk-bar-r { width:100%; }
  .bk-search { flex:1; }
  .bk-search input { width:100%; }
  .bk-grid { grid-template-columns:repeat(auto-fill, minmax(112px, 1fr)); gap:16px 12px; }
  .bk-row-side { display:none; }
  .bk-row-ops { opacity:1; }
  .bk-card-hover { opacity:1; transform:none; }
  .bk-d-mask { padding:0; align-items:flex-end; }
  .bk-d-card { width:100%; max-height:92vh; border-radius:16px 16px 0 0; }
  .bk-d-top { flex-direction:column; align-items:center; text-align:center; padding:20px 20px 18px; }
  .bk-d-cv { width:108px; }
  .bk-d-hrow, .bk-d-rate, .bk-d-chips, .bk-d-flow { justify-content:center; }
  .bk-e-body { flex-direction:column; }
  .bk-e-left { width:130px; align-self:center; }
  .bk-e-row { flex-direction:column; gap:0; }
  .bk-d-foot { flex-direction:column; align-items:stretch; }
  .bk-d-foot-r .bk-d-edit { width:100%; }
}

/* ===== 书库：电子书原文区 ===== */
.bk-file { display:flex; align-items:center; justify-content:space-between; gap:14px; margin-top:14px; padding:11px 14px; border:1px solid var(--border-soft); border-radius:var(--radius); background:var(--bg-soft); }
.bk-file-l { display:flex; align-items:center; gap:11px; min-width:0; text-align:left; }
.bk-file-l > svg { flex:none; width:22px; height:22px; color:var(--text-3); }
.bk-file-badge { flex:none; padding:4px 9px; border-radius:8px; background:var(--accent); color:#fff; font-size:10.5px; font-weight:700; letter-spacing:.5px; }
.bk-file-t { font-size:13px; font-weight:650; color:var(--text-1); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; max-width:290px; }
.bk-file-s { margin-top:2px; font-size:11.5px; color:var(--text-3); }
.bk-file-r { flex:none; display:flex; align-items:center; gap:7px; }
.bk-file-op { padding:5px 11px; border:1px solid var(--border); border-radius:8px; background:var(--bg-surface); color:var(--text-2); font-size:12px; cursor:pointer; transition:all .15s; }
.bk-file-op:hover { border-color:var(--accent); color:var(--accent-text); }
.bk-file-op-del:hover { border-color:var(--red); color:var(--red); }
.bk-file-none { background:transparent; border-style:dashed; }
.bk-file-read { width:auto; }
.bk-mini-file { padding:1px 6px; border-radius:5px; background:var(--accent-soft); color:var(--accent-text); font-weight:650; font-size:10px; }
.bk-file-flag { position:absolute; top:-5px; left:-5px; z-index:2; width:20px; height:20px; display:flex; align-items:center; justify-content:center; border-radius:50%; background:var(--accent); color:#fff; box-shadow:var(--shadow); }
.bk-file-flag svg { width:11px; height:11px; }
.bk-hbtn-read:hover { background:var(--accent); color:#fff; }
.bk-empty-btns { display:flex; gap:9px; justify-content:center; }
.bk-imp { display:inline-flex; align-items:center; gap:6px; width:auto; padding:8px 14px; }
.bk-imp svg { width:15px; height:15px; }

/* ===== 电子书阅读器 ===== */
.rd-mask { position:fixed; inset:0; z-index:200; background:var(--bg-page); display:flex; }
.rd-wrap {
  flex:1; display:flex; min-width:0;
  --rd-bg:#ffffff;
  --rd-fg:#1f2328;
  --rd-fg2:#6b7280;
  --rd-fg3:#9ca3af;
  --rd-line:#e8eaed;
  --rd-side:#f7f8fa;
  --rd-hi:var(--accent);
}
#bkReader[data-rdtheme="sepia"] .rd-wrap {
  --rd-bg:#f7f0e1;
  --rd-fg:#40352a;
  --rd-fg2:#6d5f4d;
  --rd-fg3:#9b8a72;
  --rd-line:#e4d8bf;
  --rd-side:#f1e8d5;
  --rd-hi:#a3703c;
}
#bkReader[data-rdtheme="night"] .rd-wrap {
  --rd-bg:#181a1d;
  --rd-fg:#d5d8dc;
  --rd-fg2:#9aa1a9;
  --rd-fg3:#6e767f;
  --rd-line:#2b2f34;
  --rd-side:#131518;
  --rd-hi:#4db6a4;
}
#bkReader[data-rdtheme="night"] .rd-side { background:#131518; }

/* 侧栏 */
.rd-side { flex:none; width:272px; display:flex; flex-direction:column; background:var(--rd-side); border-right:1px solid var(--rd-line); transition:width .18s, opacity .18s; }
.rd-side.off { width:0; overflow:hidden; opacity:0; border-right:none; }
.rd-side-h { flex:none; display:flex; gap:4px; padding:12px 12px 8px; }
.rd-stab { flex:1; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:7px 0; border:none; border-radius:9px; background:transparent; color:var(--rd-fg2); font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.rd-stab:hover { color:var(--rd-fg); }
.rd-stab.on { background:var(--rd-bg); color:var(--rd-hi); box-shadow:0 1px 4px rgba(0,0,0,.07); }
.rd-stab-n { padding:1px 6px; border-radius:20px; background:rgba(128,128,128,.16); font-size:10px; font-weight:700; }
.rd-side-b { flex:1; min-height:0; overflow-y:auto; padding:2px 8px 16px; }
.rd-side-empty { padding:26px 14px; text-align:center; font-size:12.5px; line-height:1.7; color:var(--rd-fg3); }
.rd-toc-i { display:flex; align-items:flex-start; gap:9px; width:100%; padding:8px 10px; border:none; border-radius:8px; background:transparent; color:var(--rd-fg2); text-align:left; font-size:12.5px; line-height:1.55; cursor:pointer; transition:all .13s; }
.rd-toc-i:hover { background:rgba(128,128,128,.1); color:var(--rd-fg); }
.rd-toc-i.on { background:var(--rd-bg); color:var(--rd-hi); font-weight:650; box-shadow:0 1px 4px rgba(0,0,0,.06); }
.rd-toc-n { flex:none; min-width:20px; font-size:10.5px; font-variant-numeric:tabular-nums; color:var(--rd-fg3); padding-top:1px; }
.rd-toc-i.on .rd-toc-n { color:var(--rd-hi); }
.rd-toc-t { flex:1; min-width:0; overflow:hidden; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; }
.rd-mk { margin:6px 2px; padding:9px 11px; border-radius:10px; background:var(--rd-bg); box-shadow:0 1px 4px rgba(0,0,0,.05); }
.rd-mk-top { display:flex; align-items:center; gap:7px; }
.rd-mk-dot { flex:none; width:9px; height:9px; border-radius:50%; }
.rd-mk-jump { flex:1; min-width:0; border:none; background:none; padding:0; text-align:left; font-size:11.5px; font-weight:600; color:var(--rd-fg2); cursor:pointer; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rd-mk-jump:hover { color:var(--rd-hi); }
.rd-mk-del { flex:none; width:20px; height:20px; display:inline-flex; align-items:center; justify-content:center; border:none; border-radius:6px; background:transparent; color:var(--rd-fg3); cursor:pointer; }
.rd-mk-del svg { width:12px; height:12px; }
.rd-mk-del:hover { background:var(--red-soft); color:var(--red); }
.rd-mk-q { margin-top:6px; font-size:12.5px; line-height:1.65; color:var(--rd-fg); display:-webkit-box; -webkit-line-clamp:4; -webkit-box-orient:vertical; overflow:hidden; }
.rd-mk-n { margin-top:6px; padding-left:8px; border-left:2px solid var(--rd-hi); font-size:11.5px; line-height:1.6; color:var(--rd-fg2); }
.rd-c-yellow { background:#f2c94c; }
.rd-c-green { background:#6cc26c; }
.rd-c-blue { background:#5b9bf0; }
.rd-c-pink { background:#ef86ac; }
.rd-c-purple { background:#a880e6; }

/* 正文区 */
.rd-main { flex:1; min-width:0; display:flex; flex-direction:column; background:var(--rd-bg); }
.rd-top { flex:none; display:flex; align-items:center; gap:12px; padding:10px 16px; border-bottom:1px solid var(--rd-line); }
.rd-ic { width:32px; height:32px; flex:none; display:inline-flex; align-items:center; justify-content:center; border:none; border-radius:9px; background:transparent; color:var(--rd-fg2); cursor:pointer; transition:all .15s; }
.rd-ic svg { width:17px; height:17px; }
.rd-ic:hover { background:rgba(128,128,128,.13); color:var(--rd-fg); }
.rd-ic.sm { width:30px; height:28px; border-radius:7px; font-size:12px; font-weight:700; }
.rd-tt { flex:1; min-width:0; }
.rd-tt-1 { font-size:13.5px; font-weight:650; color:var(--rd-fg); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rd-tt-2 { margin-top:1px; display:flex; align-items:center; gap:8px; font-size:11.5px; color:var(--rd-fg3); white-space:nowrap; overflow:hidden; }
.rd-tt-n { flex:none; padding:1px 7px; border-radius:20px; background:rgba(128,128,128,.14); font-variant-numeric:tabular-nums; }
.rd-tools { flex:none; display:flex; align-items:center; gap:8px; }
.rd-seg { display:flex; gap:2px; padding:2px; border-radius:9px; background:rgba(128,128,128,.11); }
.rd-th-d { width:13px; height:13px; border-radius:50%; border:1px solid rgba(0,0,0,.16); }
.rd-th-day { background:#fff; }
.rd-th-sepia { background:#f0e2c2; }
.rd-th-night { background:#24272b; }
.rd-th.on { background:var(--rd-bg); box-shadow:0 1px 4px rgba(0,0,0,.14); }
.rd-body { flex:1; min-height:0; overflow-y:auto; padding:34px 28px 64px; scroll-behavior:auto; }
.rd-art { margin:0 auto; color:var(--rd-fg); word-break:break-word; }
.rd-art-h { margin:0 0 26px; font-size:1.34em; font-weight:700; line-height:1.5; color:var(--rd-fg); text-align:center; }
.rd-art p { margin:0 0 1.05em; text-align:justify; }
.rd-art h1, .rd-art h2, .rd-art h3, .rd-art h4, .rd-art h5, .rd-art h6 { margin:1.7em 0 .8em; line-height:1.45; font-weight:700; color:var(--rd-fg); }
.rd-art h1 { font-size:1.3em; } .rd-art h2 { font-size:1.2em; } .rd-art h3 { font-size:1.1em; }
.rd-art h4, .rd-art h5, .rd-art h6 { font-size:1em; }
.rd-art img { display:block; max-width:100%; height:auto; margin:1.4em auto; border-radius:6px; }
.rd-art blockquote { margin:1.3em 0; padding:.5em 0 .5em 1.1em; border-left:3px solid var(--rd-hi); color:var(--rd-fg2); }
.rd-art a { color:var(--rd-hi); text-decoration:none; border-bottom:1px solid currentColor; }
.rd-art ul, .rd-art ol { margin:0 0 1.05em; padding-left:1.8em; }
.rd-art li { margin:.35em 0; }
.rd-art hr { margin:2em 0; border:none; border-top:1px solid var(--rd-line); }
.rd-art table { width:100%; margin:1.3em 0; border-collapse:collapse; font-size:.92em; }
.rd-art th, .rd-art td { padding:7px 10px; border:1px solid var(--rd-line); text-align:left; }
.rd-art th { background:rgba(128,128,128,.09); font-weight:650; }
.rd-art code, .rd-art pre { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:.9em; }
.rd-art code { padding:1px 5px; border-radius:5px; background:rgba(128,128,128,.13); }
.rd-art pre { margin:1.2em 0; padding:12px 14px; border-radius:8px; background:rgba(128,128,128,.1); overflow-x:auto; }
.rd-art pre code { padding:0; background:none; }
.rd-art figcaption, .rd-art small { font-size:.86em; color:var(--rd-fg3); }
.rd-dim { color:var(--rd-fg3); text-align:center; }
.rd-load { display:flex; align-items:center; justify-content:center; gap:6px; padding:90px 0; }
.rd-load span { width:7px; height:7px; border-radius:50%; background:var(--rd-fg3); animation:rdDot 1.05s infinite ease-in-out; }
.rd-load span:nth-child(2) { animation-delay:.16s; }
.rd-load span:nth-child(3) { animation-delay:.32s; }
@keyframes rdDot { 0%, 70%, 100% { transform:translateY(0); opacity:.4; } 35% { transform:translateY(-6px); opacity:1; } }
.rd-err { display:flex; flex-direction:column; align-items:center; gap:12px; padding:90px 20px; color:var(--rd-fg2); font-size:13px; }
.rd-err svg { width:34px; height:34px; color:var(--red); }

/* 底栏 */
.rd-foot { flex:none; display:flex; align-items:center; gap:16px; padding:10px 18px; border-top:1px solid var(--rd-line); }
.rd-nav { flex:none; display:inline-flex; align-items:center; gap:4px; padding:7px 14px; border:1px solid var(--rd-line); border-radius:9px; background:transparent; color:var(--rd-fg2); font-size:12.5px; font-weight:600; cursor:pointer; transition:all .15s; }
.rd-nav svg { width:15px; height:15px; }
.rd-nav:hover:not(:disabled) { border-color:var(--rd-hi); color:var(--rd-hi); }
.rd-nav:disabled { opacity:.36; cursor:default; }
.rd-pct { flex:1; min-width:0; display:flex; align-items:center; gap:10px; }
.rd-pct-t { flex:1; height:4px; border-radius:4px; background:rgba(128,128,128,.2); overflow:hidden; }
.rd-pct-b { height:100%; border-radius:4px; background:var(--rd-hi); transition:width .2s; }
.rd-pct-l { flex:none; font-size:11.5px; font-weight:650; color:var(--rd-fg3); font-variant-numeric:tabular-nums; min-width:34px; text-align:right; }

/* 选中工具条 */
.rd-sel { position:fixed; z-index:210; display:flex; align-items:center; gap:6px; padding:6px 8px; border-radius:11px; background:#22262b; box-shadow:0 8px 26px rgba(0,0,0,.3); }
.rd-sel[hidden] { display:none; }
.rd-sel-cs { display:flex; align-items:center; gap:5px; }
.rd-sel-c { width:17px; height:17px; border:none; border-radius:50%; cursor:pointer; transition:transform .13s; }
.rd-sel-c:hover { transform:scale(1.22); }
.rd-sel-sp { width:1px; height:18px; background:rgba(255,255,255,.2); margin:0 2px; }
.rd-sel-b { padding:4px 9px; border:none; border-radius:7px; background:transparent; color:#e6e8ea; font-size:12px; font-weight:600; cursor:pointer; transition:background .13s; }
.rd-sel-b:hover { background:rgba(255,255,255,.14); }

@media (max-width: 920px) {
  .rd-side { position:absolute; top:0; bottom:0; left:0; z-index:3; width:80%; max-width:300px; box-shadow:var(--shadow-lg); }
  .rd-body { padding:22px 16px 54px; }
  .rd-tt-2 { display:none; }
  .rd-nav span { display:none; }
  .bk-file { flex-direction:column; align-items:stretch; }
  .bk-file-r { justify-content:flex-end; }
  .bk-file-t { max-width:none; }
}

/* ===== \u9605\u8bfb\u5668\uff1aPDF \u539f\u6837\u7248\u9762 ===== */
/* 正文区改成定位上下文，否则 inset 会逃到遮罩层 */
.rd-body-pdf {
  position: relative;
  padding: 0;
  overflow: hidden;
}
.rd-pdf {
  position: absolute;
  inset: 0;
  background: var(--rd-bg);
}
.rd-pdf-f {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #52525b;
}
/* \u9875\u7801\u8df3\u8f6c\uff1a\u8ddf\u8fdb\u5ea6\u6761\u5e76\u6392\u5728\u9875\u811a */
.rd-pg {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
  font-size: 12px;
  color: var(--rd-fg3);
}
.rd-pg-i {
  width: 54px;
  padding: 4px 6px;
  border: 1px solid var(--rd-line);
  border-radius: var(--radius-sm);
  background: var(--rd-side);
  color: var(--rd-fg);
  font: inherit;
  font-size: 12px;
  text-align: center;
  outline: none;
}
.rd-pg-i:focus {
  border-color: var(--accent);
}
.rd-pg-t {
  white-space: nowrap;
}
.rd-dl {
  text-decoration: none;
  font-size: 12px;
  padding: 0 9px;
}

/* ===== \u9605\u8bfb\u5668\u53f3\u4fa7\u8bfb\u4e66\u52a9\u624b ===== */
.rd-ai {
  flex: none;
  width: 372px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--rd-side);
  border-left: 1px solid var(--rd-line);
}
.rd-aion.on {
  background: rgba(128, 128, 128, .15);
  color: var(--rd-hi);
}
.rd-ai-h {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 12px 11px 14px;
  border-bottom: 1px solid var(--rd-line);
}
.rd-ai-h-i {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: var(--rd-hi);
  color: #fff;
}
.rd-ai-h-i svg {
  width: 17px;
  height: 17px;
}
.rd-ai-h-t {
  flex: 1;
  min-width: 0;
}
.rd-ai-h-1 {
  font-size: 13px;
  font-weight: 700;
  color: var(--rd-fg);
  line-height: 1.35;
}
.rd-ai-h-2 {
  font-size: 11px;
  color: var(--rd-fg3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rd-ai-ask {
  flex: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--rd-line);
  background: var(--red-soft);
  font-size: 12px;
  color: var(--rd-fg);
}
.rd-ai-ask span {
  flex: 1;
  min-width: 0;
}
.rd-ai-ask button {
  flex: none;
  padding: 4px 10px;
  border: 1px solid var(--rd-line);
  border-radius: 7px;
  background: var(--rd-bg);
  color: var(--rd-fg2);
  font: inherit;
  cursor: pointer;
}
.rd-ai-ask button.on {
  border-color: transparent;
  background: var(--red);
  color: #fff;
}
.rd-ai-b {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.rd-ai-msg {
  display: flex;
  max-width: 100%;
}
.rd-ai-msg.me {
  justify-content: flex-end;
}
.rd-ai-bub {
  max-width: 88%;
  padding: 8px 11px;
  border-radius: 12px 12px 3px 12px;
  background: var(--rd-hi);
  color: #fff;
  font-size: 13px;
  line-height: 1.66;
  word-break: break-word;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .09);
}
.rd-ai-md {
  max-width: 100%;
  font-size: 13px;
  line-height: 1.78;
  color: var(--rd-fg);
  word-break: break-word;
}
.rd-ai-md > :first-child {
  margin-top: 0;
}
.rd-ai-md > :last-child {
  margin-bottom: 0;
}
.rd-ai-md p {
  margin: 0 0 .7em;
}
.rd-ai-md h1, .rd-ai-md h2, .rd-ai-md h3, .rd-ai-md h4 {
  margin: 1.1em 0 .5em;
  font-size: 1.02em;
  font-weight: 700;
  color: var(--rd-fg);
}
.rd-ai-md ul, .rd-ai-md ol {
  margin: 0 0 .7em;
  padding-left: 1.35em;
}
.rd-ai-md li {
  margin: .2em 0;
}
.rd-ai-md code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(128, 128, 128, .16);
  font-size: .92em;
}
.rd-ai-md pre {
  margin: 0 0 .7em;
  padding: 10px 12px;
  border-radius: 9px;
  background: rgba(128, 128, 128, .13);
  overflow-x: auto;
}
.rd-ai-md pre code {
  padding: 0;
  background: none;
}
.rd-ai-md blockquote {
  margin: 0 0 .7em;
  padding: 2px 0 2px 11px;
  border-left: 3px solid var(--rd-line);
  color: var(--rd-fg2);
}
.rd-ai-md table {
  width: 100%;
  margin: 0 0 .7em;
  border-collapse: collapse;
  font-size: 12px;
}
.rd-ai-md th, .rd-ai-md td {
  padding: 5px 8px;
  border: 1px solid var(--rd-line);
  text-align: left;
}
.rd-ai-md a {
  color: var(--rd-hi);
}
.rd-ai-typing {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
}
.rd-ai-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rd-fg3);
  animation: rdDot 1.05s infinite ease-in-out;
}
.rd-ai-typing i:nth-child(2) {
  animation-delay: .16s;
}
.rd-ai-typing i:nth-child(3) {
  animation-delay: .32s;
}
.rd-ai-load {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 44px 0;
}
.rd-ai-load span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--rd-fg3);
  animation: rdDot 1.05s infinite ease-in-out;
}
.rd-ai-load span:nth-child(2) {
  animation-delay: .16s;
}
.rd-ai-load span:nth-child(3) {
  animation-delay: .32s;
}
.rd-ai-empty {
  margin: auto 0;
  padding: 18px 6px;
  text-align: center;
  color: var(--rd-fg3);
}
.rd-ai-empty svg {
  width: 30px;
  height: 30px;
  color: var(--rd-hi);
  opacity: .55;
}
.rd-ai-empty-t {
  margin: 9px 0 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--rd-fg2);
}
.rd-ai-empty p {
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
}
.rd-ai-err {
  flex: none;
  margin: 0 14px 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
  line-height: 1.6;
}
.rd-ai-quick {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 14px 10px;
}
.rd-ai-q {
  padding: 5px 11px;
  border: 1px solid var(--rd-line);
  border-radius: 999px;
  background: var(--rd-bg);
  color: var(--rd-fg2);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
}
.rd-ai-q:hover {
  border-color: var(--rd-hi);
  color: var(--rd-hi);
}
.rd-ai-in {
  flex: none;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px 14px;
  border-top: 1px solid var(--rd-line);
}
.rd-ai-ta {
  flex: 1;
  min-width: 0;
  max-height: 132px;
  padding: 9px 11px;
  border: 1px solid var(--rd-line);
  border-radius: 11px;
  background: var(--rd-bg);
  color: var(--rd-fg);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: none;
  outline: none;
  transition: border-color .15s;
}
.rd-ai-ta:focus {
  border-color: var(--rd-hi);
}
.rd-ai-ta:disabled {
  opacity: .6;
}
.rd-ai-send {
  flex: none;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 11px;
  background: var(--rd-hi);
  color: #fff;
  cursor: pointer;
  transition: opacity .15s, background .15s;
}
.rd-ai-send:hover {
  opacity: .88;
}
.rd-ai-send svg {
  width: 17px;
  height: 17px;
}
.rd-ai-send.busy {
  background: var(--red);
}
.rd-ai-stop {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #fff;
}

/* \u7a97\u53e3\u7a84\u65f6\u52a9\u624b\u6d6e\u5728\u6b63\u6587\u4e0a\uff0c\u4e0d\u6324\u9605\u8bfb\u533a */
@media (max-width: 1180px) {
  .rd-ai {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    width: 340px;
    max-width: 86%;
    box-shadow: var(--shadow-lg);
  }
}
@media (max-width: 560px) {
  .rd-ai {
    width: 100%;
    max-width: 100%;
  }
}

/* ===== 阅读器：划线定位高亮 ===== */
/* 浮层按内容坐标定位，正文区必须是定位上下文 */
.rd-body { position: relative; }
.rd-hl-l { position:absolute; left:0; top:0; width:100%; height:0; pointer-events:none; z-index:2; }
.rd-hl {
  position:absolute;
  border-radius:3px;
  animation: rdHl 2.6s ease forwards;
}
.rd-hl-yellow { background:rgba(242,201,76,.55); box-shadow:0 0 0 2px rgba(242,201,76,.3); }
.rd-hl-green { background:rgba(108,194,108,.5); box-shadow:0 0 0 2px rgba(108,194,108,.28); }
.rd-hl-blue { background:rgba(91,155,240,.45); box-shadow:0 0 0 2px rgba(91,155,240,.26); }
.rd-hl-pink { background:rgba(239,134,172,.48); box-shadow:0 0 0 2px rgba(239,134,172,.26); }
.rd-hl-purple { background:rgba(168,128,230,.45); box-shadow:0 0 0 2px rgba(168,128,230,.26); }
#bkReader[data-rdtheme="night"] .rd-hl { mix-blend-mode:screen; }
@keyframes rdHl {
  0% { opacity:0; transform:scaleX(.94); }
  12% { opacity:1; transform:scaleX(1); }
  62% { opacity:1; }
  100% { opacity:0; }
}

/* 侧标划线卡片：整块可点，当前定位的那条留个记号 */
.rd-mk { cursor:pointer; border:1px solid transparent; transition:border-color .14s, box-shadow .14s, transform .14s; }
.rd-mk:hover { border-color:var(--rd-hi); box-shadow:0 2px 10px rgba(0,0,0,.09); }
.rd-mk:active { transform:scale(.99); }
.rd-mk:focus-visible { outline:none; border-color:var(--rd-hi); }
.rd-mk.on { border-color:var(--rd-hi); box-shadow:0 2px 10px rgba(0,0,0,.1); }
.rd-mk.on .rd-mk-jump { color:var(--rd-hi); }

/* 退出阅读：放大加底色，别让人找不到出口 */
.rd-exit {
  flex:none; display:inline-flex; align-items:center; gap:6px;
  height:36px; padding:0 14px; margin-left:2px;
  border:1px solid var(--rd-line); border-radius:10px;
  background:var(--rd-side); color:var(--rd-fg);
  font-size:13px; font-weight:650; line-height:1; cursor:pointer;
  transition:background .15s, color .15s, border-color .15s, transform .12s;
}
.rd-exit svg { width:16px; height:16px; }
.rd-exit:hover { background:var(--red-soft); border-color:var(--red); color:var(--red); }
.rd-exit:active { transform:scale(.97); }
.rd-exit:focus-visible { outline:2px solid var(--rd-hi); outline-offset:2px; }
#bkReader[data-rdtheme="night"] .rd-exit:hover { background:rgba(239,68,68,.18); border-color:#ef4444; color:#f87171; }

@media (max-width: 920px) {
  /* 窄屏只留图标，但点击区不缩水 */
  .rd-exit { padding:0 10px; }
  .rd-exit span { display:none; }
}

/* ===== AI 产出物卡片与预览 ===== */
.ai-out-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 11px;
  margin-top: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.ai-out-card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.ai-out-ic {
  flex: none;
  min-width: 44px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .3px;
  background: var(--blue-soft);
  color: var(--blue);
}
.ai-out-ic.k-sheet { background: var(--green-soft); color: var(--green); }
.ai-out-ic.k-web { background: var(--purple-soft); color: var(--purple); }
.ai-out-ic.k-code { background: var(--amber-soft); color: var(--amber); }
.ai-out-ic.k-data { background: var(--bg-soft); color: var(--text-2); }
.ai-out-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ai-out-nm {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-out-sz {
  font-size: 11.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ai-out-acts { flex: none; display: flex; gap: 6px; }
.ai-out-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-2);
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: none;
}
.ai-out-btn:hover { border-color: var(--accent); color: var(--accent); }

.modal-out { max-width: 860px; width: 92vw; display: flex; flex-direction: column; }
.out-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.out-head h3 { flex: 1; min-width: 0; margin: 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.out-head-acts { flex: none; display: flex; gap: 8px; }
.out-body {
  max-height: 66vh;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-page);
  padding: 14px;
}
.out-loading { padding: 30px; text-align: center; color: var(--text-3); font-size: 13px; }
.out-err { padding: 20px; text-align: center; color: var(--red); font-size: 13px; }
.out-tip { margin-top: 10px; font-size: 12px; color: var(--text-3); }
.out-code {
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-all;
}
.out-md { font-size: 13.5px; line-height: 1.75; color: var(--text-1); }
.out-frame { width: 100%; height: 60vh; border: 0; background: #fff; }
.out-table-wrap { overflow: auto; }
.out-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.out-table th, .out-table td {
  border: 1px solid var(--border);
  padding: 6px 9px;
  text-align: left;
  color: var(--text-1);
}
.out-table th { background: var(--bg-soft); font-weight: 600; color: var(--text-2); white-space: nowrap; }

/* ===== 服务器卡片（项目内） ===== */
.srv-warn {
  margin-bottom: 14px;
  padding: 10px 13px;
  border: 1px solid var(--amber);
  background: var(--amber-soft);
  border-radius: var(--radius);
  font-size: 12.5px;
  color: var(--text-1);
}
.srv-list { display: flex; flex-direction: column; gap: 10px; }
.srv-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-surface);
}
.srv-card:hover { border-color: var(--accent); }
.srv-card.is-ro { border-left: 3px solid var(--blue); }
.srv-main { flex: 1; min-width: 0; }
.srv-nm { font-size: 14px; font-weight: 600; color: var(--text-1); display: flex; align-items: center; gap: 7px; }
.srv-ro {
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 500;
}
.srv-addr { margin-top: 3px; font-size: 12.5px; color: var(--text-2); font-family: ui-monospace, Consolas, monospace; }
.srv-note { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.srv-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.srv-acts { display: flex; gap: 6px; }
.srv-badge { font-size: 11.5px; padding: 2px 8px; border-radius: 999px; }
.srv-badge.ok { background: var(--green-soft); color: var(--green); }
.srv-badge.bad { background: var(--red-soft); color: var(--red); }
.srv-badge.busy { background: var(--amber-soft); color: var(--amber); }
.srv-badge.dim { background: var(--bg-soft); color: var(--text-3); }
.srv-tip { margin-top: 12px; font-size: 12px; color: var(--text-3); line-height: 1.6; }
.srv-logs { display: flex; flex-direction: column; gap: 1px; }
.srv-log {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-2);
}
.srv-log:nth-child(odd) { background: var(--bg-soft); }
.srv-log.bad .srv-log-r { color: var(--red); }
.srv-log-t { flex: none; width: 130px; color: var(--text-3); }
.srv-log-s { flex: none; width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.srv-log-c { flex: 1; min-width: 0; font-family: ui-monospace, Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-1); }
.srv-log-r { flex: none; width: 72px; text-align: right; color: var(--green); }
.modal-srv { max-width: 560px; }
.srv-chk { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }
.srv-test-out { min-height: 18px; margin-bottom: 10px; font-size: 12.5px; }
.srv-test-out.ok { color: var(--green); }
.srv-test-out.bad { color: var(--red); }
.srv-test-out.busy { color: var(--text-3); }

/* ===== 操作卡：高危命令风险提示 ===== */
.ai-op-risk {
  margin: 8px 0;
  padding: 9px 11px;
  border: 1px solid var(--red);
  background: var(--red-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-1);
  line-height: 1.6;
}
.ai-op-cmd {
  margin: 8px 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 180px;
  overflow: auto;
}

/* ===== AI 管理：通用能力开关 ===== */
.aim-roots {
  width: 100%;
  min-height: 66px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-1);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12.5px;
  resize: vertical;
}

/* ===== 项目文件（项目内的云盘） ===== */
.tab-btn.tab-pf { display: inline-flex; align-items: center; gap: 5px; }
.tab-btn.tab-pf svg { flex: none; }

.pf-card { padding-bottom: 6px; }

/* 空间占用条 */
.pf-usage {
  margin: 0 0 12px;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.pf-us-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.pf-us-t { font-size: 13px; font-weight: 600; color: var(--text-1); }
.pf-us-d { font-size: 12px; color: var(--text-3); }
.pf-us-bar {
  margin: 7px 0 5px;
  height: 6px;
  background: var(--border-soft);
  border-radius: 99px;
  overflow: hidden;
}
.pf-us-bar > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  transition: width .25s ease;
}
.pf-usage.is-warm .pf-us-bar > i { background: var(--amber); }
.pf-usage.is-hot .pf-us-bar > i { background: var(--red); }
.pf-us-tip { font-size: 11.5px; color: var(--text-3); }

/* 工具条：面包屑 + 操作按钮 */
.pf-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.pf-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-width: 0; }
.pf-up {
  margin-right: 6px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.pf-up:hover { border-color: var(--accent); color: var(--accent); }
.pf-crumb {
  border: none;
  background: none;
  padding: 2px 4px;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  border-radius: 4px;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pf-crumb:hover { background: var(--accent-soft); }
.pf-crumb.cur { color: var(--text-1); font-weight: 600; cursor: default; }
.pf-crumb.cur:hover { background: none; }
.pf-crumb-sep { color: var(--text-3); font-size: 12px; }
.pf-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.pf-uping {
  margin-bottom: 8px;
  padding: 7px 12px;
  background: var(--blue-soft);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-2);
}

/* 文件列表：拖文件进来直接上传 */
.pf-drop {
  border: 1px dashed transparent;
  border-radius: var(--radius-sm);
  transition: background .15s ease, border-color .15s ease;
}
.pf-drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.pf-head-row, .pf-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px 150px 240px;
  align-items: center;
  gap: 10px;
  padding: 0 8px;
}
.pf-head-row {
  height: 32px;
  font-size: 12px;
  color: var(--text-3);
  border-bottom: 1px solid var(--border-soft);
}
.pf-row {
  min-height: 42px;
  border-bottom: 1px solid var(--border-soft);
}
.pf-row:last-child { border-bottom: none; }
.pf-row:hover { background: var(--bg-soft); }
.pf-c-sz, .pf-c-at { font-size: 12.5px; color: var(--text-3); }
.pf-c-op { display: flex; justify-content: flex-end; gap: 4px; flex-wrap: wrap; }

.pf-nm {
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  padding: 4px 0;
  font-size: 13.5px;
  color: var(--text-1);
  cursor: pointer;
  text-align: left;
  min-width: 0;
  width: 100%;
}
.pf-nm > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-nm:hover > span { color: var(--accent); text-decoration: underline; }
.pf-nm.is-dir > span { font-weight: 600; }
.pf-ic { width: 18px; height: 18px; flex: none; }

.pf-act {
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-2);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.6;
}
.pf-act:hover { border-color: var(--accent); color: var(--accent); }
.pf-act.danger:hover { border-color: var(--red); color: var(--red); }

.pf-empty { padding: 46px 20px; text-align: center; }
.pf-e-t { margin-top: 10px; font-size: 14px; color: var(--text-2); font-weight: 600; }
.pf-e-d { margin-top: 5px; font-size: 12.5px; color: var(--text-3); }

/* 在线编辑器 */
.pf-editor { margin-top: 14px; }
.pf-dirty {
  margin-left: 8px;
  padding: 1px 7px;
  background: var(--amber-soft);
  color: var(--text-2);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 500;
}
.pf-ta {
  width: 100%;
  min-height: 340px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-page);
  color: var(--text-1);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  resize: vertical;
  tab-size: 2;
}
.pf-ta:focus { outline: none; border-color: var(--accent); }
.pf-ed-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.pf-clip { font-size: 12px; color: var(--red); }

/* 预览弹窗与通用小弹窗 */
.pf-pv { max-width: 900px; width: 92vw; }
.pf-pv-body {
  margin: 4px 0 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  overflow: auto;
  max-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pf-pv-img { max-width: 100%; max-height: 70vh; display: block; }
.pf-pv-frame { width: 100%; height: 70vh; border: none; background: var(--bg-surface); }
.pf-pv-no { padding: 50px 20px; color: var(--text-3); font-size: 13px; }
.pf-ask-tx { margin: 2px 0 14px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.pf-ask-tx.is-danger { color: var(--red); }
.btn-primary.is-danger { background: var(--red); }

@media (max-width: 720px) {
  .pf-head-row { display: none; }
  .pf-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "nm sz" "op op";
    row-gap: 4px;
    padding: 8px;
  }
  .pf-c-nm { grid-area: nm; }
  .pf-c-sz { grid-area: sz; }
  .pf-c-at { display: none; }
  .pf-c-op { grid-area: op; justify-content: flex-start; }
  .pf-tools { width: 100%; }
}

/* ===== 项目服务器：权限矩阵 ===== */
.psrv-plegend {
  padding: 10px 14px;
  margin: 0 0 4px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.psrv-plegend span {
  display: inline-block;
  min-width: 20px;
  padding: 1px 6px;
  margin: 0 3px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-text);
  text-align: center;
  background: var(--accent-soft);
  border-radius: 4px;
}
.psrv-perm {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 4px 0 8px;
}
.psrv-prow {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color .15s, background .15s;
}
.psrv-prow:hover { border-color: var(--border); }
.psrv-prole {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: center;
  min-width: 0;
}
.psrv-phint {
  font-size: 12px;
  color: var(--text-3);
}
.psrv-pboxes {
  display: flex;
  flex-shrink: 0;
  gap: 8px;
}
.psrv-chk {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 13px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  transition: all .15s;
}
.psrv-chk:hover { border-color: var(--accent); }
.psrv-chk input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--accent); }
.psrv-chk.on {
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.psrv-chk input:disabled { cursor: default; }

@media (max-width: 720px) {
  .psrv-prow { flex-direction: column; align-items: flex-start; }
  .psrv-pboxes { width: 100%; }
  .psrv-chk { flex: 1; justify-content: center; }
}
/* ===== 自媒体 AI 分析 ===== */
.sm-subtabs { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.sm-queue {
  padding: 9px 14px;
  margin-bottom: 10px;
  font-size: 12.5px;
  color: var(--text-2);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
}

/* 话题列表 */
.sm-topics { display: flex; flex-direction: column; gap: 8px; padding: 4px 0 8px; }
.sm-topic {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color .15s, box-shadow .15s;
}
.sm-topic:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(0, 0, 0, .05); }
.sm-topic-main { min-width: 0; }
.sm-topic-nm { font-size: 14.5px; font-weight: 600; color: var(--text-1); }
.sm-topic-meta { margin-top: 4px; font-size: 12.5px; color: var(--text-3); }
.sm-topic-err { margin-top: 4px; font-size: 12px; color: var(--red); }
.sm-topic-side { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.sm-badge {
  padding: 2px 9px;
  font-size: 11.5px;
  border-radius: 999px;
  white-space: nowrap;
}
.sm-badge.ok { color: var(--accent-text); background: var(--accent-soft); }
.sm-badge.bad { color: var(--red); background: var(--red-soft, rgba(220, 38, 38, .1)); }
.sm-badge.wait { color: var(--text-3); background: var(--bg-soft); }

/* 时间范围切换条 */
.sm-rangebar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 4px 0 12px; }

/* 视频卡片墙 */
.sm-vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
  padding: 4px 0 8px;
}
.sm-vcard {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: inherit;
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.sm-vcard:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0, 0, 0, .08); }
.sm-vcover { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-soft); }
.sm-vcover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sm-nocover {
  display: flex;
  height: 100%;
  font-size: 12px;
  color: var(--text-3);
  align-items: center;
  justify-content: center;
}
.sm-vdur {
  position: absolute;
  right: 6px;
  bottom: 6px;
  padding: 1px 6px;
  font-size: 11px;
  color: #fff;
  background: rgba(0, 0, 0, .6);
  border-radius: 4px;
}
.sm-vpf {
  position: absolute;
  top: 6px;
  left: 6px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  border-radius: 4px;
}
.sm-vpf.pf-douyin { background: rgba(17, 17, 17, .82); }
.sm-vpf.pf-xhs { background: rgba(214, 40, 64, .88); }
.sm-vbody { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 10px 11px 11px; }
.sm-vtitle {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-1);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.sm-vmeta { display: flex; flex-wrap: wrap; gap: 3px 8px; font-size: 11.5px; color: var(--text-3); }
.sm-vau { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sm-vai {
  display: flex;
  gap: 6px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  background: var(--bg-soft);
  border-radius: 6px;
}
.sm-vai span {
  flex-shrink: 0;
  height: 16px;
  padding: 0 5px;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  color: var(--accent-text);
  background: var(--accent-soft);
  border-radius: 3px;
}
.sm-vtags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.sm-src { padding: 1px 7px; font-size: 11px; border-radius: 999px; }
.sm-src.search { color: var(--accent-text); background: var(--accent-soft); }
.sm-src.hot { color: var(--text-3); background: var(--bg-soft); }
.sm-hw {
  max-width: 100%;
  overflow: hidden;
  padding: 1px 7px;
  font-size: 11px;
  color: var(--text-3);
  text-overflow: ellipsis;
  white-space: nowrap;
  background: var(--bg-soft);
  border-radius: 999px;
}

/* 热点话题搜索 */
.sm-search { display: flex; gap: 8px; padding: 4px 0 10px; }
.sm-search input {
  flex: 1;
  min-width: 0;
  padding: 9px 12px;
  font-size: 13.5px;
  color: var(--text-1);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sm-search input:focus { outline: none; border-color: var(--accent); }
.sm-kws { display: flex; flex-direction: column; gap: 8px; }
.sm-kw {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 13px;
  cursor: pointer;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.sm-kw:hover { border-color: var(--accent); }
.sm-kw.on { background: var(--accent-soft); border-color: var(--accent); }
.sm-kw-w { font-size: 14px; font-weight: 600; color: var(--text-1); }
.sm-kw-meta { margin-top: 3px; font-size: 12px; color: var(--text-3); }
.sm-kw-side { display: flex; flex-shrink: 0; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.sm-auto { padding: 5px 11px; font-size: 12.5px; }
.sm-kwres { margin-top: 14px; }
.sm-kwres-h { margin-bottom: 8px; font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.sm-hots { display: flex; flex-direction: column; gap: 7px; }
.sm-hot {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  color: inherit;
  text-decoration: none;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  transition: border-color .15s;
}
.sm-hot:hover { border-color: var(--accent); }
.sm-hot-no {
  flex-shrink: 0;
  width: 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-3);
  text-align: center;
}
.sm-hot-body { flex: 1; min-width: 0; }
.sm-hot-t { font-size: 13.5px; color: var(--text-1); }
.sm-hot-body .sm-vai { margin-top: 5px; }
.sm-hot-v { flex-shrink: 0; font-size: 11.5px; color: var(--text-3); white-space: nowrap; }

/* 设置区：定时与 cookie */
.sm-set { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 6px; }
.sm-set-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sm-set-line label:first-child { font-size: 13px; color: var(--text-2); }
.sm-set-line input[type="time"] {
  padding: 7px 10px;
  font-size: 13px;
  color: var(--text-1);
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.sm-ck-list { display: flex; flex-direction: column; gap: 8px; }
.sm-ck-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px 13px;
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
}
.sm-ck-nm { min-width: 70px; font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.sm-ck-fp { font-size: 11px; font-weight: 400; color: var(--text-3); }
.sm-ck-tag { padding: 2px 9px; font-size: 11.5px; border-radius: 999px; }
.sm-ck-tag.ok { color: var(--accent-text); background: var(--accent-soft); }
.sm-ck-tag.bad { color: var(--red); background: var(--red-soft, rgba(220, 38, 38, .1)); }
.sm-ck-tag.wait { color: var(--text-2); background: var(--amber-soft); }
.sm-ck-tag.none { color: var(--text-3); background: var(--bg-soft); }
.sm-ck-acts { display: flex; gap: 8px; margin-left: auto; }
.sm-ck-help {
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.75;
  color: var(--text-3);
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
}
.sm-ck-help code {
  padding: 1px 5px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  background: var(--bg-surface);
  border-radius: 3px;
}
.sm-pfs { display: flex; gap: 10px; }

@media (max-width: 720px) {
  .sm-topic, .sm-kw { flex-direction: column; align-items: flex-start; }
  .sm-topic-side, .sm-kw-side { width: 100%; justify-content: flex-start; }
  .sm-vgrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
  .sm-ck-acts { margin-left: 0; }
}


.sm-ext-status {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
}
.sm-ext-status.ok {
  background: #e8f5e9;
  color: #2e7d32;
}
.sm-ext-status.warn {
  background: #fff8e1;
  color: #f57f17;
}


button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
