:root {
  color-scheme: light;
  --ink: #20323f;
  --muted: #657581;
  --border: #dce4e8;
  --accent: #11766c;
  --bg: #f4f7f8;
  --shop-columns: minmax(150px, 1.65fr) repeat(3, minmax(112px, 1fr)) minmax(126px, 1fr) 104px 96px;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.55; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 14px; border: 1px solid transparent; border-radius: 7px; background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; text-decoration: none; }
button:hover, .button:hover { filter: brightness(.96); text-decoration: none; }
button:disabled { opacity: .65; cursor: wait; }
.secondary { background: #fff; color: var(--ink); border-color: var(--border); }
.quiet { background: transparent; color: var(--ink); padding: 5px 0; justify-content: flex-start; }
.small-button { font-size: 13px; min-height: 34px; padding: 6px 10px; }
input, select { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid #bcc9d0; border-radius: 6px; background: #fff; color: var(--ink); margin-top: 5px; }
input:focus, select:focus, button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #68bcb2; outline-offset: 2px; }
input[readonly] { background: #f3f6f7; font-family: Consolas, monospace; }
label { display: block; font-weight: 600; margin: 12px 0; }
label input { font-weight: 400; }
h1 { font-size: 24px; line-height: 1.35; margin: 0 0 12px; }
h2 { font-size: 18px; margin: 0; }
h3 { font-size: 14px; margin: 0; }
p { margin: 10px 0; }
small, .small, .footnote { font-size: 12px; }
.muted, .footnote { color: var(--muted); }
.eyebrow { font-size: 12px; color: var(--accent); margin: 0 0 6px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 28px; min-height: 58px; background: #fff; border-bottom: 1px solid var(--border); }
.site-title { font-size: 21px; font-weight: 700; color: var(--ink); white-space: nowrap; }
.topbar nav { display: flex; align-items: center; gap: 22px; }
.topbar nav > a { padding: 9px 0; }
.user-menu { position: relative; }
summary { cursor: pointer; font-weight: 600; min-height: 36px; padding: 8px 0; }
.user-menu > summary { font-weight: 400; }
.user-menu-body { position: absolute; right: 0; top: 100%; z-index: 10; display: grid; gap: 6px; min-width: 190px; max-width: 270px; padding: 16px; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 25px #20323f18; overflow-wrap: anywhere; }
.user-menu-body > a { padding: 6px 0; }
.workspace { max-width: 1800px; padding: 18px 28px 36px; margin: 0 auto; }
.dashboard-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 18px; }
.filter { display: flex; align-items: center; gap: 8px; min-width: 0; }
.filter label, .sort-controls label { margin: 0; white-space: nowrap; font-size: 13px; }
.filter select { margin: 0; width: 240px; max-width: 100%; }
.js-ready .filter-submit { display: none; }
.capture-date { color: var(--muted); font-size: 13px; }
.capture-date strong { color: var(--ink); font-weight: 500; }
.capture-date small { margin-left: 4px; }
.sort-controls { display: flex; gap: 8px; align-items: center; min-width: 0; }
.sort-controls select { margin: 0; width: 150px; }
.direction-button { white-space: nowrap; min-width: 76px; font-size: 13px; }
.refresh-line { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.summary-strip { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.summary-strip strong { color: var(--ink); font-weight: 600; }
.shop-table { background: #fff; border: 1px solid var(--border); border-radius: 8px; }
.shop-grid { display: grid; grid-template-columns: var(--shop-columns); align-items: center; }
.shop-table-head { padding: 0 10px; background: #edf3f4; border-radius: 8px 8px 0 0; font-size: 12px; }
.shop-table-head > span { text-align: center; }
.sort-heading { background: transparent; color: var(--muted); border-radius: 0; font-weight: 500; min-height: 42px; padding: 7px 8px; justify-content: flex-end; gap: 5px; font-size: 13px; width: 100%; }
.sort-heading:first-child { justify-content: flex-start; }
.sort-heading.active { color: var(--accent); background: #deefeb; font-weight: 700; }
.shop-table-head > .sort-heading:nth-child(5) { justify-content: center; }
.shop-row { position: relative; border-top: 1px solid var(--border); }
.shop-row:last-child { border-radius: 0 0 8px 8px; }
.shop-summary { padding: 12px 10px; min-height: 76px; }
.shop-summary > div { min-width: 0; padding: 0 8px; }
.shop-name h2 { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.metric { text-align: right; font-variant-numeric: tabular-nums; }
.metric strong { display: block; font-size: 18px; font-weight: 600; overflow-wrap: anywhere; }
.metric small { display: block; font-size: 11px; color: var(--muted); overflow-wrap: anywhere; }
.metric-label, .mobile-label { display: none; }
.missing { color: #73808a; }
.metric strong.missing { font-size: 14px; font-weight: 400; }
.capture-time { text-align: center; font-size: 12px; font-variant-numeric: tabular-nums; }
.freshness { text-align: center; }
.badge { display: inline-block; padding: 3px 7px; border-radius: 5px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.fresh { background: #e8f5ef; color: #246d54; }
.stale { background: #fff0d9; color: #965c12; }
.badge.missing { background: #edf0f2; color: #65717a; }
.age-text { display: block; color: var(--muted); font-size: 11px; margin-top: 2px; }
.is-stale { background: #fffcf6; }
.stale-explanation { font-size: 12px; color: #965c12; margin: -4px 18px 9px; }
.collection-error { margin: 0 18px 10px; font-size: 13px; overflow-wrap: anywhere; }
.error-text { color: #a43828; overflow-wrap: anywhere; }
.warning-text { color: #965c12; overflow-wrap: anywhere; }
.accounts > summary { position: absolute; top: 18px; right: 14px; max-width: 90px; color: var(--accent); font-weight: 500; font-size: 12px; }
.accounts > summary::marker { font-size: 10px; }
.account-body { padding: 14px 18px 10px; background: #f8fafb; border-top: 1px solid var(--border); }
.account-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.account-toolbar h3 { overflow-wrap: anywhere; }
.account-toolbar select { width: 110px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; table-layout: fixed; }
th, td { text-align: right; padding: 10px; border-top: 1px solid var(--border); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; vertical-align: top; }
th { color: var(--muted); font-weight: 500; background: #edf3f4; }
th:first-child, td:first-child { text-align: left; width: 25%; }
th:last-child { width: 18%; }
th .sort-heading { min-height: 32px; padding: 0; justify-content: flex-end !important; }
th:first-child .sort-heading { justify-content: flex-start !important; }
.account-name > strong { display: block; font-weight: 600; }
.account-meta { color: var(--muted); font-size: 11px; }
.account-meta summary { font-weight: 400; font-size: 11px; min-height: 28px; padding: 4px 0; }
.account-meta span { display: block; }
.account-state span { display: block; }
.source-info { border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; }
.source-info summary { font-size: 12px; font-weight: 400; }
.source-info p { overflow-wrap: anywhere; }
.sort-caption { color: var(--muted); font-size: 12px; margin: 10px 0; }
.definitions { color: var(--muted); font-size: 12px; }
.definitions summary { font-weight: 400; }
.definitions p { max-width: 1000px; }
.panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 20px; margin: 0 0 16px; }
.empty-inline { color: var(--muted); margin: 12px 0; }
.empty { text-align: center; padding: 36px 20px; }
.notice { border-radius: 7px; padding: 12px 14px; margin: 12px 0; font-size: 13px; overflow-wrap: anywhere; }
.notice.danger { color: #993829; background: #fff0ed; border: 1px solid #efc8c0; }
.notice.warning { color: #885619; background: #fff4e3; border: 1px solid #eddbbc; }
.notice.success { color: #196758; background: #e7f5ef; border: 1px solid #bbddce; }
#connection-error { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
#connection-error > strong { flex-shrink: 0; }
#connection-error > span { flex: 1; min-width: 150px; }
.admin-tabs { display: flex; gap: 12px; border-bottom: 1px solid var(--border); margin: -2px 0 18px; }
.admin-tabs a { padding: 10px 16px; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 500; }
.admin-tabs .active { color: var(--accent); border-color: var(--accent); }
.section-title { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.section-title > span { font-size: 12px; color: var(--muted); }
.editor { border-top: 1px solid var(--border); }
.editor > summary { display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 2px; }
.editor > summary::before { content: "›"; color: var(--muted); }
.editor[open] > summary::before { content: "⌄"; }
.editor summary strong { flex: 1; font-size: 14px; overflow-wrap: anywhere; }
.detail-label { color: var(--accent); font-size: 12px; }
.creator { border-top: 0; margin-bottom: 8px; }
.creator > summary { display: inline-flex; min-height: 38px; color: var(--accent); }
.editor-body { background: #f7f9fa; padding: 16px; margin-bottom: 12px; border-radius: 6px; }
.editor form { max-width: 900px; }
.inline-form { display: flex; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.inline-form label { flex: 1; max-width: 440px; margin: 0; }
.id-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
code { font-size: 12px; overflow-wrap: anywhere; }
fieldset { border: 1px solid var(--border); border-radius: 6px; margin: 16px 0; padding: 10px 14px; }
legend { font-size: 13px; color: var(--muted); padding: 0 5px; }
.checks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; }
.checks label, .check { display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 5px 0; overflow-wrap: anywhere; }
.checks input, .check input { width: 18px; height: 18px; min-height: 18px; margin: 0; flex-shrink: 0; accent-color: var(--accent); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.separate-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border); }
.audit-panel { padding: 10px 20px; }
.audit-panel > summary { display: flex; align-items: center; gap: 14px; }
.audit-panel > summary::before { content: "›"; }
.audit-panel[open] > summary::before { content: "⌄"; }
.audit-list { padding-left: 20px; font-size: 13px; }
.audit-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.audit-list small { color: var(--muted); }
.audit-list p { margin: 4px 0; overflow-wrap: anywhere; }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card { max-width: 440px; width: 100%; padding: 36px; background: #fff; border: 1px solid var(--border); border-radius: 10px; }
.brand-mark.large { display: inline-flex; width: 44px; height: 44px; align-items: center; justify-content: center; background: #e2f0eb; color: var(--accent); border-radius: 8px; font-size: 20px; font-weight: 700; margin-bottom: 16px; }
.wide { width: 100%; margin-top: 12px; }
.narrow { max-width: 720px; }
.page-head { margin-bottom: 16px; }
.error-panel .button { margin: 8px 8px 0 0; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); padding: 10px 18px; background: #20323f; color: #fff; border-radius: 7px; z-index: 20; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@media (max-width: 1150px) {
  :root { --shop-columns: minmax(140px, 1.4fr) repeat(3, minmax(105px, 1fr)) 122px 92px 86px; }
  .workspace { padding: 16px 18px 30px; }
  .metric strong { font-size: 16px; }
  .capture-date small { display: none; }
  .sort-controls select { width: 134px; }
  .dashboard-toolbar { gap: 10px; }
}
@media (max-width: 850px) {
  .topbar { padding: 9px 14px; min-height: 52px; }
  .site-title { font-size: 19px; }
  .topbar nav { gap: 12px; font-size: 12px; }
  .workspace { padding: 12px 12px 24px; }
  .dashboard-toolbar { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
  .filter { grid-row: 1; grid-column: 1; }
  .filter > label { display: none; }
  .filter select { width: 100%; min-width: 0; }
  #refresh { grid-row: 1; grid-column: 2; }
  .dashboard-toolbar > .sort-controls { grid-row: 2; grid-column: 1 / -1; }
  .dashboard-toolbar .sort-controls select { flex: 1; max-width: 230px; }
  .capture-date { grid-row: 3; grid-column: 1 / -1; font-size: 12px; }
  .refresh-line { margin-top: 4px; font-size: 11px; }
  .summary-strip { margin: 6px 0; font-size: 11px; }
  .desktop-only { display: none; }
  .shop-table { background: transparent; border: 0; border-radius: 0; }
  .shop-table-head { display: none; }
  .shop-row { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 8px; background: #fff; }
  .shop-row.is-stale { background: #fffcf6; }
  .shop-summary { padding: 10px 10px 8px; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 5px 8px; min-height: 0; }
  .shop-summary > div { padding: 0; }
  .shop-name { grid-column: 1 / 3; grid-row: 1; }
  .shop-name h2 { font-size: 14px; }
  .freshness { grid-column: 3; grid-row: 1; text-align: right; }
  .age-text { display: none; }
  .capture-time { grid-column: 1 / -1; grid-row: 2; text-align: left; color: var(--muted); font-size: 11px; }
  .mobile-label { display: inline; }
  .metric { grid-row: 3; text-align: left; padding-top: 4px !important; }
  .metric-label { display: block; font-size: 11px; color: var(--muted); }
  .metric strong { font-size: clamp(14px, 4.3vw, 18px); line-height: 1.6; }
  .metric strong.missing { font-size: 13px; }
  .metric small { font-size: 11px; }
  .empty-comparison, .account-slot { display: none !important; }
  .accounts > summary { position: static; max-width: none; min-height: 30px; padding: 6px 10px; border-top: 1px solid #edf0f2; font-size: 11px; }
  .accounts > summary > span + span { margin-left: 5px; }
  .stale-explanation, .collection-error { margin: 0 10px 7px; font-size: 11px; }
  .account-body { padding: 10px; }
  .account-toolbar { display: block; }
  .account-toolbar h3 { margin: 2px 0 8px; font-size: 13px; }
  .account-toolbar .sort-controls select { flex: 1; max-width: 180px; }
  .account-table, .account-table tbody { display: block; }
  .account-table thead { display: none; }
  .account-table tr { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 16px; border-top: 1px solid var(--border); padding: 10px 0; }
  .account-table td, .account-table td:first-child { display: block; width: auto; border: 0; padding: 0; text-align: left; }
  .account-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--muted); margin-bottom: 2px; }
  .account-table .account-name, .account-table .account-state { grid-column: 1 / -1; }
  .account-table .account-name::before { display: none; }
  .account-meta summary { min-height: 30px; }
  .sort-caption { font-size: 11px; }
  .panel { padding: 14px; }
  .admin-tabs { gap: 0; }
  .admin-tabs a { flex: 1; text-align: center; padding: 10px 4px; font-size: 13px; }
  .editor > summary { gap: 8px; }
  .editor summary strong { font-size: 13px; }
  .editor-body { padding: 12px; }
  .checks, .form-grid { grid-template-columns: 1fr; gap: 6px; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .inline-form label { max-width: none; }
  .auth-card { padding: 28px 22px; }
}
