:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --canvas: #f7f8f6;
  --surface: #ffffff;
  --surface-soft: #f0f3ef;
  --surface-hover: #e8eee9;
  --border: #dde3de;
  --border-strong: #c7d1c9;
  --text: #1b211d;
  --muted: #667069;
  --accent: #2f6b4f;
  --accent-strong: #24543e;
  --accent-soft: #e3eee7;
  --danger: #9a4a38;
  --shadow: 0 24px 64px rgba(24, 39, 29, .18);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--canvas); color: var(--text); }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible {
  outline: 3px solid rgba(47, 107, 79, .3);
  outline-offset: 2px;
}
.muted { color: var(--muted); line-height: 1.55; }
.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3 { margin: 0; line-height: 1.2; }

/* 登录与注册页 */
.shell.narrow {
  width: min(460px, calc(100% - 32px));
  margin: 64px auto;
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 18px 50px rgba(27, 42, 33, .09);
}
.shell.narrow h1 { margin-bottom: 16px; font-size: 2rem; }
.shell.narrow form, .panel-section form { display: grid; gap: 12px; margin-top: 22px; }
label { font-weight: 680; }
input, select {
  width: 100%;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
}
form button, #logout {
  min-height: 42px;
  padding: 10px 14px;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  font-weight: 750;
}
form button:hover { background: var(--accent-strong); }
.secondary { color: #294637 !important; background: var(--accent-soft) !important; }
.message { min-height: 1.5em; color: var(--danger); overflow-wrap: anywhere; }

/* 导航与主内容 */
.app-body { overflow: hidden; }
.app-shell {
  display: grid;
  grid-template-columns:240px minmax(0,1fr);
  min-height: 100vh;
  min-height:100dvh;
  background: var(--canvas);
}
.app-rail {
  position: relative;
  z-index: 2;
  display: flex;
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  flex-direction: column;
  background: var(--surface-soft);
  transition: transform .22s ease, box-shadow .22s ease;
}
.navigation-rail { border-right: 1px solid var(--border); }
.context-rail { border-left: 1px solid var(--border); }
.navigation-brand, .rail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.navigation-brand { padding: 20px 16px 14px; }
.navigation-brand h2, .rail-header h2 { font-size: 1.05rem; }
.rail-description { margin: 14px 4px 16px; font-size: .84rem; }
.icon-button, .compact-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}
.icon-button:hover, .compact-toggle:hover { background: var(--surface-hover); border-color: var(--border); }
.panel-close, .navigation-toggle, .context-toggle { display: none; }

.module-nav { display: grid; gap: 5px; padding: 6px 12px 16px; }
.module-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 43px;
  padding: 7px 9px;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 700;
}
.module-item:hover:not(:disabled) { background: var(--surface-hover); }
.module-item[aria-current="page"] { background: var(--surface); border-color: var(--border-strong); }
.module-item:disabled { color: var(--muted); cursor: default; }
.module-item small { color: var(--muted); font-size: .68rem; font-weight: 650; }
.module-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.module-item[aria-current="page"] .module-icon { color: var(--accent-strong); background: var(--accent-soft); border-color: transparent; }
.module-detail {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
  padding: 18px 16px 12px;
  border-top: 1px solid var(--border);
}
.module-detail h2 { font-size: .92rem; }
.module-subitem {
  width: 100%;
  margin: 14px 0 0;
  padding: 11px 12px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: .84rem;
  font-weight: 700;
}
.module-subitem:hover { background: var(--surface-hover); }
.module-subitem[aria-current="page"] { background: var(--surface); border-color: var(--border-strong); }
.admin-subnav { display: grid; gap: 4px; }

