/* 宠物经济赛道工作台 · Claude 风格视觉
 * 暖米画布 + 陶土橙强调 + 衬线标题 / 无衬线正文
 * 明暗双主题：html[data-theme]
 */
:root {
  --canvas: #EDE8E0;
  --surface: #FFFFFF;
  --surface-warm: #F7F3EC;
  --surface-sunken: #FAF7F1;
  --ink: #1C1713;
  --ink-soft: #575047;
  --ink-faint: #8A8078;
  --line: #D5CEC1;
  --line-soft: #E5DFD3;
  --accent: #D94A26;
  --accent-deep: #B03A1B;
  --accent-soft: #F8EAE4;
  --inverse: #1C1713;
  --inverse-ink: #FFFFFF;

  --chip-green-bg: #E8EFE4; --chip-green-ink: #3E5A34;
  --chip-yellow-bg: #FBF1D4; --chip-yellow-ink: #7A6420;
  --chip-blue-bg: #E4EAEF; --chip-blue-ink: #46586B;
  --chip-violet-bg: #ECE7F2; --chip-violet-ink: #5A4A73;
  --chip-red-bg: #F9E3DD; --chip-red-ink: #A03A22;

  --radius-tag: 6px;
  --radius-ctl: 8px;
  --radius-card: 12px;
  --shadow-card: 0 1px 2px rgba(28, 23, 19, .05), 0 4px 16px rgba(28, 23, 19, .06);
}
html[data-theme="dark"] {
  --canvas: #171310;
  --surface: #211C17;
  --surface-warm: #2A241D;
  --surface-sunken: #1D1813;
  --ink: #F2EDE4;
  --ink-soft: #B5ACA0;
  --ink-faint: #8A8078;
  --line: #3A322B;
  --line-soft: #2E2721;
  --accent: #E07856;
  --accent-deep: #D94A26;
  --accent-soft: #3A2620;
  --inverse: #F2EDE4;
  --inverse-ink: #1C1713;

  --chip-green-bg: #2C3A28; --chip-green-ink: #B9D4AE;
  --chip-yellow-bg: #3D3520; --chip-yellow-ink: #E5D194;
  --chip-blue-bg: #28313A; --chip-blue-ink: #AFC6DC;
  --chip-violet-bg: #332C3D; --chip-violet-ink: #C9BCDF;
  --chip-red-bg: #40251E; --chip-red-ink: #ECA98F;

  --shadow-card: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
.serif { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--ink); }

.boot-loading { padding: 80px 0; text-align: center; color: var(--ink-faint); }

/* ---------- 布局骨架 ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 216px; flex: none; padding: 20px 14px;
  background: var(--surface-warm); border-right: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh;
}
.sidebar .brand { padding: 4px 10px 18px; }
.sidebar .brand .kicker { font-size: 11px; letter-spacing: .14em; color: var(--accent-deep); font-weight: 600; }
.sidebar .brand h1 { font-size: 19px; line-height: 1.35; margin-top: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: none; background: none;
  border-radius: var(--radius-ctl); color: var(--ink-soft); font-size: 14px; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface-sunken); color: var(--ink); }
.nav-item.active { background: var(--surface); color: var(--accent-deep); font-weight: 600; box-shadow: var(--shadow-card); }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.sidebar .side-foot { margin-top: auto; padding: 10px 10px 0; border-top: 1px solid var(--line-soft); }
.side-user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 600; font-size: 13px;
}
.side-user .nm { font-weight: 600; font-size: 13px; }
.side-user .rl { font-size: 11px; color: var(--ink-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 14px; padding: 14px 32px;
  border-bottom: 1px solid var(--line-soft); background: var(--canvas); position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 20px; }
.topbar .desc { color: var(--ink-faint); font-size: 12.5px; margin-top: 1px; }
.topbar .spacer { flex: 1; }
.icon-btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft);
  border-radius: var(--radius-ctl); padding: 6px 12px; font-size: 13px;
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.content { padding: 24px 32px 60px; max-width: 1400px; width: 100%; }

/* ---------- 通用组件 ---------- */
.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--radius-ctl); padding: 7px 14px; font-size: 13.5px; font-weight: 500;
}
.btn:hover { border-color: var(--ink-faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-deep); border-color: var(--accent-deep); }
.btn.ghost-danger { color: var(--accent-deep); border-color: transparent; background: none; padding: 4px 8px; }
.btn.ghost-danger:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.chip { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 9px; font-size: 11.5px; font-weight: 500; white-space: nowrap; }
.chip.green { background: var(--chip-green-bg); color: var(--chip-green-ink); }
.chip.yellow { background: var(--chip-yellow-bg); color: var(--chip-yellow-ink); }
.chip.blue { background: var(--chip-blue-bg); color: var(--chip-blue-ink); }
.chip.violet { background: var(--chip-violet-bg); color: var(--chip-violet-ink); }
.chip.red { background: var(--chip-red-bg); color: var(--chip-red-ink); }
.chip.accent { background: var(--accent-soft); color: var(--accent-deep); }
.chip.grey { background: var(--surface-sunken); color: var(--ink-faint); border: 1px solid var(--line-soft); }

