/* Geist 的语义色阶、文字角色与材质；保留智境引擎的青色品牌。
   共享规则放在一处，页面布局仍由各页的独立样式负责。 */
:root {
  --bg: #f7f8fa;
  --surface: #fff;
  --surface-2: #f9fafb;
  --sunk: #eff2f5;
  --border: #e1e6eb;
  --border-strong: #bac6cf;
  --text: #132b3a;
  --text-2: #425c6d;
  --text-3: #5a7080;
  --brand: #087d8c;
  --brand-hover: #066573;
  --brand-soft: #e8f5f6;
  --side: #f2f5f7;
  --side-text: #4e6575;
  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --shadow-sm: none;
  --shadow: 0 2px 5px #132b3a06, 0 8px 24px #132b3a08;
  --shadow-lg: 0 8px 36px #132b3a24, 0 0 0 1px #132b3a08;
  --focus: 0 0 0 3px #087d8c24;
}
body { font-size: 16px; line-height: 1.65; }
h1 { font-size: 30px; line-height: 1.35; letter-spacing: -.025em; }
h2 { font-size: 20px; line-height: 1.5; letter-spacing: -.015em; }
h3 { font-size: 18px; line-height: 1.5; }
main { max-width: 1560px; padding: 32px clamp(24px, 2.6vw, 48px) 64px; }
main.wide { max-width: 1840px; }
.workspace-topbar { padding: 14px clamp(24px, 2.6vw, 48px); min-height: 64px; }
.workspace-context, .workspace-context b, .workspace-status { font-size: 15px; }
.workspace-context b { color: var(--text); font-weight: 600; }
.workspace-context i { font-style: normal; color: var(--border-strong); }
.workspace-status { min-height: 34px; padding: 4px 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--text-2); }
.workspace-status:hover { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
#nav .brand .tagline { font-size: 14px; letter-spacing: .025em; }
#nav a { height: 44px; border-radius: 8px; }
#nav a.active { background: var(--brand-soft); border-color: transparent; }
/* 大分区与可点击菜单分层：粗标题、品牌竖线和延伸分隔线。 */
@media (min-width: 1101px) {
  #nav .nav-group {
    display: flex; align-items: center; gap: 10px; flex: none;
    min-height: 28px; margin: 18px 6px 6px; padding: 0 0 0 10px;
    border-left: 3px solid var(--brand);
    color: var(--text); font-size: 20px; font-weight: 750; line-height: 1.5; letter-spacing: .025em;
  }
  #nav .brand + .nav-group { margin-top: 0; }
  #nav .nav-group::after { content: ''; height: 1px; flex: 1; background: var(--border-strong); }
}
#nav .me .who b { font-size: 15px; }
.page-head { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.page-head .sub { color: var(--text-2); font-size: 16px; line-height: 1.7; }
.card-head { padding: 20px 24px; background: var(--surface-2); border-radius: var(--r) var(--r) 0 0; }
.card-head p { font-size: 16px; color: var(--text-2); }
.card-body { padding: 24px; }
.card-foot { background: var(--surface-2); }
.card:has(> .table-wrap:only-child) { overflow: hidden; }
.card, .pc, .ditem, .icard { box-shadow: none; }
.btn { min-height: 44px; padding: 9px 16px; border-radius: 8px; line-height: 1.4; font-size: 16px; box-shadow: none; }
.btn.sm { min-height: 40px; padding: 7px 12px; font-size: 16px; }
.btn.lg { min-height: 48px; font-size: 17px; }
.btn:hover:not(:disabled) { box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.btn.ghost { border-color: var(--border-strong); }
.btn:active:not(:disabled) { filter: brightness(.96); }
.btn:disabled, .btn[aria-disabled=true] { opacity: .58; }
.icon-btn { min-width: 36px; min-height: 36px; }
.link-btn { min-height: 34px; font-size: 16px; }
.field > span { font-size: 16px; color: var(--text); }
.field .hint { font-size: 15px; color: var(--text-2); }
input:not([type=checkbox]):not([type=radio]):not([type=color]), textarea, select { font-size: 16px; line-height: 1.5; }
input:not([type=checkbox]):not([type=radio]):not([type=color]), select { min-height: 44px; }
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }
.dd-btn { min-height: 44px; font-size: 16px; border-radius: 8px; }
.dd-opt { min-height: 40px; font-size: 16px; }
.dd-menu { border-radius: 10px; border-color: var(--border); }
.small, .hint, .ref-hint { font-size: 15px; }
.pill, .tag { font-size: 14px; line-height: 1.6; }
.banner { font-size: 16px; }
.crumb { font-size: 16px; }
th { font-size: 15px; color: var(--text-2); letter-spacing: 0; padding: 14px 20px; }
td { font-size: 16px; padding: 17px 20px; }
th:first-child, td:first-child { padding-left: 24px; }
table, .mono, .stat .n { font-variant-numeric: tabular-nums; }
.empty h3 { font-size: 22px; }
.empty p { font-size: 16px; color: var(--text-2); max-width: 480px; }
.empty-icon { border-radius: 14px; background: var(--brand-soft); border-color: transparent; }
.modal { border-radius: 16px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 24px; }
.modal .small { font-size: 16px; }
.intake-upload, .intake-side-pick > button, .intake-side-pick > em,
.intake-sample-name > input[data-sample-name]:not([type=checkbox]),
.intake-sample-name > strong, .intake-sample-save, .intake-image-match.is-sample .link-btn { font-size: 16px; }
.intake-side-pick > button { min-height: 38px; }
.intake-color-result > small { font-size: 14px; }
.intake-color-status > p, .intake-color-source, .intake-preview-grid figcaption { font-size: 16px; }
.intake-remove { min-width: 36px; min-height: 36px; }
.intake-asset { grid-template-columns: 48px minmax(0, 1fr) 36px; }
.busy-spinner { width: 18px; height: 18px; flex: none; }
.ai-loading { padding-top: 40px; }
.ai-loading-main { justify-content: flex-start; padding: 0; gap: 18px; }
.ai-loading-copy strong, .ai-loading.compact .ai-loading-copy strong { font-size: 18px; }
.ai-loading-copy p, .ai-loading.compact .ai-loading-copy p { font-size: 16px; color: var(--text-2); max-width: 620px; }
.ai-loading-skeleton { margin-top: 28px; gap: 18px; }
.ai-skeleton-card { border-color: var(--border); background: var(--surface); border-radius: 12px; min-height: 180px; }
.ai-loading[data-layout=list] .ai-loading-skeleton,
.ai-loading[data-layout=form] .ai-loading-skeleton { grid-template-columns: minmax(0, 1fr); }
.ai-loading[data-layout=list] .ai-skeleton-card { min-height: 76px; }
.ai-loading[data-layout=list] .ai-skeleton-card:nth-child(n+4) { display: none; }
.ai-loading[data-layout=form] .ai-skeleton-card { min-height: 220px; }
.ai-loading[data-layout=dashboard] .ai-loading-skeleton { grid-template-columns: repeat(3,minmax(0,1fr)); }
.ai-loading[data-layout=dashboard] .ai-skeleton-card:last-child { grid-column: 1 / -1; min-height: 260px; }

/* 管理区：左侧信息、右侧低频操作；不与创作区争夺注意力。 */
.admin-overview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--border); margin-bottom: 26px; }
.admin-overview > div { padding: 18px 24px; background: var(--surface); display: grid; gap: 3px; }
.admin-overview span { color: var(--text-2); font-size: 15px; }
.admin-overview b { font-size: 22px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.admin-overview .admin-description { font-size: 17px; }
.admin-columns { grid-template-columns: minmax(0,1fr) 360px; gap: 24px; }
.admin-columns > .card, .settings-grid > .card { min-width: 0; }
.admin-columns .table-wrap th, .admin-columns .table-wrap td { padding-left: 18px; padding-right: 18px; }
.admin-table-title { padding: 20px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; border-bottom: 1px solid var(--border); }
.admin-table-title > span { font-size: 15px; color: var(--text-2); }
.admin-columns .table-wrap b { white-space: normal; overflow-wrap: anywhere; }
.admin-avatar { width: 36px; height: 36px; font-size: 16px; }
.admin-person { display: flex; gap: 10px; align-items: center; min-width: 170px; }
.admin-side .card-head { background: var(--brand-soft); }
.admin-side .card-head h2 { color: var(--brand); }
.admin-side .card-foot .btn { width: 100%; }
.log-detail { white-space: normal; min-width: 220px; max-width: 440px; }
.log-detail summary { cursor: pointer; font-size: 15px; color: var(--text-2); }
.log-detail pre { max-width: 100%; margin: 12px 0 0; padding: 12px; border: 1px solid var(--border); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); background: var(--surface-2); font: 14px/1.7 ui-monospace,Consolas,monospace; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1.15fr) minmax(340px,.85fr); gap: 24px; align-items: start; }
.settings-grid .card + .card { margin-top: 0; }
.settings-stack { display: grid; gap: 24px; min-width: 0; }
.settings-grid .kv td { white-space: normal; padding: 15px 0; }
.settings-grid .kv td:first-child { width: 160px; }
.settings-grid .pill { white-space: normal; overflow-wrap: anywhere; }
.settings-usage { display: grid; gap: 22px; }
.settings-usage > div { display: grid; gap: 9px; }
.settings-usage label { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.settings-usage b { font-weight: 600; font-variant-numeric: tabular-nums; }
.settings-usage meter { width: 100%; height: 9px; appearance: none; border: 0; border-radius: 5px; overflow: hidden; background: var(--sunk); }
.settings-usage meter::-webkit-meter-bar { background: var(--sunk); border: 0; border-radius: 5px; }
.settings-usage meter::-webkit-meter-optimum-value { background: var(--brand); border-radius: 5px; }
.settings-usage meter::-moz-meter-bar { background: var(--brand); border-radius: 5px; }
.settings-usage small { color: var(--text-2); font-size: 15px; }
@media (max-width: 1380px) {
  .admin-columns { grid-template-columns: minmax(0,1fr) 320px; gap: 20px; }
  .admin-overview > div { padding: 16px 20px; }
  .admin-columns .table-wrap th, .admin-columns .table-wrap td { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 1120px) {
  .admin-columns, .settings-grid { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c151d; --surface: #131f29; --surface-2: #172630; --sunk: #20313e;
    --border: #2b3c49; --border-strong: #506776;
    --text: #edf4f7; --text-2: #bdced9; --text-3: #a4bac8;
    --brand: #68dce5; --brand-hover: #9cebf1; --brand-soft: #173c44;
    --side: #101c25; --side-text: #b6c8d4;
    --shadow-lg: 0 10px 40px #0007,0 0 0 1px #ffffff0c;
    --focus: 0 0 0 3px #68dce52b;
  }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
  .ai-loading *, .ai-loading *::after, .busy-spinner { animation: none !important; }
}
