:root {
  --bg: #f6f1e7;
  --bg-2: #efe6d6;
  --paper: #fffdf8;
  --ink: #2b2620;
  --muted: #7a6f60;
  --line: #e3d8c4;
  --accent: #b5482e;       /* 朱砂 */
  --accent-2: #2f6f5e;     /* 青绿 */
  --gold: #b8893a;
  --warn: #a33a2a;
  --backlog: #8a7a55;
  --shadow: 0 6px 24px rgba(60, 45, 25, .08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, #fbf6ec 0%, transparent 60%),
    radial-gradient(900px 400px at 100% 0%, #f3e7d3 0%, transparent 60%),
    var(--bg);
  line-height: 1.55;
}
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 20px; }
a { color: var(--accent-2); }
code { background: var(--bg-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.muted { color: var(--muted); }

/* hero */
.hero { padding: 36px 0 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(255,253,248,.7), transparent); }
.hero-inner { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: center; }
.eyebrow { letter-spacing: .18em; font-size: 12px; color: var(--gold); margin: 0 0 6px; text-transform: uppercase; }
h1 { font-family: "Songti SC", "STSong", "Noto Serif CJK SC", serif; font-size: 40px; margin: 0 0 10px; letter-spacing: .04em; }
.lead { margin: 0; color: #4a4238; font-size: 16px; }
.progress-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.progress-top { display: flex; justify-content: space-between; align-items: baseline; }
.progress-label { font-weight: 600; }
.progress-num b { font-size: 36px; color: var(--accent); font-variant-numeric: tabular-nums; }
.progress-target { color: var(--muted); font-size: 16px; }
.bar { height: 10px; background: var(--bg-2); border-radius: 999px; overflow: hidden; margin: 10px 0; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--gold)); border-radius: 999px; transition: width .6s ease; min-width: 4px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); gap: 10px; flex-wrap: wrap; }

/* tabs */
.tabs { display: flex; gap: 10px; padding-top: 18px; flex-wrap: wrap; }
.tab { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 9px 16px; border-radius: 999px; cursor: pointer; font-size: 15px; font-family: inherit; }
.tab:hover { border-color: var(--gold); }
.tab.active { background: var(--accent-2); border-color: var(--accent-2); color: #fff; }
.tab.backlog.active { background: var(--backlog); border-color: var(--backlog); }
.pill { display: inline-block; min-width: 22px; padding: 0 7px; border-radius: 999px; background: rgba(0,0,0,.08); font-size: 12px; margin-left: 4px; }
.tab.active .pill { background: rgba(255,255,255,.25); }

/* layout */
.layout { display: grid; grid-template-columns: 280px 1fr; gap: 24px; padding-top: 20px; padding-bottom: 40px; }
.filters { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; align-self: start; }
.filter-block { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.filter-title { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; letter-spacing: .05em; }
#search { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; font-size: 14px; background: #fff; font-family: inherit; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 13px; cursor: pointer; font-family: inherit; color: var(--ink); }
.chip small { color: var(--muted); margin-left: 3px; }
.chip:hover { border-color: var(--gold); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip.active small { color: #ddd; }
.reset { border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 8px; cursor: pointer; color: var(--muted); font-family: inherit; }
.bar-card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; }
.bar-card summary { cursor: pointer; font-weight: 600; }
.bar-card ol { padding-left: 18px; margin: 8px 0; }

/* results */
.results-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.sort { font-size: 13px; color: var(--muted); }
.sort select { font-family: inherit; padding: 5px 8px; border-radius: 8px; border: 1px solid var(--line); background: #fff; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; display: flex; flex-direction: column; box-shadow: var(--shadow); transition: transform .15s ease, box-shadow .15s ease; position: relative; }
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 30px rgba(60, 45, 25, .14); }
.card:focus-visible { outline: 3px solid var(--gold); }
.thumb { height: 120px; display: flex; align-items: center; justify-content: center; font-size: 56px; position: relative;
  background: linear-gradient(135deg, #f3ead8, #e7dcc4); }
.card.is-backlog .thumb { background: repeating-linear-gradient(135deg, #ece5d6 0 12px, #e3dac7 12px 24px); filter: saturate(.6); }
.badge { position: absolute; top: 10px; left: 10px; font-size: 12px; padding: 3px 9px; border-radius: 999px; color: #fff; font-weight: 600; }
.badge.q { background: var(--accent-2); }
.badge.b { background: var(--backlog); }
.card.is-backlog { border-style: dashed; border-color: #c9bb9c; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 16px; font-weight: 700; margin: 0; }
.card-sub { font-size: 12px; color: var(--muted); margin: 0; }
.meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 6px; background: var(--bg-2); color: #4f463a; }
.tag.ok { background: #e1efe9; color: #1f5a49; }
.tag.warn { background: #f8e3dc; color: var(--warn); }
.tag.neutral { background: #eee7d8; color: #6a5e48; }
.reason { font-size: 12.5px; color: #6b5a36; background: #f6efdc; border-left: 3px solid var(--backlog); padding: 6px 8px; border-radius: 6px; }
.empty { text-align: center; padding: 40px; color: var(--muted); }

.log-card { margin-top: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.log-card h2 { font-size: 16px; margin: 0 0 8px; }
.log-card ul { margin: 0; padding-left: 18px; font-size: 14px; }

.footer { padding: 20px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }

/* detail dialog */
.detail { border: none; border-radius: 18px; padding: 0; width: min(760px, 94vw); max-height: 90vh; background: var(--paper); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.detail::backdrop { background: rgba(40, 30, 15, .45); }
.detail-close { position: absolute; right: 14px; top: 12px; border: none; background: rgba(255,255,255,.8); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 16px; z-index: 2; }
.detail-hero { padding: 26px 26px 18px; display: flex; gap: 18px; align-items: center; background: linear-gradient(135deg, #f3ead8, #e7dcc4); }
.detail-hero .ico { font-size: 64px; }
.detail-hero h2 { margin: 0 0 4px; font-size: 24px; }
.detail-body { padding: 18px 26px 26px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; word-break: break-all; }
.section-title { font-size: 14px; font-weight: 700; margin: 18px 0 8px; border-left: 3px solid var(--accent); padding-left: 8px; }
.action-list { display: flex; flex-wrap: wrap; gap: 6px; }
.action-list span { font-size: 12px; background: #fff; border: 1px solid var(--line); padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.warning-box { background: #fbe9e3; border: 1px solid #e9b6a6; color: #7d2c1d; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 10px; }
.backlog-box { background: #f6efdc; border: 1px solid #ddcfa9; color: #5e4f2c; padding: 10px 12px; border-radius: 10px; font-size: 13.5px; margin-top: 10px; }

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  h1 { font-size: 32px; }
}