.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: var(--radius-ctl); background: var(--surface-sunken);
  padding: 8px 10px; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 68px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- 登录页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 400px; max-width: 100%; padding: 36px 34px 30px; }
.auth-submit { width: 100%; min-height: 44px; padding: 10px 0; }
.auth-card .kicker { font-size: 11px; letter-spacing: .18em; color: var(--accent-deep); font-weight: 700; }
.auth-card h1 { font-size: 26px; margin: 6px 0 4px; }
.auth-card .sub { color: var(--ink-faint); font-size: 13px; margin-bottom: 26px; }
.auth-tabs { display: flex; gap: 4px; margin-bottom: 20px; background: var(--surface-sunken); border-radius: var(--radius-ctl); padding: 3px; }
.auth-tabs button { flex: 1; border: none; background: none; padding: 7px 0; border-radius: 6px; color: var(--ink-soft); font-size: 13px; }
.auth-tabs button.active { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-card); }
.auth-note { margin-top: 16px; font-size: 12px; color: var(--ink-faint); background: var(--surface-sunken); border-radius: var(--radius-ctl); padding: 9px 12px; }
.auth-theme { position: fixed; top: 18px; right: 22px; }

/* ---------- 总览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 22px; }
.stat-card { padding: 18px 20px; }
.stat-card .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.stat-card .lbl { color: var(--ink-faint); font-size: 12.5px; margin-top: 2px; }
.stat-card .trend { font-size: 12px; margin-top: 6px; color: var(--ink-soft); }
.overview-cols { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.panel { padding: 18px 20px; }
.panel h3 { font-size: 15px; margin-bottom: 12px; }
.panel h3 .cnt { color: var(--ink-faint); font-weight: 400; font-size: 12.5px; margin-left: 6px; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-soft); }
.list-row:first-of-type { border-top: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .s { font-size: 12px; color: var(--ink-faint); }
.empty { padding: 26px 0; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ---------- 选题矩阵 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar .search { position: relative; }
.toolbar .search input {
  border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
  padding: 7px 14px 7px 32px; width: 260px; outline: none;
}
.toolbar .search input:focus { border-color: var(--accent); }
.toolbar .search::before { content: "⌕"; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--ink-faint); font-size: 16px; }
.toolbar .spacer { flex: 1; }

.matrix-wrap { overflow: auto; border-radius: var(--radius-card); }
table.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 1180px; background: var(--surface); }
.matrix th, .matrix td { border-bottom: 1px solid var(--line-soft); padding: 0; }
.matrix thead th {
  position: sticky; top: 0; background: var(--surface-warm); z-index: 2;
  font-size: 11.5px; color: var(--ink-soft); font-weight: 600; padding: 8px 8px; text-align: center; white-space: nowrap;
}
.matrix thead th:first-child { text-align: left; padding-left: 16px; }
.matrix tbody tr:hover { background: var(--surface-sunken); }
.matrix td { height: 52px; }
.matrix .topic-cell {
  position: sticky; left: 0; background: var(--surface); z-index: 1; min-width: 250px; max-width: 300px;
  padding: 9px 14px; border-right: 1px solid var(--line-soft);
}
.matrix tbody tr:hover .topic-cell { background: var(--surface-sunken); }
.topic-cell .t { font-weight: 600; font-size: 13.5px; cursor: pointer; }
.topic-cell .t:hover { color: var(--accent-deep); }
.topic-cell .m { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; align-items: center; }
.topic-cell .m .x { font-size: 11.5px; color: var(--ink-faint); }
.pcell { display: flex; align-items: center; justify-content: center; }
.pcell button {
  width: 30px; height: 30px; border-radius: 50%; border: 1.5px dashed var(--line);
  background: none; display: flex; align-items: center; justify-content: center; font-size: 11px; padding: 0;
}
.pcell button:hover { border-color: var(--accent); }
.pcell button.s-planned { border: none; background: var(--chip-blue-bg); color: var(--chip-blue-ink); border-radius: 999px; width: auto; padding: 0 8px; }
.pcell button.s-draft { border: none; background: var(--chip-yellow-bg); color: var(--chip-yellow-ink); border-radius: 999px; width: auto; padding: 0 8px; }
.pcell button.s-published { border: none; background: var(--chip-green-bg); color: var(--chip-green-ink); border-radius: 999px; width: auto; padding: 0 8px; }
.pcell button.s-archived { border: none; background: var(--chip-violet-bg); color: var(--chip-violet-ink); border-radius: 999px; width: auto; padding: 0 8px; }
.matrix .status-cell { text-align: center; }

/* ---------- 日历 ---------- */
.cal-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.cal-head .ym { font-size: 18px; font-weight: 700; min-width: 130px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.cal-dow { text-align: center; font-size: 12px; color: var(--ink-faint); padding: 4px 0; font-weight: 600; }
.cal-cell {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius-ctl);
  min-height: 96px; padding: 6px; cursor: pointer; transition: border-color .12s;
}
.cal-cell:hover { border-color: var(--accent); }
.cal-cell.other { background: var(--surface-sunken); opacity: .55; }
.cal-cell .dnum { font-size: 12px; color: var(--ink-faint); font-weight: 600; }
.cal-cell.today .dnum { color: #fff; background: var(--accent); border-radius: 50%; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.cal-ev {
  border: none; display: block; width: 100%; text-align: left; border-radius: var(--radius-tag);
  font-size: 11px; padding: 2px 6px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cal-ev.publish { background: var(--accent-soft); color: var(--accent-deep); }
.cal-ev.activity { background: var(--chip-green-bg); color: var(--chip-green-ink); }
.cal-ev.other { background: var(--surface-warm); color: var(--ink-soft); border: 1px solid var(--line-soft); }
.cal-legend { display: flex; gap: 14px; margin-top: 14px; font-size: 12px; color: var(--ink-faint); align-items: center; flex-wrap: wrap; }
.cal-legend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- 产出物 ---------- */
.deliv-filter { display: flex; gap: 8px; }
.deliv-item { padding: 16px 20px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; }
.deliv-item .grow { flex: 1; min-width: 0; }
.deliv-item .t { font-weight: 600; font-size: 15px; }
.deliv-item .meta { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; align-items: center; }
.deliv-item .meta .x { font-size: 12px; color: var(--ink-faint); }
.deliv-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.reject-note { margin-top: 8px; background: var(--chip-red-bg); color: var(--chip-red-ink); border-radius: var(--radius-tag); padding: 7px 10px; font-size: 12.5px; }

/* ---------- 成员 ---------- */
.member-row { display: flex; align-items: center; gap: 14px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.member-row:first-child { border-top: none; }
.member-row .grow { flex: 1; }
.member-row .nm { font-weight: 600; }
.member-row .un { font-size: 12px; color: var(--ink-faint); }
.role-note { margin-top: 18px; font-size: 12.5px; color: var(--ink-faint); background: var(--surface-sunken); border-radius: var(--radius-card); padding: 14px 16px; line-height: 1.9; }

/* ---------- 新增模块 ---------- */
.nav-scroll { flex: 1; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 2px; }
.clickable { cursor: pointer; }
.clickable:hover { border-color: var(--accent); }
.notice-btn { position: relative; }
.notice-badge {
  position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--accent); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}
.notice-panel {
  position: absolute; right: 32px; top: 58px; width: 340px; max-height: 420px; overflow: auto;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); z-index: 8; padding: 8px;
}
.notice-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; }
.notice-item { display: block; width: 100%; text-align: left; border: none; background: none; border-radius: 8px; padding: 8px; }
.notice-item:hover { background: var(--surface-sunken); }
.notice-item.unread { background: var(--accent-soft); }
.notice-item .t { font-weight: 600; font-size: 13px; }
.notice-item .s { font-size: 12px; color: var(--ink-faint); }
.stage-card { padding: 16px 18px; margin-bottom: 14px; }
.stage-head { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; }
.stage-head .t { font-weight: 650; font-size: 16px; display: flex; gap: 8px; align-items: center; }
.stage-head .meta, .note, .s, .muted { color: var(--ink-faint); font-size: 12.5px; }
.stage-head .meta { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.note { margin-top: 6px; white-space: pre-wrap; }
.task-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--inverse); color: var(--inverse-ink); border-radius: var(--radius-card); padding: 16px 18px; margin-bottom: 14px;
}
.task-banner .serif { font-size: 20px; }
.task-banner .s { color: var(--ink-faint); font-size: 12.5px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; }
.check {
  width: 18px; height: 18px; border-radius: 4px; border: 1.5px solid var(--line); background: var(--surface); flex: none; padding: 0;
}
.check.on { background: var(--accent); border-color: var(--accent); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.act-row { display: block; width: 100%; text-align: left; border: none; border-bottom: 1px solid var(--line-soft); background: none; padding: 12px 14px; }
.act-row.on { background: var(--accent-soft); }
.act-row .t { font-weight: 600; }
.act-row .s { margin-top: 4px; color: var(--ink-faint); font-size: 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.detail-hero { background: var(--inverse); color: var(--inverse-ink); border-radius: var(--radius-card); padding: 16px 18px; }
.detail-hero .kicker { font-size: 11px; letter-spacing: .12em; opacity: .7; }
.detail-hero h3 { font-size: 22px; margin: 4px 0; }
.detail-hero .s { opacity: .75; font-size: 12.5px; }
.kv { display: grid; grid-template-columns: 72px 1fr; gap: 8px 10px; font-size: 13px; }
.kv span { color: var(--ink-faint); }
.prose { white-space: pre-wrap; font-size: 13.5px; line-height: 1.7; }
.inline-form { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.inline-form select, .inline-form input { border: 1px solid var(--line); border-radius: var(--radius-ctl); background: var(--surface-sunken); padding: 6px 8px; }
.bar-row { margin: 10px 0; }
.bar-lab { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.bar { height: 8px; background: var(--surface-sunken); border-radius: 99px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
.rate { font-size: 28px; font-family: "Noto Serif SC", "Songti SC", serif; font-weight: 650; }
.rate span { font-family: "Noto Sans SC", "PingFang SC", sans-serif; font-size: 13px; color: var(--ink-faint); font-weight: 400; margin-left: 8px; }
.workshop { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.formula { background: var(--surface-sunken); border-radius: var(--radius-ctl); padding: 12px; line-height: 1.7; }
.disclaimer { font-size: 12.5px; color: var(--ink-soft); background: var(--surface-sunken); border-radius: var(--radius-ctl); padding: 8px 12px; margin-bottom: 14px; }
.card.panel + .card.panel { margin-top: 12px; }
a { color: var(--accent-deep); }

/* ---------- 弹窗 & Toast ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(28, 23, 19, .45); z-index: 50;
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 20px 20px; overflow: auto;
}
.modal {
  background: var(--surface); border-radius: var(--radius-card); box-shadow: 0 12px 48px rgba(0,0,0,.22);
  width: 480px; max-width: 100%; padding: 22px 24px; animation: pop .16s ease-out;
}
.modal.wide { width: 620px; }
.modal.xwide { width: 760px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 17px; margin-bottom: 16px; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
#toast-root { position: fixed; top: 20px; right: 22px; z-index: 99; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--inverse); color: var(--inverse-ink); border-radius: var(--radius-ctl);
  padding: 10px 16px; font-size: 13px; box-shadow: 0 6px 24px rgba(0,0,0,.25); max-width: 340px; animation: pop .15s;
}
.toast.err { background: var(--accent-deep); color: #fff; }

@media (max-width: 1080px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-cols, .split, .workshop { grid-template-columns: 1fr; }
  .stage-head { flex-direction: column; }
  .content { padding: 20px 18px 50px; }
  .topbar { padding: 12px 18px; }
}
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; padding: 10px; }
  .sidebar .brand { padding: 0 10px; }
  .sidebar .brand h1 { font-size: 15px; }
  .nav-item { width: auto; white-space: nowrap; }
  .sidebar .side-foot { margin: 0 0 0 auto; border: none; padding: 0; }
}
