:root {
  color-scheme: dark;
  --lc-bg: #09090b;
  --lc-surface: #111114;
  --lc-surface-2: #161619;
  --lc-border: #2a2a2f;
  --lc-border-soft: #1d1d21;
  --lc-text: #f5f5f7;
  --lc-muted: #92929d;
  --lc-red: #f5222d;
  --lc-green: #25c47a;
  --lc-amber: #f1b947;
  --lc-purple: #b47cff;
}

[x-cloak] { display: none !important; }
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--lc-bg); color: var(--lc-text); }
body { font-family: "Satoshi", "PingFang SC", "Microsoft YaHei", sans-serif; }
button, input { font: inherit; }
button { color: inherit; }

.lc-shell { min-height: 100vh; background: radial-gradient(circle at 42% -20%, #151518 0, var(--lc-bg) 38%); }
.lc-topbar { height: 72px; border-bottom: 1px solid var(--lc-border-soft); display: flex; align-items: center; padding: 0 32px; position: sticky; top: 0; z-index: 20; background: rgba(9,9,11,.94); backdrop-filter: blur(18px); }
.lc-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--lc-text); text-decoration: none; font-size: 18px; font-weight: 800; }
.lc-brand-mark { width: 34px; height: 34px; border-radius: 8px; background: var(--lc-red); display: grid; place-items: center; font-size: 11px; font-weight: 900; }
.lc-nav { margin-left: auto; display: flex; gap: 26px; align-items: center; }
.lc-nav a { color: var(--lc-muted); text-decoration: none; font-size: 14px; }
.lc-nav a:hover, .lc-nav a.active { color: var(--lc-text); }

