/* 凯创工作台 KaiStudio ·「印刷四色」主题
   黑墨（K）做导航，纸白做工作区，品红（M）是主要操作，青（C）是链接和信息，黄（Y）只做高亮。 */
:root {
  --k: #16161D; --k2: #23232D; --k3: #30303C;
  --m: #E4007C; --m-d: #B80064; --m-l: #FDE6F2; --c: #0087C9; --c-l: #E2F4FC; --y: #FFE100; --y-l: #FFF9C7;
  --ok: #1E8E5A; --ok-l: #E3F5EC; --warn: #D7263D; --warn-l: #FDE7EA;
  --bg: #F4F4F6; --card: #FFFFFF; --line: #E1E1E8; --line-2: #EDEDF2; --text: #1B1B22; --muted: #6B6B78; --faint: #9A9AA8;
  --r: 10px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --font: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --sat: env(safe-area-inset-top, 0px); --sab: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #111116; --card: #1C1C24; --line: #2C2C38; --line-2: #24242E; --text: #ECECF2; --muted: #A0A0B0; --faint: #70707E;
    --m-l: #3A1027; --c-l: #0E2B3A; --y-l: #3A3510; --ok-l: #0F3326; --warn-l: #3B1219; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #111116; --card: #1C1C24; --line: #2C2C38; --line-2: #24242E; --text: #ECECF2; --muted: #A0A0B0; --faint: #70707E;
  --m-l: #3A1027; --c-l: #0E2B3A; --y-l: #3A3510; --ok-l: #0F3326; --warn-l: #3B1219; color-scheme: dark; }
:root:lang(zh-CN) { --font: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 var(--font); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
a { color: var(--c); text-decoration: none; } a:hover { text-decoration: underline; }
h1 { font-size: 21px; margin: 0; font-weight: 800; } h2 { font-size: 17px; margin: 0 0 8px; } h3 { font-size: 15px; margin: 0 0 8px; } h4 { margin: 12px 0 6px; font-size: 13px; }
p { margin: 0 0 8px; } [hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--y); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .nowrap { white-space: nowrap; } .center { text-align: center; justify-content: center; }
.warn { color: var(--warn); } .ok { color: var(--ok); } .pre { white-space: pre-wrap; } .ell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } .row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; } .stack > * + * { margin-top: 12px; } .stack { display: flex; flex-direction: column; gap: 0; }
.grid2, .grid3, .grid4 { display: grid; gap: 10px 12px; } .grid2 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid3 { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid4 { grid-template-columns: repeat(4, minmax(0,1fr)); margin-bottom: 12px; }
.cols { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 12px; align-items: start; }
@media (max-width: 1000px) { .cols { grid-template-columns: 1fr; } .grid4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

/* 表单 */
label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); font-weight: 600; }
label.chk { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; color: var(--text); font-size: 13px; }
input, select, textarea { font: inherit; font-size: 14px; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--m); }
input:focus, select:focus, textarea:focus { border-color: var(--m); outline: none; box-shadow: 0 0 0 3px var(--m-l); }
input:disabled, select:disabled, textarea:disabled { background: var(--line-2); color: var(--muted); }
textarea { resize: vertical; } fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 14px; } legend { font-weight: 700; font-size: 12px; }
details > summary { cursor: pointer; font-weight: 600; margin: 8px 0; }
.btn { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--text); cursor: pointer; white-space: nowrap; text-decoration: none !important; }
.btn:hover { border-color: var(--m); } .btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--m); color: #fff; border-color: var(--m); } .btn.primary:hover { background: var(--m-d); }
.btn.danger { background: var(--warn); color: #fff; border-color: var(--warn); } .btn.danger.ghost { background: transparent; color: var(--warn); }
.btn.sm { padding: 5px 10px; font-size: 13px; } .btn.lg { padding: 14px; font-size: 16px; } .btn.block { width: 100%; justify-content: center; }
.icon-btn { display: inline-grid; place-items: center; position: relative; width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.icon-btn:hover { background: var(--line-2); } .icon-btn.sm { width: 26px; height: 26px; font-size: 12px; }
.link { background: none; border: 0; color: var(--c); cursor: pointer; font: inherit; padding: 2px 4px; } .link.on { font-weight: 800; color: var(--m); } .link.sm { font-size: 12px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg > * { border: 0; background: none; padding: 7px 12px; cursor: pointer; color: var(--text); font: inherit; font-weight: 600; } .seg > .on { background: var(--k); color: #fff; }

/* 外壳 */
.shell { display: grid; grid-template-columns: 228px minmax(0,1fr); min-height: 100vh; }
.side { background: var(--k); color: #C8C8D4; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto; padding-top: var(--sat); z-index: 20; }
.brand { display: flex; gap: 10px; align-items: center; padding: 16px; color: #fff; } .brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; }
.brand b { display: block; font-size: 14px; } .brand span { font-size: 11px; color: #8E8E9E; }
.nav-group { padding: 6px 10px; } .nav-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #6E6E80; padding: 6px 10px 2px; }
.side nav a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; color: #C8C8D4; position: relative; text-decoration: none; }
.side nav a:hover { background: var(--k2); color: #fff; } .side nav a.active { background: var(--k3); color: #fff; box-shadow: inset 3px 0 0 var(--m); }
.nbadge { position: absolute; right: 6px; top: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--m); color: #fff; font: 700 11px/18px var(--font); font-style: normal; text-align: center; }
.side .nbadge { top: 8px; }
.me-link { margin-top: auto; display: flex; gap: 10px; align-items: center; padding: 14px 16px; color: #fff !important; border-top: 1px solid var(--k3); } .me-link small { display: block; color: #8E8E9E; }
.main { min-width: 0; display: flex; flex-direction: column; }
.top { display: flex; gap: 8px; align-items: center; padding: calc(8px + var(--sat)) 16px 8px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top .lang-sel { width: auto; padding: 5px 8px; }
.rt-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); } .rt-dot.on { background: var(--ok); } .rt-dot.connecting { background: var(--y); }
.page { padding: 16px; max-width: 1500px; width: 100%; margin: 0 auto; padding-bottom: calc(24px + var(--sab)); }
.only-m { display: none; }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; } .only-m { display: inline-grid; }
  .side { position: fixed; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; } .side.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  .page { padding: 12px; }
}
.loading { height: 3px; background: linear-gradient(90deg, var(--c), var(--m), var(--y)); animation: ld 1s infinite; border-radius: 2px; } @keyframes ld { 50% { opacity: .3; } }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.card.narrow { max-width: 880px; margin-left: auto; margin-right: auto; } .card.err { color: var(--warn); }
.cols > .stack > .card, .cols > .card { margin-bottom: 0; } .cols { margin-bottom: 12px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; } .toolbar input[type=search] { max-width: 360px; } .toolbar select { width: auto; }
.empty { text-align: center; color: var(--muted); padding: 30px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 10px; background: var(--line-2); color: var(--muted); margin: 1px 2px; white-space: nowrap; }
.tag.p-must { background: var(--warn-l); color: var(--warn); } .tag.p-should { background: var(--y-l); color: #8A6D00; } .tag.p-could { background: var(--c-l); color: var(--c); }

/* 状态标签 */
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.badge.lg { font-size: 13px; padding: 4px 12px; }
.b-inquiry, .b-lead, .b-todo, .b-queued { background: var(--line-2); color: var(--muted); }
.b-quoted, .b-qualify, .b-demo, .b-proposal, .b-review, .b-pending, .b-trial { background: var(--c-l); color: var(--c); }
.b-confirmed, .b-negotiation, .b-open, .b-partial, .b-expiring, .b-suspended { background: var(--y-l); color: #8A6D00; }
.b-designing, .b-proofing, .b-doing, .b-revising, .b-implementing, .b-changes { background: var(--m-l); color: var(--m); }
.b-ready, .b-printing, .b-finishing { background: #EDE7FB; color: #5B3CC4; }
.b-completed, .b-delivered, .b-paid, .b-approved, .b-done, .b-won, .b-live, .b-active, .b-sent, .b-received { background: var(--ok-l); color: var(--ok); }
.b-cancelled, .b-lost, .b-unpaid, .b-expired, .b-failed, .b-void, .b-refunded { background: var(--warn-l); color: var(--warn); }

/* 看板 */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 10px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.col { background: var(--line-2); border-radius: var(--r); padding: 8px; min-height: 120px; } .col > header { display: flex; justify-content: space-between; align-items: center; padding: 2px 4px 8px; }
.kcard { display: block; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; margin-bottom: 8px; color: var(--text); text-decoration: none !important; border-left: 3px solid transparent; }
.kcard:hover { border-color: var(--m); } .kcard.late { border-left-color: var(--warn); } .kcard.urgent { border-left-color: var(--m); }
.ktitle { font-weight: 600; margin: 2px 0; } .kthumb { width: 100%; height: 90px; object-fit: cover; border-radius: 6px; margin-bottom: 6px; background: var(--line-2); }
.bar { height: 5px; background: var(--line-2); border-radius: 3px; overflow: hidden; margin: 5px 0; } .bar i { display: block; height: 100%; background: var(--ok); }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; } .tbl th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; } .tbl tr[data-href] { cursor: pointer; } .tbl tr[data-href]:hover td { background: var(--line-2); }
.tbl tr.late td:first-child { box-shadow: inset 3px 0 0 var(--warn); } .tbl tr.void, li.void { opacity: .5; text-decoration: line-through; } .tbl tr.unread td { font-weight: 700; }
.tbl.small td, .tbl.small th { padding: 4px 6px; font-size: 12px; } .scroll { overflow-x: auto; }
.card > .tbl { margin: 0 -4px; width: calc(100% + 8px); }
@media (max-width: 760px) { .card:has(> .tbl) { overflow-x: auto; } }
.matrix td.c { text-align: center; } .matrix tr.grp td { background: var(--line-2); font-weight: 700; }
.reqs select { width: auto; padding: 3px 6px; font-size: 12px; } .rq-done td:nth-child(3) b { text-decoration: line-through; color: var(--muted); }

/* 详情头部 */
.head h1 { margin-bottom: 2px; }
.steps { display: flex; gap: 2px; margin: 12px 0; overflow-x: auto; }
.steps span { flex: 1; min-width: 68px; text-align: center; font-size: 11px; padding: 5px 4px; background: var(--line-2); color: var(--muted); white-space: nowrap; }
.steps span:first-child { border-radius: 6px 0 0 6px; } .steps span:last-child { border-radius: 0 6px 6px 0; }
.steps .done { background: var(--ok-l); color: var(--ok); } .steps .cur { background: var(--m); color: #fff; font-weight: 700; } .steps .off { opacity: .4; } .steps [data-st] { cursor: pointer; }
.kv { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 8px 0; } .kv > div { display: flex; flex-direction: column; min-width: 110px; } .kv small { color: var(--muted); font-size: 11px; } .kv b { font-size: 15px; }
.kv.sm b { font-size: 14px; }
.actions { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-2); }
.list { list-style: none; margin: 0; padding: 0; } .list li { padding: 7px 0; border-bottom: 1px solid var(--line-2); } .list li:last-child { border: 0; }
.list small { display: block; }
.timeline { list-style: none; margin: 0; padding: 0 0 0 14px; border-left: 2px solid var(--line); } .timeline li { position: relative; padding: 0 0 12px 8px; }
.timeline li::before { content: ''; position: absolute; left: -20px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--m); }
.timeline li.cur::before { background: var(--m); }

/* 预算单编辑 */
.items .item { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 8px; background: var(--bg); }
.grid-item { display: grid; grid-template-columns: minmax(140px,2.2fr) minmax(130px,1.8fr) minmax(70px,.9fr) minmax(70px,.9fr) minmax(56px,.7fr) minmax(52px,.6fr) minmax(80px,1fr); gap: 8px; }
@media (max-width: 900px) { .grid-item { grid-template-columns: repeat(3, minmax(0,1fr)); } .grid-item .span2 { grid-column: span 3; } }
.fins { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0 4px; } .fins .fq { width: 56px; padding: 2px 6px; }
.totals { margin: 10px 0 10px auto; max-width: 340px; } .totals > div { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; }
.totals input { width: 130px; text-align: right; } .totals .big { font-size: 18px; border-top: 2px solid var(--text); margin-top: 4px; padding-top: 6px; }

/* 文件 */
.files { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.file { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; background: var(--card); }
.file .thumb { display: grid; place-items: center; height: 110px; background: var(--line-2); font-size: 38px; text-decoration: none; }
.file .thumb img, .file .thumb video { width: 100%; height: 110px; object-fit: cover; } .file .meta { padding: 6px 8px; } .file .meta a { display: block; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .meta small { display: block; font-size: 11px; color: var(--muted); } .file [data-del] { position: absolute; top: 4px; right: 4px; background: rgba(0,0,0,.5); color: #fff; }
.drop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; border: 2px dashed var(--line); border-radius: 8px; padding: 8px; margin-bottom: 10px; }
.drop.over { border-color: var(--m); background: var(--m-l); } .drop select { width: auto; } .drop progress { width: 160px; }

/* 样稿 */
.proofs .proof { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); } .proof.void { opacity: .55; }
.pthumb { width: 120px; height: 90px; flex: none; display: grid; place-items: center; background: var(--line-2); border-radius: 6px; overflow: hidden; font-size: 34px; }
.pthumb img, .pthumb video { width: 100%; height: 100%; object-fit: cover; } .quote { border-left: 3px solid var(--m); padding: 4px 8px; margin: 6px 0; background: var(--m-l); border-radius: 0 6px 6px 0; }
.workload { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; } .wl { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; display: flex; gap: 8px; align-items: center; }

/* 统计 */
.stat { display: flex; flex-direction: column; gap: 2px; margin: 0; } .stat small { color: var(--muted); } .stat b { font-size: 22px; } .stat.hl { border-top: 3px solid var(--m); } .stat.warnbg { border-top: 3px solid var(--warn); }
.pipeline { display: grid; grid-template-columns: repeat(9, minmax(70px,1fr)); gap: 4px; overflow-x: auto; }
.pl { background: var(--line-2); border-radius: 6px; padding: 8px; text-align: center; color: var(--text); text-decoration: none !important; } .pl b { display: block; font-size: 20px; } .pl small { font-size: 11px; color: var(--muted); } .pl.late { box-shadow: inset 0 -3px 0 var(--warn); }
.bars, .stackbar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; margin: 6px 0; } .bars span, .stackbar i { display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; } .legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 4px; }
.bl-electronics { background: #0087C9; } .bl-pos { background: #16161D; } .bl-print { background: #E4007C; } .bl-design { background: #FFB800; } .bl-software { background: #1E8E5A; } .bl-service { background: #9A9AA8; }
:root[data-theme="dark"] .bl-pos { background: #C8C8D4; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 210px; padding-top: 10px; } .cm { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.cm .stackbar { width: 100%; max-width: 46px; flex-direction: column-reverse; height: auto; border-radius: 4px 4px 0 0; }

/* 门店收银 */
.pos { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(320px,1fr); gap: 12px; } @media (max-width: 900px) { .pos { grid-template-columns: 1fr; } }
.results { display: grid; gap: 6px; margin: 10px 0; max-height: 60vh; overflow-y: auto; }
.prod { display: grid; grid-template-columns: 1fr auto; text-align: left; gap: 2px 10px; padding: 9px 12px; border: 1px solid var(--line); background: var(--card); border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); }
.prod small { grid-column: 1; color: var(--muted); } .prod span { grid-row: 1 / 3; grid-column: 2; align-self: center; font-weight: 700; } .prod:hover { border-color: var(--m); }
.cart .qty { width: 64px; } .picker { position: absolute; z-index: 50; background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); max-height: 280px; overflow-y: auto; margin-top: 52px; min-width: 280px; }
label:has(+ .picker), label { position: relative; } .picker button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 12px; cursor: pointer; font: inherit; color: var(--text); } .picker button:hover { background: var(--m-l); }

/* 邮件 */
.mailbody { width: 100%; min-height: 380px; border: 1px solid var(--line); border-radius: 8px; background: #fff; margin: 10px 0; }

/* 聊天 */
body.chat-full .page { padding: 0; max-width: none; }
.chat { display: grid; grid-template-columns: 300px minmax(0,1fr); height: calc(100dvh - 51px - var(--sat)); background: var(--card); }
.ch-list { border-right: 1px solid var(--line); overflow-y: auto; padding: 8px; } .ch-list .row { margin-bottom: 8px; }
.ch { display: flex; gap: 10px; align-items: center; padding: 8px; border-radius: 8px; color: var(--text); text-decoration: none !important; position: relative; } .ch:hover { background: var(--line-2); } .ch.on { background: var(--m-l); }
.ch .nbadge { position: static; } .ch-main { display: flex; flex-direction: column; min-height: 0; } .ch-main > .empty { margin: auto; }
.ch-head { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); } .ch-head small { display: block; }
.msgs { flex: 1; overflow-y: auto; padding: 14px; background: var(--bg); }
.msg { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; } .msg.grp { margin-top: 2px; } .msg.mine { flex-direction: row-reverse; }
.av-sp { width: 32px; flex: none; } .bub { max-width: min(72%, 560px); background: var(--card); border: 1px solid var(--line); padding: 7px 11px; border-radius: 14px 14px 14px 4px; word-wrap: break-word; }
.bub .txt { white-space: pre-wrap; }
.mine .bub { background: var(--m); color: #fff; border-color: var(--m); border-radius: 14px 14px 4px 14px; } .mine .bub a { color: #fff; text-decoration: underline; }
.bub .who { display: block; font-weight: 700; font-size: 11px; color: var(--m); } .bub .when { display: block; font-size: 10px; opacity: .65; text-align: right; }
.bub .rq { font-size: 12px; opacity: .8; border-left: 2px solid currentColor; padding-left: 6px; margin-bottom: 4px; } .mention { color: var(--c); } .mine .mention { color: var(--y); }
.mimg { max-width: 280px; max-height: 260px; border-radius: 8px; display: block; } .mfile { display: block; }
.mact { opacity: 0; transition: opacity .15s; } .msg:hover .mact { opacity: 1; }
.sys { text-align: center; font-size: 12px; color: var(--muted); margin: 10px 0; white-space: pre-line; }
.composer { display: flex; gap: 6px; align-items: flex-end; padding: 8px 10px calc(8px + var(--sab)); border-top: 1px solid var(--line); }
.composer textarea { max-height: 140px; } .composer .send { color: var(--m); } .reply { padding: 6px 12px; background: var(--m-l); display: flex; justify-content: space-between; font-size: 12px; } .more { display: block; margin: 0 auto; }
@media (max-width: 800px) { .chat { grid-template-columns: 1fr; } .hide-m { display: none !important; } }

/* 头像 */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--k3); color: #fff; display: inline-grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; position: relative; overflow: visible; }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; } .avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar .on { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid var(--card); }
.avatar.company, .avatar.ref, .avatar.group { background: var(--line-2); font-size: 16px; }

/* 弹窗与提示 */
.modal-back { position: fixed; inset: 0; background: rgba(10,10,15,.45); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--card); border-radius: 14px; width: min(560px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal.wide { width: min(900px, 100%); } .modal header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal header h2 { margin: 0; } .modal .body { padding: 16px 18px; overflow-y: auto; } .modal .body form { display: flex; flex-direction: column; gap: 10px; }
.modal footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; right: 16px; bottom: calc(16px + var(--sab)); display: flex; flex-direction: column; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--k); color: #fff; padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); cursor: pointer; border-left: 4px solid var(--ok); } .toast.err { border-left-color: var(--warn); }
.toast small { display: block; opacity: .8; } .notifs li.unread { background: var(--m-l); padding-left: 8px; border-radius: 6px; } .notifs a { color: var(--text); display: block; text-decoration: none; }

/* 登录 */
.login-body { background: linear-gradient(135deg, #16161D 0%, #23232D 60%, #3A1027 100%); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { background: var(--card); width: min(400px, 100%); padding: 28px; border-radius: 16px; box-shadow: 0 30px 80px rgba(0,0,0,.4); border-top: 5px solid var(--m); }
.brand-l { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; } .brand-l b { font-size: 18px; display: block; } .brand-l span { font-size: 12px; color: var(--muted); }
.login-card .err { color: var(--warn); margin: 0; } .or { text-align: center; margin: 16px 0; border-top: 1px solid var(--line); } .or span { background: var(--card); padding: 0 10px; position: relative; top: -10px; color: var(--muted); font-size: 12px; }
.gbtn { display: flex; justify-content: center; min-height: 44px; }
