/* Tsinlo 业务管理工作台 — 样式。分区：变量 / 基础 / 外壳 / 组件 / 页面 / 响应式 */
:root {
  --pri: #2456c9; --pri-d: #1b449f; --pri-l: #eaf0fd;
  --ok: #12855a; --ok-l: #e4f5ed; --warn: #b96a00; --warn-l: #fdf1dc; --bad: #c8322d; --bad-l: #fdeaea;
  --ink: #1b2433; --ink2: #475467; --mute: #7a8699; --line: #e4e8ef; --line2: #eef1f5;
  --bg: #f3f5f9; --card: #fff; --side: #152238; --side-ink: #b8c3d6;
  --r: 10px; --shadow: 0 1px 2px rgba(16, 24, 40, .05); --shadow-l: 0 12px 40px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.55 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--pri); text-decoration: none; } a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--mute); } .small { font-size: 12px; } .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.up { color: var(--ok); } .down { color: var(--bad); } .nowrap { white-space: nowrap; } .pre { white-space: pre-wrap; word-break: break-word; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; } .grow { flex: 1; min-width: 0; } .right { margin-left: auto; }
.stack > * + * { margin-top: 14px; }

/* ── 外壳 ── */
.shell { display: flex; min-height: 100vh; }
.side { width: 216px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex: none; overflow-y: auto; }
.brand-row { display: flex; align-items: center; gap: 10px; padding: 18px 16px 14px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #3b74ee, #2456c9); color: #fff; font-weight: 700; font-size: 17px; display: grid; place-items: center; flex: none; }
.brand-name { color: #fff; font-weight: 600; font-size: 15px; line-height: 1.3; } .side-sub { font-size: 12px; color: #8494ad; }
.nav-sec { padding: 14px 18px 4px; font-size: 11px; letter-spacing: .08em; color: #6b7c97; }
.nav a { display: flex; align-items: center; gap: 10px; margin: 1px 8px; padding: 8px 10px; border-radius: 8px; color: var(--side-ink); }
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav a.on { background: var(--pri); color: #fff; }
.nav svg { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav .cnt { margin-left: auto; background: #e5484d; color: #fff; border-radius: 9px; font-size: 11px; padding: 0 6px; line-height: 17px; min-width: 17px; text-align: center; }
.nav a.on .cnt { background: #fff; color: var(--pri); }
.side-foot { margin-top: auto; padding: 12px 18px 16px; font-size: 12px; color: #7486a2; border-top: 1px solid rgba(255, 255, 255, .07); }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.top { height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 24px; position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb { color: var(--mute); font-weight: 400; } .crumb a { color: var(--mute); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.who { text-align: right; line-height: 1.25; padding: 0 6px; } .who b { display: block; font-size: 13px; } .who span { font-size: 12px; color: var(--mute); }
.menu-btn { display: none; }
#loadbar { position: fixed; top: 0; left: 0; height: 2px; width: 0; background: var(--pri); z-index: 99; transition: width .25s; }
body.loading #loadbar { width: 70%; transition: width 4s cubic-bezier(.1, .7, .3, 1); }
.demo-bar { background: #fff7e6; border-bottom: 1px solid #f5dfb3; color: #7a4b00; padding: 7px 24px; font-size: 13px; }
#view { padding: 20px 24px 48px; max-width: 1440px; width: 100%; }

/* ── 组件 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; white-space: nowrap; font-weight: 500; }
.btn:hover { background: #f6f8fb; text-decoration: none; border-color: #d3d9e3; }
.btn.primary { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.primary:hover { background: var(--pri-d); }
.btn.danger { color: var(--bad); } .btn.danger:hover { background: var(--bad-l); border-color: #f1c4c2; }
.btn.ghost { border-color: transparent; background: transparent; } .btn.ghost:hover { background: #f0f3f8; }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; border-radius: 7px; } .btn.block { width: 100%; }
.btn:disabled { opacity: .55; cursor: default; }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible { outline: 2px solid #7ea2f5; outline-offset: 1px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card h3 { font-size: 14px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.card h3 small { font-weight: 400; color: var(--mute); font-size: 12px; } .card h3 .right { font-weight: 400; font-size: 13px; }
.card-head { display: flex; align-items: center; gap: 8px; padding: 12px 18px; border-bottom: 1px solid var(--line2); font-weight: 600; flex-wrap: wrap; }
.card-head small { font-weight: 400; color: var(--mute); }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } .g32 { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.sec { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; font-size: 15px; font-weight: 600; flex-wrap: wrap; }
.sec small, .sec .muted { font-weight: 400; font-size: 13px; }
.kpi .lab { color: var(--ink2); font-size: 13px; display: flex; align-items: center; gap: 6px; }
.kpi .val { font-size: 26px; font-weight: 650; line-height: 1.25; margin-top: 4px; font-variant-numeric: tabular-nums; } .kpi .val small { font-size: 13px; font-weight: 400; color: var(--mute); }
.kpi .sub { color: var(--mute); font-size: 12px; margin-top: 4px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 6px; flex: none; vertical-align: 1px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: 12px; line-height: 19px; background: #eef1f5; color: var(--ink2); white-space: nowrap; }
.tag.ok { background: var(--ok-l); color: var(--ok); } .tag.warn { background: var(--warn-l); color: var(--warn); } .tag.bad { background: var(--bad-l); color: var(--bad); } .tag.pri { background: var(--pri-l); color: var(--pri); }
.tag.solid-bad { background: var(--bad); color: #fff; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 500; color: var(--mute); font-size: 12px; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; background: #fafbfc; }
td { padding: 10px 12px; border-bottom: 1px solid var(--line2); vertical-align: top; }
tr:last-child > td { border-bottom: 0; }
th.num { text-align: right; }
.tbl-wrap { overflow-x: auto; }
tr.click { cursor: pointer; } tr.click:hover > td { background: #f7f9fc; }
.plain td, .plain th { padding: 6px 8px; } .plain th { background: none; }
.bar { position: relative; height: 8px; background: #e9edf3; border-radius: 5px; min-width: 90px; }
.bar > i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--pri); }
.bar > i.green { background: #17a06c; } .bar > i.yellow { background: #e59a18; } .bar > i.red { background: #dc4a44; } .bar > i.gray { background: #a9b3c2; }
.bar > b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); border-radius: 1px; }
.seg { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: #e9edf3; } .seg i { display: block; }
.empty { text-align: center; color: var(--mute); padding: 34px 16px; } .empty b { display: block; color: var(--ink2); font-size: 15px; margin-bottom: 4px; } .empty .btn { margin-top: 12px; }
.chart { position: relative; height: 230px; } .chart.sm { height: 170px; }
.notice { border-radius: 8px; padding: 9px 12px; background: var(--pri-l); color: #1d3f8f; font-size: 13px; } .notice.warn { background: var(--warn-l); color: #7a4b00; } .notice.bad { background: var(--bad-l); color: #8f2320; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; } .kv dt { color: var(--mute); } .kv dd { margin: 0; }
details > summary { cursor: pointer; color: var(--pri); }

/* 工具条 / 筛选 */
.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=search] { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; background: #fff; }
.toolbar input[type=search] { width: 190px; }
.chips { display: inline-flex; background: #e9edf3; border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.chips button { border: 0; background: transparent; padding: 4px 11px; border-radius: 7px; cursor: pointer; color: var(--ink2); white-space: nowrap; }
.chips button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: var(--shadow); } .chips button em { font-style: normal; color: var(--mute); font-weight: 400; margin-left: 3px; }
.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 9px 0; cursor: pointer; color: var(--ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--pri); border-color: var(--pri); font-weight: 600; }

/* 表单 */
label.f { display: block; margin-bottom: 12px; font-size: 13px; color: var(--ink2); }
label.f > span { display: block; margin-bottom: 4px; } label.f i.req { color: var(--bad); font-style: normal; }
.f input, .f select, .f textarea, .inp { width: 100%; border: 1px solid #d5dbe5; border-radius: 8px; padding: 7px 10px; background: #fff; color: var(--ink); }
.f textarea { min-height: 76px; resize: vertical; line-height: 1.5; } .f .hint { color: var(--mute); font-size: 12px; margin-top: 3px; }
.f input:focus, .f select:focus, .f textarea:focus, .inp:focus { border-color: var(--pri); outline: 2px solid #c9d9fb; outline-offset: 0; }
.frow { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; } .frow3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.checks { display: flex; flex-wrap: wrap; gap: 6px 8px; } .checks label { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px; cursor: pointer; color: var(--ink); }
.checks input { width: auto; margin: 0; } .checks label:has(input:checked) { border-color: var(--pri); background: var(--pri-l); }
.err { background: var(--bad-l); color: #8f2320; border-radius: 8px; padding: 8px 10px; margin: 4px 0 10px; font-size: 13px; }

/* 弹窗 / 侧栏详情 */
.mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 60; display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; }
.modal-card { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; box-shadow: var(--shadow-l); padding: 20px 22px; }
.modal-card.wide { max-width: 760px; } .modal-card h2 { font-size: 17px; margin-bottom: 4px; } .modal-card .intro { color: var(--mute); margin-bottom: 14px; font-size: 13px; } .modal-card h2 + form { margin-top: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 50; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(640px, 100vw); background: #fff; z-index: 51; box-shadow: var(--shadow-l); display: flex; flex-direction: column; animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(24px); opacity: .4; } }
.drawer-head { display: flex; align-items: flex-start; gap: 10px; padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 17px; line-height: 1.4; } .drawer-body { flex: 1; overflow-y: auto; padding: 16px 20px 24px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 8px; flex-wrap: wrap; background: #fafbfc; }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--mute); padding: 2px 6px; border-radius: 6px; margin-left: auto; } .x:hover { background: #f0f3f8; color: var(--ink); }
.block-t { font-size: 12px; color: var(--mute); margin: 16px 0 5px; font-weight: 500; letter-spacing: .02em; }
.quote { background: #f6f8fb; border-left: 3px solid #cfd8e6; border-radius: 0 8px 8px 0; padding: 8px 12px; } .quote.pri { background: var(--pri-l); border-color: var(--pri); } .quote.warn { background: var(--warn-l); border-color: #e59a18; } .quote.ok { background: var(--ok-l); border-color: #17a06c; }
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: #1b2433; color: #fff; padding: 9px 16px; border-radius: 9px; z-index: 90; box-shadow: var(--shadow-l); max-width: 90vw; }
.toast.bad { background: var(--bad); }

/* 时间线 / 留言 */
.tl { border-left: 2px solid var(--line); margin-left: 5px; padding-left: 14px; } .tl > div { position: relative; padding-bottom: 12px; }
.tl > div::before { content: ""; position: absolute; left: -20px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: #b4bfd0; border: 2px solid #fff; }
.tl .meta { font-size: 12px; color: var(--mute); }
.cmt { display: flex; gap: 10px; margin-bottom: 10px; } .cmt .av { width: 28px; height: 28px; border-radius: 50%; background: #dfe6f2; color: #41506b; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex: none; }
.cmt.mgr .av { background: var(--pri); color: #fff; } .cmt .bub { background: #f4f6fa; border-radius: 4px 10px 10px 10px; padding: 7px 11px; min-width: 0; } .cmt .meta { font-size: 12px; color: var(--mute); }
.cmt-form { display: flex; gap: 8px; align-items: flex-end; } .cmt-form textarea { flex: 1; min-height: 38px; height: 38px; border: 1px solid #d5dbe5; border-radius: 8px; padding: 7px 10px; resize: vertical; }

/* ── 页面 ── */
.todo { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line2); }
.todo:last-child { border-bottom: 0; } .todo:hover { background: #f8fafc; }
.todo .lv { width: 4px; align-self: stretch; border-radius: 2px; background: #c3ccda; flex: none; } .todo .lv.high { background: #dc4a44; } .todo .lv.mid { background: #e59a18; }
.todo .t { font-weight: 500; } .todo .s { color: var(--mute); font-size: 13px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.act { padding: 9px 18px; border-bottom: 1px solid var(--line2); font-size: 13px; } .act:last-child { border-bottom: 0; }
.tcard { display: block; border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 14px 16px; cursor: pointer; box-shadow: var(--shadow); }
.tcard:hover { border-color: #b9c8e8; } .tcard.hl, .pcard.hl { border-color: var(--pri); box-shadow: 0 0 0 3px var(--pri-l); }
.tcard .ttl { font-weight: 600; font-size: 15px; } .tcard .nums { font-variant-numeric: tabular-nums; }
.tcard .foot { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.gcard { display: block; color: inherit; border: 1px solid var(--line); border-radius: var(--r); background: #fff; padding: 14px 16px; box-shadow: var(--shadow); border-top: 3px solid var(--gc, #ccd); }
.gcard:hover { text-decoration: none; border-color: #b9c8e8; border-top-color: var(--gc, #ccd); } .gcard .nm { font-weight: 600; font-size: 15px; }
.gcard .stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; } .gcard .stats b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; } .gcard .stats span { font-size: 12px; color: var(--mute); }
.pcard { border: 1px solid var(--line); border-radius: var(--r); background: #fff; box-shadow: var(--shadow); }
.pcard .hd { padding: 13px 16px 10px; } .pcard .ttl { font-weight: 600; font-size: 15px; }
.item { display: flex; align-items: center; gap: 10px; padding: 7px 16px; border-top: 1px solid var(--line2); }
.item .st { width: 20px; height: 20px; border-radius: 50%; border: 2px solid #b7c1d1; background: #fff; cursor: pointer; flex: none; padding: 0; display: grid; place-items: center; font-size: 12px; line-height: 1; color: #fff; }
.item .st.doing { border-color: #e59a18; background: linear-gradient(90deg, #e59a18 50%, #fff 50%); } .item .st.done { border-color: #17a06c; background: #17a06c; }
.item.done .nm { color: var(--mute); text-decoration: line-through; } .item .ops { visibility: hidden; display: flex; gap: 2px; } .item:hover .ops, .item:focus-within .ops { visibility: visible; }
.icon-btn { border: 0; background: none; cursor: pointer; color: var(--mute); padding: 2px 6px; border-radius: 6px; font-size: 13px; } .icon-btn:hover { background: #eef1f5; color: var(--ink); }
.add-item { display: flex; gap: 8px; padding: 9px 16px 12px; border-top: 1px solid var(--line2); } .add-item input { flex: 1; min-width: 0; border: 1px dashed #c9d2df; border-radius: 8px; padding: 6px 10px; background: #fafbfc; } .add-item input[type=date] { flex: none; width: 140px; }
.rcard .sect { margin-top: 10px; } .rcard .sect h4 { font-size: 12px; color: var(--mute); font-weight: 500; margin-bottom: 2px; }
.fdef { display: flex; flex-direction: column; gap: 6px; } .fdef .nm { font-weight: 600; }
.light { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: #a9b3c2; } .light.green { background: #17a06c; } .light.yellow { background: #e59a18; } .light.red { background: #dc4a44; }
.spark { display: block; }
.n-item { display: flex; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line2); cursor: pointer; } .n-item:hover { background: #f8fafc; } .n-item.read { opacity: .6; }
.n-item .dotu { width: 8px; height: 8px; border-radius: 50%; background: var(--pri); margin-top: 7px; flex: none; } .n-item.read .dotu { background: transparent; }
.switch { position: relative; width: 36px; height: 20px; border-radius: 10px; background: #c5cedb; border: 0; cursor: pointer; padding: 0; flex: none; } .switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: left .15s; }
.switch.on { background: var(--pri); } .switch.on::after { left: 18px; }
.login-body { display: grid; place-items: center; min-height: 100vh; background: linear-gradient(160deg, #152238, #23406f); padding: 16px; }
.login-card { background: #fff; border-radius: 16px; padding: 28px 28px 22px; width: 100%; max-width: 380px; box-shadow: var(--shadow-l); }
.login-card .brand-name { color: var(--ink); font-size: 17px; } .login-card .brand-row { padding: 0 0 20px; }

/* ── 响应式 ── */
@media (max-width: 1180px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g21, .g32 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) {
  .side { position: fixed; left: 0; top: 0; z-index: 70; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow-l); } .side.open { transform: none; }
  .side-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .4); z-index: 69; }
  .menu-btn { display: inline-flex; padding: 0 8px; font-size: 18px; } .top { padding: 0 12px; gap: 6px; } #view { padding: 14px 12px 40px; } .demo-bar { padding: 7px 12px; }
  .who { display: none; } .g2, .g3 { grid-template-columns: minmax(0, 1fr); } .frow, .frow3 { grid-template-columns: minmax(0, 1fr); }
  .toolbar input[type=search] { width: 100%; } .item .ops { visibility: visible; } .mask { padding: 12px 8px; } .modal-card { padding: 16px; }
  .todo { padding: 10px 12px; } .kv { grid-template-columns: 80px minmax(0, 1fr); } .top .btn.ghost.hide-m { display: none; }
}
@media (max-width: 520px) { .g4 { grid-template-columns: minmax(0, 1fr); } .kpi .val { font-size: 22px; } .add-item { flex-wrap: wrap; } .add-item input[type=date] { flex: 1; } }
@media print { .side, .top, .toolbar, .demo-bar, .btn { display: none !important; } #view { padding: 0; } .card { box-shadow: none; break-inside: avoid; } }