#digest-history { min-height: 0; flex: 1; overflow-y: auto; }
.history-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.history-item {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 11px 12px;
  color: inherit;
  text-align: left;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
}
.history-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: .82rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.history-item:hover { background: var(--surface-hover); }
.history-item.active { background: var(--surface); border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(25, 42, 31, .06); }
.profile-footer { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 7px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); }
.profile-trigger { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-width: 0; padding: 7px 8px; color: var(--text); background: transparent; border: 1px solid transparent; border-radius: 12px; text-align: left; transition: background .16s ease, border-color .16s ease; }
.profile-trigger:hover { background: var(--surface-hover); border-color: var(--border); }
.profile-trigger:focus-visible { outline: 3px solid rgba(47, 107, 79, .3); outline-offset: 2px; }
.profile-avatar {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 800;
}
.profile-copy { display: grid; min-width: 0; gap: 2px; }
#current-profile { overflow: hidden; font-size: .78rem; font-weight: 750; line-height: 1.35; text-overflow: ellipsis; white-space: nowrap; }
.profile-copy small { overflow: hidden; color: var(--muted); font-size: .68rem; text-overflow: ellipsis; white-space: nowrap; }
.profile-chevron { color: var(--muted); font-size: 1.25rem; transition: transform .16s ease; }
.profile-trigger:hover .profile-chevron { transform: translateX(2px); }
.profile-logout { width: 38px; min-height: 38px !important; padding: 0 !important; border: 0; border-radius: 11px; font-size: 1rem; font-weight: 800; }

