:root {
  --bg: #F8F5ED; --card: #FFFDF8; --ink: #242321; --muted: #68645E; --line: #E4DFD4;
  --orange: #FF5A24; --orange-ink: #B83612; --ok: #1F7A4D; --danger: #B3261E; --warn-bg: #FFF1D6; --warn-ink: #6B4A00;
  --chip: #EFEAE0; --shadow: 0 6px 20px #2423210F;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1B1A19; --card: #262523; --ink: #F3EFE7; --muted: #A9A398; --line: #3A3835;
    --orange-ink: #FF8A62; --ok: #5CC28E; --danger: #FF8A80; --warn-bg: #3A2F14; --warn-ink: #F5D48A;
    --chip: #33312E; --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--orange-ink); }
code { font-size: .9em; background: var(--chip); padding: 1px 5px; border-radius: 6px; }

.brand { display: inline-flex; align-items: center; gap: 7px; font-weight: 800; letter-spacing: -.02em; }
.brand i { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }
.brand span { font-weight: 600; color: var(--muted); letter-spacing: 0; margin-left: 4px; }

/* 登录 */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login form { width: 100%; max-width: 360px; display: grid; gap: 14px; }
.login h1 { margin: 6px 0 0; font-size: 28px; }
.login p { margin: 0; color: var(--muted); font-size: 15px; }
.login input { height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.err { color: var(--danger) !important; }

/* 顶部 */
#app { max-width: 680px; margin: 0 auto; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }
.top { display: flex; justify-content: space-between; align-items: center; padding: calc(12px + env(safe-area-inset-top)) 0 8px; font-size: 20px; }
.office-link { font-size: 15px; font-weight: 600; color: var(--orange-ink); text-decoration: none; margin-right: 4px; }
.icon-btn { width: 44px; height: 44px; border: 0; border-radius: 50%; background: transparent; font-size: 22px; cursor: pointer; }
.icon-btn:active { background: var(--chip); }
.warn { background: var(--warn-bg); color: var(--warn-ink); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin: 4px 0 8px; }

.tabs { position: sticky; top: 0; z-index: 5; display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 10px; margin: 0 -16px; padding-inline: 16px;
  background: var(--bg); scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); cursor: pointer; font-size: 15px; white-space: nowrap; }
.tabs button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tabs span:not(:empty) { margin-left: 6px; font-weight: 700; color: var(--orange); }
.tabs button.on span { color: var(--orange); }
.hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.foot { color: var(--muted); font-size: 12px; margin-top: 24px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden;
  transition: opacity .25s, transform .25s; }
.card.leaving { opacity: 0; transform: translateX(24px); }
.card-body { padding: 14px 16px 16px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; background: var(--chip); color: var(--ink); font-size: 12.5px; font-weight: 600; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.alert { background: #FFE3D8; color: var(--orange-ink); }
.chip.good { background: #DDF2E6; color: #1F5E3D; }
@media (prefers-color-scheme: dark) { .chip.alert { background: #4A2416; } .chip.good { background: #1F3A2B; color: #9BDDB8; } }
.cid { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-top: 6px; word-break: break-all; }
.title { font-size: 17px; font-weight: 700; margin: 10px 0 6px; line-height: 1.4; }
.caption { white-space: pre-wrap; word-break: break-word; margin: 0; font-size: 15px; }
.caption.clamp { display: -webkit-box; -webkit-line-clamp: 7; -webkit-box-orient: vertical; overflow: hidden; }
.more { border: 0; background: none; color: var(--orange-ink); padding: 4px 0; font-size: 14px; cursor: pointer; }
.tags { color: var(--muted); font-size: 14px; margin-top: 6px; word-break: break-word; }
.link { display: block; font: 12px/1.45 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--muted); margin-top: 8px; word-break: break-all; }
.note { background: var(--chip); border-radius: 10px; padding: 8px 12px; font-size: 14px; margin-top: 10px; }
.note.warn-note { background: var(--warn-bg); color: var(--warn-ink); }

.media { display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 12px 16px 0; scrollbar-width: none; }
.media::-webkit-scrollbar { display: none; }
.media a, .media video { flex: none; scroll-snap-align: start; }
.media img, .media video { display: block; height: 300px; width: auto; max-width: 82vw; border-radius: 12px; background: var(--chip); object-fit: cover; }
.media .file { display: grid; place-items: center; height: 120px; padding: 0 16px; border-radius: 12px; background: var(--chip); font-size: 13px; }
.count-hint { font-size: 12px; color: var(--muted); padding: 6px 16px 0; }

.actions { display: flex; gap: 8px; margin-top: 14px; }
.actions .btn { flex: 1; }
.btn { height: 46px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-weight: 600; cursor: pointer; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.dark { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn[disabled] { opacity: .5; pointer-events: none; }

.edit { display: grid; gap: 10px; margin-top: 12px; }
.edit label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.edit input, .edit textarea, .pub input, textarea#reject-reason, .reply {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-size: 16px; }
.edit textarea { min-height: 220px; resize: vertical; }
.reply { min-height: 120px; margin-top: 10px; resize: vertical; }
.pub { display: flex; gap: 8px; margin-top: 10px; }
.pub input { flex: 1; min-width: 0; }

.empty { text-align: center; color: var(--muted); padding: 48px 16px; }
.empty b { display: block; font-size: 18px; color: var(--ink); margin-bottom: 6px; }

.row-item { display: flex; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.row-item:first-child { border-top: 0; }

/* 拒绝弹层 */
.sheet { position: fixed; inset: 0; z-index: 20; background: #0007; display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { width: 100%; max-width: 680px; background: var(--card); border-radius: 22px 22px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); display: grid; gap: 12px; }
.sheet-card h2 { margin: 0; font-size: 19px; }
.sheet-card .hint { margin: -6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 14px; }
.chips button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.sheet .row { display: flex; gap: 8px; }
.sheet .row .btn { flex: 1; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 999px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: 0 8px 24px #0003; }

@media (min-width: 700px) { .media img, .media video { height: 360px; } }

/* 多账号 */
.me-btn { border: 0; background: var(--chip); border-radius: 999px; height: 32px; padding: 0 12px; font-size: 13px; font-weight: 600; margin-right: 6px; cursor: pointer; }
.me-btn:empty { display: none; }
body.ro .card .actions, body.ro .card .pub, body.ro .card .edit { display: none !important; }
.ro-banner { background: var(--chip); border-radius: 12px; padding: 8px 12px; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.act { display: flex; gap: 10px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 14px; }
.act:first-child { border-top: 0; }
.act b { white-space: nowrap; } .act span { color: var(--muted); word-break: break-word; } .act time { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.urow { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.urow .grow { flex: 1; } .urow select { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.urow button { height: 34px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); padding: 0 10px; cursor: pointer; font-size: 13px; }
#acct .sheet-card { max-height: 90vh; overflow-y: auto; }
#acct select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); font-size: 16px; }
#acct .urow select { width: auto; height: 36px; padding: 0 8px; font-size: 14px; }

/* 账号矩阵 */
.filters { margin: 0 0 8px; }
.filters select { height: 36px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); padding: 0 12px; font-size: 14px; max-width: 100%; }
.chip.acct { background: var(--ink); color: var(--bg); }
body.op .view .actions, body.op .card[data-idea] .actions, body.op .card[data-intent] .actions, body.op .edit { display: none !important; }
.btn.dl { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); }

/* 融合工作台面板（保持 Warm Paper 风格） */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
@media (min-width: 520px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.kpi .k-lbl { font-size: 12.5px; color: var(--muted); }
.kpi .k-val { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0; }
.kpi .k-sub { font-size: 12px; color: var(--muted); }
.sec-h { font-size: 15px; font-weight: 700; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: left; }
.tbl th { color: var(--muted); font-weight: 600; font-size: 12.5px; border-top: 0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.bar-wrap { height: 7px; border-radius: 99px; background: var(--chip); overflow: hidden; margin-top: 6px; }
.bar-fill { height: 100%; background: var(--orange); border-radius: 99px; }
.bar-fill.ok { background: var(--ok); }
.cal-day { font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; padding-left: 2px; }
.sched-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.sched-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 14px; }
.sched-row .btn { height: 38px; padding: 0 12px; font-size: 13.5px; }
.p-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.p-filter button { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 13px; cursor: pointer; }
.p-filter button.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.p-act { display: flex; gap: 8px; margin-top: 10px; align-items: center; }
.p-act select, .p-act input { padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 13.5px; }
.p-act input { flex: 1; min-width: 0; }
.p-act .btn { height: 36px; padding: 0 12px; font-size: 13px; }
pre.md-raw { white-space: pre-wrap; font: 12.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--bg); padding: 12px; border-radius: 12px; border: 1px solid var(--line); overflow-x: auto; margin: 10px 0 0; }
