:root {
  --red: #b81c22;
  --red-dark: #8f1419;
  --red-soft: #fbeaeb;
  --gold: #c9a227;
  --ink: #1f2329;
  --ink-soft: #5b6068;
  --line: #e6e2dc;
  --bg: #f6f4f0;
  --card: #ffffff;
  --ok: #2e7d32;
  --warn: #c77700;
  --shadow: 0 2px 12px rgba(60, 30, 30, 0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}

.topbar {
  background: linear-gradient(135deg, var(--red), var(--red-dark));
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow);
}
.topbar .emblem {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: var(--gold);
  border: 2px solid rgba(255,255,255,0.4);
}
.topbar .title { font-size: 18px; font-weight: 700; }
.topbar .sub { font-size: 12px; opacity: 0.85; }
.topbar .spacer { flex: 1; }
.topbar .who { font-size: 13px; opacity: 0.95; }

.container { max-width: 1040px; margin: 0 auto; padding: 24px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}
.card h2 { margin: 0 0 4px; font-size: 17px; }
.card .hint { color: var(--ink-soft); font-size: 13px; margin-bottom: 14px; }

.label { font-weight: 600; font-size: 14px; margin: 14px 0 6px; }
.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 14px; background: #fff; color: var(--ink);
}
textarea.field { min-height: 180px; resize: vertical; line-height: 1.7; }
.field:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 14px; font-weight: 600; transition: .15s;
}
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }
.btn-ghost { background: #fff; color: var(--red); border: 1px solid var(--red); }
.btn-ghost:hover { background: var(--red-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.dir-option {
  display: block; border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; transition: .15s;
  background: #fff;
}
.dir-option:hover { border-color: var(--red); background: #fffafa; }
.dir-option.selected { border-color: var(--red); background: var(--red-soft); }
.dir-option input { margin-right: 10px; transform: translateY(2px); }
.dir-option .dt { font-weight: 600; }
.dir-option .dd { color: var(--ink-soft); font-size: 13px; margin-top: 4px; }
.dir-num {
  display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center;
  background: var(--red); color: #fff; border-radius: 50%; font-size: 12px; margin-right: 8px;
}

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-sub { background: #e8f0fe; color: #1a56c4; }
.badge-adopt { background: #e6f4ea; color: var(--ok); }
.badge-arch { background: #eee; color: #666; }
.badge-none { background: #fdecec; color: var(--red); }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row.end { justify-content: flex-end; }
.muted { color: var(--ink-soft); font-size: 13px; }
.mt { margin-top: 14px; }
.center-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fbeaeb, #f6f4f0);
}
.login-box { width: 380px; }
.login-box .topbar { border-radius: 12px 12px 0 0; }
.login-box .card { border-radius: 0 0 12px 12px; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #faf7f3; color: var(--ink-soft); font-weight: 600; position: sticky; top: 0; }
tbody tr:hover { background: #fcfafa; }
.content-cell { max-width: 360px; white-space: pre-wrap; word-break: break-word; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px;
}
.stat .num { font-size: 28px; font-weight: 800; color: var(--red); }
.stat .cap { color: var(--ink-soft); font-size: 13px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; }
.bar-track { flex: 1; background: #f0ece6; border-radius: 999px; height: 18px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, var(--red), var(--gold)); }
.bar-val { width: 32px; text-align: right; font-weight: 600; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none;
  align-items: center; justify-content: center; z-index: 50;
}
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 12px; width: 720px; max-width: 94vw; max-height: 90vh; overflow: auto; padding: 22px; }
.modal h3 { margin-top: 0; }

.toast {
  position: fixed; left: 50%; top: 24px; transform: translateX(-50%);
  background: #1f2329; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 14px;
  opacity: 0; transition: .25s; pointer-events: none; z-index: 100;
}
.toast.show { opacity: 1; }
.toast.err { background: var(--red); }
.toast.ok { background: var(--ok); }

.tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.tab { padding: 8px 16px; border-radius: 8px; cursor: pointer; background: #fff; border: 1px solid var(--line); font-size: 14px; }
.tab.active { background: var(--red); color: #fff; border-color: var(--red); }

.filter-input { max-width: 260px; }
.count-pill { background: var(--red-soft); color: var(--red-dark); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }

/* 「不知道怎么写？」引导卡片 */
.tip-card {
  border-color: var(--gold);
  background: linear-gradient(180deg, #fffdf6, #ffffff);
}
.tip-card h2 { color: var(--red-dark); }
.tip-card h2::before {
  content: "💡";
  margin-right: 8px;
  font-size: 18px;
}
.tip-body {
  white-space: pre-wrap;
  word-break: break-word;
  background: #faf7f0;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink);
  max-height: 440px;
  overflow: auto;
  margin: 0;
  font-family: inherit;
}
.tip-hint {
  margin-top: 10px;
  font-size: 12px;
  color: #9a9a9a;
  text-align: right;
}
