:root {
  color-scheme: light;
  --page: #f3f7f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafb;
  --ink: #17212b;
  --muted: #667681;
  --line: #dce5e8;
  --line-strong: #cad7dc;
  --blue: #2f6f9f;
  --blue-soft: #e9f2f8;
  --teal: #167c75;
  --teal-soft: #e5f4f1;
  --green: #27845d;
  --green-soft: #e9f5ee;
  --amber: #a96913;
  --amber-soft: #fbf2df;
  --red: #b14b45;
  --red-soft: #faecea;
  --sidebar: #edf3f4;
  --shadow: 0 8px 24px rgba(28, 60, 73, 0.07);
}

* { box-sizing: border-box; }
html { background: var(--page); }
body { margin: 0; min-width: 320px; background: var(--page); color: var(--ink); font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif; letter-spacing: 0; }
button, input { font: inherit; letter-spacing: 0; }
button { color: inherit; }
svg { width: 18px; height: 18px; stroke-width: 1.8; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 24px 16px 18px; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 8px 22px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: #fff; background: var(--teal); border-radius: 7px; }
.brand-mark svg { width: 21px; height: 21px; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 17px; font-weight: 600; }
.brand span { margin-top: 2px; color: var(--muted); font-size: 11px; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 42px; border: 0; background: transparent; border-radius: 6px; padding: 0 11px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 9px; color: #566671; cursor: pointer; text-align: left; }
.nav-item:hover { background: rgba(255,255,255,.68); color: var(--ink); }
.nav-item.is-active { background: var(--surface); color: var(--teal); box-shadow: 0 2px 10px rgba(39, 79, 91, .06); }
.nav-item b { min-width: 20px; padding: 1px 6px; border-radius: 999px; background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 600; text-align: center; }
.sidebar-foot { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--line-strong); display: grid; gap: 9px; }
.scope-line { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.scope-line svg { width: 15px; height: 15px; }
.scope-line.muted { color: var(--muted); }

.main-area { min-width: 0; padding: 28px 32px 44px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 24px; }
.eyebrow, .section-kicker { margin: 0 0 3px; color: var(--teal); font-size: 10px; font-weight: 600; }
h1, h2, h3, p { letter-spacing: 0; }
h1 { margin: 0; font-size: 26px; line-height: 1.25; font-weight: 600; }
h2 { margin: 0; font-size: 17px; font-weight: 600; }
h3 { margin: 0; font-size: 15px; font-weight: 600; }
.top-actions { display: flex; align-items: center; gap: 12px; }
.search-box { width: min(300px, 32vw); height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 6px; }
.search-box:focus-within { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(22,124,117,.1); }
.search-box svg { color: var(--muted); flex: 0 0 auto; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 14px; }
.search-box input::placeholder { color: #93a0a8; }
.last-update { min-height: 40px; padding: 0 11px; border: 1px solid var(--line); background: var(--surface-subtle); border-radius: 6px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; white-space: nowrap; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }

.view { display: none; }
.view.is-visible { display: block; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { min-width: 0; padding: 17px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; display: flex; align-items: flex-start; gap: 13px; box-shadow: var(--shadow); }
.metric-icon { width: 38px; height: 38px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 6px; }
.metric-icon.blue { color: var(--blue); background: var(--blue-soft); }
.metric-icon.green { color: var(--green); background: var(--green-soft); }
.metric-icon.amber { color: var(--amber); background: var(--amber-soft); }
.metric-icon.teal { color: var(--teal); background: var(--teal-soft); }
.metric-card span, .metric-card small { display: block; color: var(--muted); }
.metric-card span { font-size: 12px; }
.metric-card strong { display: block; margin: 2px 0 1px; font-size: 25px; line-height: 1.2; font-weight: 600; font-variant-numeric: tabular-nums; }
.metric-card small { font-size: 11px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; margin-bottom: 18px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
.panel-head { min-height: 62px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 15px; border-bottom: 1px solid var(--line); }
.text-button { border: 0; background: transparent; padding: 7px 0; display: inline-flex; align-items: center; gap: 5px; color: var(--teal); cursor: pointer; font-size: 12px; }
.text-button:hover { color: #0c5d57; }
.text-button svg { width: 15px; height: 15px; }
.change-list { padding: 4px 18px 8px; }
.change-item { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 15px 0; border-bottom: 1px solid var(--line); }
.change-item:last-child { border-bottom: 0; }
.change-type-icon { width: 36px; height: 36px; border-radius: 6px; display: grid; place-items: center; }
.change-type-icon.registration { color: var(--green); background: var(--green-soft); }
.change-type-icon.topic { color: var(--blue); background: var(--blue-soft); }
.change-type-icon.rule { color: var(--amber); background: var(--amber-soft); }
.change-main { min-width: 0; }
.change-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.change-title-row strong { font-size: 14px; font-weight: 600; }
.change-main p { margin: 5px 0 7px; color: #51616c; font-size: 13px; line-height: 1.65; }
.change-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.change-meta a { color: var(--teal); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.change-meta a:hover { text-decoration: underline; }
.change-meta svg { width: 13px; height: 13px; }
.date-chip { color: var(--muted); font-size: 11px; white-space: nowrap; }
.tag { display: inline-flex; align-items: center; min-height: 22px; padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 500; }
.tag.confirmed { background: var(--green-soft); color: var(--green); }
.tag.open { background: var(--green-soft); color: var(--green); }
.tag.pending { background: var(--amber-soft); color: var(--amber); }
.tag.ended { background: var(--red-soft); color: var(--red); }
.tag.neutral { background: #edf1f3; color: #60707a; }
.empty-inline { padding: 28px 0; text-align: center; color: var(--muted); font-size: 13px; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 11px; }
.live-label > span { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.status-flow { padding: 8px 18px 11px; }
.flow-row { position: relative; min-height: 59px; display: grid; grid-template-columns: 30px 1fr auto; gap: 9px; align-items: center; }
.flow-row:not(:last-child)::after { content: ""; position: absolute; left: 14px; top: 44px; bottom: -7px; width: 1px; background: var(--line-strong); }
.flow-row > svg { width: 28px; height: 28px; padding: 6px; border-radius: 50%; color: var(--green); background: var(--green-soft); }
.flow-row strong, .flow-row span { display: block; }
.flow-row strong { font-size: 12px; font-weight: 500; }
.flow-row span, .flow-row time { color: var(--muted); font-size: 10px; }
.category-panel { margin-bottom: 20px; }
.category-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 15px; padding: 18px; }
.category-bar-item { min-width: 0; }
.category-bar-head { display: flex; justify-content: space-between; gap: 6px; margin-bottom: 8px; font-size: 11px; }
.category-bar-head span { color: var(--muted); }
.bar-track { height: 6px; border-radius: 99px; overflow: hidden; background: #edf1f2; }
.bar-fill { height: 100%; border-radius: inherit; background: var(--teal); }

.section-toolbar { min-height: 54px; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.competition-filter-stack { min-width: 0; display: grid; gap: 8px; }
.segmented, .filter-row { display: flex; flex-wrap: wrap; gap: 5px; }
.segmented { padding: 4px; background: #e9eff1; border-radius: 7px; }
.segmented button, .filter-row button { border: 0; border-radius: 5px; cursor: pointer; color: var(--muted); background: transparent; font-size: 12px; }
.segmented button { min-height: 32px; padding: 0 12px; }
.segmented button.is-active { color: var(--ink); background: var(--surface); box-shadow: 0 1px 4px rgba(26,63,76,.1); }
.filter-row button { min-height: 34px; padding: 0 11px; border: 1px solid var(--line); background: var(--surface); }
.filter-row button.is-active { border-color: var(--teal); color: var(--teal); background: var(--teal-soft); }
.status-filters button[data-registration-filter="open"].is-active { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.status-filters button[data-registration-filter="pending"].is-active { border-color: var(--amber); color: var(--amber); background: var(--amber-soft); }
.status-filters button[data-registration-filter="ended"].is-active { border-color: var(--red); color: var(--red); background: var(--red-soft); }
.result-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.change-grid { display: grid; gap: 12px; }
.change-card { padding: 17px 18px; background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--green); border-radius: 6px; box-shadow: var(--shadow); }
.change-card.topic { border-left-color: var(--blue); }
.change-card.rule { border-left-color: var(--amber); }
.change-card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.change-card p { margin: 9px 0; color: #51616c; font-size: 13px; line-height: 1.7; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; min-width: 900px; }
th, td { padding: 13px 16px; border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; vertical-align: middle; }
th { color: var(--muted); background: var(--surface-subtle); font-weight: 500; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fafcfc; }
.competition-name { font-size: 13px; font-weight: 500; }
.competition-name-wrap { display: flex; align-items: center; gap: 8px; }
.expand-button { width: 26px; height: 26px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--teal); background: var(--surface); cursor: pointer; }
.expand-button:hover { border-color: var(--teal); background: var(--teal-soft); }
.expand-button svg { width: 15px; height: 15px; transition: transform .16s ease; }
.expand-button[aria-expanded="true"] svg { transform: rotate(90deg); }
.track-count { color: var(--muted); font-size: 10px; white-space: nowrap; }
.registration-time { color: #51616c; font-variant-numeric: tabular-nums; white-space: nowrap; }
.registration-time.pending { color: var(--amber); }
.track-row[hidden] { display: none; }
.track-row td { padding: 0 16px 14px 50px; background: #fbfdfd; }
.track-panel { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 6px; overflow: hidden; }
.track-panel-head { padding: 9px 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface-subtle); border-bottom: 1px solid var(--line); }
.track-panel-head strong { font-size: 11px; font-weight: 600; }
.track-panel-head span { color: var(--muted); font-size: 10px; }
.track-list { display: grid; }
.track-group { min-width: 0; }
.track-item { min-width: 0; padding: 11px 12px; display: grid; grid-template-columns: minmax(180px, 1fr) 90px minmax(170px, .7fr) minmax(180px, 1fr) auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.track-item:last-child { border-bottom: 0; }
.track-name-line { min-width: 0; display: flex; align-items: center; gap: 8px; }
.track-name-line strong { min-width: 0; }
.track-expand-button { width: 24px; height: 24px; padding: 0; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; color: var(--teal); background: var(--surface); cursor: pointer; }
.track-expand-button:hover { border-color: var(--teal); background: var(--teal-soft); }
.track-expand-button svg { width: 14px; height: 14px; transition: transform .16s ease; }
.track-expand-button[aria-expanded="true"] svg { transform: rotate(90deg); }
.track-children[hidden] { display: none; }
.track-level-3 { padding-left: 44px; background: #f7faf9; }
.track-level-3 .track-name { position: relative; }
.track-level-3 .track-name::before { content: ""; position: absolute; left: -20px; top: 4px; bottom: 4px; width: 2px; background: #cfe1dc; }
.track-name strong, .track-name span { display: block; }
.track-name strong { font-size: 12px; font-weight: 500; }
.track-name span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.track-note { color: var(--muted); font-size: 11px; line-height: 1.55; }
.track-source { color: var(--teal); text-decoration: none; font-size: 11px; white-space: nowrap; }
.track-source:hover { text-decoration: underline; }
.official-link { color: var(--teal); text-decoration: none; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.official-link:hover { text-decoration: underline; }
.official-link svg { width: 14px; height: 14px; }
.empty-state { min-height: 260px; display: grid; place-content: center; justify-items: center; gap: 7px; color: var(--muted); }
.empty-state[hidden] { display: none; }
.empty-state svg { width: 28px; height: 28px; }
.empty-state strong { color: var(--ink); font-size: 14px; }
.empty-state span { font-size: 12px; }
.pending-list { display: grid; gap: 12px; }
.pending-card { padding: 18px; background: var(--surface); border: 1px solid #ead8b5; border-left: 4px solid var(--amber); border-radius: 6px; box-shadow: var(--shadow); }
.pending-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pending-card p { margin: 10px 0; color: #51616c; font-size: 13px; line-height: 1.7; }
.pending-card footer { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }
.pending-card a { color: var(--teal); text-decoration: none; }

@media (max-width: 1120px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .category-bars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .app-shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding-inline: 10px; }
  .brand { justify-content: center; padding-inline: 0; }
  .brand > div:last-child, .nav-item span, .sidebar-foot { display: none; }
  .nav-item { grid-template-columns: 1fr; justify-items: center; padding: 0; position: relative; }
  .nav-item b { position: absolute; top: 2px; right: 2px; min-width: 17px; padding-inline: 4px; }
  .overview-grid { grid-template-columns: 1fr; }
  .topbar { align-items: flex-start; }
  .top-actions { align-items: stretch; flex-direction: column; }
  .search-box { width: 280px; max-width: 44vw; }
}
@media (max-width: 620px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 10; left: 0; right: 0; bottom: 0; top: auto; height: 64px; padding: 7px 10px; border-right: 0; border-top: 1px solid var(--line-strong); }
  .brand, .sidebar-foot { display: none; }
  .nav-list { grid-template-columns: repeat(4, 1fr); gap: 4px; }
  .nav-item { min-height: 49px; }
  .nav-item span { display: block; font-size: 10px; }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-item b { top: -2px; right: calc(50% - 22px); }
  .main-area { padding: 20px 16px 88px; }
  .topbar { display: block; }
  h1 { font-size: 22px; }
  .top-actions { margin-top: 15px; }
  .search-box { width: 100%; max-width: none; }
  .last-update { width: fit-content; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { padding: 13px; display: block; }
  .metric-icon { width: 32px; height: 32px; margin-bottom: 9px; }
  .metric-card strong { font-size: 22px; }
  .category-bars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .change-item { grid-template-columns: 34px minmax(0, 1fr); }
  .date-chip { grid-column: 2; }
  .section-toolbar { align-items: flex-start; flex-direction: column; }
  .competition-toolbar { gap: 9px; }
  .track-row td { padding-left: 16px; }
  .track-item { grid-template-columns: 1fr auto; }
  .track-item .registration-time, .track-note { grid-column: 1 / -1; }
  .change-card-head, .pending-card-head { display: block; }
  .change-card-head .tag, .pending-card-head .tag { margin-top: 8px; }
}
@media (max-width: 390px) {
  .metric-grid { grid-template-columns: 1fr; }
  .segmented button { padding-inline: 9px; }
}
