/* ==========================================================================
   塑序 · 塑料制品智造云 — 界面系统
   欧式编辑风格 / 暖纸底色 / 松墨绿 / 陶土色 / 精细数据密度
   ========================================================================== */

@font-face {
  font-family: "Noto Sans SC";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-400.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans SC";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-500.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Sans SC";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/noto-sans-sc-700.woff2") format("woff2");
}
@font-face {
  font-family: "Noto Serif SC";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/noto-serif-sc-600.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/instrument-serif.woff2") format("woff2");
}
@font-face {
  font-family: "Instrument Serif";
  font-weight: 400;
  font-style: italic;
  font-display: swap;
  src: url("../fonts/instrument-serif-italic.woff2") format("woff2");
}

:root {
  --bg: #f2efe8;
  --bg-deep: #eae5da;
  --surface: #fbf9f4;
  --surface-2: #f6f2ea;
  --surface-3: #efeade;
  --ink: #1b2b26;
  --ink-2: #3c4b45;
  --ink-3: #5f6b64;
  --muted: #838b83;
  --line: rgba(27, 43, 38, 0.13);
  --line-soft: rgba(27, 43, 38, 0.075);
  --pine: #14352c;
  --pine-2: #1c473a;
  --pine-3: #2c5a4b;
  --cream: #f4efe3;
  --clay: #b25f45;
  --clay-soft: #c98068;
  --brass: #b18c50;
  --sage: #7e9b8a;
  --ok: #3f7a5e;
  --warn: #a9772e;
  --bad: #a44a3e;
  --info: #4b6d7d;
  --violet: #6e5d7c;
  --ok-bg: rgba(63, 122, 94, 0.1);
  --warn-bg: rgba(169, 119, 46, 0.12);
  --bad-bg: rgba(164, 74, 62, 0.1);
  --info-bg: rgba(75, 109, 125, 0.1);
  --clay-bg: rgba(178, 95, 69, 0.1);
  --shadow-sm: 0 1px 1px rgba(24, 38, 32, 0.03), 0 10px 30px -24px rgba(24, 38, 32, 0.35);
  --shadow-md: 0 1px 2px rgba(24, 38, 32, 0.04), 0 22px 50px -30px rgba(24, 38, 32, 0.4);
  --shadow-lg: 0 30px 80px -32px rgba(10, 24, 19, 0.55);
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --sidebar-w: 252px;
  --topbar-h: 68px;
  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-display: "Instrument Serif", "Noto Serif SC", "Songti SC", serif;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

[data-theme="dark"] {
  --bg: #101613;
  --bg-deep: #0b110e;
  --surface: #17201c;
  --surface-2: #1c2621;
  --surface-3: #222d27;
  --ink: #ece7da;
  --ink-2: #c3c8bd;
  --ink-3: #a2aaa0;
  --muted: #7c867d;
  --line: rgba(236, 231, 218, 0.14);
  --line-soft: rgba(236, 231, 218, 0.08);
  --pine: #d8e4d5;
  --pine-2: #c2d6c5;
  --pine-3: #9fbea6;
  --cream: #17201c;
  --clay: #d0876e;
  --clay-soft: #b96e56;
  --brass: #c8a76c;
  --ok: #79b394;
  --warn: #d3a45e;
  --bad: #d38476;
  --info: #89adc0;
  --ok-bg: rgba(121, 179, 148, 0.13);
  --warn-bg: rgba(211, 164, 94, 0.13);
  --bad-bg: rgba(211, 132, 118, 0.13);
  --info-bg: rgba(137, 173, 192, 0.13);
  --clay-bg: rgba(208, 135, 110, 0.14);
  --shadow-sm: 0 1px 1px rgba(0, 0, 0, 0.2), 0 10px 30px -24px rgba(0, 0, 0, 0.7);
  --shadow-md: 0 1px 2px rgba(0, 0, 0, 0.25), 0 22px 50px -30px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 80px -32px rgba(0, 0, 0, 0.85);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.62;
  letter-spacing: 0.012em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.22;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.16'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
[data-theme="dark"] body::before { opacity: 0.1; mix-blend-mode: screen; }
::selection { background: rgba(178, 95, 69, 0.22); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 2px; }

/* 布局 ------------------------------------------------------------------ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  min-height: 100vh;
}
.app-main { min-width: 0; display: flex; flex-direction: column; }
.page {
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 30px 34px 56px;
  flex: 1;
  animation: page-in 0.55s var(--ease) both;
}
@keyframes page-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* 侧边栏 ---------------------------------------------------------------- */
.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: #122a23;
  color: #dbe3d7;
  border-right: 1px solid rgba(244, 239, 227, 0.08);
  z-index: 60;
  overflow: hidden;
}
.sidebar::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 280px at 15% -5%, rgba(177, 140, 80, 0.16), transparent 65%),
    radial-gradient(360px 300px at 100% 105%, rgba(126, 155, 138, 0.13), transparent 70%);
}
.sidebar > * { position: relative; z-index: 1; }
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 72px;
  padding: 0 22px;
  border-bottom: 1px solid rgba(244, 239, 227, 0.09);
  flex: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e8dfcd;
  color: #14352c;
  display: grid;
  place-items: center;
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(20, 53, 44, 0.12);
  flex: none;
}
.brand-word { display: flex; flex-direction: column; line-height: 1.25; }
.brand-word b { font-size: 17px; letter-spacing: 0.16em; font-weight: 600; color: #f1eadb; }
.brand-word span { font-size: 9.5px; letter-spacing: 0.18em; color: rgba(219, 227, 215, 0.58); margin-top: 3px; }
.side-scroll { overflow-y: auto; overflow-x: hidden; padding: 14px 12px 20px; flex: 1; scrollbar-width: thin; scrollbar-color: rgba(244,239,227,.16) transparent; }
.side-scroll::-webkit-scrollbar { width: 4px; }
.side-scroll::-webkit-scrollbar-thumb { background: rgba(244, 239, 227, 0.16); border-radius: 4px; }
.nav-group { margin-bottom: 8px; }
.nav-group-label {
  padding: 0 12px;
  margin: 1px 0 4px;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: rgba(219, 227, 215, 0.4);
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 11px;
  height: 33px;
  padding: 0 12px;
  border-radius: 8px;
  color: rgba(219, 227, 215, 0.74);
  font-size: 12.5px;
  letter-spacing: 0.03em;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease);
  position: relative;
}
.nav-link svg { width: 17px; height: 17px; flex: none; opacity: 0.78; }
.nav-link:hover { background: rgba(244, 239, 227, 0.06); color: #f1eadb; }
.nav-link.is-active { background: #e9e1cf; color: #14352c; box-shadow: 0 8px 22px -14px rgba(0, 0, 0, 0.6); }
.nav-link.is-active svg { opacity: 1; color: #a7573f; }
.nav-link.is-active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--brass);
}
.nav-link .nav-badge {
  margin-left: auto;
  font-size: 10px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 20px;
  background: rgba(178, 95, 69, 0.9);
  color: #fff4ea;
  letter-spacing: 0;
}
.side-foot { padding: 12px; border-top: 1px solid rgba(244, 239, 227, 0.09); flex: none; }
.plant-card {
  border: 1px solid rgba(244, 239, 227, 0.13);
  background: rgba(244, 239, 227, 0.045);
  border-radius: 11px;
  padding: 10px 11px;
  display: flex;
  align-items: center;
  gap: 9px;
}
.plant-card .dot { width: 7px; height: 7px; border-radius: 50%; background: #8fc3a3; box-shadow: 0 0 0 3px rgba(143, 195, 163, 0.12); flex: none; }
.plant-card b { font-size: 11.5px; font-weight: 500; color: rgba(241, 234, 219, 0.9); display: block; }
.plant-card span { font-size: 9.5px; color: rgba(219, 227, 215, 0.46); display: block; }
.plant-card svg { width: 14px; height: 14px; margin-left: auto; opacity: 0.45; }

/* 顶栏 ------------------------------------------------------------------ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 30px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn.menu-toggle { display: none; }
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--ink-2); font-weight: 500; }
.crumb .sep { opacity: 0.4; }
.top-date {
  font-size: 11px;
  color: var(--muted);
  padding-right: 12px;
  border-right: 1px solid var(--line);
  margin-right: 4px;
  white-space: nowrap;
  letter-spacing: 0.06em;
}
.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--ink); }
.icon-btn .notify-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--clay);
  box-shadow: 0 0 0 2px var(--bg);
}
.chip-lang {
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: 0.06em;
}
.chip-lang svg { width: 14px; height: 14px; }
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #cfb691, #a98254);
  color: #26382f;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(20, 53, 44, 0.18);
  flex: none;
}
.top-search {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 9px 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--muted);
  font-size: 11.5px;
  min-width: 210px;
  justify-content: flex-start;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.top-search:hover { border-color: rgba(178, 95, 69, 0.4); }
.top-search svg { width: 15px; height: 15px; opacity: 0.65; }
.top-search kbd {
  margin-left: auto;
  font-family: var(--font-sans);
  font-size: 9.5px;
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  background: var(--surface-2);
}

/* 页头 ------------------------------------------------------------------ */
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}
.eyebrow {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 9px;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 18px; height: 1px; background: var(--brass); display: inline-block; }
.eyebrow.no-rule::before { display: none; }
.page-title {
  font-family: var(--font-serif);
  font-size: clamp(27px, 2.5vw, 36px);
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.24;
  margin-top: 8px;
  color: var(--ink);
}
.page-sub { color: var(--muted); font-size: 12.5px; margin-top: 7px; max-width: 680px; letter-spacing: 0.02em; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.page-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.page-meta .meta-item { display: inline-flex; align-items: center; gap: 6px; }
.page-meta .live-dot { width: 6px; height: 6px; }

/* 按钮 ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: var(--pine);
  color: #f5efe2;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
  transition: transform 0.16s var(--ease), background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
[data-theme="dark"] .btn { background: #e6dfcf; color: #18352c; }
.btn svg { width: 15px; height: 15px; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px -12px rgba(20, 53, 44, 0.6); }
.btn:active { transform: none; }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink-2); }
.btn-outline:hover { background: var(--surface); border-color: var(--ink-3); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-clay { background: var(--clay); color: #fff7f0; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-icon { width: 34px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* 通用卡片 -------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
  position: relative;
}
.card.pad { padding: 20px; }
.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 0;
}
.card-head.with-border { padding-bottom: 15px; border-bottom: 1px solid var(--line-soft); }
.card-title { font-size: 14px; font-weight: 500; letter-spacing: 0.04em; display: flex; align-items: center; gap: 8px; }
.card-title .index { font-family: var(--font-display); font-size: 12px; color: var(--brass); letter-spacing: 0.08em; }
.card-sub { font-size: 11px; color: var(--muted); margin-top: 4px; letter-spacing: 0.03em; }
.card-body { padding: 16px 20px 20px; }
.card-foot { padding: 12px 20px; border-top: 1px solid var(--line-soft); font-size: 11px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-link { font-size: 11.5px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.card-link svg { width: 13px; height: 13px; }
.card-link:hover { color: var(--clay); }

/* 网格 ------------------------------------------------------------------ */
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.span-3 { grid-column: span 3; }
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-9 { grid-column: span 9; }
.span-12 { grid-column: span 12; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 11px; }
.center { text-align: center; }
.right { text-align: right; }

/* 数字与标签 ------------------------------------------------------------ */
.num-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0.005em;
}
.num-tab { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.unit { font-family: var(--font-sans); font-size: 11px; font-weight: 400; color: var(--muted); margin-left: 4px; letter-spacing: 0.04em; }
.delta { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; padding: 2px 6px; border-radius: 20px; letter-spacing: 0.02em; }
.delta.up { color: var(--ok); background: var(--ok-bg); }
.delta.down { color: var(--bad); background: var(--bad-bg); }
.delta.flat { color: var(--muted); background: var(--surface-2); }
.delta svg { width: 10px; height: 10px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 20px;
  font-size: 10.5px;
  line-height: 1;
  white-space: nowrap;
  letter-spacing: 0.03em;
  background: var(--surface-2);
  color: var(--ink-2);
  border: 1px solid transparent;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.badge.no-dot::before { display: none; }
.badge.ok { color: var(--ok); background: var(--ok-bg); }
.badge.warn { color: var(--warn); background: var(--warn-bg); }
.badge.bad { color: var(--bad); background: var(--bad-bg); }
.badge.info { color: var(--info); background: var(--info-bg); }
.badge.clay { color: var(--clay); background: var(--clay-bg); }
.badge.neutral { color: var(--ink-3); background: var(--surface-2); }
.badge.solid { background: var(--pine); color: #f2ead9; }
[data-theme="dark"] .badge.solid { background: #e6dfcf; color: #18352c; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-size: 10.5px;
  color: var(--ink-3);
  background: transparent;
  white-space: nowrap;
}
.chip.is-active { background: var(--pine); border-color: var(--pine); color: #f4eddd; }
[data-theme="dark"] .chip.is-active { background: #e6dfcf; border-color: #e6dfcf; color: #18352c; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; position: relative; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid currentColor; color: var(--ok); opacity: 0.35; animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { transform: scale(0.9); opacity: 0.4; } 50% { transform: scale(1.4); opacity: 0; } }

/* KPI ------------------------------------------------------------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: 15px;
  padding: 15px 16px 13px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.kpi-label { font-size: 11px; color: var(--muted); letter-spacing: 0.06em; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kpi-label svg { width: 14px; height: 14px; opacity: 0.4; }
.kpi-value { font-family: var(--font-display); font-size: clamp(28px, 2.2vw, 36px); line-height: 1.05; margin-top: 9px; color: var(--ink); font-variant-numeric: tabular-nums; }
.kpi-value .unit { font-family: var(--font-sans); font-size: 10px; margin-left: 3px; }
.kpi-foot { display: flex; align-items: center; gap: 7px; margin-top: 8px; font-size: 10px; color: var(--muted); white-space: nowrap; }
.kpi-spark { margin-top: 9px; height: 24px; width: 100%; }
.kpi-spark path, .kpi-spark polyline { fill: none; stroke: var(--sage); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.kpi.is-accent { background: linear-gradient(160deg, #17392f, #10291f); border-color: transparent; color: #e9e3d4; }
.kpi.is-accent .kpi-label, .kpi.is-accent .kpi-foot { color: rgba(233, 227, 212, 0.55); }
.kpi.is-accent .kpi-value { color: #f3ecdc; }
.kpi.is-accent .delta.up { color: #a6d3b6; background: rgba(166, 211, 182, 0.12); }
.kpi.is-accent .kpi-spark path, .kpi.is-accent .kpi-spark polyline { stroke: #c7a978; }

/* 主面板 ---------------------------------------------------------------- */
.hero-panel {
  position: relative;
  overflow: hidden;
  background: linear-gradient(138deg, #17392f 0%, #122e26 52%, #0e241e 100%);
  color: #f0e8d8;
  border-radius: 20px;
  padding: 26px 28px;
  border: 1px solid rgba(240, 232, 216, 0.08);
  box-shadow: var(--shadow-md);
}
.hero-panel::before {
  content: "";
  position: absolute;
  width: 520px;
  height: 520px;
  right: -160px;
  top: -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(177, 140, 80, 0.28), transparent 64%);
  pointer-events: none;
}
.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(240, 232, 216, 0.11) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  opacity: 0.35;
  pointer-events: none;
  mask-image: linear-gradient(120deg, transparent 20%, #000 100%);
}
.hero-panel > * { position: relative; z-index: 1; }
.hero-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.hero-kicker { font-size: 10px; letter-spacing: 0.24em; color: rgba(240, 232, 216, 0.5); }
.hero-title { font-family: var(--font-serif); font-size: clamp(20px, 2vw, 26px); font-weight: 600; margin-top: 7px; letter-spacing: 0.03em; color: #f4eddd; }
.hero-big { display: flex; align-items: flex-end; gap: 12px; margin-top: 24px; }
.hero-big b { font-family: var(--font-display); font-size: clamp(48px, 6vw, 76px); line-height: 0.9; font-weight: 400; letter-spacing: 0.01em; }
.hero-big .hero-unit { font-size: 11px; color: rgba(240, 232, 216, 0.5); padding-bottom: 8px; letter-spacing: 0.08em; }
.hero-meta-row { display: flex; gap: 30px; margin-top: 22px; flex-wrap: wrap; }
.hero-meta-row div { min-width: 72px; }
.hero-meta-row b { font-family: var(--font-display); font-size: 22px; font-weight: 400; display: block; color: #efe6d4; }
.hero-meta-row span { font-size: 9.5px; color: rgba(240, 232, 216, 0.45); letter-spacing: 0.08em; }
.hero-ring { position: absolute; right: 26px; bottom: 22px; width: 132px; height: 132px; opacity: 0.9; }
.hero-ring .ring-track { fill: none; stroke: rgba(240, 232, 216, 0.1); stroke-width: 5; }
.hero-ring .ring-val { fill: none; stroke: #c9a96f; stroke-width: 5; stroke-linecap: round; }
.hero-ring text { fill: #efe6d4; font-family: var(--font-display); font-size: 26px; }
.hero-ring .ring-cap { fill: rgba(240, 232, 216, 0.46); font-family: var(--font-sans); font-size: 8px; letter-spacing: 0.1em; }

/* 表格 ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; min-width: 0; scrollbar-width: thin; }
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }
table.data { font-size: 12px; }
table.data th {
  text-align: left;
  font-weight: 500;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
  background: var(--surface-2);
  position: sticky;
  top: 0;
  z-index: 1;
}
table.data th:first-child { padding-left: 20px; }
table.data th:last-child { padding-right: 20px; }
table.data td { padding: 13px 14px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; color: var(--ink-2); }
table.data td:first-child { padding-left: 20px; }
table.data td:last-child { padding-right: 20px; }
table.data tbody tr { transition: background 0.16s var(--ease); cursor: pointer; }
table.data tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data .strong { color: var(--ink); font-weight: 500; }
.row-title { color: var(--ink); font-weight: 500; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.row-title .code { font-size: 10px; color: var(--muted); font-weight: 400; letter-spacing: 0.03em; }
.cell-sub { font-size: 10px; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.avatar-sm {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
  background: var(--surface-3);
  color: var(--ink-2);
  flex: none;
  letter-spacing: 0;
}
.cell-customer { display: flex; align-items: center; gap: 9px; }

/* 工具条 ---------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line-soft);
  flex-wrap: wrap;
}
.toolbar .spacer { flex: 1; }
.tabs { display: flex; align-items: center; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 9px; max-width: 100%; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  border: 0;
  background: transparent;
  padding: 6px 12px;
  border-radius: 7px;
  font-size: 11.5px;
  color: var(--muted);
  transition: background 0.18s var(--ease), color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  white-space: nowrap;
}
.tab:hover { color: var(--ink-2); }
.tab.is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(24, 38, 32, 0.1); font-weight: 500; }
.tab .count { font-size: 9.5px; color: var(--muted); margin-left: 4px; font-variant-numeric: tabular-nums; }
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.segmented button { border: 0; background: var(--surface); padding: 6px 10px; font-size: 10.5px; color: var(--muted); border-right: 1px solid var(--line); }
.segmented button:last-child { border-right: 0; }
.segmented button.is-active { background: var(--pine); color: #f4eddd; }
.search-field {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 220px;
  color: var(--muted);
  transition: border-color 0.16s var(--ease);
}
.search-field:focus-within { border-color: var(--clay); }
.search-field svg { width: 15px; height: 15px; opacity: 0.55; flex: none; }
.search-field input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 11.5px; color: var(--ink); }
.search-field input::placeholder { color: var(--muted); }
.select {
  height: 34px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0 28px 0 10px;
  font-size: 11.5px;
  color: var(--ink-2);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath d='M2 3.6 5 6.4 8 3.6' fill='none' stroke='%23838b83' stroke-width='1.2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-chips .chip { cursor: pointer; height: 26px; }

/* 进度与指标条 ---------------------------------------------------------- */
.progress { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.progress > i { display: block; height: 100%; border-radius: 4px; background: var(--sage); transition: width 0.7s var(--ease); }
.progress.clay > i { background: var(--clay); }
.progress.warn > i { background: var(--warn); }
.progress.ok > i { background: var(--ok); }
.progress-line { display: flex; align-items: center; gap: 9px; }
.progress-line .progress { width: 64px; flex: none; }
.progress-line span { font-size: 10.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 30px; }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--ink-2); gap: 12px; }
.meter-head b { font-family: var(--font-display); font-weight: 400; font-size: 15px; color: var(--ink); }
.meter .progress { height: 4px; }

/* 图例 ------------------------------------------------------------------ */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 10px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 7px; height: 7px; border-radius: 2px; display: inline-block; }

/* 图表 ------------------------------------------------------------------ */
.chart { width: 100%; display: block; }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-family: var(--font-sans); font-size: 8px; letter-spacing: 0.05em; }
.chart .line-main { fill: none; stroke: var(--pine-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .chart .line-main { stroke: var(--sage); }
.chart .line-secondary { fill: none; stroke: var(--brass); stroke-width: 1.2; stroke-dasharray: 3 4; }
.chart .area-main { fill: url(#areaFade); }
.chart .bar-main { fill: var(--pine-3); opacity: 0.75; }
.chart .bar-clay { fill: var(--clay); opacity: 0.7; }
.chart .bar-warn { fill: var(--warn); opacity: 0.6; }
.chart .chart-dot { fill: var(--surface); stroke: var(--pine-3); stroke-width: 1.5; }
.chart .chart-label { fill: var(--ink-2); font-size: 8.5px; font-family: var(--font-sans); }
.chart .chart-value { fill: var(--ink); font-size: 8.5px; font-family: var(--font-sans); font-variant-numeric: tabular-nums; }
.chart-animate .line-main { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: draw 1.6s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* 时间线 ---------------------------------------------------------------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.timeline-item { position: relative; padding: 0 0 16px 0; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid var(--sage);
}
.timeline-item.is-clay::before { border-color: var(--clay); }
.timeline-item.is-warn::before { border-color: var(--warn); }
.timeline-time { font-size: 9.5px; color: var(--muted); letter-spacing: 0.05em; }
.timeline-title { font-size: 12px; color: var(--ink); margin-top: 2px; }
.timeline-desc { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.55; }

/* 抽屉 ------------------------------------------------------------------ */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 25, 20, 0.34);
  backdrop-filter: blur(3px);
  z-index: 120;
  opacity: 0;
  transition: opacity 0.28s var(--ease);
}
.drawer-backdrop.is-open { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(520px, 94vw);
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  z-index: 121;
  transform: translateX(102%);
  transition: transform 0.36s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.is-open { transform: none; }
.drawer-wide { width: min(720px, 96vw); }
.drawer-head {
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
.drawer-head h3 { font-family: var(--font-serif); font-size: 20px; font-weight: 600; }
.drawer-head .sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.drawer-close { margin-left: auto; flex: none; }
.drawer-body { padding: 20px 24px 32px; overflow-y: auto; flex: 1; }
.drawer-foot { padding: 14px 24px; border-top: 1px solid var(--line-soft); display: flex; gap: 8px; justify-content: flex-end; background: var(--surface); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.detail-item { border-bottom: 1px solid var(--line-soft); padding-bottom: 10px; }
.detail-item span { font-size: 10px; color: var(--muted); display: block; letter-spacing: 0.04em; }
.detail-item b { font-size: 12.5px; color: var(--ink); font-weight: 500; margin-top: 2px; display: block; }

/* 弹窗 ------------------------------------------------------------------ */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(12, 25, 20, 0.38);
  backdrop-filter: blur(4px);
  z-index: 130;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.24s var(--ease);
}
.modal-backdrop.is-open { opacity: 1; }
.modal {
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  transform: translateY(14px) scale(0.985);
  transition: transform 0.3s var(--ease);
}
.modal-backdrop.is-open .modal { transform: none; }
.modal-head { padding: 20px 24px; border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 12px; }
.modal-head h3 { font-family: var(--font-serif); font-size: 19px; font-weight: 600; }
.modal-body { padding: 22px 24px; }
.modal-foot { padding: 14px 24px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 10.5px; color: var(--muted); letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  height: 38px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  border-radius: 8px;
  padding: 0 11px;
  font-size: 12px;
  outline: 0;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.field textarea { height: 78px; padding: 9px 11px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--clay); background: var(--surface); }

/* 提示 ------------------------------------------------------------------ */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--pine);
  color: #f3ecdd;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 11.5px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.32s var(--ease);
  max-width: 90vw;
}
.toast svg { width: 14px; height: 14px; color: #c9a96f; flex: none; }
[data-theme="dark"] .toast { background: #e6dfcf; color: #18352c; }
[data-theme="dark"] .toast svg { color: #a7573f; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* 命令面板 -------------------------------------------------------------- */
.command-backdrop { position: fixed; inset: 0; z-index: 150; background: rgba(12, 25, 20, 0.42); backdrop-filter: blur(4px); display: flex; justify-content: center; padding: 12vh 16px 16px; opacity: 0; transition: opacity 0.2s; }
.command-backdrop.is-open { opacity: 1; }
.command {
  width: min(560px, 100%);
  max-height: 60vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(-8px);
  transition: transform 0.24s var(--ease);
}
.command-backdrop.is-open .command { transform: none; }
.command-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.command-input svg { width: 17px; height: 17px; color: var(--muted); flex: none; }
.command-input input { border: 0; outline: 0; background: transparent; flex: 1; font-size: 13px; color: var(--ink); }
.command-input kbd { font-size: 9px; border: 1px solid var(--line); border-radius: 4px; padding: 2px 5px; color: var(--muted); }
.command-list { overflow-y: auto; padding: 8px; }
.command-group { font-size: 9.5px; letter-spacing: 0.12em; color: var(--muted); padding: 8px 10px 4px; }
.command-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 12px; color: var(--ink-2); }
.command-item svg { width: 15px; height: 15px; opacity: 0.55; }
.command-item .cmd-meta { margin-left: auto; font-size: 9.5px; color: var(--muted); }
.command-item:hover, .command-item.is-active { background: var(--surface-2); color: var(--ink); }
.command-foot { padding: 8px 14px; border-top: 1px solid var(--line-soft); display: flex; gap: 14px; font-size: 9.5px; color: var(--muted); }

/* 公告 / 通知 ----------------------------------------------------------- */
.notice {
  display: flex;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid var(--line-soft);
  background: var(--surface-2);
  border-radius: 10px;
  align-items: flex-start;
}
.notice svg { width: 15px; height: 15px; color: var(--warn); flex: none; margin-top: 1px; }
.notice b { font-size: 11.5px; color: var(--ink); font-weight: 500; display: block; }
.notice span { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; line-height: 1.5; }
.notice.clay svg { color: var(--clay); }
.notice.info svg { color: var(--info); }
.notif-item { display: flex; gap: 11px; padding: 13px 0; border-bottom: 1px solid var(--line-soft); }
.notif-item:last-child { border-bottom: 0; }
.notif-icon { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); flex: none; }
.notif-icon svg { width: 15px; height: 15px; }
.notif-icon.clay { background: var(--clay-bg); color: var(--clay); }
.notif-icon.info { background: var(--info-bg); color: var(--info); }
.notif-item b { font-size: 11.5px; font-weight: 500; color: var(--ink); }
.notif-item p { font-size: 10.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.notif-item time { font-size: 9px; color: var(--muted); margin-left: auto; white-space: nowrap; }

/* 仪表与环 -------------------------------------------------------------- */
.ring { position: relative; display: inline-grid; place-items: center; }
.ring svg { transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--surface-3); }
.ring .val { fill: none; stroke: var(--sage); stroke-linecap: round; }
.ring .val.clay { stroke: var(--clay); }
.ring .val.warn { stroke: var(--warn); }
.ring text { font-family: var(--font-display); fill: var(--ink); }
.ring .cap { font-family: var(--font-sans); fill: var(--muted); font-size: 8px; letter-spacing: 0.06em; }
.ring-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-center b { font-family: var(--font-display); font-size: 22px; font-weight: 400; line-height: 1; display: block; }
.ring-center span { font-size: 8.5px; color: var(--muted); display: block; margin-top: 2px; }

/* 车间 / 模具卡片 ------------------------------------------------------- */
.machine-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.machine {
  border: 1px solid var(--line-soft);
  background: var(--surface);
  border-radius: 13px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.machine:hover { transform: translateY(-2px); border-color: var(--line); }
.machine.is-run { border-top: 2px solid var(--ok); }
.machine.is-warn { border-top: 2px solid var(--warn); }
.machine.is-stop { border-top: 2px solid var(--bad); }
.machine.is-maint { border-top: 2px solid var(--info); }
.machine-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.machine-name { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.machine-model { font-size: 9.5px; color: var(--muted); margin-top: 1px; letter-spacing: 0.02em; }
.machine-num { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--ink); }
.machine-data { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
.machine-data div { background: var(--surface-2); border-radius: 7px; padding: 6px 8px; }
.machine-data span { display: block; font-size: 8.5px; color: var(--muted); letter-spacing: 0.04em; }
.machine-data b { display: block; font-size: 12px; color: var(--ink); font-weight: 500; margin-top: 1px; font-variant-numeric: tabular-nums; }
.machine-foot { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 9.5px; color: var(--muted); }

.mold-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.mold {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface);
  padding: 16px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.mold:hover { transform: translateY(-2px); border-color: var(--line); }
.mold-head { display: flex; justify-content: space-between; gap: 12px; }
.mold-code { font-family: var(--font-display); font-size: 22px; line-height: 1; color: var(--ink); }
.mold-name { font-size: 11px; color: var(--muted); margin-top: 3px; }
.mold-stats { display: flex; gap: 20px; margin-top: 14px; }
.mold-stats span { font-size: 9px; color: var(--muted); display: block; }
.mold-stats b { font-size: 13px; color: var(--ink); font-weight: 500; display: block; margin-top: 1px; font-variant-numeric: tabular-nums; }
.life { margin-top: 13px; }
.life-head { display: flex; justify-content: space-between; font-size: 9.5px; color: var(--muted); margin-bottom: 5px; }

/* 甘特 ------------------------------------------------------------------ */
.gantt { border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: var(--surface); }
.gantt-scroll { overflow-x: auto; }
.gantt-inner { min-width: 880px; }
.gantt-head { display: grid; grid-template-columns: 148px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.gantt-head > div { padding: 9px 10px; font-size: 9.5px; color: var(--muted); letter-spacing: 0.04em; border-left: 1px solid var(--line-soft); }
.gantt-head > div:first-child { border-left: 0; }
.gantt-head b { display: block; font-size: 10.5px; color: var(--ink-2); font-weight: 500; }
.gantt-row { display: grid; grid-template-columns: 148px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); min-height: 46px; position: relative; }
.gantt-row:last-child { border-bottom: 0; }
.gantt-machine { padding: 9px 10px; border-right: 1px solid var(--line-soft); background: var(--surface); position: sticky; left: 0; z-index: 2; }
.gantt-machine b { font-size: 10.5px; font-weight: 500; display: block; color: var(--ink); }
.gantt-machine span { font-size: 8.5px; color: var(--muted); display: block; margin-top: 1px; }
.gantt-cell { border-left: 1px solid var(--line-soft); position: relative; min-height: 46px; }
.gantt-bar {
  position: absolute;
  top: 9px;
  height: 28px;
  border-radius: 6px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  font-size: 9px;
  color: #f7f1e4;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.16s var(--ease), filter 0.16s var(--ease);
  box-shadow: 0 4px 12px -8px rgba(20, 53, 44, 0.5);
}
.gantt-bar:hover { transform: translateY(-1px); filter: brightness(1.08); z-index: 3; }
.gantt-bar.run { background: linear-gradient(100deg, #2e5f4e, #3d755f); }
.gantt-bar.setup { background: linear-gradient(100deg, #a98254, #c09a64); }
.gantt-bar.maint { background: linear-gradient(100deg, #4b6d7d, #5d8393); }
.gantt-bar.warn { background: linear-gradient(100deg, #a9772e, #c08d43); }
.gantt-bar.plan { background: linear-gradient(100deg, #7e9b8a, #93ac9c); }
.gantt-bar span { overflow: hidden; text-overflow: ellipsis; }

/* 热力 / 库位 ----------------------------------------------------------- */
.heat { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; }
.heat i { aspect-ratio: 1; border-radius: 3px; background: var(--surface-3); display: block; transition: transform 0.16s var(--ease); }
.heat i:hover { transform: scale(1.15); }
.heat i.l1 { background: color-mix(in srgb, var(--sage) 28%, var(--surface-3)); }
.heat i.l2 { background: color-mix(in srgb, var(--sage) 48%, var(--surface-3)); }
.heat i.l3 { background: color-mix(in srgb, var(--sage) 70%, var(--surface-3)); }
.heat i.l4 { background: var(--sage); }
.heat i.hot { background: var(--clay); }
.heat-legend { display: flex; align-items: center; gap: 4px; font-size: 9px; color: var(--muted); margin-top: 10px; }
.heat-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

.rack-list { display: flex; flex-direction: column; gap: 9px; }
.rack-row { display: grid; grid-template-columns: 54px 1fr 42px; align-items: center; gap: 10px; font-size: 10px; color: var(--muted); }
.rack-row .bar { height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rack-row .bar i { display: block; height: 100%; border-radius: 4px; }
.rack-row b { font-weight: 500; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

/* 追溯树 ---------------------------------------------------------------- */
.trace-wrap { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; }
.trace-tree { padding: 8px 6px; overflow-x: auto; }
.tree-node { display: flex; align-items: flex-start; gap: 10px; position: relative; padding: 8px 0; }
.tree-node .tree-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--sage); background: var(--surface); flex: none; margin-top: 4px; position: relative; z-index: 1; }
.tree-node.is-clay .tree-dot { border-color: var(--clay); }
.tree-node.is-brass .tree-dot { border-color: var(--brass); }
.tree-node .tree-line { position: absolute; left: 4px; top: 20px; bottom: -8px; width: 1px; background: var(--line); }
.tree-node:last-child .tree-line { display: none; }
.tree-card { flex: 1; border: 1px solid var(--line-soft); border-radius: 9px; padding: 9px 12px; background: var(--surface); min-width: 0; }
.tree-card b { font-size: 11.5px; color: var(--ink); font-weight: 500; display: block; }
.tree-card span { font-size: 9.5px; color: var(--muted); display: block; margin-top: 2px; }
.tree-card .row { margin-top: 6px; }
.tree-children { margin-left: 22px; padding-left: 12px; border-left: 1px dashed var(--line); }

/* 成本 ------------------------------------------------------------------ */
.cost-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 22px; align-items: center; }
.cost-list { display: flex; flex-direction: column; gap: 9px; }
.cost-row { display: flex; align-items: center; gap: 8px; font-size: 10.5px; color: var(--ink-2); }
.cost-row i { width: 7px; height: 7px; border-radius: 2px; flex: none; }
.cost-row span { color: var(--muted); margin-left: auto; font-variant-numeric: tabular-nums; }

/* 设置 ------------------------------------------------------------------ */
.settings-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.setting-row:last-child { border-bottom: 0; }
.setting-row b { font-size: 12px; font-weight: 500; display: block; color: var(--ink); }
.setting-row span { font-size: 10.5px; color: var(--muted); display: block; margin-top: 2px; }
.switch { width: 38px; height: 22px; border-radius: 20px; background: var(--surface-3); border: 1px solid var(--line); position: relative; flex: none; transition: background 0.2s; }
.switch::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.15); transition: transform 0.22s var(--ease); }
.switch.is-on { background: var(--pine-3); border-color: var(--pine-3); }
.switch.is-on::after { transform: translateX(16px); background: #f4eddd; }
[data-theme="dark"] .switch.is-on { background: var(--sage); }
.radio-row { display: flex; gap: 8px; }
.radio-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 6px 10px; font-size: 11px; color: var(--ink-2); }
.radio-btn.is-active { border-color: var(--pine-3); background: var(--pine); color: #f4eddd; }
[data-theme="dark"] .radio-btn.is-active { background: #e6dfcf; color: #18352c; border-color: #e6dfcf; }

/* 报价 ------------------------------------------------------------------ */
.quote-sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 20px; }
.quote-result { background: linear-gradient(160deg, #17392f, #10291f); border-radius: 14px; padding: 20px; color: #f0e8d8; }
.quote-result .label { font-size: 9.5px; letter-spacing: 0.16em; color: rgba(240, 232, 216, 0.5); }
.quote-result .big { font-family: var(--font-display); font-size: 44px; line-height: 1; margin-top: 8px; }
.quote-result .rows { margin-top: 16px; border-top: 1px solid rgba(240, 232, 216, 0.14); padding-top: 10px; display: flex; flex-direction: column; gap: 7px; }
.quote-result .rows div { display: flex; justify-content: space-between; font-size: 10.5px; color: rgba(240, 232, 216, 0.68); }
.quote-result .rows b { color: #efe6d4; font-weight: 500; font-variant-numeric: tabular-nums; }
.slider { -webkit-appearance: none; width: 100%; height: 4px; border-radius: 4px; background: var(--surface-3); outline: 0; }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 15px; height: 15px; border-radius: 50%; background: var(--clay); border: 2px solid var(--surface); box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer; }
.slider::-moz-range-thumb { width: 15px; height: 15px; border-radius: 50%; background: var(--clay); border: 2px solid var(--surface); cursor: pointer; }
.sim-row { margin-bottom: 15px; }
.sim-row label { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--muted); margin-bottom: 7px; }
.sim-row label b { color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }

/* 其他 ------------------------------------------------------------------ */
.list-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 11.5px; }
.list-line:last-child { border-bottom: 0; }
.list-line .grow { flex: 1; min-width: 0; }
.list-line .name { color: var(--ink); font-weight: 500; display: block; }
.list-line .sub { font-size: 9.5px; color: var(--muted); display: block; }
.list-line .val { font-variant-numeric: tabular-nums; color: var(--ink-2); white-space: nowrap; }
.empty { padding: 36px; text-align: center; color: var(--muted); font-size: 11.5px; }
.empty svg { width: 22px; height: 22px; margin: 0 auto 8px; opacity: .4; }
.hr { height: 1px; background: var(--line-soft); margin: 16px 0; }
.kbd { font-size: 9.5px; border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--muted); background: var(--surface-2); }
.scroll-y { overflow-y: auto; scrollbar-width: thin; }
.scroll-y::-webkit-scrollbar { width: 4px; }
.scroll-y::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }

/* 紧凑模式 -------------------------------------------------------------- */
.is-compact table.data td { padding-top: 8px; padding-bottom: 8px; }
.is-compact .kpi { padding: 12px 14px 10px; }
.is-compact .kpi-value { font-size: 29px; }
.is-compact .card-body { padding: 12px 18px 16px; }
.is-compact .machine { padding: 11px; }

/* 响应式 ---------------------------------------------------------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .machine-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1240px) {
  .page { padding: 24px 24px 48px; }
  .topbar { padding: 0 22px; }
  .span-3 { grid-column: span 6; }
  .span-4 { grid-column: span 6; }
  .span-5, .span-7, .span-8, .span-9 { grid-column: span 12; }
  .mold-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quote-sim { grid-template-columns: 1fr; }
  .settings-layout { grid-template-columns: 1fr; }
}
@media (max-width: 1024px) {
  :root { --sidebar-w: 0px; }
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 268px;
    transform: translateX(-102%);
    transition: transform 0.32s var(--ease);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.is-open { transform: none; }
  .menu-toggle, .icon-btn.menu-toggle { display: grid; }
  .sidebar-mask { position: fixed; inset: 0; background: rgba(12, 25, 20, 0.4); z-index: 55; opacity: 0; pointer-events: none; transition: opacity 0.28s; }
  .sidebar-mask.is-open { opacity: 1; pointer-events: auto; }
  .top-date { display: none; }
  .machine-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trace-wrap { grid-template-columns: 1fr; }
  .hero-ring { opacity: 0.45; }
  .span-6 { grid-column: span 12; }
}
@media (max-width: 768px) {
  .page { padding: 20px 16px 40px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .topbar { padding: 0 14px; height: 60px; }
  .top-search { min-width: 0; width: 36px; padding: 0; justify-content: center; }
  .top-search span, .top-search kbd { display: none; }
  .crumb { display: none; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-value { font-size: 30px; }
  .machine-grid { grid-template-columns: 1fr; }
  .mold-grid { grid-template-columns: 1fr; }
  .cost-layout { grid-template-columns: 1fr; }
  .hero-big b { font-size: 52px; }
  .hero-ring { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .page-title { font-size: 28px; }
  .page-head { gap: 14px; margin-bottom: 20px; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
  .span-3, .span-4 { grid-column: span 6; }
}
@media (max-width: 560px) {
  .span-3, .span-4 { grid-column: span 12; }
  .kpi-grid { gap: 9px; }
  .kpi { padding: 12px 13px 11px; }
  .kpi-value { font-size: 26px; }
  .kpi-label { font-size: 10px; }
  .card-head { padding: 15px 15px 0; }
  .card-body { padding: 13px 15px 16px; }
  .toolbar { padding: 10px 14px; }
  .search-field { min-width: 0; flex: 1; }
  .topbar-right .icon-btn:nth-child(2) { display: none; }
  .chip-lang span { display: none; }
  .chip-lang { padding: 0 8px; }
  .page-meta { gap: 10px; }
  .legend { gap: 8px; }
}

/* 动效 ------------------------------------------------------------------ */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
