:root {
  --primary: #2c6e49;
  --primary-d: #1e4d33;
  --bg: #f4f6f5;
  --card: #ffffff;
  --text: #222;
  --muted: #777;
  --line: #e2e6e4;
  --danger: #b03a2e;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font: 15px/1.6 "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); }
button { cursor: pointer; }
input, select { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; }
input:focus, select:focus { outline: 2px solid #9cc5ab; }
button { padding: 7px 16px; background: var(--primary); color: #fff; border: none; border-radius: 5px; }
button:active { background: var(--primary-d); }
button.ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }
button.mini { padding: 3px 10px; font-size: 13px; background: #fff; color: var(--muted); border: 1px solid var(--line); }
button.danger { background: var(--danger); }

/* 登录 */
#page-login { display: flex; justify-content: center; align-items: center; min-height: 100vh; }
.login-box { background: var(--card); padding: 36px 30px; border-radius: 10px; width: 320px; box-shadow: 0 2px 14px rgba(0,0,0,.08); text-align: center; }
.login-box h2 { color: var(--primary); margin-bottom: 18px; font-size: 20px; }
.login-box input { width: 100%; margin-bottom: 12px; }
.login-box button { width: 100%; padding: 10px; font-size: 16px; }
.hint { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; }

/* 框架 */
header { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--primary); color: #fff; position: sticky; top: 0; z-index: 10; }
#app-title { font-weight: bold; font-size: 17px; }
#whoami { margin-left: auto; font-size: 13px; opacity: .9; }
header .mini { border-color: rgba(255,255,255,.5); color: #fff; background: transparent; }
.tabs { display: flex; flex-wrap: wrap; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 44px; z-index: 9; }
.tabs button { background: transparent; color: var(--muted); border-radius: 0; padding: 11px 15px; border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--primary); font-weight: bold; border-bottom-color: var(--primary); background: transparent; }
main { padding: 12px; max-width: 1100px; margin: 0 auto; }

/* 卡片与表格 */
.card { background: var(--card); border-radius: 8px; padding: 14px; margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.card h3 { font-size: 16px; color: var(--primary-d); margin-bottom: 10px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; white-space: nowrap; }
table.t th { background: #eef3f0; }
table.t td.n, table.t th.n { text-align: right; }
table.t tbody tr:nth-child(even) { background: #fafbfa; }
.tbl-wrap { overflow-x: auto; }
.summary { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0; }
.summary .s { background: #eef3f0; border-radius: 6px; padding: 8px 14px; }
.summary .s b { display: block; font-size: 20px; color: var(--primary-d); }
.muted { color: var(--muted); font-size: 13px; }
.empty { color: var(--muted); text-align: center; padding: 18px; }

/* 弹层（自定义 modal，禁用原生 confirm/alert） */
#modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; justify-content: center; align-items: center; }
.modal { background: #fff; border-radius: 10px; padding: 20px; width: min(92vw, 460px); max-height: 85vh; overflow: auto; }
.modal-title { font-weight: bold; font-size: 16px; margin-bottom: 12px; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.modal label { display: block; font-size: 13px; color: var(--muted); margin: 8px 0 3px; }
.modal input, .modal select { width: 100%; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; background: #eef3f0; color: var(--primary-d); }
.tag.warn { background: #fdeeea; color: var(--danger); }
#toast { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); background: rgba(30,30,30,.9); color: #fff; padding: 8px 20px; border-radius: 20px; font-size: 14px; z-index: 200; transition: opacity .3s; opacity: 0; pointer-events: none; }
@media (max-width: 640px) { .tabs { top: 44px; overflow-x: auto; } main { padding: 8px; } }
