/* ============================================================
   TestPM — 测试事务管理  · 设计令牌
   ============================================================ */
:root {
  --bg: #f4f8ff;
  --bg-grad: radial-gradient(900px 380px at 85% -8%, rgba(37, 99, 235, .14), transparent 70%),
             radial-gradient(700px 320px at -5% 0%, rgba(14, 165, 233, .10), transparent 70%);
  --surface: #ffffff;
  --surface-2: #f7faff;
  --surface-3: #eaf1fb;
  --border: #dce7f5;
  --border-strong: #c8d8ec;
  --text: #11213d;
  --text-2: #405675;
  --muted: #788ba6;
  --accent: #1769d1;
  --accent-2: #0ea5e9;
  --accent-soft: rgba(23, 105, 209, .10);
  --accent-grad: linear-gradient(135deg, #1769d1 0%, #0b9fe8 100%);
  --shadow-sm: 0 1px 2px rgba(26, 31, 54, .05), 0 1px 1px rgba(26, 31, 54, .03);
  --shadow: 0 10px 28px -12px rgba(24, 74, 133, .18), 0 2px 6px rgba(26, 31, 54, .04);
  --shadow-lg: 0 24px 60px -12px rgba(24, 74, 133, .28);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar-w: 236px;
  --font: "Inter", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, "Courier New", monospace;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c0f1d;
  --bg-grad: radial-gradient(900px 380px at 85% -8%, rgba(124, 124, 255, .16), transparent 70%),
             radial-gradient(700px 320px at -5% 0%, rgba(14, 165, 233, .09), transparent 70%);
  --surface: #151a2d;
  --surface-2: #1a2036;
  --surface-3: #212842;
  --border: #262d48;
  --border-strong: #343c5c;
  --text: #e9ecf8;
  --text-2: #b4bad6;
  --muted: #7f88ab;
  --accent: #8080ff;
  --accent-2: #a78bfa;
  --accent-soft: rgba(128, 128, 255, .14);
  --accent-grad: linear-gradient(135deg, #6d6df5 0%, #9d6bf7 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 8px 28px -8px rgba(0, 0, 0, .55);
  --shadow-lg: 0 24px 60px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

/* 语义色 */
.tone-blue   { --tc: #2563eb; } .tone-violet { --tc: #7c3aed; } .tone-amber  { --tc: #b7791f; }
.tone-orange { --tc: #ea580c; } .tone-teal   { --tc: #0d9488; } .tone-green  { --tc: #16a34a; }
.tone-slate  { --tc: #64748b; } .tone-danger { --tc: #dc2626; } .tone-accent { --tc: var(--accent); }
[data-theme="dark"] .tone-blue   { --tc: #6ea0ff; } [data-theme="dark"] .tone-violet { --tc: #b496ff; }
[data-theme="dark"] .tone-amber  { --tc: #f5c451; } [data-theme="dark"] .tone-orange { --tc: #ff9a5c; }
[data-theme="dark"] .tone-teal   { --tc: #4fd1c5; } [data-theme="dark"] .tone-green  { --tc: #4ade80; }
[data-theme="dark"] .tone-slate  { --tc: #9aa6bd; } [data-theme="dark"] .tone-danger { --tc: #ff7b7b; }

/* ============================================================ 基础 */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.55; color: var(--text);
  background: var(--bg); background-image: var(--bg-grad); background-attachment: fixed;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
body.modal-open { overflow: hidden; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; letter-spacing: -.01em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--muted); }
.ic { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 2px solid transparent; }

/* ============================================================ 布局 */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 18px 14px 14px;
  background: var(--surface); border-right: 1px solid var(--border); z-index: 30;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 18px; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px; background: var(--accent-grad); color: #fff;
  display: grid; place-items: center; box-shadow: 0 6px 16px -4px rgba(91, 91, 240, .55);
}
.brand b { font-size: 14.5px; letter-spacing: -.01em; display: block; }
.brand small { color: var(--muted); font-size: 11.5px; display: block; }
/* 标题 + 副标题作为一个整体占满中间；折叠按钮在其右侧、与这个整体垂直居中 */
.sidebar .brand > div:nth-child(2) { flex: 1; min-width: 0; line-height: 1.3; }
.sidebar .brand b, .sidebar .brand small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .brand { gap: 9px; padding: 4px 2px 18px 4px; }
.sidebar .brand b { font-size: 13.5px; letter-spacing: -.02em; }
.sidebar .brand small { font-size: 11px; letter-spacing: 0; }
.sidebar .brand .sidebar-toggle { flex: none; align-self: center; margin: 0 0 0 -6px; width: 24px; height: 24px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px; color: var(--text-2);
  font-weight: 500; text-decoration: none; transition: background .15s, color .15s; position: relative;
}
.nav a:hover { background: var(--surface-3); color: var(--text); }
.nav a.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav a.active::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent-grad); }
.nav .count { margin-left: auto; font-size: 11.5px; font-weight: 600; background: var(--surface-3); color: var(--text-2); padding: 1px 8px; border-radius: 20px; }
.nav a.active .count { background: var(--accent); color: #fff; }
.nav .count.hot { background: color-mix(in srgb, #ef4444 16%, transparent); color: #dc2626; }
.side-foot { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 8px; }
.user-card { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; text-decoration: none; color: inherit; }
.user-card:hover { background: var(--surface-3); text-decoration: none; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-grad); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px; flex: none; }
.user-card .u-name { font-weight: 600; font-size: 13.5px; line-height: 1.2; }
.user-card .u-sub { font-size: 11.5px; color: var(--muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: 62px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.topbar .menu-btn { display: none; }
.page-title { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.top-search {
  display: flex; align-items: center; gap: 9px; margin-left: 18px; padding: 7px 12px; min-width: 240px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: 13px; transition: border-color .15s, box-shadow .15s;
}
.top-search:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.top-search kbd { margin-left: auto; font: 600 11px var(--font); padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); }
.spacer { flex: 1; }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); padding: 6px 10px; border-radius: 20px; background: transparent; border: 0; }
.sync:hover { background: var(--surface-3); }
.sync .ic { transition: transform .3s; }
.sync.syncing .ic { animation: spin 1s linear infinite; }
.sync.ok { color: #16a34a; } .sync.bad { color: #dc2626; }
@keyframes spin { to { transform: rotate(360deg); } }

.page { padding: 26px 28px 56px; width: 100%; max-width: 1360px; margin: 0 auto; }
@keyframes fadein { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; font-weight: 750; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.page-head .actions { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ============================================================ 通用组件 */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-h { display: flex; align-items: center; gap: 10px; padding: 15px 18px 0; }
.card-h h3 { font-size: 14.5px; font-weight: 650; display: flex; align-items: center; gap: 8px; }
.card-h h3 .ic { color: var(--accent); }
.card-h-link { color: inherit; text-decoration: none; }
.card-h-link:hover { color: inherit; text-decoration: none; }
.card-h-link:hover h3 { color: var(--accent); }
.card-h .more { margin-left: auto; font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 2px; }
.card-h .more:hover { color: var(--accent); text-decoration: none; }
.card-b { padding: 14px 18px 18px; }
.card-b.tight { padding: 8px 8px 10px; }
.grid { display: grid; gap: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 8px 15px; border-radius: 10px; font-weight: 600; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); white-space: nowrap; transition: all .15s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); border-color: var(--muted); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 6px 16px -6px rgba(91, 91, 240, .65); }
.btn.primary:hover { filter: brightness(1.07); box-shadow: 0 8px 20px -6px rgba(91, 91, 240, .75); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-3); }
.btn.danger { background: #dc2626; border-color: transparent; color: #fff; }
.btn.danger-ghost { color: #dc2626; }
.btn.danger-ghost:hover { background: color-mix(in srgb, #dc2626 10%, transparent); border-color: color-mix(in srgb, #dc2626 35%, transparent); }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 8px; }
.btn.lg { padding: 11px 20px; font-size: 14.5px; border-radius: 12px; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; background: transparent; border: 0; color: var(--text-2); transition: background .15s, color .15s; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn.sm { width: 28px; height: 28px; border-radius: 7px; }
.icon-btn.danger:hover { background: color-mix(in srgb, #dc2626 12%, transparent); color: #dc2626; }

.input, select, textarea, input[type=date], input[type=datetime-local], input[type=text], input[type=password], input[type=number], input[type=search] {
  width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text); font: inherit; outline: none; transition: border-color .15s, box-shadow .15s, background .15s;
}
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .85; }
.input:focus, select:focus, textarea:focus, input:focus { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
select { appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%237b84a3' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
select.compact, .input.compact { padding: 6px 10px; font-size: 13px; border-radius: 9px; }
select.compact { padding-right: 28px; }
textarea { resize: vertical; line-height: 1.6; }
input[type=checkbox] { accent-color: var(--accent); width: 16px; height: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: grid; gap: 14px; }
.row.c2 { grid-template-columns: 1fr 1fr; } .row.c3 { grid-template-columns: repeat(3, 1fr); } .row.c4 { grid-template-columns: repeat(4, 1fr); }
.form { display: flex; flex-direction: column; gap: 16px; }
.flex { display: flex; align-items: center; gap: 10px; } .flex.wrap { flex-wrap: wrap; } .flex.between { justify-content: space-between; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 600; line-height: 1.5; white-space: nowrap;
  color: var(--tc, var(--text-2)); background: color-mix(in srgb, var(--tc, #64748b) 13%, transparent); }
.badge.outline { background: transparent; border: 1px solid color-mix(in srgb, var(--tc) 40%, transparent); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tc, var(--muted)); flex: none; }
.chip-proj { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 550; color: var(--text-2); padding: 1px 9px 1px 7px; border-radius: 20px; background: var(--surface-3); max-width: 160px; }
.chip-proj i { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.chip-proj span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; border-radius: 7px; font-size: 12px; background: var(--accent-soft); color: var(--accent); font-weight: 550; }
.tag button { border: 0; background: none; color: inherit; padding: 0; font-size: 14px; line-height: 1; opacity: .7; }
.tag button:hover { opacity: 1; }
.kbd { font: 600 11px var(--font); padding: 1px 6px; border-radius: 6px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--border); }

.seg { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--surface-3); gap: 2px; }
.seg button, .seg label { border: 0; background: transparent; padding: 5px 13px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--text-2); cursor: pointer; transition: all .15s; display: inline-flex; align-items: center; gap: 6px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg .n { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.seg-sev { display: flex; gap: 6px; }
.seg-sev label { flex: 1; text-align: center; justify-content: center; padding: 8px 6px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-2); transition: all .15s; user-select: none; }
.seg-sev input { display: none; }
.seg-sev label:hover { border-color: var(--tc); }
.seg-sev input:checked + span { color: var(--tc); }
.seg-sev label:has(input:checked) { border-color: var(--tc); background: color-mix(in srgb, var(--tc) 11%, var(--surface)); color: var(--tc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tc) 14%, transparent); }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 36px; }
.toolbar select { width: auto; min-width: 118px; }

.progress { height: 7px; border-radius: 10px; background: var(--surface-3); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 10px; background: var(--accent-grad); transition: width .4s; }

.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.empty h4 { color: var(--text); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 0 14px; font-size: 13px; }
.empty.mini { padding: 20px 10px; } .empty.mini .empty-ic { display: none; }

/* ============================================================ 弹窗 / Toast */
.modal-wrap { position: fixed; inset: 0; z-index: 100; display: grid; place-items: start center; padding: 6vh 16px 16px; overflow-y: auto; opacity: 0; transition: opacity .18s; }
.modal-wrap.in { opacity: 1; }
.modal-back { position: fixed; inset: 0; background: rgba(12, 15, 29, .5); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); }
.modal { position: relative; width: 100%; background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--border); transform: translateY(14px) scale(.985); transition: transform .22s cubic-bezier(.2, .9, .3, 1.2); }
.modal-wrap.in .modal { transform: none; }
.modal.sm { max-width: 420px; } .modal.md { max-width: 640px; } .modal.lg { max-width: 820px; } .modal.xl { max-width: 980px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.modal-head h3 { font-size: 16.5px; font-weight: 700; }
.modal-body { padding: 16px 20px 6px; }
.modal-body.flush { padding: 0; }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; }
.modal-foot .left { margin-right: auto; color: var(--muted); font-size: 12.5px; }
.confirm-msg { margin: 4px 0 8px; color: var(--text-2); font-size: 14.5px; }
.toasts { position: fixed; z-index: 200; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; padding: 10px 16px; border-radius: 12px; background: #1c2138; color: #fff; font-weight: 550; font-size: 13.5px; box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all .22s; }
.toast.in { opacity: 1; transform: none; }
.toast.error { background: #b91c1c; } .toast.success { background: #15803d; }
.lightbox { position: fixed; inset: 0; z-index: 300; background: rgba(0, 0, 0, .85); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fadein .15s; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: var(--shadow-lg); }

/* ============================================================ Markdown 内容 */
.md { font-size: 14px; line-height: 1.7; color: var(--text); word-break: break-word; }
.md > :first-child { margin-top: 0; } .md > :last-child { margin-bottom: 0; }
.md p { margin: .55em 0; }
.md .md-h { margin: 1.1em 0 .4em; font-weight: 700; }
.md h2.md-h { font-size: 1.2em; } .md h3.md-h { font-size: 1.08em; } .md h4.md-h, .md h5.md-h { font-size: 1em; color: var(--text-2); }
.md code { font-family: var(--mono); font-size: .88em; padding: .12em .42em; border-radius: 6px; background: var(--surface-3); color: var(--accent); }
.md-code { margin: .7em 0; border-radius: 12px; overflow: hidden; background: #12162a; border: 1px solid #262c4a; }
[data-theme="dark"] .md-code { background: #0a0d1a; }
.md-code-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 14px; background: rgba(255, 255, 255, .05); font-size: 11.5px; color: #8e97c0; font-family: var(--mono); }
.md-copy { border: 0; background: rgba(255, 255, 255, .08); color: #c3caea; border-radius: 6px; padding: 2px 10px; font-size: 11.5px; transition: background .15s; }
.md-copy:hover { background: rgba(255, 255, 255, .18); }
.md-code pre { margin: 0; padding: 12px 14px; overflow-x: auto; }
.md-code code { background: none; color: #dfe4fb; padding: 0; font-size: 13px; line-height: 1.6; white-space: pre; }
.md blockquote { margin: .7em 0; padding: .1em 1em; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 10px 10px 0; color: var(--text-2); }
.md-list { margin: .5em 0; padding-left: 1.5em; }
.md-list li { margin: .18em 0; }
.md-list .md-task { list-style: none; margin-left: -1.35em; display: flex; gap: 8px; align-items: flex-start; }
.md-box { flex: none; width: 16px; height: 16px; margin-top: 4px; border-radius: 5px; border: 1.6px solid var(--border-strong); display: grid; place-items: center; font-size: 11px; color: #fff; }
.md-task.done .md-box { background: var(--accent); border-color: var(--accent); }
.md-task.done { color: var(--muted); text-decoration: line-through; }
.md-img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; margin: 4px 0; display: block; }
.md hr { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.md-table { overflow-x: auto; margin: .7em 0; }
.md table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.md th { background: var(--surface-2); font-weight: 650; }

/* Markdown 编辑器 */
.mde { border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.mde:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.mde.drag { border-color: var(--accent); background: var(--accent-soft); }
.mde-bar { display: flex; align-items: center; justify-content: space-between; padding: 5px 6px 5px 8px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.mde-tools { display: flex; gap: 1px; flex-wrap: wrap; }
.mde-tabs { display: flex; gap: 2px; }
.mde-tabs button { border: 0; background: none; padding: 3px 11px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-radius: 7px; }
.mde-tabs button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.mde textarea { border: 0; border-radius: 0; box-shadow: none !important; display: block; min-height: 90px; resize: none; font-family: var(--font); padding: 12px 14px; background: transparent; }
.mde textarea.mono { font-family: var(--mono); font-size: 13px; }
.mde-preview { padding: 12px 14px; min-height: 90px; }
.mde-foot { display: flex; justify-content: space-between; padding: 5px 12px 7px; font-size: 11.5px; color: var(--muted); border-top: 1px dashed var(--border); }
.mde.compact .mde-foot { display: none; }
.taginput { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 6px 8px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface); min-height: 40px; cursor: text; }
.taginput:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3.5px var(--accent-soft); }
.taginput input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 100px; padding: 3px 4px; background: transparent; }

/* ============================================================ 首页 */
.home-grid { display: grid; grid-template-columns: 372px minmax(0, 1fr); gap: 20px; align-items: start; }
.home-left, .home-right { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.hero { position: relative; overflow: hidden; padding: 20px; border-radius: 18px; color: #fff; background: var(--accent-grad); box-shadow: 0 16px 36px -14px rgba(91, 91, 240, .7); }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 190px; height: 190px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero::before { content: ""; position: absolute; right: 30px; bottom: -70px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero h2 { font-size: 19px; font-weight: 750; position: relative; z-index: 1; }
.hero .date { opacity: .85; font-size: 13px; margin-top: 2px; position: relative; z-index: 1; }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero-stat { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .2); border-radius: 13px; padding: 10px 13px; backdrop-filter: blur(6px); text-decoration: none; color: #fff; display: block; transition: background .15s; }
.hero-stat:hover { background: rgba(255, 255, 255, .26); text-decoration: none; }
.hero-stat b { font-size: 24px; font-weight: 750; letter-spacing: -.02em; display: block; line-height: 1.15; }
.hero-stat small { opacity: .85; font-size: 12px; }
.todo-quick { display: flex; gap: 8px; padding: 12px 14px 4px; }
.todo-quick input { border-radius: 10px; }
.todo-list { list-style: none; margin: 0; padding: 6px 8px 8px; }
.todo-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px; border-radius: 10px; transition: background .12s; position: relative; }
.todo-item:hover { background: var(--surface-2); }
.todo-item .cb { flex: none; width: 19px; height: 19px; margin-top: 2px; border-radius: 6px; border: 1.8px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; padding: 0; color: #fff; transition: all .15s; }
.todo-item .cb:hover { border-color: var(--accent); }
.todo-item.done .cb { background: var(--accent); border-color: var(--accent); }
.todo-item .cb .ic { opacity: 0; } .todo-item.done .cb .ic { opacity: 1; }
.todo-body { flex: 1; min-width: 0; cursor: pointer; }
.todo-title { font-weight: 550; word-break: break-word; }
.todo-item.done .todo-title { color: var(--muted); text-decoration: line-through; }
.todo-meta { display: flex; align-items: center; gap: 8px; margin-top: 2px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.todo-meta .due.over { color: #dc2626; font-weight: 600; }
.todo-meta .due.today { color: var(--accent); font-weight: 600; }
.todo-item .row-actions { opacity: 0; display: flex; transition: opacity .12s; }
.todo-item:hover .row-actions { opacity: 1; }
.todo-sec { padding: 10px 12px 2px; font-size: 12px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.todo-sec.over { color: #dc2626; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .25) 0); display: grid; place-items: center; position: relative; flex: none; }
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: #6b63f2; }
.ring span { position: relative; font-size: 12px; font-weight: 700; }

.quick-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.quick-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--accent-grad); }
.quick-card .qc-title { display: flex; align-items: center; gap: 8px; font-weight: 650; margin-bottom: 11px; }
.quick-card .qc-title .ic { color: var(--accent); }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; }
.quick-row .grow { flex: 1; min-width: 220px; }
.quick-row select { width: auto; min-width: 140px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat { padding: 15px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; display: block; transition: transform .15s, box-shadow .15s; }
a.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; }
.stat .s-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in srgb, var(--tc) 14%, transparent); color: var(--tc); margin-bottom: 10px; }
.stat b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; line-height: 1.1; display: block; }
.stat small { color: var(--muted); font-size: 12.5px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.proj-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; padding: 14px 18px 18px; }
.proj-mini a { display: block; padding: 13px 14px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--border); color: inherit; text-decoration: none; transition: all .15s; }
.proj-mini a:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.pm-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.pm-top b { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-sub { color: var(--muted); font-size: 12.5px; margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.pm-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }

.chart-wrap { padding: 8px 18px 18px; }
.donut-box { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.legend { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 140px; }
.legend div { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.legend b { margin-left: auto; font-weight: 650; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 130px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-width: 0; }
.bar-stack { width: 100%; max-width: 22px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; flex: 1; }
.bar-stack i { display: block; width: 100%; border-radius: 5px; min-height: 0; transition: height .4s; }
.bar-col small { font-size: 10.5px; color: var(--muted); }
.bar-col.today small { color: var(--accent); font-weight: 700; }

/* ============================================================ 问题反馈 */
.issue-list { display: flex; flex-direction: column; gap: 10px; }
.issue-row {
  display: grid; grid-template-columns: 4px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 13px 18px 13px 0; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-sm); text-decoration: none; color: inherit; transition: all .15s; cursor: pointer; overflow: hidden;
}
.issue-row:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); box-shadow: var(--shadow); transform: translateY(-1px); text-decoration: none; }
.issue-row .bar { align-self: stretch; background: var(--tc); border-radius: 0 4px 4px 0; }
.issue-row.closed { opacity: .72; }
.issue-row.closed .i-title { text-decoration: line-through; text-decoration-color: var(--muted); }
.i-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.i-no { font: 600 12px var(--mono); color: var(--muted); }
.i-title { font-weight: 650; font-size: 14.5px; word-break: break-word; }
.i-sub { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.i-sub .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--border-strong); }
.i-side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.i-side .when { font-size: 12px; color: var(--muted); }

.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.col { background: var(--surface-3); border-radius: 16px; padding: 10px; min-height: 160px; transition: background .15s, box-shadow .15s; }
.col.over { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.col-h { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; font-weight: 650; font-size: 13.5px; }
.col-h .n { margin-left: auto; font-size: 12px; color: var(--muted); font-weight: 600; background: var(--surface); padding: 0 8px; border-radius: 10px; }
.kcard { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 11px 12px; margin-bottom: 9px; cursor: grab; box-shadow: var(--shadow-sm); transition: all .15s; border-left: 3px solid var(--tc); display: block; color: inherit; text-decoration: none; }
.kcard:hover { box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.kcard.dragging { opacity: .4; }
.kcard .k-t { font-weight: 600; font-size: 13.5px; margin: 3px 0 7px; word-break: break-word; }
.kcard .k-m { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }

.detail { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.crumb { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.crumb a { color: var(--muted); display: inline-flex; align-items: center; gap: 4px; } .crumb a:hover { color: var(--accent); text-decoration: none; }
.d-title { font-size: 23px; font-weight: 750; line-height: 1.3; word-break: break-word; }
.d-badges { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; align-items: center; }
.sec-title { font-size: 13.5px; font-weight: 700; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.sec-title .ic { color: var(--accent); }
.props { display: flex; flex-direction: column; }
.prop { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.prop:last-child { border-bottom: 0; }
.prop > label { font-size: 12.5px; color: var(--muted); font-weight: 550; }
.prop .v { min-width: 0; font-weight: 550; word-break: break-word; }
.prop input, .prop select { padding: 5px 9px; font-size: 13px; border-color: transparent; background: var(--surface-2); border-radius: 8px; font-weight: 550; }
.prop input:hover, .prop select:hover { border-color: var(--border-strong); }
.prop input:focus, .prop select:focus { border-color: var(--accent); background: var(--surface); }

.timeline { position: relative; display: flex; flex-direction: column; gap: 0; padding-left: 4px; }
.tl-item { position: relative; display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding-bottom: 18px; }
.tl-item::before { content: ""; position: absolute; left: 14px; top: 30px; bottom: 0; width: 2px; background: var(--border); }
.tl-item:last-child::before { display: none; }
.tl-dot { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--tc, var(--accent)) 14%, var(--surface)); color: var(--tc, var(--accent)); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border); z-index: 1; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; min-height: 30px; }
.tl-head b { font-weight: 650; }
.tl-head .t { color: var(--muted); font-size: 12px; }
.tl-head .row-actions { margin-left: auto; opacity: 0; display: flex; }
.tl-item:hover .tl-head .row-actions { opacity: 1; }
.tl-body { margin-top: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; }
.tl-arrow { color: var(--muted); }
.composer { margin-top: 6px; padding: 14px; border: 1px solid var(--border); background: var(--surface-2); border-radius: 14px; }
.composer-foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer-foot select, .composer-foot input { width: auto; }

/* ============================================================ 项目 / 样机 / 笔记 / 日报 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 16px; }
.pcard { padding: 18px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-sm); cursor: pointer; text-decoration: none; color: inherit; display: block; transition: all .18s; position: relative; overflow: hidden; }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--pc) 50%, var(--border)); text-decoration: none; }
.pcard::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--pc); }
.pcard h3 { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.pcard .p-sub { color: var(--muted); font-size: 13px; margin: 3px 0 12px; }
.pcard .p-stats { display: flex; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--text-2); }
.pcard .p-stats b { font-size: 15px; display: block; color: var(--text); }
.milestones { display: flex; flex-direction: column; gap: 4px; }
.ms { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; }
.ms:hover { background: var(--surface-2); }
.ms.done .ms-name { text-decoration: line-through; color: var(--muted); }
.ms .ms-name { flex: 1; font-weight: 550; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin: 8px 0 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-color: var(--accent); }
.tabs .n { font-size: 11.5px; background: var(--surface-3); border-radius: 10px; padding: 0 7px; color: var(--text-2); }

.dev-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.dev-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.dev-table th:first-child { border-top-left-radius: 14px; } .dev-table th:last-child { border-top-right-radius: 14px; }
.dev-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dev-table tr:last-child td { border-bottom: 0; }
.dev-table tbody tr { cursor: pointer; transition: background .12s; } .dev-table tbody tr:hover { background: var(--surface-2); }
.mono { font-family: var(--mono); font-size: 12.5px; }
.table-wrap { overflow-x: auto; border-radius: 14px; }

.split { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.side-list { position: sticky; top: 80px; max-height: calc(100vh - 100px); display: flex; flex-direction: column; overflow: hidden; }
.side-list .items { overflow-y: auto; padding: 6px 8px 10px; flex: 1; }
.li { display: block; padding: 10px 12px; border-radius: 11px; cursor: pointer; border: 1px solid transparent; color: inherit; text-decoration: none; }
.li:hover { background: var(--surface-2); text-decoration: none; }
.li.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.li .t { font-weight: 650; display: flex; align-items: center; gap: 6px; }
.li .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.li .m { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.paper { padding: 22px 26px 26px; min-height: 420px; }
.paper h1.title { font-size: 24px; font-weight: 750; }
.paper .title-input { font-size: 22px; font-weight: 750; border: 0; padding: 4px 0; background: transparent; box-shadow: none !important; border-radius: 0; border-bottom: 1px dashed var(--border-strong); }
.paper-meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0 18px; color: var(--muted); font-size: 12.5px; }

/* 日报周报日历 */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding: 4px 10px 12px; text-align: center; }
.cal .wd { font-size: 11px; color: var(--muted); padding: 4px 0; font-weight: 600; }
.cal button { border: 0; background: transparent; height: 32px; border-radius: 9px; font-size: 12.5px; font-weight: 550; position: relative; color: var(--text-2); }
.cal button:hover { background: var(--surface-3); }
.cal button.has::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); transform: translateX(-50%); }
.cal button.today { color: var(--accent); font-weight: 800; }
.cal button.sel { background: var(--accent); color: #fff; }
.cal button.sel::after { background: #fff; }
.cal button.dim { opacity: .35; }

/* 设置 / 登录 */
.settings { max-width: 760px; display: flex; flex-direction: column; gap: 16px; }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row .info { flex: 1; min-width: 0; } .set-row .info b { display: block; font-weight: 600; } .set-row .info span { font-size: 12.5px; color: var(--muted); }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; padding: 56px 60px; color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(800px 500px at 100% 0%, rgba(167, 139, 250, .55), transparent 60%), radial-gradient(700px 500px at 0% 100%, rgba(14, 165, 233, .45), transparent 60%), linear-gradient(135deg, #3b3bd6, #6d3fe0); }
.auth-hero::after { content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%; right: -180px; bottom: -200px; border: 70px solid rgba(255, 255, 255, .06); }
.auth-hero .brand-mark { background: rgba(255, 255, 255, .2); box-shadow: none; backdrop-filter: blur(6px); }
.auth-hero h1 { font-size: 38px; font-weight: 800; line-height: 1.2; letter-spacing: -.02em; margin: 0 0 14px; }
.auth-hero p.lead { font-size: 16px; opacity: .88; max-width: 460px; line-height: 1.7; margin: 0; }
.feat { display: grid; gap: 14px; margin-top: 34px; max-width: 470px; position: relative; z-index: 1; }
.feat div { display: flex; gap: 13px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(6px); }
.feat b { display: block; font-size: 14px; } .feat span { font-size: 12.5px; opacity: .8; }
.auth-form-wrap { display: grid; place-items: center; padding: 32px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h2 { font-size: 26px; font-weight: 800; margin-bottom: 6px; }
.auth-card .sub { color: var(--muted); margin-bottom: 24px; }
.auth-err { background: color-mix(in srgb, #ef4444 12%, transparent); color: #dc2626; border-radius: 10px; padding: 9px 13px; font-size: 13px; font-weight: 550; margin-bottom: 14px; }
[data-theme="dark"] .auth-err { color: #ff8a8a; }

/* 搜索面板 */
.palette-modal { max-width:960px; }
.palette-in { display:flex; align-items:center; gap:12px; min-width:0; padding:16px 20px; border-bottom:1px solid var(--border); background:linear-gradient(180deg,var(--surface),var(--surface-2)); }
.palette-in > .ic { flex:none; color:var(--accent); }
.palette-in input { flex:1 1 auto; width:0 !important; min-width:0; height:32px; padding:3px 0; border:0 !important; border-radius:0; outline:0; box-shadow:none !important; background:transparent; color:var(--text); font-size:16px; font-weight:540; }
.palette-in input::placeholder { color:var(--muted); opacity:.8; }
.palette-list { max-height:50vh; overflow-y:auto; padding:10px 12px 12px; }
.palette-group { font-size:10.5px; font-weight:720; color:var(--muted); text-transform:uppercase; letter-spacing:.08em; padding:10px 10px 5px; }
.palette-item { display:flex; align-items:center; gap:12px; padding:10px 12px; border:1px solid transparent; border-radius:11px; cursor:pointer; transition:background .14s,border-color .14s; }
.palette-item:hover,.palette-item.on { background:var(--accent-soft); border-color:color-mix(in srgb,var(--accent) 12%,transparent); }
.palette-item .p-ic { width:32px; height:32px; border-radius:10px; display:grid; place-items:center; background:var(--surface-3); color:var(--accent); flex:none; }
.palette-item .p-t { font-size:13.5px; font-weight:650; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.palette-item .p-s { margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:11.5px; color:var(--muted); }
.palette-foot { display:flex; gap:16px; padding:10px 18px; border-top:1px solid var(--border); background:var(--surface-2); font-size:11.5px; color:var(--muted); }
@media (max-width:640px) { .palette-in { padding:14px 16px; }.palette-in input { font-size:14px; }.palette-list { max-height:56vh; padding:8px; }.palette-foot { gap:10px; padding:9px 12px; font-size:10.5px; } }

.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 28px; }
.sc-grid div { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px dashed var(--border); }

.back-drop { display: none; }

/* ============================================================ 响应式 */
@media (max-width: 1180px) {
  .home-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; width: 264px; transform: translateX(-102%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .back-drop.show { display: block; position: fixed; inset: 0; background: rgba(12, 15, 29, .45); z-index: 25; }
  .topbar { padding: 0 16px; } .topbar .menu-btn { display: inline-grid; }
  .top-search { min-width: 0; margin-left: 4px; } .top-search span, .top-search kbd { display: none; }
  .page { padding: 18px 16px 48px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); } .side-list { position: static; max-height: 340px; }
  .two-col { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; } .auth-hero { display: none; }
}
@media (max-width: 640px) {
  .row.c2, .row.c3, .row.c4 { grid-template-columns: 1fr; }
  .issue-row { grid-template-columns: 4px minmax(0, 1fr); } .i-side { display: none; }
  .page-head h1 { font-size: 21px; }
  .sc-grid { grid-template-columns: 1fr; }
  .stat-grid { gap: 10px; }
  .modal-wrap { padding: 0; place-items: end center; }
  .modal { border-radius: 20px 20px 0 0; max-width: none !important; }
  .sync span { display: none; }
  .btn .hide-sm { display: none; }
}
@media print { .sidebar, .topbar { display: none; } .app { display: block; } }

/* ============================================================ 补充组件 */
.cbx { flex: none; width: 19px; height: 19px; border-radius: 6px; border: 1.8px solid var(--border-strong); background: var(--surface); display: grid; place-items: center; padding: 0; color: #fff; transition: all .15s; }
.cbx:hover { border-color: var(--accent); }
.cbx .ic { opacity: 0; } .cbx.on { background: var(--accent); border-color: var(--accent); } .cbx.on .ic { opacity: 1; }
.bar-pair { display: flex; align-items: flex-end; justify-content: center; gap: 2px; flex: 1; width: 100%; }
.bar-pair i { display: block; width: 8px; max-width: 45%; border-radius: 4px 4px 2px 2px; min-height: 2px; transition: height .4s; }
.bar-pair i.a { background: var(--accent); } .bar-pair i.b { background: #22c55e; }
details.more { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 10px 14px; background: var(--surface-2); }
details.more > summary { cursor: pointer; font-weight: 600; font-size: 13.5px; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--text-2); user-select: none; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary .muted { font-weight: 400; font-size: 12px; }
details.more > summary .ic { transition: transform .15s; }
details.more[open] > summary .ic { transform: rotate(90deg); }
.title-input { width: 100%; }
.todo-list .todo-item .row-actions { flex: none; }
@media (hover: none) { .todo-item .row-actions, .tl-head .row-actions { opacity: 1; } }
.link-btn { color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: none; }
.link-btn:hover { text-decoration: underline; }
.search { max-width: 280px; }
.toolbar select { min-width: 104px; }
.quick-row select { min-width: 0; width: 124px; }
.quick-row .grow { min-width: 200px; }
.board { grid-auto-columns: minmax(215px, 1fr); }

/* ============================================================ 父子项目工作台 */
.dashboard-page { max-width: 1500px; }
.welcome-card { margin-bottom: 18px; padding: 22px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.welcome-card > div:nth-child(2) { flex: 1; min-width: 240px; }
.dashboard-header { display: flex; justify-content: space-between; align-items: stretch; gap: 22px; margin: 4px 0 20px; }
.dashboard-header h2 { font-size: 26px; font-weight: 760; margin-top: 8px; }.dashboard-header .date { color: var(--muted); margin-top: 5px; }
.kpi-grid { margin-left: auto; display: grid; grid-template-columns: repeat(4, minmax(118px, 1fr)); gap: 10px; width: min(680px, 66%); }
.kpi-card { min-height: 88px; padding: 14px 15px; border-radius: 14px; color: var(--text); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); text-decoration: none; display: flex; flex-direction: column; justify-content: space-between; transition: .16s ease; }
.kpi-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }.kpi-card span { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 5px; }.kpi-card b { font-size: 26px; line-height: 1; }.kpi-card b small { color: var(--muted); font-size: 13px; font-weight: 600; }.kpi-card.danger b { color: #dc2626; }.kpi-card.blue b { color: var(--accent); }.kpi-card.green b { color: #16995a; }.kpi-card.violet b { color: #5c63c9; }
.dashboard-project { margin-bottom: 18px; }.dashboard-project .card-h { padding: 18px 20px 4px; }.dashboard-project .card-h h3 { font-size: 16px; }
.project-status-grid { display: flex; flex-wrap: nowrap; gap: 12px; overflow-x: auto; padding: 14px 20px 20px; }.project-status-grid.has-expanded { flex-wrap: wrap; overflow: visible; }
.parent-project-card { position: relative; flex: 1 0 250px; min-width: 250px; background: linear-gradient(145deg, var(--surface) 0%, var(--surface-2) 100%); border: 1px solid var(--border); border-radius: 15px; overflow: hidden; transition: .2s ease; }.parent-project-card::before { content:""; height: 3px; position:absolute; inset:0 0 auto; background:var(--accent-grad); }.parent-project-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); box-shadow: var(--shadow); }.parent-project-card.expanded { flex-basis: 100%; min-width: 100%; }
.parent-project-main { display: block; color: inherit; padding: 18px 42px 15px 17px; text-decoration: none; }.parent-project-main:hover { text-decoration: none; }.parent-project-code { display: flex; align-items: center; gap: 8px; }.parent-project-code i { width: 9px; height: 9px; border-radius: 3px; background: var(--accent-grad); }.parent-project-code b { font-size: 16px; }.parent-project-customer { display:block; color:var(--muted); font-size:12px; margin:3px 0 13px 17px; }.parent-project-metrics { display:flex; gap:10px; color:var(--muted); font-size:12px; }.parent-project-metrics b { color:var(--text); font-size:15px; }.project-expand { position:absolute; right:11px; top:11px; width:29px; height:29px; border:0; border-radius:8px; background:var(--surface-3); color:var(--accent); display:grid; place-items:center; }.project-expand:hover { background:var(--accent-soft); }
.model-project-row { display:grid; grid-template-columns:repeat(auto-fit,minmax(215px,1fr)); gap:10px; padding: 0 14px 14px; border-top:1px solid var(--border); padding-top:12px; }.model-project-card { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:12px; border:1px solid var(--border); border-radius:11px; background:var(--surface); color:var(--text); text-decoration:none; }.model-project-card:hover { text-decoration:none; border-color:var(--accent); }.model-project-card b,.model-project-card span { display:block; }.model-project-card span { font-size:11.5px; color:var(--muted); margin-top:2px; }.model-project-card div:last-child { font-size:11.5px; color:var(--muted); white-space:nowrap; }.model-project-card em,.detail-model-card em { font-style:normal; color:var(--accent); font-weight:750; }.model-project-empty { color:var(--muted); font-size:13px; padding:4px; }
.dashboard-body { display:grid; grid-template-columns:minmax(300px,.75fr) minmax(0,1.5fr); gap:18px; align-items:start; }.dashboard-todos,.dashboard-feed { display:flex; flex-direction:column; gap:18px; }.compact-issues .issue-row { padding-top:10px; padding-bottom:10px; }.compact-issues .i-sub { margin-top:3px; }.note-grid { padding:10px; display:grid; grid-template-columns:repeat(auto-fit,minmax(210px,1fr)); gap:8px; }.note-card { color:var(--text); text-decoration:none; padding:13px; border:1px solid transparent; border-radius:12px; background:var(--surface-2); }.note-card:hover { text-decoration:none; border-color:var(--border-strong); background:var(--surface); }.note-card b { display:block; }.note-card p { color:var(--muted); font-size:12.5px; margin:5px 0 8px; min-height:37px; }.note-card span { color:var(--muted); font-size:11.5px; }
.parent-list-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(380px,1fr)); gap:18px; }.parent-list-card { border:1px solid var(--border); border-radius:17px; overflow:hidden; background:var(--surface); box-shadow:var(--shadow-sm); }.parent-list-head { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:19px 19px 14px; text-decoration:none; color:var(--text); border-top:4px solid var(--pc); }.parent-list-head:hover { text-decoration:none; }.parent-list-head h3 { display:inline; font-size:18px; }.parent-list-head p { color:var(--muted); margin:4px 0 0 17px; font-size:12.5px; }.parent-code-dot { width:9px; height:9px; display:inline-block; margin-right:8px; border-radius:3px; background:var(--pc); }.parent-list-stats { display:flex; gap:18px; padding:0 19px 14px; color:var(--muted); font-size:12px; }.parent-list-stats b { color:var(--text); font-size:16px; }.model-list { padding:8px; background:var(--surface-2); border-top:1px solid var(--border); display:grid; gap:5px; }.model-list-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 11px; color:var(--text); border-radius:10px; text-decoration:none; }.model-list-item:hover { text-decoration:none; background:var(--surface); }.model-list-item b,.model-list-item span { display:block; }.model-list-item span { font-size:12px; color:var(--muted); }.model-list-item > span { white-space:nowrap; }.detail-model-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(185px,1fr)); gap:10px; }.detail-model-card { padding:15px; border-radius:12px; border:1px solid var(--border); color:var(--text); background:var(--surface-2); text-decoration:none; }.detail-model-card:hover { text-decoration:none; border-color:var(--accent); }.detail-model-card b,.detail-model-card span { display:block; }.detail-model-card span { color:var(--muted); font-size:12px; margin:3px 0 11px; }.detail-model-card div { font-size:12px; color:var(--muted); }
@media (max-width:1180px) { .dashboard-header { display:block; }.kpi-grid { width:100%; margin:16px 0 0; }.dashboard-body { grid-template-columns:1fr; } }
@media (max-width:640px) { .kpi-grid { grid-template-columns:repeat(2,1fr); }.kpi-card { min-height:76px; }.project-status-grid { padding-left:12px; padding-right:12px; }.parent-project-card { flex-basis:230px; min-width:230px; }.parent-list-grid { grid-template-columns:1fr; }.parent-list-head .link-btn { display:none; }.model-list-item > span { font-size:11px; }.dashboard-header h2 { font-size:22px; } }

/* 工作台第二版：左侧待办，右侧 KPI / 项目 / 信息流 */
.dashboard-layout { display:grid; grid-template-columns:320px minmax(0,1fr); gap:18px; align-items:start; }
.dashboard-todos { display:flex; flex-direction:column; gap:16px; }.dashboard-greeting { padding:7px 2px 2px; }.dashboard-greeting h2 { font-size:23px; font-weight:760; }.dashboard-greeting .date { color:var(--muted); margin-top:4px; font-size:12.5px; }.dashboard-right { min-width:0; display:flex; flex-direction:column; gap:18px; }.dashboard-right .kpi-grid { width:100%; margin:0; grid-template-columns:repeat(4,minmax(120px,1fr)); }.dashboard-right .dashboard-project { margin:0; }.dashboard-feed { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(280px,.85fr); gap:18px; align-items:start; }
.home-todo-group { padding:7px 9px 4px; }.home-todo-group + .home-todo-group { border-top:1px solid var(--border); }.home-todo-group > a,.home-todo-group > span { display:block; padding:2px 9px 4px; color:var(--muted); font-size:11px; font-weight:650; letter-spacing:.02em; text-decoration:none; }.home-todo-group > a:hover { color:var(--accent); }.home-todo-group.loose > span { color:var(--muted); }.home-todo-group .todo-list { margin:0; }.home-todo-group .todo-item { padding-top:7px; padding-bottom:7px; }.home-todo-group .todo-item .meta { font-size:11px; }

/* 展开项目：父卡片和机型卡片永远保持同一标准尺寸。 */
.project-status-grid { display:flex; flex-wrap:wrap; gap:12px; overflow:visible; padding:14px 20px 20px; }
.project-status-group { flex:0 0 260px; width:260px; }.project-status-group.expanded { flex-basis:100%; width:100%; display:flex; align-items:stretch; flex-wrap:wrap; gap:12px; }
.parent-project-card,.project-status-group .model-project-card { flex:0 0 260px; width:260px; min-width:0; min-height:132px; }.parent-project-card { background:linear-gradient(145deg,var(--surface) 0%,var(--surface-2) 100%); border:1px solid var(--border); border-radius:15px; overflow:hidden; position:relative; transition:.2s ease; }.parent-project-card::before { content:""; height:3px; position:absolute; inset:0 0 auto; background:var(--accent-grad); }.parent-project-card:hover { border-color:color-mix(in srgb,var(--accent) 45%,var(--border)); box-shadow:var(--shadow); }.parent-project-main { min-height:132px; padding:18px 42px 15px 17px; }
.project-status-group .model-project-card { min-height:132px; display:flex; flex-direction:column; justify-content:space-between; padding:17px; border-radius:15px; background:var(--surface); border:1px solid var(--border); }.project-status-group .model-project-card:hover { border-color:var(--accent); box-shadow:var(--shadow-sm); }.project-status-group .model-project-card div:last-child { white-space:normal; }.project-status-group .model-project-empty { flex:0 0 260px; width:260px; min-height:132px; display:flex; align-items:center; justify-content:center; text-align:center; padding:14px; border:1px dashed var(--border-strong); border-radius:15px; background:var(--surface-2); }

/* 可收起的桌面侧边栏 */
.sidebar-toggle { margin-left:auto; color:var(--muted); }.sidebar-toggle:hover { color:var(--accent); }.app.sidebar-collapsed { --sidebar-w:76px; }.app.sidebar-collapsed .sidebar { padding-left:10px; padding-right:10px; }.app.sidebar-collapsed .brand { padding-left:4px; padding-right:4px; justify-content:center; }.app.sidebar-collapsed .brand > div:nth-child(2),.app.sidebar-collapsed .nav-sec,.app.sidebar-collapsed .nav a > span:not(.count),.app.sidebar-collapsed .user-card > div:not(.avatar) { display:none; }.app.sidebar-collapsed .sidebar-toggle { position:absolute; left:50%; bottom:5px; transform:translateX(-50%); background:var(--surface); border:1px solid var(--border); }.app.sidebar-collapsed .sidebar-toggle .ic { transform:rotate(180deg); }.app.sidebar-collapsed .nav a { justify-content:center; padding-left:8px; padding-right:8px; }.app.sidebar-collapsed .nav a.active::before { left:-10px; }.app.sidebar-collapsed .side-foot { display:flex; justify-content:center; }.app.sidebar-collapsed .user-card { padding:8px 0; }

@media (max-width:1180px) { .dashboard-layout { grid-template-columns:290px minmax(0,1fr); }.dashboard-right .kpi-grid { grid-template-columns:repeat(2,1fr); }.dashboard-feed { grid-template-columns:1fr; } }
@media (max-width:960px) { .dashboard-layout { grid-template-columns:1fr; }.dashboard-todos { display:grid; grid-template-columns:1fr 1fr; }.dashboard-greeting { grid-column:1 / -1; }.app.sidebar-collapsed { --sidebar-w:236px; }.app.sidebar-collapsed .sidebar { padding:18px 14px 14px; }.app.sidebar-collapsed .brand { padding:4px 8px 18px; justify-content:initial; }.app.sidebar-collapsed .brand > div:nth-child(2),.app.sidebar-collapsed .nav-sec,.app.sidebar-collapsed .nav a > span:not(.count),.app.sidebar-collapsed .user-card > div:not(.avatar) { display:initial; }.app.sidebar-collapsed .sidebar-toggle { position:static; transform:none; margin-left:auto; background:transparent; border:0; }.app.sidebar-collapsed .sidebar-toggle .ic { transform:none; }.app.sidebar-collapsed .nav a { justify-content:initial; padding-left:12px; padding-right:12px; }.app.sidebar-collapsed .nav a.active::before { left:-14px; }.app.sidebar-collapsed .side-foot { display:block; }.app.sidebar-collapsed .user-card { padding:8px; } }
@media (max-width:640px) { .dashboard-todos { display:flex; }.dashboard-right .kpi-grid { grid-template-columns:repeat(2,1fr); }.project-status-grid { padding-left:12px; padding-right:12px; }.project-status-group,.parent-project-card,.project-status-group .model-project-card { flex-basis:230px; width:230px; }.project-status-group.expanded { flex-basis:100%; width:100%; }.project-status-group.expanded .parent-project-card,.project-status-group.expanded .model-project-card { flex-basis:230px; width:230px; } }

/* 首页对齐：第一行问候 / KPI，第二行今日待办 / 项目状态。 */
.dashboard-layout { grid-template-columns:320px minmax(0,1fr); grid-template-rows:auto auto; }
.dashboard-greeting { align-self:center; min-height:88px; padding:0 2px; }.dashboard-kpi { min-width:0; }.dashboard-kpi .kpi-grid { width:100%; margin:0; grid-template-columns:repeat(4,minmax(120px,1fr)); }.dashboard-todos { grid-column:1; grid-row:2; }.dashboard-right { grid-column:2; grid-row:2; }.dashboard-right .kpi-grid { width:auto; }.dashboard-right > .dashboard-project { margin-top:0; }

/* Logo、主题色和待办进度 */
.project-logo-mark { width:24px; height:24px; object-fit:contain; flex:none; border-radius:6px; }.project-color-mark { width:10px; height:10px; border-radius:3px; background:var(--project-color,var(--accent)); flex:none; }.parent-project-code { gap:9px; }.parent-project-code i { display:none; }.model-card-title { display:flex; gap:9px; align-items:center; min-width:0; }.model-card-title > div { min-width:0; }.model-card-title b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }.parent-project-card::before { background:var(--project-color,var(--accent)); }.project-todo-progress { margin-top:10px; }.project-todo-progress > div { display:flex; justify-content:space-between; color:var(--muted); font-size:10.5px; margin-bottom:4px; }.project-todo-progress b { color:var(--text-2); font-weight:650; }.project-todo-progress > i { display:block; height:4px; border-radius:5px; overflow:hidden; background:var(--surface-3); }.project-todo-progress em { display:block; height:100%; border-radius:inherit; background:var(--project-color,var(--accent)); }.parent-project-card,.project-status-group .model-project-card { min-height:158px; }.parent-project-main { min-height:158px; }.chip-proj .proj-logo { width:13px; height:13px; object-fit:contain; border-radius:3px; flex:none; }.project-title-with-logo { display:flex; align-items:center; gap:9px; }.project-title-with-logo .parent-code-dot { margin:0; background:var(--project-color,var(--pc,var(--accent))); }.project-title-with-logo h3 { margin:0; }
.logo-editor { display:flex; align-items:center; gap:13px; padding:10px 12px; border:1px dashed var(--border-strong); border-radius:12px; background:var(--surface-2); }.logo-editor-preview { width:58px; height:58px; display:grid; place-items:center; flex:none; color:var(--muted); border-radius:12px; background:var(--surface); border:1px solid var(--border); overflow:hidden; }.logo-editor-preview img { width:100%; height:100%; object-fit:contain; }.logo-editor .hint { margin:6px 0 0; font-size:12px; color:var(--muted); }

/* 待办保持紧凑、单行；项目归属仅在分组标题内出现。 */
.home-todo-group { padding:5px 8px 3px; }.home-todo-group > a,.home-todo-group > span { padding:2px 8px 3px; font-size:10.5px; }.home-todo-group .todo-list { padding-top:1px; padding-bottom:3px; }.home-todo-group .todo-item { gap:8px; padding:5px 7px; }.home-todo-group .todo-item .cb { width:18px; height:18px; margin-top:1px; }.home-todo-group .todo-title { font-size:13.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; word-break:normal; }.home-todo-group .todo-meta { margin-top:1px; font-size:10.5px; gap:6px; flex-wrap:nowrap; }.home-todo-group .todo-meta .badge { font-size:10px; padding:1px 6px; }.home-todo-group .todo-body { overflow:hidden; }.home-todo-group .row-actions { display:none; }
.collapsible-todos { position:relative; }.section-collapse { position:absolute; top:11px; right:11px; width:26px; height:26px; padding:0; border:0; border-radius:8px; background:var(--surface-3); color:var(--accent); display:grid; place-items:center; }.section-collapse:hover { background:var(--accent-soft); }
.collapsible-todos.collapsed .card-h { min-height:62px; padding:0 52px 0 18px; align-items:center; }
.collapsible-todos.collapsed .section-collapse { top:50%; transform:translateY(-50%); }

/* 折叠按钮始终紧挨品牌 Logo，不再移动到侧栏底部。 */
.app.sidebar-collapsed .brand { justify-content:space-between; }.app.sidebar-collapsed .sidebar-toggle { position:static; left:auto; bottom:auto; transform:none; margin-left:0; background:transparent; border:0; }.app.sidebar-collapsed .sidebar-toggle .ic { transform:rotate(180deg); }

@media (max-width:1180px) { .dashboard-layout { grid-template-columns:290px minmax(0,1fr); }.dashboard-kpi .kpi-grid { grid-template-columns:repeat(2,1fr); } }
@media (max-width:960px) { .dashboard-layout { grid-template-columns:1fr; }.dashboard-greeting,.dashboard-kpi,.dashboard-todos,.dashboard-right { grid-column:1; grid-row:auto; }.dashboard-greeting { min-height:auto; padding:7px 2px 2px; }.dashboard-todos { display:grid; grid-template-columns:1fr 1fr; }.dashboard-kpi .kpi-grid { grid-template-columns:repeat(2,1fr); }.dashboard-right { grid-row:auto; } }
@media (max-width:640px) { .dashboard-todos { display:flex; }.project-logo-mark { width:21px; height:21px; }.logo-editor { align-items:flex-start; }.project-status-group,.parent-project-card,.project-status-group .model-project-card { min-height:150px; }.parent-project-main { min-height:150px; } }

.parent-list-card > .project-todo-progress { padding:0 19px 16px; }.model-list-item { display:grid; grid-template-columns:minmax(0,1fr) auto; }.model-list-item > .project-todo-progress { grid-column:1 / -1; margin-top:3px; }.model-list-item > .project-todo-progress > div { margin-bottom:3px; }

/* 工作台收口：三列紧凑卡片、机型图优先，避免卡片留出无效空白。 */
.dashboard-greeting { display:flex; flex-direction:column; justify-content:center; }
.project-status-grid { gap:11px; }
.project-status-group { flex-basis:220px; width:220px; }
.parent-project-card,.project-status-group .model-project-card { flex-basis:220px; width:220px; min-height:148px; }
.parent-project-main { min-height:148px; padding:16px 40px 13px 15px; }
.project-status-group.expanded .parent-project-card,.project-status-group.expanded .model-project-card { flex-basis:220px; width:220px; }
.project-status-group .model-project-card { padding:12px 13px 11px; justify-content:space-between; }
.model-card-main { min-width:0; display:flex; align-items:center; gap:11px; }
.model-image { width:66px; height:78px; display:grid; place-items:center; flex:none; border-radius:11px; overflow:hidden; background:color-mix(in srgb, var(--project-color,var(--accent)) 7%, var(--surface-2)); border:1px solid color-mix(in srgb, var(--project-color,var(--accent)) 15%, var(--border)); }
.model-image .project-logo-mark { width:100%; height:100%; max-width:none; max-height:none; padding:6px; border-radius:0; }
.model-image .project-color-mark { width:28px; height:28px; border-radius:8px; }
.model-card-title { display:block; flex:1; min-width:0; }
.model-card-title b { display:block; font-size:14px; line-height:1.25; }
.model-card-title > span { display:block; margin-top:3px; font-size:11px; }
.model-card-title > div { margin-top:10px; color:var(--muted); font-size:11.5px; white-space:nowrap; }
.model-card-title > div em { color:var(--project-color,var(--accent)); font-size:16px; }
.project-todo-progress { margin-top:8px; }
.collapsible-todos .card-h h3 { white-space:nowrap; }

/* 问题详情更适合阅读与输入：字号略收，描述和时间线均可按需展开。 */
.issue-detail-page { font-size:13px; }
.issue-detail-page .d-title { font-size:21px; }
.issue-detail-page .d-badges { margin-top:9px; }
.detail-section-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-top:16px; padding-top:12px; border-top:1px solid var(--border); font-size:13px; }
.detail-collapsed-note { margin:10px 0 0; color:var(--muted); font-size:12.5px; }
.issue-details-body { margin-top:10px; font-size:13px; line-height:1.65; }
.timeline-title { gap:8px; flex-wrap:wrap; }
.timeline-toggle { margin-left:auto; }
.issue-detail-page .tl-head { font-size:12.5px; }
.issue-detail-page .tl-body { font-size:12.5px; }
.issue-detail-page .composer { margin-top:12px; padding:13px; }
.issue-detail-page .composer .mde textarea { min-height:170px; font-size:13px; line-height:1.6; }
.issue-detail-page .props { font-size:12.5px; }
.issue-detail-page .prop > label { font-size:12px; }
@media (max-width:640px) { .project-status-group,.parent-project-card,.project-status-group .model-project-card,.project-status-group.expanded .parent-project-card,.project-status-group.expanded .model-project-card { flex-basis:210px; width:210px; }.timeline-toggle { margin-left:0; } }

/* 父项目颜色由编辑器明确选择；机型卡片以透明 Logo 和可快速操作为核心。 */
.theme-color-editor { display:flex; align-items:center; gap:10px; }
.theme-color-editor input[type="color"] { width:42px; height:36px; padding:3px; flex:none; border:1px solid var(--border-strong); border-radius:9px; background:var(--surface); cursor:pointer; }
.theme-color-editor .input { width:108px; text-transform:uppercase; }
.theme-color-editor span { color:var(--muted); font-size:12px; }
.project-status-group .model-project-card { align-items:stretch; min-height:178px; padding:10px 11px 11px; cursor:pointer; }
.model-card-main { gap:10px; align-items:center; }
.model-image { width:82px; height:94px; margin-left:-2px; border:0; border-radius:0; background:transparent; overflow:visible; justify-content:flex-start; }
.model-image .project-logo-mark { width:100%; height:100%; padding:0; object-fit:contain; object-position:left center; border-radius:0; }
.model-image .project-color-mark { width:40px; height:40px; margin-left:6px; border-radius:10px; }
.model-card-title { align-self:stretch; display:flex; flex-direction:column; justify-content:center; }
.model-card-title > span { min-height:0; }
.model-card-title > div { margin-top:9px; }
.project-status-group .model-project-card .project-todo-progress { align-self:stretch; width:100%; margin-top:6px; }
.project-status-group .model-project-card .project-todo-progress > div { display:flex; justify-content:space-between; align-items:center; width:100%; text-align:left; }
.project-status-group .model-project-card .project-todo-progress > i { width:100%; }
.model-card-actions { display:flex; gap:6px; margin-top:9px; }
.model-card-actions .btn { flex:1; min-width:0; justify-content:center; padding-left:7px; padding-right:7px; font-size:11px; }
.model-card-actions .btn:first-child { color:var(--project-color,var(--accent)); border-color:color-mix(in srgb, var(--project-color,var(--accent)) 35%, var(--border)); }
@media (max-width:640px) { .theme-color-editor { flex-wrap:wrap; }.theme-color-editor span { flex-basis:100%; }.model-image { width:76px; height:88px; } }

/* 展开后每张卡片均保持自己的固定尺寸，子卡片不会反向拉伸父卡片。 */
.project-status-group.expanded { align-items:flex-start; }
.parent-project-card { height:148px; min-height:0; box-sizing:border-box; }
.parent-project-main { min-height:0; height:100%; box-sizing:border-box; }
.project-status-group .model-project-card { height:178px; min-height:0; box-sizing:border-box; position:relative; }
.parent-project-code .project-logo-mark { width:30px; height:30px; border-radius:8px; }
.parent-project-customer { margin-left:39px; }
.model-quick-add { position:absolute; top:9px; right:9px; width:26px; height:26px; padding:0; display:grid; place-items:center; border:0; border-radius:8px; color:var(--project-color,var(--accent)); background:color-mix(in srgb, var(--project-color,var(--accent)) 9%, var(--surface)); z-index:3; }
.model-quick-add:hover { background:color-mix(in srgb, var(--project-color,var(--accent)) 16%, var(--surface)); }
.model-add-menu { position:absolute; z-index:5; top:40px; right:9px; width:124px; padding:5px; border:1px solid var(--border-strong); border-radius:10px; background:var(--surface); box-shadow:var(--shadow); }
.model-add-menu button { width:100%; display:flex; align-items:center; gap:6px; border:0; border-radius:7px; padding:7px 8px; background:transparent; color:var(--text-2); text-align:left; font-size:11.5px; }
.model-add-menu button:hover { background:var(--accent-soft); color:var(--accent); }

/* 跟进待办：左侧列表、右侧就地编辑；字体比全局略收紧。 */
.todos-page { font-size:13px; }
.todos-page .page-head h1 { font-size:22px; }
.todos-page .page-head p { font-size:12.5px; }
.todos-workspace { display:grid; grid-template-columns:minmax(360px,.93fr) minmax(380px,1.07fr); gap:16px; align-items:start; }
.todos-list-column { min-width:0; display:flex; flex-direction:column; gap:10px; }
.todo-quick-add { padding:11px 12px !important; }
.todo-quick-add .quick-row { gap:7px; flex-wrap:nowrap; }
.todo-quick-add .input,.todo-quick-add select { padding:7px 8px; font-size:12px; }
.todo-quick-add input[type=date] { width:126px; flex:none; }
.todo-quick-add select { width:108px; min-width:0; flex:none; }
.todo-quick-add .grow { min-width:110px; }
.todo-quick-add .btn { width:34px; padding:0; justify-content:center; flex:none; }
.todo-filter { margin:0; min-height:0; }
.todo-list-card .todo-list { padding:4px 6px 7px; }
.todos-page .todo-item { gap:8px; padding:6px 7px; }
.todos-page .todo-title { font-size:13px; }
.todos-page .todo-meta { font-size:11px; margin-top:1px; }
.todos-page .todo-sec { padding:8px 10px 2px; font-size:11.5px; }
.todo-done-toggle { cursor:pointer; }
.todo-editor-column { min-width:0; position:sticky; top:76px; }
.todo-editor-card,.todo-editor-empty { min-height:420px; }
.todo-editor-empty { display:grid; place-items:center; color:var(--muted); text-align:center; }
.todo-editor-empty .ic { color:var(--border-strong); }
.todo-editor-empty p { margin:9px 0 0; font-size:12.5px; }
.todo-editor-card .card-h { padding-top:13px; }
.todo-edit-form { gap:12px; }
.todo-edit-form .field label { font-size:12px; }
.todo-edit-form .input,.todo-edit-form select { padding:8px 10px; font-size:13px; }
.todo-edit-form textarea { min-height:160px; }
.todo-editor-actions { display:flex; align-items:center; gap:8px; padding-top:4px; }

/* 收起侧栏仍保留完整品牌图标与独立的展开按钮，菜单统一居中对齐。 */
@media (min-width:961px) {
  .app.sidebar-collapsed { --sidebar-w:92px; }
  .app.sidebar-collapsed .sidebar { padding:14px 10px 12px; }
  .app.sidebar-collapsed .brand { display:grid; grid-template-columns:40px 26px; gap:6px; justify-content:center; align-items:center; padding:4px 0 16px; }
  .app.sidebar-collapsed .brand-mark { width:40px; height:40px; border-radius:12px; flex:none; }
  .app.sidebar-collapsed .sidebar-toggle { width:26px; height:26px; margin:0; justify-self:end; flex:none; }
  .app.sidebar-collapsed .nav { align-items:center; gap:8px; overflow:visible; }
  .app.sidebar-collapsed .nav a { width:52px; height:44px; min-height:44px; padding:0; justify-content:center; flex:none; }
  .app.sidebar-collapsed .nav a .ic { width:21px; height:21px; }
  .app.sidebar-collapsed .nav a.active::before { left:-10px; top:8px; bottom:8px; }
  .app.sidebar-collapsed .nav .count { position:absolute; right:-5px; top:5px; margin:0; padding:1px 7px; }
  .app.sidebar-collapsed .side-foot { width:100%; display:flex; justify-content:center; }
  .app.sidebar-collapsed .user-card { padding:6px; }
}
@media (max-width:960px) { .todos-workspace { grid-template-columns:1fr; }.todo-editor-column { position:static; }.todo-quick-add .quick-row { flex-wrap:wrap; } }

/* 主页项目卡片统一规格：父/子项目都使用同一尺寸和底部进度区。 */
.parent-project-card,.project-status-group .model-project-card { height:178px; min-height:0; }
.parent-project-main { display:flex; flex-direction:column; padding:18px 40px 14px 16px; }
.parent-project-code { align-items:center; padding-top:4px; }
.parent-project-code .project-logo-mark,.parent-project-code .project-system-mark { width:32px; height:32px; }
.parent-project-customer { margin:4px 0 10px 41px; }
.parent-project-metrics { margin-top:0; }
.parent-project-main .project-todo-progress { margin-top:auto; }
.project-system-mark { width:24px; height:24px; display:grid; place-items:center; flex:none; border-radius:7px; color:var(--project-color,var(--accent)); background:color-mix(in srgb,var(--project-color,var(--accent)) 10%,var(--surface)); }
.model-card-main { min-height:92px; align-items:flex-start; }
.model-image { width:72px; height:82px; margin-left:0; }
.model-card-title { padding:13px 29px 0 0; justify-content:flex-start; }
.model-card-title b { max-width:100%; }
.project-status-group .model-project-card .project-todo-progress { margin-top:auto; }
.project-status-group .model-project-card .project-todo-progress,.parent-project-main .project-todo-progress { margin-bottom:0; }

/* 更醒目的问候、信息流的摘要折叠状态。 */
.dashboard-greeting h2 { font-size:29px; letter-spacing:-.025em; }
.dashboard-greeting .date { font-size:13px; }
.dashboard-feed-card { position:relative; }
.feed-collapse { position:absolute; top:12px; right:14px; width:26px; height:26px; padding:0; border:0; border-radius:8px; display:grid; place-items:center; background:var(--surface-3); color:var(--accent); }
.dashboard-feed-card.feed-collapsed .issue-list { gap:5px; }
.dashboard-feed-card.feed-collapsed .issue-row { grid-template-columns:4px minmax(0,1fr) auto; gap:9px; padding:7px 10px 7px 0; border-radius:9px; box-shadow:none; }
.dashboard-feed-card.feed-collapsed .issue-row .i-title { font-size:12.5px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dashboard-feed-card.feed-collapsed .issue-row .i-head { flex-wrap:nowrap; }
.dashboard-feed-card.feed-collapsed .issue-row .i-sub { margin-top:2px; gap:6px; font-size:10.5px; white-space:nowrap; overflow:hidden; flex-wrap:nowrap; }
.dashboard-feed-card.feed-collapsed .issue-row .i-sub .issue-device { display:none; }
.dashboard-feed-card.feed-collapsed .issue-row .i-sub > span:nth-child(n+4),.dashboard-feed-card.feed-collapsed .issue-row .i-side .when { display:none; }
.dashboard-feed-card.feed-collapsed .issue-row .i-side { gap:0; }
.dashboard-feed-card.feed-collapsed .issue-row .badge { font-size:10px; padding:2px 5px; }
.dashboard-feed-card.feed-collapsed .note-grid { display:block; padding:7px 10px 10px; }
.dashboard-feed-card.feed-collapsed .note-card { display:block; padding:8px 10px; background:transparent; border-radius:8px; }
.dashboard-feed-card.feed-collapsed .note-card p,.dashboard-feed-card.feed-collapsed .note-card span { display:none; }
.dashboard-feed-card.feed-collapsed .note-card b { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12.5px; }

/* 待办输入独占第一行，列表与右侧编辑卡片在同一基线；编辑字段一行排布。 */
.todo-quick-add .quick-row { display:grid; grid-template-columns:minmax(0,1fr) 126px 108px 124px 34px; }
.todo-quick-add .quick-row .grow { grid-column:1 / -1; }
.todo-quick-add .quick-row .input.grow { min-width:0; }
.todo-editor-column { margin-top:88px; }
.todo-edit-form .row.c3 { grid-template-columns:110px 105px minmax(0,1fr); gap:8px; }
.todo-edit-form textarea { min-height:230px; }
@media (max-width:960px) { .todo-editor-column { margin-top:0; }.todo-quick-add .quick-row { display:flex; }.todo-quick-add .quick-row .grow { width:100%; flex-basis:100%; }.todo-edit-form .row.c3 { grid-template-columns:1fr; } }

/* 项目卡片最终排版：统一尺寸与纵向基线，上部身份、中部统计、底部进度。 */
.parent-project-card,.project-status-group .model-project-card { height:178px; min-height:178px; }
.parent-project-main,.project-status-group .model-project-card { padding:13px 14px 12px; box-sizing:border-box; }
.parent-project-main { display:flex; flex-direction:column; }
.parent-project-identity { height:68px; display:grid; grid-template-columns:48px minmax(0,1fr); align-items:center; gap:10px; padding-right:27px; }
.parent-project-logo { height:58px; display:grid; place-items:center; transform:translateY(3px); }
.parent-project-logo .project-logo-mark { width:38px; height:38px; object-fit:contain; border-radius:8px; }
.parent-project-logo .project-system-mark { width:36px; height:36px; border-radius:9px; }
.parent-project-copy { min-width:0; display:flex; flex-direction:column; justify-content:center; gap:4px; }
.parent-project-copy b { font-size:16px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.parent-project-copy span { color:var(--muted); font-size:12px; line-height:1.2; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.parent-project-metrics { height:28px; margin:4px 0 5px; display:flex; justify-content:center; align-items:center; gap:17px; flex:none; }
.parent-project-metrics span { display:inline-flex; align-items:baseline; gap:3px; white-space:nowrap; }
.parent-project-metrics b { font-size:16px; }
.parent-project-main .project-todo-progress,.project-status-group .model-project-card .project-todo-progress { width:100%; margin:auto 0 0; flex:none; }
.project-status-group .model-project-card { display:flex; flex-direction:column; justify-content:flex-start; align-items:stretch; }
.model-card-main { height:68px; min-height:68px; display:grid; grid-template-columns:70px minmax(0,1fr); align-items:center; gap:9px; padding-right:25px; }
.model-image { width:70px; height:66px; display:grid; place-items:center start; margin:0; }
.model-image .project-logo-mark { width:70px; height:66px; object-fit:contain; object-position:left center; }
.model-image .project-system-mark { width:38px; height:38px; margin-left:7px; }
.model-card-title { min-width:0; align-self:stretch; display:flex; flex-direction:column; justify-content:center; padding:7px 0 0; }
.model-card-title b { font-size:14px; line-height:1.25; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.model-card-title > span { margin-top:4px; font-size:11px; line-height:1.2; }
.model-project-metrics { gap:24px; }
.model-project-metrics b { color:var(--project-color,var(--accent)); }
.model-quick-add { top:10px; right:10px; }
@media (max-width:640px) {
  .parent-project-card,.project-status-group .model-project-card { height:174px; min-height:174px; }
  .parent-project-identity { grid-template-columns:44px minmax(0,1fr); gap:8px; }
  .model-card-main { grid-template-columns:64px minmax(0,1fr); gap:7px; }
  .model-image,.model-image .project-logo-mark { width:64px; }
}

/* 项目统计从 Logo 起始线左对齐；系统项目使用同规格白底图标。 */
.parent-project-metrics { justify-content:flex-start; padding-left:8px; }
.model-project-metrics { justify-content:flex-start; gap:24px; }
.model-card-main { grid-template-columns:68px minmax(0,1fr); gap:4px; }
.model-image { width:68px; }
.model-image .project-logo-mark { width:68px; }
.model-card-title { padding-left:0; }
.model-card-title b { color:var(--text); font-weight:760; }
.model-quick-add { background:var(--accent); color:#fff; }
.model-quick-add:hover { background:var(--accent); color:#fff; filter:brightness(.91); }
.project-system-mark { background:#fff; border:1px solid color-mix(in srgb,var(--project-color,var(--accent)) 16%,var(--border)); box-shadow:0 3px 10px rgba(28,55,96,.08); }
.parent-project-logo .project-system-mark { width:38px; height:38px; }
.model-image .project-system-mark { width:62px; height:58px; margin-left:0; border-radius:11px; }
.model-image .project-system-mark .ic { width:25px; height:25px; }
@media (max-width:640px) {
  .model-card-main { grid-template-columns:62px minmax(0,1fr); gap:4px; }
  .model-image,.model-image .project-logo-mark { width:62px; }
  .model-image .project-system-mark { width:58px; height:56px; }
}

/* 跟进待办：新增与筛选在同一条全宽工作栏内；下方两栏卡片共用同一顶部基线。 */
.todo-control-bar { margin-bottom:16px; }
.todo-control-bar .todo-quick-add { padding:12px 14px !important; }
.todo-control-bar .quick-row { display:flex; align-items:center; flex-wrap:nowrap; gap:8px; }
.todo-control-bar .quick-row .grow { grid-column:auto; flex:1 1 460px; min-width:260px; }
.todo-control-bar input[type=date] { width:124px; flex:none; }
.todo-control-bar .todo-control-select { width:auto; min-width:0; height:38px; padding:7px 32px 7px 10px; border-radius:10px; border-color:var(--border); background-color:var(--surface-2); box-shadow:inset 0 1px 0 rgba(255,255,255,.55); font-size:12px; font-weight:600; color:var(--text-2); }
.todo-control-bar .todo-control-select:hover { border-color:var(--border-strong); background-color:var(--surface); }
.todo-control-bar .todo-control-select:focus { border-color:var(--accent); color:var(--text); }
.todo-tool-divider { width:1px; height:24px; flex:none; background:var(--border); margin:0 2px; }
.todo-status-filter { flex:none; white-space:nowrap; }
.todo-status-filter button { padding:5px 9px; font-size:11.5px; }
.todo-filter-fields { display:flex; align-items:center; gap:8px; flex:none; }
.todo-control-bar #nt-pri { width:100px; }
.todo-control-bar #nt-proj { width:clamp(122px, 10vw, 168px); }
.todo-filter-fields .todo-control-select[data-in="project"] { width:clamp(106px, 9vw, 148px); }
.todo-filter-fields .todo-control-select[data-in="sort"] { width:112px; }
.todos-workspace { align-items:start; }
.todos-workspace .todos-list-column { gap:0; }
.todos-workspace .todo-editor-column { margin-top:0; align-self:start; }
.todo-list-card,.todo-editor-card,.todo-editor-empty { box-sizing:border-box; }
@media (max-width:1220px) {
  .todo-control-bar .quick-row { flex-wrap:wrap; }
  .todo-control-bar .quick-row .grow { flex-basis:100%; }
  .todo-tool-divider { display:none; }
  .todo-status-filter { margin-left:auto; }
}
@media (max-width:760px) {
  .todo-control-bar .quick-row { align-items:stretch; }
  .todo-control-bar .quick-row > * { min-height:38px; }
  .todo-status-filter { margin-left:0; }
  .todo-filter-fields { width:100%; }
  .todo-filter-fields .todo-control-select { flex:1; }
}

/* 待办新增独占工作栏；筛选固定在标题右侧。 */
.todo-control-bar .quick-row .grow { flex-basis:560px; }
.todo-head-filters { gap:8px; align-items:center; }
.todo-head-filters .todo-control-select { width:auto; min-width:0; height:34px; padding:6px 30px 6px 10px; border-radius:10px; border:1px solid var(--border); background-color:var(--surface-2); box-shadow:inset 0 1px 0 rgba(255,255,255,.55); font-size:11.5px; font-weight:600; color:var(--text-2); }
.todo-head-filters .todo-control-select:hover { border-color:var(--border-strong); background-color:var(--surface); }
.todo-head-filters .todo-control-select:focus { border-color:var(--accent); color:var(--text); }
.todo-head-filters .todo-filter-fields { gap:7px; }
.todo-head-filters .todo-filter-fields .todo-control-select[data-in="project"] { width:clamp(106px, 9vw, 148px); }
.todo-head-filters .todo-filter-fields .todo-control-select[data-in="sort"] { width:108px; }
@media (max-width:1120px) { .todo-head-filters { margin-top:10px; } }
@media (max-width:760px) { .todo-head-filters .todo-filter-fields { width:100%; }.todo-head-filters .todo-filter-fields .todo-control-select { flex:1; } }

/* 顶部快速新建：一个主加号，展开后按类别直达对应新建页。 */
.quick-create { position:relative; flex:none; }
.quick-create-trigger { width:38px; height:38px; padding:0; display:grid; place-items:center; border:0; border-radius:11px; color:#fff; background:var(--accent-grad); box-shadow:0 7px 16px -7px rgba(23,105,209,.7); transition:transform .16s, box-shadow .16s, filter .16s; }
.quick-create-trigger:hover { filter:brightness(1.06); transform:translateY(-1px); box-shadow:0 10px 20px -8px rgba(23,105,209,.78); }
.quick-create-trigger .ic { transition:transform .18s ease; }
.quick-create.open .quick-create-trigger .ic { transform:rotate(45deg); }
.quick-create-menu { position:absolute; z-index:35; top:calc(100% + 10px); right:0; display:none; grid-template-columns:repeat(2, minmax(122px,1fr)); gap:4px; width:282px; padding:7px; border:1px solid var(--border); border-radius:13px; background:color-mix(in srgb,var(--surface) 94%,transparent); box-shadow:var(--shadow-lg); backdrop-filter:blur(16px); }
.quick-create.open .quick-create-menu { display:grid; }
.quick-create-menu button { display:flex; align-items:center; gap:8px; min-width:0; padding:9px 10px; border:0; border-radius:9px; background:transparent; color:var(--text-2); text-align:left; font-size:12px; font-weight:620; }
.quick-create-menu button:hover { background:var(--accent-soft); color:var(--accent); }
.quick-create-menu button .ic { color:var(--accent); flex:none; }
@media (max-width:640px) { .quick-create-menu { grid-template-columns:1fr; width:174px; }.quick-create-menu button { padding:8px 10px; } }