.lc-main { width: min(1480px, calc(100% - 64px)); margin: 0 auto; padding: 38px 0 72px; }
.lc-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; border-bottom: 1px solid var(--lc-border); }
.lc-heading h1 { margin: 0 0 22px; font-size: clamp(30px, 3vw, 46px); line-height: 1; letter-spacing: -.04em; }
.lc-tabs { display: flex; gap: 32px; }
.lc-tab { border: 0; background: transparent; padding: 0 0 19px; color: var(--lc-muted); cursor: pointer; border-bottom: 2px solid transparent; font-weight: 700; }
.lc-tab.active { color: var(--lc-text); border-color: var(--lc-red); }
.lc-tab-count { margin-left: 7px; font-size: 12px; color: #686872; }

.lc-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; padding-top: 20px; }
.lc-panel, .lc-rail { border: 1px solid var(--lc-border); background: rgba(17,17,20,.7); }
.lc-summary { min-height: 86px; display: grid; grid-template-columns: minmax(250px, 1fr) repeat(3, 170px); align-items: center; border-bottom: 1px solid var(--lc-border); }
.lc-summary-period { padding: 0 26px; font-size: 21px; font-weight: 800; }
.lc-metric { min-height: 54px; padding: 0 24px; border-left: 1px solid var(--lc-border); display: flex; flex-direction: column; justify-content: center; }
.lc-metric span { color: var(--lc-muted); font-size: 12px; }
.lc-metric strong { color: var(--lc-red); font-size: 22px; }
.lc-section-head { display: flex; align-items: center; padding: 22px 24px 14px; gap: 10px; }
.lc-section-head h2 { margin: 0; font-size: 18px; }
.lc-section-head p { margin: 0 0 0 auto; color: var(--lc-muted); font-size: 13px; }
.lc-table-head, .lc-rule-row { display: grid; grid-template-columns: minmax(280px, 1.4fr) minmax(150px,.65fr) 100px 115px minmax(320px,1fr); gap: 18px; align-items: center; padding: 16px 24px; }
.lc-table-head { color: var(--lc-muted); font-size: 12px; border-top: 1px solid var(--lc-border); border-bottom: 1px solid var(--lc-border); }
.lc-rule-row { min-height: 126px; border-bottom: 1px solid var(--lc-border-soft); }
.lc-rule-row:last-child { border-bottom: 0; }
.lc-rule-title { font-weight: 800; margin-bottom: 6px; }
.lc-rule-copy, .lc-rule-meta { color: var(--lc-muted); font-size: 13px; line-height: 1.45; }
.lc-rule-scope { color: #c7c7ce; font-size: 13px; }
.lc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.lc-button { min-height: 38px; padding: 0 15px; border: 1px solid #3a3a40; background: #151518; border-radius: 5px; cursor: pointer; white-space: nowrap; }
.lc-button:hover { border-color: #6a6a72; }
.lc-button.primary { background: var(--lc-red); border-color: var(--lc-red); font-weight: 800; }
.lc-empty { padding: 58px 24px; text-align: center; color: var(--lc-muted); border-top: 1px solid var(--lc-border); }
.lc-empty strong { display: block; color: var(--lc-text); margin-bottom: 8px; }

.lc-rail { padding: 22px; height: fit-content; }
.lc-rail h2 { margin: 0 0 18px; font-size: 18px; }
.lc-change-group { padding: 16px 0; border-top: 1px solid var(--lc-border); }
.lc-change-row { display: flex; justify-content: space-between; color: var(--lc-muted); margin: 9px 0; font-size: 14px; }
.lc-change-row strong { color: var(--lc-text); }
.lc-history-link { display: inline-flex; margin-top: 18px; color: var(--lc-text); text-decoration: none; font-size: 14px; background: none; border: 0; padding: 0; cursor: pointer; }
.lc-history-link:hover { color: var(--lc-red); }

.lc-view { padding-top: 20px; }
.lc-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.lc-toolbar h2 { margin: 0; font-size: 20px; }
.lc-toolbar p { margin: 0; color: var(--lc-muted); }
.lc-search { margin-left: auto; width: min(340px, 40vw); height: 42px; border: 1px solid var(--lc-border); background: var(--lc-surface); color: var(--lc-text); padding: 0 14px; border-radius: 5px; outline: none; }
.lc-search:focus { border-color: #62626c; }
.lc-list { border: 1px solid var(--lc-border); background: rgba(17,17,20,.65); }
.lc-simple-row { display: grid; grid-template-columns: minmax(240px, 1.15fr) minmax(300px, 1.5fr) 140px 120px; gap: 24px; align-items: center; min-height: 92px; padding: 18px 24px; border-bottom: 1px solid var(--lc-border-soft); }
.lc-simple-row:last-child { border-bottom: 0; }
.lc-status { font-size: 13px; color: var(--lc-green); }
.lc-status.observed { color: var(--lc-amber); }
.lc-week-row { display: grid; grid-template-columns: 170px 1fr repeat(3, 120px) 80px; align-items: center; min-height: 74px; padding: 0 24px; border-bottom: 1px solid var(--lc-border-soft); gap: 16px; }
.lc-week-row:last-child { border-bottom: 0; }
.lc-week-id { font-weight: 800; }
.lc-week-range, .lc-week-stat { color: var(--lc-muted); font-size: 13px; }
.lc-week-open { color: var(--lc-red); border: 0; background: none; cursor: pointer; text-align: right; }
.lc-toast { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 40; padding: 12px 18px; background: #202025; border: 1px solid #45454d; border-radius: 6px; }

@media (max-width: 1050px) {
  .lc-workspace { grid-template-columns: 1fr; }
  .lc-rail { display: grid; grid-template-columns: 180px repeat(3,1fr); gap: 18px; }
  .lc-rail h2 { margin: 0; }
  .lc-change-group { border-top: 0; padding: 0; }
  .lc-summary { grid-template-columns: 1fr repeat(3, 130px); }
  .lc-table-head { display: none; }
  .lc-rule-row { grid-template-columns: 1fr 120px; }
  .lc-rule-row > :nth-child(2), .lc-rule-row > :nth-child(3), .lc-rule-row > :nth-child(4) { display: none; }
}

@media (max-width: 720px) {
  .lc-topbar { height: 62px; padding: 0 18px; }
  .lc-nav a:not(.active) { display: none; }
  .lc-main { width: calc(100% - 28px); padding-top: 24px; }
  .lc-heading { display: block; overflow-x: auto; }
  .lc-heading h1 { font-size: 32px; margin-bottom: 22px; }
  .lc-tabs { width: max-content; gap: 22px; }
  .lc-workspace { padding-top: 14px; }
  .lc-summary { display: flex; flex-wrap: wrap; padding: 18px; gap: 16px; }
  .lc-summary-period { width: 100%; padding: 0; font-size: 18px; }
  .lc-metric { flex: 1; min-width: 86px; padding: 0 12px; border-left: 0; border-right: 1px solid var(--lc-border); }
  .lc-rule-row { display: block; padding: 20px; }
  .lc-actions { justify-content: flex-start; margin-top: 16px; }
  .lc-rail { display: block; }
  .lc-change-group { border-top: 1px solid var(--lc-border); padding: 14px 0; }
  .lc-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .lc-search { width: 100%; margin-left: 0; }
  .lc-simple-row { display: block; min-height: 0; }
  .lc-simple-row > * { margin-bottom: 7px; }
  .lc-week-row { grid-template-columns: 1fr auto; padding: 16px 18px; }
  .lc-week-row > :nth-child(n+3):not(:last-child) { display: none; }
}
