:root {
  --bg: #0e1116;
  --bg-soft: #151a21;
  --card: #171d25;
  --card-hi: #1d2530;
  --line: #263040;
  --text: #e6edf3;
  --muted: #8b98a9;
  --accent: #3ddc97;
  --accent-dim: #1f6f52;
  --gold: #f0b429;
  --danger: #f47067;
  --info: #58a6ff;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.3; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }

/* ---------- 布局 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; height: 56px;
  background: rgba(14,17,22,.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 700; letter-spacing: .5px; display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.nav { display: flex; gap: 4px; }
.nav a {
  color: var(--muted); padding: 6px 12px; border-radius: 8px; font-size: 13px;
}
.nav a:hover { background: var(--card); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--card-hi); color: var(--text); }
.spacer { flex: 1; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 22px 80px; }
.wrap.narrow { max-width: 820px; }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.card.hi { background: var(--card-hi); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.stack > * + * { margin-top: 10px; }

button, .btn {
  font: inherit; cursor: pointer; border-radius: 8px;
  padding: 8px 15px; border: 1px solid var(--line);
  background: var(--card-hi); color: var(--text);
  transition: .15s;
}
button:hover, .btn:hover { border-color: var(--accent-dim); background: #202a36; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: var(--accent); color: #08130e; border-color: var(--accent); font-weight: 600; }
button.primary:hover { filter: brightness(1.08); }
button.ghost { background: transparent; }
button.danger { border-color: #5c2b2b; color: var(--danger); }
button.sm { padding: 4px 10px; font-size: 12px; }

input, select, textarea {
  font: inherit; width: 100%; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 9px 11px;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-dim); }
textarea { resize: vertical; min-height: 90px; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 99px;
  font-size: 11.5px; border: 1px solid var(--line); color: var(--muted);
}
.badge.open { color: var(--accent); border-color: var(--accent-dim); background: rgba(61,220,151,.08); }
.badge.completed { color: var(--info); border-color: #1f4f7a; background: rgba(88,166,255,.08); }
.badge.pending { color: var(--gold); border-color: #6b5316; background: rgba(240,180,41,.08); }
.badge.rejected { color: var(--danger); border-color: #5c2b2b; background: rgba(244,112,103,.08); }
.badge.gold { color: var(--gold); border-color: #6b5316; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 99px; font-size: 12px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted);
}

.tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: transparent; border-color: transparent; color: var(--muted); }
.tabs button.active { background: var(--card-hi); color: var(--text); border-color: var(--line); }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 12px; }
tr:last-child td { border-bottom: none; }

pre, code {
  font-family: "Cascadia Code", Consolas, monospace;
  background: var(--bg-soft); border-radius: 6px;
}
code { padding: 1.5px 6px; font-size: 12.5px; color: var(--accent); }
pre { padding: 14px; overflow: auto; border: 1px solid var(--line); font-size: 12.5px; line-height: 1.55; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  display: none; align-items: flex-start; justify-content: center;
  padding: 60px 20px; z-index: 50; overflow: auto;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  width: 100%; max-width: 640px; padding: 22px;
}

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--card-hi); border: 1px solid var(--line);
  padding: 10px 18px; border-radius: 10px; z-index: 100;
  opacity: 0; transition: .2s; pointer-events: none; max-width: 80vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }
.toast.ok { border-color: var(--accent-dim); }
.toast.err { border-color: #5c2b2b; color: var(--danger); }

/* ---------- 业务 ---------- */
.task-item { display: block; color: inherit; }
.task-item:hover { text-decoration: none; border-color: #34435a; }
.task-title { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.task-meta { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

.credit-bar { height: 6px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.credit-bar > i { display: block; height: 100%; background: var(--accent); }

.timeline { position: relative; padding-left: 22px; }
.timeline::before {
  content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px;
  width: 1px; background: var(--line);
}
.tl-item { position: relative; padding-bottom: 14px; }
.tl-item::before {
  content: ""; position: absolute; left: -20px; top: 6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--bg);
}

.milestone {
  border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px;
  background: var(--bg-soft); margin-bottom: 8px;
}
.milestone.done { border-color: var(--accent-dim); }
.milestone .mi-head { display: flex; justify-content: space-between; gap: 10px; }

.empty { text-align: center; color: var(--muted); padding: 46px 10px; }

@media (max-width: 720px) {
  .grid2 { grid-template-columns: 1fr; }
  .nav { display: none; }
  .wrap { padding: 18px 14px 70px; }
}
