:root {
  --bg: #f4f1ea; --card: #fffdf9; --ink: #1f2a26; --ink2: #5b6560; --ink3: #8d958f; --line: #e6e0d4; --line2: #efeadf;
  --pri: #2f6b5c; --pri2: #3f8572; --pri-soft: #e3eee9; --amber: #b7791f; --amber-soft: #f8edd8; --red: #b4453a; --red-soft: #f7e3df;
  --blue: #3a6a9a; --blue-soft: #e2ebf4; --gray-soft: #eeebe4; --radius: 14px; --shadow: 0 1px 2px rgba(40,35,20,.04), 0 4px 18px rgba(40,35,20,.05);
  --serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 14px/1.6 var(--sans); }
a { color: var(--pri); text-decoration: none; cursor: pointer; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; margin: 0; }

/* 顶栏 */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 28px; height: 64px; padding: 0 32px;
  background: rgba(244,241,234,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.logo { width: 36px; height: 36px; border-radius: 10px; background: var(--pri); color: #fff; display: grid; place-items: center; font: 700 20px var(--serif); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font: 700 17px var(--serif); letter-spacing: 1px; }
.brand-text small { font-size: 9px; letter-spacing: 2px; color: var(--ink3); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 8px 16px; border-radius: 999px; color: var(--ink2); font-size: 15px; text-decoration: none; }
.nav a:hover { background: var(--gray-soft); }
.nav a.on { background: var(--ink); color: #fff; }
.top-right { display: flex; align-items: center; gap: 12px; position: relative; }
.search { position: relative; }
.search input { width: 220px; height: 36px; padding: 0 14px 0 34px; border: 1px solid var(--line); border-radius: 999px; background: var(--card) no-repeat 12px 50%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%238d958f' stroke-width='2'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cpath d='m9.5 9.5 3 3'/%3E%3C/svg%3E"); outline: none; }
.search input:focus { border-color: var(--pri); }
.avatar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--pri); color: #fff; font: 700 15px var(--serif); cursor: pointer; }
.dropdown { position: absolute; top: 44px; right: 0; min-width: 260px; max-height: 420px; overflow: auto; background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 6px; z-index: 40; }
.dropdown .item { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); }
.dropdown .item:hover { background: var(--gray-soft); text-decoration: none; }
.dropdown .item small { color: var(--ink3); white-space: nowrap; }
.menu { min-width: 200px; }
.menu .who { padding: 10px; border-bottom: 1px solid var(--line2); margin-bottom: 4px; }
.menu .who b { display: block; } .menu .who small { color: var(--ink3); }
.subnav { display: flex; gap: 2px; padding: 0 32px; border-bottom: 1px solid var(--line); background: var(--bg); overflow-x: auto; }
.subnav:empty { display: none; }
.subnav a { padding: 11px 14px; color: var(--ink2); border-bottom: 2px solid transparent; white-space: nowrap; text-decoration: none; }
.subnav a.on { color: var(--pri); border-color: var(--pri); font-weight: 600; }
.main { max-width: 1440px; margin: 0 auto; padding: 24px 32px 60px; }
/* 卡片与工作台 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { font-size: 18px; } .card-h small { color: var(--ink3); margin-left: 8px; font-family: var(--sans); font-weight: 400; font-size: 12px; }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); } .g3 { grid-template-columns: repeat(3, 1fr); } .g2 { grid-template-columns: repeat(2, 1fr); }
.g-main { grid-template-columns: 2fr 1fr; }
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 18px 0 26px; }
.hero .date { color: var(--ink3); letter-spacing: 1px; }
.hero h1 { font-size: 40px; margin: 6px 0 4px; letter-spacing: 2px; }
.hero h2 { font-size: 24px; font-weight: 400; color: var(--ink2); }
.hero p { color: var(--ink2); margin: 12px 0 0; font-size: 15px; }
.hero p b { color: var(--pri); }
.motto { text-align: right; font-family: var(--serif); color: var(--ink2); font-size: 18px; max-width: 360px; }
.motto small { display: block; font-size: 13px; color: var(--ink3); margin-top: 6px; }
.kpi .label { color: var(--ink2); font-size: 14px; }
.kpi .val { font: 700 38px/1.2 var(--serif); margin: 6px 0; letter-spacing: .5px; }
.kpi .val small { font-size: 16px; margin-left: 3px; font-weight: 400; color: var(--ink2); }
.kpi .sub { color: var(--ink3); font-size: 13px; }
.up { color: var(--pri); } .down { color: var(--red); }
.todo { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px dashed var(--line); cursor: pointer; }
.todo:last-child { border-bottom: 0; }
.todo b { display: block; font-weight: 600; } .todo small { color: var(--ink3); }
.todo .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; margin-right: 10px; }
.todo .l { display: flex; align-items: center; min-width: 0; }
.empty { color: var(--ink3); text-align: center; padding: 30px 0; }
.feed li { list-style: none; padding: 7px 0; border-bottom: 1px dashed var(--line2); font-size: 13px; color: var(--ink2); }
.feed { padding: 0; margin: 0; } .feed time { color: var(--ink3); margin-right: 8px; font-size: 12px; }

/* 徽标 */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; line-height: 20px; white-space: nowrap; background: var(--gray-soft); color: var(--ink2); }
.b-green { background: var(--pri-soft); color: var(--pri); } .b-amber { background: var(--amber-soft); color: var(--amber); }
.b-red { background: var(--red-soft); color: var(--red); } .b-blue { background: var(--blue-soft); color: var(--blue); }
.b-dark { background: var(--ink); color: #fff; }

/* 按钮与表单 */
.btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--line); background: var(--card); cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--ink3); }
.btn.pri { background: var(--pri); border-color: var(--pri); color: #fff; } .btn.pri:hover { background: var(--pri2); }
.btn.danger { color: var(--red); } .btn.danger:hover { border-color: var(--red); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.toolbar .sp { flex: 1; }
.toolbar h2 { font-size: 22px; margin-right: 10px; }
.inp, .toolbar input, .toolbar select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); outline: none; }
.inp:focus, .toolbar input:focus, .toolbar select:focus, .form textarea:focus { border-color: var(--pri); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink2); }
.form label.wide { grid-column: 1 / -1; }
.form label i { color: var(--red); font-style: normal; }
.form input, .form select, .form textarea { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; color: var(--ink); }
.form textarea { height: 80px; padding: 8px 10px; resize: vertical; }
/* 表格 */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--ink2); background: #faf7f0; padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; cursor: pointer; user-select: none; }
.tbl th.sorted::after { content: " ↓"; } .tbl th.sorted.asc::after { content: " ↑"; }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line2); vertical-align: middle; max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl tbody tr { cursor: pointer; } .tbl tbody tr:hover td { background: #faf8f2; }
.tbl tfoot td { font-weight: 600; background: #faf7f0; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 10px 4px; color: var(--ink3); font-size: 13px; }
.pager .btns { display: flex; gap: 6px; align-items: center; }
.bar { position: relative; width: 90px; height: 6px; border-radius: 3px; background: var(--gray-soft); display: inline-block; vertical-align: middle; margin-right: 6px; }
.bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--pri); }
.warn-row td { background: #fdf6ea; }

/* 弹层 */
.mask { position: fixed; inset: 0; background: rgba(25,30,28,.32); z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { width: 680px; max-width: 100%; max-height: 90vh; display: flex; flex-direction: column; background: var(--card); border-radius: 16px; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal.sm { width: 420px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line2); }
.modal-h h3 { font-size: 18px; }
.modal-b { padding: 18px 22px; overflow: auto; }
.modal-f { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line2); }
.x { border: 0; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--ink3); }
.drawer-mask { justify-content: flex-end; padding: 0; align-items: stretch; }
.drawer { width: 760px; max-width: 100%; background: var(--bg); display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.15); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.drawer .modal-h { background: var(--card); }
.drawer .modal-b { flex: 1; }
.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.kv > div { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px solid var(--line2); min-width: 0; }
.kv > div.wide { grid-column: 1 / -1; }
.kv span { color: var(--ink3); width: 88px; flex: none; }
.kv b { font-weight: 500; word-break: break-all; white-space: pre-wrap; }
.sec-t { margin: 20px 0 8px; font: 700 15px var(--serif); display: flex; justify-content: space-between; align-items: center; }
.toast-wrap { position: fixed; top: 76px; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 10px; background: var(--ink); color: #fff; box-shadow: 0 8px 20px rgba(0,0,0,.2); animation: slide .2s; }
.toast.err { background: var(--red); }
/* 看板 */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.col { background: #ece7dc; border-radius: 12px; padding: 10px; min-height: 300px; }
.col.over { outline: 2px dashed var(--pri); }
.col-h { display: flex; justify-content: space-between; font-weight: 600; padding: 2px 4px 10px; }
.col-h small { color: var(--ink3); font-weight: 400; }
.kcard { background: var(--card); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; border: 1px solid var(--line2); }
.kcard b { display: block; font-weight: 600; font-size: 13.5px; } .kcard small { color: var(--ink3); display: block; }
.kcard .amt { font: 700 16px var(--serif); color: var(--pri); margin-top: 4px; }

/* 图表 */
.chart { width: 100%; height: auto; display: block; }
.chart text { font: 11px var(--sans); fill: var(--ink3); }
.chart .grid-l { stroke: var(--line); stroke-dasharray: 3 4; }
.chart-tip { position: fixed; pointer-events: none; background: var(--ink); color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; z-index: 95; white-space: nowrap; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; font-size: 12px; color: var(--ink2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.stat-row { display: flex; gap: 28px; flex-wrap: wrap; }
.stat-row div span { display: block; color: var(--ink3); font-size: 13px; } .stat-row div b { font: 700 24px var(--serif); }

/* 登录 */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login .side { background: var(--pri); color: #e9f2ee; padding: 56px 64px; display: flex; flex-direction: column; justify-content: space-between; }
.login .side h1 { font-size: 44px; color: #fff; letter-spacing: 4px; margin-top: 28px; }
.login .side p { font: 20px/1.8 var(--serif); opacity: .9; }
.login .side .flow { display: flex; gap: 8px; flex-wrap: wrap; font-size: 13px; opacity: .85; }
.login .side .flow span { border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: 3px 12px; }
.login .box { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login form { width: 360px; }
.login form h2 { font-size: 26px; margin-bottom: 6px; }
.login form p { color: var(--ink3); margin: 0 0 24px; }
.login .form { grid-template-columns: 1fr; }
.login .btn.pri { width: 100%; height: 42px; justify-content: center; font-size: 15px; margin-top: 8px; }
.login .err { color: var(--red); min-height: 22px; font-size: 13px; }

@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, 1fr); } .g-main, .g3 { grid-template-columns: 1fr; } .search input { width: 150px; } }
@media (max-width: 760px) {
  .topbar { padding: 0 16px; gap: 12px; height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .nav { order: 3; width: 100%; overflow-x: auto; } .brand-text small { display: none; }
  .main { padding: 16px; } .subnav { padding: 0 16px; } .g4, .g2 { grid-template-columns: 1fr; } .form, .kv { grid-template-columns: 1fr; }
  .hero { flex-direction: column; align-items: flex-start; } .motto { text-align: left; } .hero h1 { font-size: 30px; }
  .login { grid-template-columns: 1fr; } .login .side { display: none; } .search input { width: 120px; }
}
@media print {
  .topbar, .subnav, .toolbar .btn, .pager, #layer, .toast-wrap { display: none !important; }
  body { background: #fff; } .main { padding: 0; max-width: none; } .card { box-shadow: none; break-inside: avoid; }
}