.main-panel {
  min-width: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface);
}
.app-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 88px;
  padding: 16px clamp(24px, 5vw, 64px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(14px);
}
.app-identity { min-width: 0; }
.app-identity h1 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.app-identity > .muted { margin: 5px 0 0; font-size: .8rem; }
.detail-panel, .admin-view { width: min(820px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 96px; }
.detail-heading { display: flex; align-items: center; gap: 12px; }
.badge { display: inline-block; padding: 4px 9px; color: #69551d; background: #ece5cf; border-radius: 999px; font-size: .75rem; font-weight: 750; }
.overview { margin: 26px 0 34px; font-size: 1.08rem; line-height: 1.78; }
.digest-section { margin-top: 38px; }
.digest-section h3 { font-size: 1.05rem; }
.digest-entry { padding: 18px 0; border-top: 1px solid var(--border); }
.digest-entry:first-of-type { margin-top: 12px; }
.digest-entry a { color: var(--accent-strong); font-weight: 750; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.digest-entry p { margin: .7rem 0; line-height: 1.7; }
.legacy-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; }
.admin-intro { max-width: 680px; }
.admin-intro h2 { font-size: 1.5rem; }
.admin-intro > .muted { margin: 14px 0 0; line-height: 1.7; }
.admin-card { margin-top: 30px; padding: 22px; background: var(--surface-soft); border: 1px solid var(--border); border-radius: 14px; }
.admin-card h3 { font-size: 1rem; }
.admin-card p { margin: 11px 0 0; color: var(--muted); font-size: .9rem; line-height: 1.65; }
.admin-section[hidden] { display: none; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.role-legend { max-width: 310px; text-align: right; }
.user-list { display: grid; gap: 10px; margin-top: 20px; }
.user-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.user-identity { display: grid; min-width: 0; gap: 5px; }
.user-identity strong { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.user-identity span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-controls { display: grid; grid-template-columns: 112px 112px auto; gap: 8px; }
.user-controls select { min-width: 0; padding: 8px; }
.user-controls button, .pending-row button, #invitation-link-actions button { padding: 8px 11px; border: 0; border-radius: 8px; font-weight: 700; }
.user-controls :disabled { opacity: .55; cursor: not-allowed; }
.pending-list { display: grid; gap: 9px; margin: 14px 0 0; padding: 0; list-style: none; }
.pending-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 11px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.pending-row div { display: grid; min-width: 0; gap: 4px; }
.pending-row strong, .pending-row small { overflow-wrap: anywhere; }
#invitation-link-actions { margin-top: 8px; }
.settings-notice { padding: 12px 14px; color: var(--accent-strong) !important; background: var(--accent-soft); border-radius: 10px; }
.settings-form { display: grid; gap: 18px; margin-top: 20px; }
.settings-group { display: grid; gap: 12px; min-width: 0; margin: 0; padding: 16px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.settings-group legend { padding: 0 6px; font-size: .86rem; font-weight: 800; }
.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(150px, 190px); align-items: center; gap: 12px 18px; }
.settings-grid label { color: var(--muted); font-size: .86rem; line-height: 1.45; }
.settings-form > button { justify-self: end; min-width: 150px; }
.settings-status-list { display: grid; gap: 0; margin: 18px 0 0; }
.settings-status-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--border); }
.settings-status-list dt { color: var(--muted); font-size: .84rem; }
.settings-status-list dd { margin: 0; font-size: .84rem; font-weight: 750; text-align: right; overflow-wrap: anywhere; }

.profile-dialog { width: min(520px, calc(100% - 32px)); max-height: min(760px, calc(100dvh - 32px)); padding: 26px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.profile-dialog::backdrop { background: rgba(12, 20, 15, .54); backdrop-filter: blur(2px); }
.dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.profile-dialog form { display: grid; gap: 10px; margin-top: 18px; }
.profile-dialog form button { min-height: 42px; padding: 10px 14px; color: #fff; background: var(--accent); border: 0; border-radius: 10px; font-weight: 750; }
.password-section { margin-top: 22px; padding-top: 22px; border-top: 1px solid var(--border); }
#profile-account { margin: 12px 0 0; }

.context-rail > .rail-header { padding: 22px 20px 16px; border-bottom: 1px solid var(--border); }
.context-scroll { min-height: 0; flex: 1; overflow-y: auto; }
.panel-section { padding: 24px 20px; border-bottom: 1px solid var(--border); }
.panel-section h3 { font-size: 1rem; }
.panel-section > .muted { margin: 9px 0 0; font-size: .84rem; }
.notification-list { display: grid; gap: 10px; margin: 16px 0 0; padding: 0; list-style: none; }
.notification-item { display: grid; gap: 7px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 11px; }
.notification-item span { overflow-wrap: anywhere; font-size: .86rem; line-height: 1.45; }
.notification-item button { justify-self: start; padding: 7px 10px; border: 0; border-radius: 8px; }
.panel-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 0;
  background: rgba(12, 18, 14, .38);
  border: 0;
  border-radius: 0;
  backdrop-filter: blur(2px);
}

/* 平板：保留模块栏，工具栏改为抽屉。 */
@media(max-width:1199px) {
  .app-shell { grid-template-columns: 240px minmax(0, 1fr); }
  .app-header { grid-template-columns: minmax(0, 1fr) auto; }
  .context-toggle { display: inline-flex; }
  .context-rail {
    position: fixed;
    top: 0;
    right: 0;
    z-index: 50;
    width: min(360px, calc(100vw - 48px));
    transform: translateX(105%);
    box-shadow: none;
  }
  .context-rail.is-open { transform: translateX(0); box-shadow: var(--shadow); }
  .context-rail .panel-close { display: inline-flex; }
}

/* 手机竖屏：中间主栏常驻，模块与工具都改为抽屉。 */
@media(max-width:759px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .navigation-toggle { display: inline-flex; }
  .app-header { grid-template-columns: auto minmax(0, 1fr) auto; min-height: 68px; padding: 10px 12px; gap: 8px; }
  .app-identity { text-align: center; }
  .app-identity .eyebrow { display: none; }
  .app-identity h1 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .compact-toggle { min-width: 42px; padding: 8px; font-size: .82rem; }
  .navigation-rail {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 50;
    width: min(320px, calc(100vw - 40px));
    transform: translateX(-105%);
    box-shadow: none;
  }
  .navigation-rail.is-open { transform: translateX(0); box-shadow: var(--shadow); }
  .navigation-rail .panel-close { display: inline-flex; }
  .detail-panel, .admin-view { width: min(100% - 36px, 760px); padding: 30px 0 80px; }
  .section-heading { display: block; }
  .role-legend { max-width: none; text-align: left; }
  .user-row { grid-template-columns: 1fr; }
  .user-controls { grid-template-columns: 1fr 1fr auto; }
  .settings-grid { grid-template-columns: 1fr; gap: 7px; }
  .settings-grid input, .settings-grid select { margin-bottom: 7px; }
  .settings-form > button { width: 100%; justify-self: stretch; }
  .overview { font-size: 1rem; }
  .shell.narrow { margin: 24px auto; padding: 26px 22px; }
}

@media(max-width:420px) {
  .compact-toggle span:not([aria-hidden="true"]) { display: none; }
  .app-header { grid-template-columns: 42px minmax(0, 1fr) 42px; }
  .profile-dialog { padding: 20px; }
  .user-controls { grid-template-columns: 1fr; }
}

@media(prefers-reduced-motion:reduce) {
  .app-rail { transition: none; }
}

@media(prefers-color-scheme:dark) {
  :root {
    --canvas: #101511;
    --surface: #171d19;
    --surface-soft: #121814;
    --surface-hover: #222c25;
    --border: #303a33;
    --border-strong: #435047;
    --text: #e7ece8;
    --muted: #a6b0a9;
    --accent: #81b99a;
    --accent-strong: #9ed0b3;
    --accent-soft: #2c4034;
    --danger: #e39a85;
  }
  .secondary { color: var(--text) !important; }
  .badge { color: #ddca91; background: #493f25; }
  .history-item.active { box-shadow: none; }
}

#news-settings-view { display: grid; gap: 20px; }
.news-card { padding: 24px; margin-top: 0; }
.news-form { display: grid; gap: 12px; margin-top: 24px; }
.news-form .settings-group { display: grid; gap: 12px; min-width: 0; }
.news-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.news-actions h4 { margin: 0; }
.news-actions button, .news-button, .news-delete-confirm button { border: 0; border-radius: 9px; padding: 10px 14px; min-height: 42px; }
.subscription-list { display: grid; gap: 14px; }
.subscription-row { padding: 18px; border: 1px solid var(--border); border-radius: 12px; min-width: 0; }
.subscription-row p { margin: 10px 0; }
.source-query { overflow-wrap: anywhere; }
.subscription-list { margin-top: 16px; }
.news-card .message { color: var(--danger); }
.news-card .message:empty { display: none; }
.news-card button:disabled { opacity: .55; cursor: not-allowed; }
.news-actions h4 { overflow-wrap: anywhere; min-width: 0; }
.news-submenu { padding: 0 10px 8px 30px; }
.news-subnav { display: grid; gap: 4px; border-left: 1px solid var(--border); padding-left: 8px; }
#news-topic-navigation { display: grid; gap: 4px; }
.news-subnav .module-subitem { text-align: left; padding: 9px 12px; width: 100%; border-radius: 8px; overflow-wrap: anywhere; }
.news-manage-link { border-top: 1px solid var(--border) !important; margin-top: 4px; }
.news-topics-empty { font-size: .8rem; margin: 6px 12px; }
#news-topic-items { overflow-wrap: anywhere; }
#news-discovery-report { overflow-wrap: anywhere; }
#news-discovery-report article { margin-top: 12px; }
.news-delete-confirm { margin-top: 12px; padding: 12px; background: var(--surface-soft); border-radius: 10px; }
.news-delete-confirm button { margin: 4px; }
@media (max-width: 759px) { .news-card { padding: 16px; } }
.subscription-list { gap: 0; margin-top: 0; }
#subscription-list .subscription-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 24px; padding: 20px 0; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
#subscription-list .subscription-row p { font-size: .85rem; margin: 8px 0 0; }
#subscription-list .subscription-row .news-delete-confirm { grid-column: 1 / -1; }
.subscription-models .model-policy-control { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 0; margin: 0; border-bottom: 1px solid var(--border); }
.subscription-models .model-policy-control button { flex-shrink: 0; }
#news-schedule-form { max-width: 620px; }
#news-generation-card { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
#subscription-add-editor > .page-tabs { margin-top: 20px; }
@media(max-width:759px) { #subscription-list .subscription-row { grid-template-columns: minmax(0,1fr); gap: 12px; } .subscription-models .model-policy-control { align-items: flex-start; flex-direction: column; gap: 4px; } }

.model-dialog { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.model-dialog::backdrop { background: rgb(0 0 0 / 60%); }
.model-dialog .news-form { margin-top: 0; }
.model-dialog input, .model-dialog select { width: 100%; min-width: 0; }
.model-dialog details label { display: block; margin: 12px 0 6px; }
.model-dialog fieldset { min-width: 0; display: grid; gap: 12px; }
.model-window { margin: 16px 0; border: 1px solid var(--border); border-radius: 8px; }
.model-dialog .model-window-days { display: flex; flex-wrap: wrap; gap: 12px; }
.model-dialog .model-window-days label { display: flex; align-items: center; gap: 4px; margin: 0; }
.model-dialog .model-window-days input { width: auto; }
.model-order { padding-left: 24px; overflow-wrap: anywhere; }
.model-order li { margin: 12px 0; }
.model-policy-control { margin: 14px 0; overflow-wrap: anywhere; }
#models-list, #model-policies { overflow-wrap: anywhere; }
.model-template-details { padding: 12px; border: 1px solid var(--border); border-radius: 8px; overflow-wrap: anywhere; }
.model-template-details p { margin: 8px 0; }
.model-selection-choice { display: flex; align-items: center; gap: 10px; padding: 10px 0; overflow-wrap: anywhere; }
.model-dialog .model-selection-choice input { width: auto; flex: 0 0 auto; }
.model-credentials { display: grid; gap: 12px; }
.model-credentials[hidden] { display: none; }
.model-template-model { padding: 8px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.model-template-model p { margin: 6px 0; font-size: 0.9rem; }
.provider-list { display: grid; gap: 24px; }
.provider-usage { padding: 16px 22px; border-bottom: 1px solid var(--border); }
.provider-usage h4 { margin: 0; }
.usage-limit { margin: 12px 0; }
.usage-limit p { margin: 5px 0; }
.usage-limit progress { width: min(100%, 360px); display: block; margin: 6px 0; accent-color: var(--accent); }
.provider-group { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; min-width: 0; background: var(--surface); }
#models-list:not(:empty) { margin-top: 24px; }
.provider-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 20px 22px; margin: 0; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.provider-heading h3 { margin: 4px 0 0; font-size: 1.15rem; }
.provider-heading p { margin: 6px 0 0; font-size: .8rem; }
.provider-kicker { color: var(--accent-strong); font-size: .7rem; font-weight: 750; letter-spacing: .08em; }
.provider-metadata { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: .8rem; }
.provider-metadata .news-button { border: 1px solid var(--border-strong); }
.provider-models { padding: 16px 22px 18px; }
.provider-models-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.provider-model-list { margin: 12px 0 0 8px; padding-left: 20px; border-left: 2px solid var(--border-strong); }
.provider-model-list .model-row { padding: 14px 0; border-top: 0; border-bottom: 1px solid var(--border); }
.provider-model-list .model-row:last-child { border-bottom: 0; }
.provider-empty { margin: 12px 0 0 8px; padding: 10px 0 10px 20px; border-left: 2px solid var(--border-strong); }
.standalone-heading { margin: 0; padding: 18px 20px; background: var(--surface-soft); font-size: 1rem; }
.model-row { display: grid; grid-template-columns: minmax(0,1fr) minmax(160px,1fr) auto; align-items: center; gap: 14px 24px; padding: 18px 20px; border-top: 1px solid var(--border); }
.model-row h4 { margin: 0; font-size: .95rem; }
.model-row p { margin: 6px 0 0; font-size: .85rem; overflow-wrap: anywhere; }
.model-row > .news-delete-confirm { grid-column: 1 / -1; }
.model-price small { display: block; margin-top: 8px; }
.catalog-footer { margin-top: 20px; justify-content: flex-end; gap: 24px; font-size: .875rem; }
.policy-row { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; gap: 24px; border-bottom: 1px solid var(--border); padding: 24px 0; }
.policy-row h3 { font-size: 1rem; }
.policy-row p { margin: 12px 0 0; font-size: .875rem; }
.policy-controls { display: grid; gap: 12px; justify-items: start; }
.policy-controls details { font-size: .78rem; color: var(--muted); }
.advanced-policy { margin-top: 24px; font-size: .9rem; }
@media(max-width:1000px) { .model-row { grid-template-columns: minmax(0,1fr) auto; } .model-price { grid-column: 1; } .model-row > .news-actions { grid-column: 2; grid-row: 1 / 3; } }
@media(max-width:480px) { .model-row { display: flex; flex-wrap: wrap; padding: 16px; } .model-row > * { width: 100%; } .provider-heading { padding: 16px; } .provider-models { padding: 14px 16px 16px; } .provider-model-list { margin-left: 2px; padding-left: 12px; } .provider-model-list .model-row { padding: 14px 0; } .provider-empty { margin-left: 2px; padding-left: 12px; } .policy-row { grid-template-columns: minmax(0,1fr); gap: 14px; } }

/* 页面只有导航和主内容常驻，详情以侧栏打开。 */
.navigation-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.nav-group-label { margin: 18px 12px 8px; color: var(--muted); font-size: .72rem; font-weight: 700; }
.navigation-brand strong { font-size: 1.2rem; letter-spacing: .03em; }
.module-detail { flex: initial; padding: 0 12px 16px; border: 0; }
.module-detail .nav-group-label { font-size: .72rem; }
.module-subitem { margin: 0; }
.profile-footer { margin-top: auto; }
.context-toggle, .context-rail .panel-close { display: inline-flex; }
.context-rail { position: fixed; top: 0; right: 0; z-index: 50; width: min(460px, calc(100vw - 32px)); transform: translateX(105%); box-shadow: none; }
.context-rail.is-open { transform: translateX(0); box-shadow: var(--shadow); }
.app-header { min-height: 96px; padding-inline: clamp(24px, 4vw, 56px); }
.app-identity h1 { font-size: 1.55rem; }
.app-identity > .muted { font-size: .875rem; max-width: 760px; }
.detail-panel, .admin-view { width: min(1040px, calc(100% - 80px)); padding: 28px 0 72px; }
.admin-view .admin-view { width: 100%; margin: 0; padding: 0; }
.admin-card { background: var(--surface); margin-top: 0; padding: 0; border: 0; border-radius: 0; }
.message:empty { display: none; }
.page-tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; }
.page-tabs > button { padding: 12px 0; flex: 0 0 auto; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); background: transparent; font-weight: 650; font-size: .9rem; }
.page-tabs > button[aria-selected="true"] { color: var(--accent-strong); border-bottom-color: var(--accent); }
.page-tabs > button:hover { color: var(--text); }
.page-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.page-toolbar p { margin: 0; }
.primary-button { color: var(--surface); background: var(--accent); font-weight: 700; }
.quiet-link { padding: 6px 0; border: 0; color: var(--accent-strong); background: transparent; font-weight: 650; }
.empty-state { padding: 36px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 12px; }
.side-sheet { position: fixed; inset: 0 0 0 auto; width: min(560px, 100vw); height: 100dvh; max-height: 100dvh; max-width: 100vw; margin: 0; overflow-y: auto; padding: 64px 28px 32px; border: 0; border-left: 1px solid var(--border); border-radius: 0; color: var(--text); background: var(--surface); box-shadow: var(--shadow); }
.side-sheet::backdrop { background: rgb(12 20 15 / 40%); }
.side-sheet .sheet-close { position: absolute; top: 16px; right: 20px; font-size: .85rem; }
.side-sheet h2 { padding-right: 0; font-size: 1.3rem; }
.side-sheet .news-form { margin-top: 0; }
.side-sheet .admin-card { margin: 0; padding: 0; }
.side-sheet .news-actions { margin-top: 12px; }
.side-sheet details { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 16px; }
summary { cursor: pointer; font-weight: 650; }
.editor-footer { position: sticky; bottom: -32px; margin: 16px -28px -32px; padding: 16px 28px; background: var(--surface); border-top: 1px solid var(--border); }
.context-scroll .page-tabs { margin: 0; padding-inline: 20px; gap: 20px; }
.user-list { margin-top: 20px; }
.settings-form { max-width: 800px; }
@media(prefers-color-scheme:dark) { form button { color: var(--surface); } }
@media(max-width:759px) {
  .app-header { padding: 12px 16px; min-height: 76px; }
  .app-identity h1 { font-size: 1.1rem; }
  .app-identity > .muted { display: none; }
  .detail-panel, .admin-view { width: calc(100% - 32px); padding-top: 20px; }
  .page-toolbar { align-items: flex-start; flex-wrap: wrap; }
  .page-tabs { gap: 20px; margin-bottom: 20px; }
  .side-sheet { padding: 60px 20px 24px; }
  .side-sheet .sheet-close { right: 16px; }
  .editor-footer { bottom: -24px; margin-inline: -20px; padding-inline: 20px; }
}
