:root {
  --brand: #5B5BD6;
  --brand-2: #4343B8;
  --bg: #F6F5F2;
  --surface: #fff;
  --line: #ECEAE4;
  --text: #1B1B21;
  --muted: #6B6B76;
  --ok: #12B76A;
  --bad: #F04438;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}
.hidden { display: none !important; }

/* 登录 */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-card {
  width: 100%; max-width: 340px; background: #fff; border-radius: 18px;
  padding: 32px 28px; box-shadow: 0 10px 40px rgba(27,27,33,.08); text-align: center;
}
.login-card h1 { margin: 0; font-size: 20px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card input {
  width: 100%; height: 44px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; margin-bottom: 12px;
}
.login-card input:focus { outline: none; border-color: var(--brand); }
.login-card button {
  width: 100%; height: 44px; border: 0; border-radius: 10px;
  background: var(--brand); color: #fff; font-size: 15px; cursor: pointer;
}
.login-card button:hover { background: var(--brand-2); }
.err { color: var(--bad); font-size: 13px; height: 18px; margin-top: 10px; }

.cap-row { display: flex; gap: 10px; margin-bottom: 12px; }
.cap-row input { flex: 1; margin-bottom: 0 !important; }
.cap-img {
  width: 120px; height: 44px; flex-shrink: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.cap-img svg { display: block; width: 100%; height: 100%; }

/* 布局 */
.app { display: flex; min-height: 100vh; }
.side {
  width: 200px; background: #fff; border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; flex-shrink: 0;
}
.brand { font-weight: 600; font-size: 16px; padding: 0 8px 20px; color: var(--brand-2); }
.nav {
  display: block; padding: 10px 12px; border-radius: 10px; color: var(--muted);
  text-decoration: none; cursor: pointer; margin-bottom: 4px;
}
.nav:hover { background: var(--bg); }
.nav.on { background: #EEEEFB; color: var(--brand-2); font-weight: 600; }
.logout { margin-top: auto; font-size: 13px; color: var(--muted); cursor: pointer; padding: 10px 12px; }
.logout:hover { color: var(--bad); }

.main { flex: 1; padding: 28px 32px; max-width: 1100px; }
h2 { font-size: 15px; margin: 26px 0 12px; font-weight: 600; }
h2:first-child { margin-top: 0; }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.card { background: #fff; border-radius: 14px; padding: 16px 18px; border: 1px solid var(--line); }
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 26px; font-weight: 600; margin-top: 6px; font-variant-numeric: tabular-nums; }

/* 图表 */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 150px; background: #fff;
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px 10px; }
.bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }
.bar { width: 100%; max-width: 46px; background: linear-gradient(180deg, #7C7CE8, #5B5BD6); border-radius: 6px 6px 0 0; min-height: 2px; }
.bar-n { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.bar-d { font-size: 11px; color: var(--muted); margin-top: 6px; }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* 列表 */
.list { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.list-item { display: flex; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 13px; }
.list-item:last-child { border-bottom: 0; }
.list-item .n { color: var(--muted); }

.todo { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; font-size: 13px; }
.todo .row { display: flex; justify-content: space-between; padding: 8px 0; }
.todo .num { color: var(--brand); font-weight: 600; }

/* 留言 */
.filters { display: flex; gap: 8px; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 20px; padding: 6px 14px; font-size: 13px; cursor: pointer; color: var(--muted); }
.chip.on { background: #EEEEFB; border-color: var(--brand); color: var(--brand-2); font-weight: 600; }
.comments { display: flex; flex-direction: column; gap: 12px; }
.cmt { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.cmt-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.cmt-nick { color: var(--brand-2); font-weight: 600; font-size: 13px; }
.cmt-body { margin: 10px 0; font-size: 14px; line-height: 1.7; }
.cmt-qid { font-size: 12px; color: var(--muted); }
.cmt-actions { display: flex; gap: 8px; margin-top: 10px; }
.cmt-actions button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 14px; font-size: 13px; cursor: pointer; }
.cmt-actions button.ok { border-color: var(--ok); color: var(--ok); }
.cmt-actions button.no { border-color: var(--bad); color: var(--bad); }
.cmt-actions button:hover { opacity: .8; }
.empty { color: var(--muted); text-align: center; padding: 40px; font-size: 13px; }

@media (max-width: 720px) {
  .app { flex-direction: column; }
  .side { width: 100%; flex-direction: row; align-items: center; padding: 12px; }
  .brand { padding: 0 12px 0 0; }
  nav { display: flex; gap: 6px; }
  .logout { margin: 0 0 0 auto; }
  .main { padding: 16px; }
  .cards { grid-template-columns: repeat(2, 1fr); }
  .two { grid-template-columns: 1fr; }
}
