:root {
  color-scheme: dark;
  --bg: #0c0908;
  --panel: #17110f;
  --panel-2: #211815;
  --line: #3f2d24;
  --line-bright: #6f4e32;
  --text: #f2e8d7;
  --muted: #9d8b7d;
  --gold: #d9a94b;
  --gold-soft: #8e642e;
  --red: #8c2f27;
  --green: #68a875;
  --blue: #7296b5;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% -20%, rgba(126, 55, 31, .2), transparent 42%),
    linear-gradient(135deg, rgba(255,255,255,.018) 25%, transparent 25%) 0 0 / 28px 28px,
    var(--bg);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
}
button, a { font: inherit; }
button { cursor: pointer; }
.topbar {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 clamp(18px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(15, 10, 9, .92);
  box-shadow: 0 8px 28px rgba(0,0,0,.25);
}
.back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: .2s;
}
.back:hover { color: var(--gold); border-color: var(--gold-soft); }
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #24140a;
  background: linear-gradient(145deg, #f1d07b, #9b6527);
  border: 1px solid #f6d987;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  box-shadow: 0 0 18px rgba(217,169,75,.18);
  font-weight: 800;
}
.brand { display: flex; flex-direction: column; gap: 3px; margin-left: 2px; }
.brand strong { font-size: 16px; letter-spacing: .08em; }
.brand span, .version span { color: var(--muted); font-size: 11px; }
.version { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.version code { color: var(--gold); }
.version.stale code { color: #df766c; }
main { width: min(1380px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 70px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 28px; }
.eyebrow { color: var(--gold); font: 700 11px/1 Consolas, monospace; letter-spacing: .22em; }
h1 { margin: 12px 0 8px; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(30px, 4vw, 48px); font-weight: 500; }
.hero p { margin: 0; color: var(--muted); }
.hero-actions { display: flex; gap: 10px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line-bright);
  color: var(--text);
  background: var(--panel-2);
  text-decoration: none;
  transition: .18s ease;
}
.button:hover { transform: translateY(-1px); border-color: var(--gold); }
.button.primary {
  color: #1a1008;
  border-color: #e2b55a;
  background: linear-gradient(#e0b75e, #a8712c);
  box-shadow: inset 0 1px rgba(255,255,255,.35), 0 5px 20px rgba(169,113,44,.18);
  font-weight: 700;
}
.button.secondary { background: transparent; }
.button.compact { min-height: 36px; margin-top: 18px; padding: 0 14px; font-size: 13px; }
.overview { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 36px 0 20px; }
.overview article {
  position: relative;
  min-height: 118px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(120deg, rgba(255,255,255,.025), transparent), var(--panel);
}
.overview article::after {
  content: "";
  position: absolute;
  right: -20px;
  bottom: -34px;
  width: 90px;
  height: 90px;
  border: 1px solid rgba(217,169,75,.1);
  transform: rotate(45deg);
}
.overview span, .overview small { display: block; color: var(--muted); font-size: 12px; }
.overview strong { display: block; margin: 8px 0 2px; color: var(--gold); font: 500 30px/1 Georgia, serif; }
.task-panel { border: 1px solid var(--line); background: rgba(23,17,15,.9); }
.panel-heading { min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; }
.panel-heading > div span { color: var(--muted); font-size: 12px; }
.filters { display: flex; gap: 4px; flex-wrap: wrap; }
.filters button {
  padding: 7px 11px;
  border: 1px solid transparent;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}
.filters button:hover, .filters button.active { color: var(--gold); border-color: var(--line-bright); background: rgba(217,169,75,.06); }
.table-head, .task-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.1fr) minmax(180px, 1.5fr) minmax(130px, .9fr) 110px 110px 94px;
  gap: 18px;
  align-items: center;
}
.table-head { padding: 11px 20px; color: #77675c; border-bottom: 1px solid #2c211c; font-size: 11px; }
.task-row { min-height: 86px; padding: 13px 20px; border-bottom: 1px solid #2c211c; transition: background .16s; }
.task-row:last-child { border-bottom: 0; }
.task-row:hover { background: rgba(255,255,255,.018); }
.task-identity { display: flex; align-items: center; gap: 12px; min-width: 0; }
.type-icon { display: grid; flex: 0 0 40px; width: 40px; height: 40px; place-items: center; color: var(--gold); border: 1px solid var(--gold-soft); background: #21150e; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); font-family: "KaiTi", serif; font-size: 19px; }
.type-icon.zodiac { color: #83b8ab; border-color: #426e64; background: #11231f; }
.type-icon.single { color: #c78d85; border-color: #713d38; background: #271310; }
.task-identity div { min-width: 0; }
.task-identity strong, .task-identity code { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-identity strong { margin-bottom: 5px; font-size: 13px; }
.task-identity code { color: #76675d; font-size: 10px; }
.task-prompt { margin: 0; overflow: hidden; color: #baaa9d; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.progress-wrap div { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.progress-wrap em { color: var(--gold); font-style: normal; }
.progress-wrap i { display: block; height: 3px; margin-top: 7px; overflow: hidden; background: #34251e; }
.progress-wrap b { display: block; height: 100%; background: linear-gradient(90deg, #8d5e26, #e6bd61); }
.status { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.status i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.status.running { color: var(--blue); }
.status.review { color: var(--gold); }
.status.done { color: var(--green); }
.status.error { color: #c96860; }
.task-row time { color: #76675d; font-size: 11px; }
.open-task { color: var(--gold); text-decoration: none; font-size: 12px; white-space: nowrap; }
.open-task span { font-size: 18px; vertical-align: -1px; }
.empty-state { display: flex; min-height: 290px; align-items: center; justify-content: center; flex-direction: column; color: var(--muted); text-align: center; }
.empty-state strong { margin-bottom: 8px; color: var(--text); }
.empty-gem { margin-bottom: 18px; color: var(--gold); font: 48px/1 Georgia, serif; text-shadow: 0 0 30px rgba(217,169,75,.35); }
.empty-state.error strong { color: #df766c; }

@media (max-width: 1000px) {
  .table-head { display: none; }
  .task-row { grid-template-columns: 1fr 1fr 100px; }
  .task-prompt { grid-column: 1 / 3; grid-row: 2; }
  .progress-wrap { grid-column: 1 / 3; }
  .task-row time { text-align: right; }
  .open-task { text-align: right; }
}
@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .brand span, .version span { display: none; }
  main { width: min(100% - 24px, 1380px); padding-top: 28px; }
  .hero { align-items: stretch; flex-direction: column; }
  .hero-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .overview { grid-template-columns: 1fr 1fr; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .task-row { grid-template-columns: 1fr auto; gap: 10px; }
  .task-prompt, .progress-wrap { grid-column: 1 / -1; }
  .status { grid-row: 1; grid-column: 2; }
  .task-row time { text-align: left; }
  .open-task { text-align: right; }
}
@media (max-width: 460px) {
  .version { display: none; }
  .hero-actions { grid-template-columns: 1fr; }
  .overview article { min-height: 96px; padding: 15px; }
  .filters { width: 100%; }
  .filters button { flex: 1 0 30%; }
}