:root {
  --ink: #17201c;
  --muted: #617069;
  --line: #d9e0dc;
  --paper: #f4f7f4;
  --white: #ffffff;
  --green: #1f6b50;
  --green-dark: #124534;
  --amber: #c7862f;
  --steel: #33443f;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

.quality-page-body {
  background: #050913;
  color: #e5edf8;
}

.quality-page-body .topbar {
  background: rgba(5, 9, 19, 0.92);
  border-bottom-color: rgba(148, 163, 184, 0.18);
  backdrop-filter: blur(18px);
}

.quality-page-body .brand strong,
.quality-page-body .nav a {
  color: #f8fbff;
}

.quality-page-body .brand small {
  color: #9aa7b8;
}

.quality-shell {
  width: min(1320px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.quality-head {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  padding-bottom: 24px;
  margin-bottom: 24px;
}

.quality-head h1 {
  margin: 6px 0 10px;
  color: #f8fbff;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.03;
  letter-spacing: 0;
}

.quality-head p:last-child {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.quality-status {
  min-width: 180px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(15, 23, 42, 0.78);
  padding: 16px 18px;
  text-align: right;
}

.quality-status span,
.quality-panel-title span,
.quality-metrics span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.quality-status strong {
  display: block;
  margin-top: 6px;
  color: #f8fbff;
  font-size: 24px;
}

.quality-status.ok strong {
  color: #39ff88;
}

.quality-status.review strong {
  color: #ffb84d;
}

.quality-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 18px;
  align-items: start;
}

.quality-panel {
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(8, 13, 27, 0.96));
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 20px;
}

.quality-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.quality-panel-title h2,
.quality-rules h2 {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
}

.quality-panel-title button {
  border: 1px solid rgba(57, 255, 136, 0.4);
  background: rgba(57, 255, 136, 0.1);
  color: #dfffe8;
  padding: 8px 12px;
  cursor: pointer;
}

.quality-input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.quality-input-grid label {
  color: var(--muted);
  font-size: 13px;
  display: grid;
  gap: 7px;
}

.quality-input-grid input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.68);
  color: var(--ink);
  padding: 11px 12px;
  font: inherit;
  outline: none;
}

.quality-input-grid input:focus {
  border-color: rgba(57, 255, 136, 0.7);
  box-shadow: 0 0 0 3px rgba(57, 255, 136, 0.08);
}

.quality-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.quality-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.quality-metrics article {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.42);
  padding: 14px;
  min-height: 78px;
}

.quality-metrics strong {
  display: block;
  margin-top: 8px;
  color: #f8fbff;
  font-size: 20px;
  line-height: 1.25;
}

.quality-warning {
  border-left: 3px solid #39ff88;
  background: rgba(57, 255, 136, 0.08);
  color: #dfffe8;
  padding: 11px 12px;
  line-height: 1.7;
  margin: 10px 0 14px;
}

.quality-warning.alert {
  border-left-color: #ffb84d;
  background: rgba(255, 184, 77, 0.1);
  color: #ffe3b3;
}

.quality-table-wrap {
  overflow-x: auto;
}

.quality-table {
  width: 100%;
  border-collapse: collapse;
  color: #e5edf8;
  min-width: 620px;
}

.quality-table th,
.quality-table td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

.quality-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.quality-rules {
  margin-top: 18px;
}

.quality-rule-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.quality-rule-list span {
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(2, 6, 23, 0.34);
  color: var(--muted);
  padding: 12px;
  line-height: 1.55;
}

@media (max-width: 980px) {
  .quality-head,
  .quality-grid {
    grid-template-columns: 1fr;
  }

  .quality-head {
    display: grid;
    align-items: start;
  }

  .quality-status {
    text-align: left;
  }

  .quality-rule-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .quality-shell {
    width: min(100% - 22px, 1320px);
    padding-top: 28px;
  }

  .quality-input-grid,
  .quality-metrics,
  .quality-rule-list {
    grid-template-columns: 1fr;
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 70px;
  padding: 12px clamp(20px, 4vw, 56px);
  background: rgba(244, 247, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--green-dark);
  border-radius: 6px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.nav a {
  padding: 9px 12px;
  border-radius: 6px;
  color: var(--steel);
  font-size: 14px;
}

.nav a:hover {
  background: #e7eee9;
}

.hero {
  position: relative;
  min-height: calc(100vh - 70px);
  overflow: hidden;
  background: #1d2a25;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 22, 18, 0.86), rgba(12, 22, 18, 0.52) 42%, rgba(12, 22, 18, 0.08));
}

.hero-plant-widget {
  position: fixed;
  right: clamp(14px, 3vw, 42px);
  bottom: clamp(18px, 5vh, 44px);
  z-index: 8;
  width: min(20vw, 216px);
  min-width: 144px;
  aspect-ratio: 1 / 1;
  filter: drop-shadow(0 18px 24px rgba(0, 0, 0, 0.28));
  cursor: default;
  user-select: none;
  touch-action: manipulation;
}

.hero-plant-widget.is-hidden {
  display: none;
}

.hero-plant-widget img {
  position: static;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: filter 0.28s ease, opacity 0.28s ease;
}

.plant-widget-close {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.72);
  background: rgba(0, 0, 0, 0.08);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
}

.plant-widget-close:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.18);
}

.plant-second-output {
  position: absolute;
  left: 4px;
  top: 8px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff8d6;
  background: rgba(31, 107, 80, 0.68);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.20);
  font-family: "Comic Sans MS", "Microsoft YaHei", "PingFang SC", cursive, sans-serif;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.26);
  pointer-events: none;
  animation: plantSecondPop 1s ease-out infinite;
  white-space: nowrap;
}

.plant-buff-float {
  position: absolute;
  left: 22%;
  top: 34%;
  z-index: 3;
  color: #fff4a8;
  font-family: "Comic Sans MS", "Microsoft YaHei", "PingFang SC", cursive, sans-serif;
  font-size: 14px;
  font-weight: 900;
  text-shadow:
    0 2px 0 #6b2a00,
    0 0 10px rgba(255, 171, 45, 0.85);
  pointer-events: none;
  animation: plantBuffFloat 0.74s ease-out forwards;
  white-space: nowrap;
}

.plant-combo-burst {
  position: absolute;
  left: 50%;
  top: 42%;
  z-index: 4;
  transform: translate(-50%, -50%) scale(0.76) rotate(-4deg);
  color: #ffe65a;
  font-family: Impact, "Arial Black", "Microsoft YaHei", sans-serif;
  font-size: clamp(22px, 3.2vw, 42px);
  font-style: italic;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 0.95;
  opacity: 0;
  pointer-events: none;
  text-align: center;
  text-shadow:
    2px 2px 0 #6b1400,
    -2px 2px 0 #6b1400,
    2px -2px 0 #6b1400,
    -2px -2px 0 #6b1400,
    0 0 14px rgba(255, 65, 16, 0.95),
    0 8px 18px rgba(0, 0, 0, 0.42);
  -webkit-text-stroke: 1px #8b1a00;
  white-space: nowrap;
}

.plant-combo-burst strong {
  color: #ff4b25;
  margin-left: 4px;
  font-size: 1.18em;
  -webkit-text-stroke: 1px #fff0a4;
}

.hero-plant-widget.combo-active {
  animation: plantWidgetShake 0.16s linear infinite;
}

.hero-plant-widget.combo-active .plant-combo-burst {
  animation: plantComboFlash 0.42s ease-out forwards;
}

.plant-overload-text {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  width: max-content;
  max-width: 190px;
  padding: 8px 12px;
  border-radius: 6px;
  color: #fff;
  background: rgba(18, 22, 22, 0.82);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.34);
}

.hero-plant-widget.is-overloaded {
  animation: none;
  cursor: wait;
}

.hero-plant-widget.is-overloaded img {
  filter: grayscale(1) brightness(0.62);
  opacity: 0.72;
}

.hero-plant-widget.is-overloaded .plant-overload-text {
  opacity: 1;
}

@keyframes plantBuffFloat {
  0% {
    opacity: 0;
    transform: translate(0, 14px) scale(0.82) rotate(-4deg);
  }
  18% {
    opacity: 1;
    transform: translate(-6px, 0) scale(1.08) rotate(3deg);
  }
  100% {
    opacity: 0;
    transform: translate(-18px, -54px) scale(0.96) rotate(-6deg);
  }
}

@keyframes plantComboFlash {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.58) rotate(-8deg);
  }
  32% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.18) rotate(-3deg);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(-4deg);
  }
}

@keyframes plantWidgetShake {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(1px, -1px) rotate(-0.6deg); }
  50% { transform: translate(-1px, 1px) rotate(0.6deg); }
  75% { transform: translate(1px, 1px) rotate(-0.4deg); }
}

@keyframes plantSecondPop {
  0% {
    opacity: 0;
    transform: translate(0, 10px) scale(0.84) rotate(-3deg);
  }
  18% {
    opacity: 1;
    transform: translate(-3px, 0) scale(1.06) rotate(2deg);
  }
  62% {
    opacity: 1;
    transform: translate(-8px, -22px) scale(1) rotate(-1deg);
  }
  100% {
    opacity: 0;
    transform: translate(-12px, -42px) scale(0.92) rotate(3deg);
  }
}

.plant-output-tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 18px);
  transform: translateX(-50%) translateY(8px);
  min-width: 150px;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 6px;
  color: #fff;
  background: rgba(12, 22, 18, 0.88);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28);
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}

.plant-output-tooltip strong {
  color: var(--amber);
  font-size: 18px;
}

.hero-plant-widget:hover .plant-output-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.hero-content {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  min-height: calc(100vh - 70px);
  padding: 80px clamp(22px, 6vw, 86px) 120px;
  color: var(--white);
}

.eyebrow,
.label,
.section-heading p {
  margin: 0 0 12px;
  color: var(--amber);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 720px;
  margin-bottom: 18px;
  font-size: clamp(42px, 5vw, 72px);
  line-height: 1.06;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
}

.hero-copy {
  max-width: 660px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.75;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 700;
}

.primary-button {
  color: var(--white);
  background: var(--green);
}

.primary-button:hover {
  background: #18583f;
}

.secondary-button {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.42);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* --- 宏观仪表盘入口按钮 --- */
.macro-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #0a0e0f 0%, #1a2a2e 100%);
  border: 1px solid #00e6c8;
  box-shadow: 0 0 12px rgba(0, 230, 200, 0.15);
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}
.macro-button:hover {
  background: linear-gradient(135deg, #11181c 0%, #0f2a2e 100%);
  box-shadow: 0 0 24px rgba(0, 230, 200, 0.3);
  border-color: #00ffd8;
  transform: translateY(-1px);
}
.macro-button:active {
  transform: scale(0.97);
}
.macro-icon {
  font-size: 18px;
}
.macro-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 4px;
  background: #ffd740;
  color: #0a0e0f;
  letter-spacing: 0.5px;
  animation: macro-badge-pulse 2s ease-in-out infinite;
}
@keyframes macro-badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- 导航栏宏观入口 --- */
.macro-nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  color: #00e6c8 !important;
  font-weight: 700 !important;
  border: 1px solid transparent;
  transition: all 0.2s ease !important;
}
.macro-nav-link:hover {
  border-color: #00e6c8 !important;
  background: rgba(0, 230, 200, 0.08) !important;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.metric-strip article {
  min-height: 116px;
  padding: 24px clamp(18px, 3vw, 42px);
  border-right: 1px solid var(--line);
}

.metric-strip span {
  display: block;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
}

.metric-strip strong {
  font-size: 32px;
}

.section,
.split-section,
.contact {
  padding: 76px clamp(22px, 5vw, 72px);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 30px;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.module,
.document-layout article {
  display: block;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module:hover,
.folder-list a:hover {
  border-color: rgba(31, 107, 80, 0.42);
  box-shadow: 0 12px 30px rgba(23, 32, 28, 0.08);
  transform: translateY(-2px);
}

.module p,
.split-section p,
.documents p {
  color: var(--muted);
  line-height: 1.7;
}

.icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 22px;
  place-items: center;
  color: var(--white);
  background: var(--steel);
  border-radius: 6px;
  font-weight: 800;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 48px;
  align-items: center;
  background: #e9efeb;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  padding: 13px 16px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.process-panel {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 220px;
  padding: 28px;
  background: var(--green-dark);
  border-radius: 8px;
}

.process-panel div,
.process-panel a {
  display: grid;
  min-height: 76px;
  place-items: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.11);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 6px;
  font-weight: 800;
}

.process-panel a:hover {
  background: rgba(255, 255, 255, 0.2);
}

.process-panel span {
  display: none;
}

.documents {
  background: var(--white);
}

.document-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compact {
  margin-top: 8px;
}

.folder-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.folder-list span,
.folder-list a {
  padding: 12px 14px;
  color: var(--steel);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.page-shell {
  min-height: calc(100vh - 70px);
}

.page-hero {
  padding: 76px clamp(22px, 5vw, 72px) 52px;
  color: var(--white);
  background:
    linear-gradient(90deg, rgba(18, 69, 52, 0.95), rgba(51, 68, 63, 0.88)),
    url("assets/baiyanshan-plant.jpg") center / cover;
}

.module-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  min-height: 300px;
  padding-top: 64px;
  padding-bottom: 46px;
}

.page-hero h1 {
  color: var(--white);
  max-width: 760px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
}

.page-hero p:last-child {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
  line-height: 1.7;
}

.module-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: flex-end;
  min-width: 240px;
}

.page-section {
  padding-top: 34px;
}

.wide-grid {
  grid-template-columns: repeat(3, 1fr);
}

.module-detail {
  display: grid;
  gap: 20px;
}

.module-photo {
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.photo-placeholder {
  display: grid;
  min-height: 260px;
  place-items: center;
  color: var(--muted);
  background: var(--paper);
  border: 1px dashed #aebbb4;
  border-radius: 8px;
  font-weight: 700;
}

.module-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.module-stats article {
  padding: 18px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.module-stats span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

.module-stats strong {
  color: var(--green-dark);
  font-size: 28px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.8fr) minmax(0, 1.2fr);
  gap: 18px;
  align-items: start;
}

.detail-panel {
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.photo-panel {
  position: sticky;
  top: 92px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-title h2 {
  margin: 0;
  font-size: 22px;
}

.panel-title a {
  color: var(--green);
  font-weight: 800;
}

.data-table-wrap,
.admin-table-wrap {
  overflow-x: auto;
  background: var(--white);
  border: 0;
  border-radius: 8px;
}

.data-table,
.admin-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
}

.data-table th,
.data-table td,
.admin-table th,
.admin-table td {
  padding: 14px 13px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.data-table th,
.admin-table th {
  color: var(--steel);
  background: #eef3ef;
  font-size: 14px;
}

.data-table td {
  color: var(--steel);
  line-height: 1.6;
}

.data-table tbody tr:hover {
  background: #f7faf8;
}

.quality-dashboard {
  display: grid;
  gap: 16px;
}

.quality-summary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.quality-summary-grid article {
  min-height: 116px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf8;
}

.quality-summary-grid article span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.quality-summary-grid article strong {
  display: block;
  color: var(--green-dark);
  font-size: 24px;
  line-height: 1.2;
}

.quality-summary-grid article small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.quality-verdict-card.good {
  border-color: rgba(31, 107, 80, 0.28);
  background: #edf7f1;
}

.quality-verdict-card.warn {
  border-color: rgba(204, 134, 44, 0.34);
  background: #fff7e8;
}

.quality-verdict-card.bad {
  border-color: rgba(180, 67, 52, 0.34);
  background: #fff0ec;
}

.quality-verdict-card.bad strong {
  color: #a23b2d;
}

.quality-verdict-card.warn strong {
  color: #a76920;
}

.quality-chart-wrap {
  height: 360px;
  padding: 10px 12px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f7faf8 100%);
}

.quality-chart-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.quality-reasons {
  border-left: 4px solid var(--green);
  border-radius: 8px;
  padding: 14px 16px;
  background: #f5faf6;
  color: var(--steel);
}

.quality-reasons.warn {
  border-left-color: #c9892d;
  background: #fff8ea;
}

.quality-reasons.bad {
  border-left-color: #b44334;
  background: #fff1ed;
}

.quality-reasons b {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
}

.quality-reasons p {
  margin: 6px 0 0;
  color: var(--steel);
  line-height: 1.65;
}

.empty-state {
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.admin-shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 48px 22px;
}

.wide-admin {
  max-width: 1280px;
}

.admin-panel {
  padding: 30px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.admin-panel h1 {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 30px;
}

.admin-panel p {
  color: var(--muted);
  line-height: 1.7;
}

.admin-form {
  display: grid;
  gap: 18px;
  margin-top: 26px;
}

.password-line {
  max-width: 420px;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.tab-button,
.table-delete {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--steel);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.tab-button.active {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
}

.tab-panel {
  display: none;
  gap: 18px;
}

.tab-panel.active {
  display: grid;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.panel-heading h2 {
  margin-bottom: 6px;
  font-size: 26px;
}

.photo-uploader {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.excel-import {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(260px, 0.7fr) auto;
  gap: 16px;
  align-items: end;
  padding: 18px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.excel-import h2 {
  margin-bottom: 6px;
  font-size: 24px;
}

.excel-import p {
  margin-bottom: 0;
}

.photo-uploader label {
  min-width: min(360px, 100%);
}

.photo-uploader span {
  color: var(--muted);
  font-weight: 700;
}

.data-date-info {
  margin: 0;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
}
.data-date-info.has-data {
  background: #e7f4ed;
  border-color: #b8d9c6;
  color: #1a6d46;
}
.data-date-info strong {
  color: #0e5435;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--steel);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid #cfd8d3;
  border-radius: 6px;
  font: inherit;
}

input:focus {
  outline: 2px solid rgba(31, 107, 80, 0.18);
  border-color: var(--green);
}

.admin-table input {
  min-width: 140px;
}

.table-delete {
  color: #b42318;
}

.staff-section {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding: 20px;
  background: #f0f5f2;
  border: 1px solid #d0ddd5;
  border-radius: 10px;
}

.staff-header h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--green-dark);
}

.staff-header p {
  margin: 0 0 14px;
  font-size: 0.85rem;
  color: var(--muted);
}

.staff-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.staff-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.staff-message {
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 20px;
}

.staff-message.success {
  color: var(--green);
}

.staff-message.error {
  color: #b42318;
}

/* --- 密码验证状态 --- */
.pwd-verify-status {
  font-size: 0.85rem;
  font-weight: 600;
  margin-left: 8px;
  min-height: 20px;
  display: inline-block;
}

.pwd-verify-status.success {
  color: var(--green);
}

.pwd-verify-status.error {
  color: #b42318;
}

.password-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.password-line input[type="password"] {
  max-width: 220px;
}

/* --- 一键更新按钮状态 --- */
.local-update-status {
  font-size: 0.9rem;
  font-weight: 600;
  min-height: 20px;
  margin-left: 12px;
  white-space: pre-line;
}

.local-update-status.success {
  color: var(--green);
}

.local-update-status.error {
  color: #b42318;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.admin-message {
  min-height: 24px;
  margin: 0;
  font-weight: 700;
}

.admin-message.success {
  color: var(--green);
}

.admin-message.error {
  color: #b42318;
}

.light {
  color: var(--green-dark);
  border-color: var(--line);
}

code {
  padding: 2px 6px;
  background: var(--paper);
  border-radius: 4px;
}

.contact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--white);
  background: var(--steel);
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.contact-grid span {
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 6px;
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav {
    justify-content: flex-start;
  }

  .metric-strip,
  .module-grid,
  .wide-grid,
  .module-stats,
  .excel-import,
  .split-section,
  .document-layout {
    grid-template-columns: 1fr 1fr;
  }

  .split-section {
    align-items: stretch;
  }

  .process-panel {
    grid-column: 1 / -1;
  }

  .module-hero,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .quality-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .module-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .photo-panel {
    position: static;
  }

  .hero-plant-widget {
    right: 14px;
    bottom: 18px;
    width: min(24vw, 168px);
    min-width: 132px;
    opacity: 0.92;
  }
}

@media (max-width: 640px) {
  .brand {
    min-width: 0;
  }

  .hero {
    min-height: 720px;
  }

  .hero-content {
    min-height: 720px;
    padding-bottom: 92px;
  }

  .hero-plant-widget {
    right: 10px;
    bottom: 14px;
    width: min(34vw, 136px);
    min-width: 112px;
    opacity: 0.9;
  }

  .plant-output-tooltip {
    bottom: calc(100% - 8px);
  }

  .plant-second-output {
    font-size: 12px;
    padding: 3px 7px;
  }

  .plant-combo-burst {
    font-size: 20px;
  }

  .plant-overload-text {
    max-width: 132px;
    padding: 7px 9px;
    font-size: 12px;
  }

  .metric-strip,
  .module-grid,
  .wide-grid,
  .module-stats,
  .quality-summary-grid,
  .excel-import,
  .split-section,
  .document-layout,
  .folder-list,
  .process-panel,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .metric-strip article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .contact {
    align-items: flex-start;
    flex-direction: column;
  }
}
/* A11Y: Focus visible */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--green) !important;
  outline-offset: 2px !important;
}
/* Skip to content */
.skip-link { position: absolute; top: -100px; left: 0; z-index: 100; padding: 8px 16px; background: var(--green); color: #fff; font-weight: 700; transition: top 0.2s; }
.skip-link:focus { top: 0; }
/* Skeleton loading */
@keyframes skeleton-loading { 0%{opacity:0.6} 50%{opacity:1} 100%{opacity:0.6} }
.metric-strip[aria-label="生产指标"] b[data-field] { animation: skeleton-loading 1.5s ease-in-out infinite; }
.metric-strip[aria-label="生产指标"] b[data-field]:not(:empty) { animation: none; }
/* Save flash */
@keyframes flash-green { 0%{background-color:rgba(31,107,80,0.12)} 100%{background-color:transparent} }
.admin-table tr.flash { animation: flash-green 1s ease-out; }

/* ============================================================
   UX/交互/动画 增强 (2026-05-14)
   ============================================================ */

/* --- 1.1 滚动入场动画 (Scroll Reveal) --- */
@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in-scale {
  from { opacity: 0; transform: scale(0.92); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-30px); }
  to   { opacity: 1; transform: translateX(0); }
}

.reveal {
  opacity: 0;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
}
.reveal-fade-up.visible {
  animation: fade-in-up 0.6s ease forwards;
}
.reveal-scale.visible {
  animation: fade-in-scale 0.5s ease forwards;
}
.reveal-slide-left.visible {
  animation: slide-in-left 0.5s ease forwards;
}

/* Stagger children */
.stagger-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0.05s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(2) { transition-delay: 0.10s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(3) { transition-delay: 0.15s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(4) { transition-delay: 0.20s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(5) { transition-delay: 0.25s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(6) { transition-delay: 0.30s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(7) { transition-delay: 0.35s; opacity: 1; transform: translateY(0); }
.stagger-children.visible > *:nth-child(8) { transition-delay: 0.40s; opacity: 1; transform: translateY(0); }

/* --- 1.2 按钮微动效 --- */
.primary-button, .secondary-button, .tab-button {
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.primary-button:active, .secondary-button:active {
  transform: scale(0.97);
}
.primary-button::after, .secondary-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.15);
  opacity: 0;
  transition: opacity 0.3s;
}
.primary-button:active::after, .secondary-button:active::after {
  opacity: 1;
}

/* Ripple effect */
.ripple {
  position: relative;
  overflow: hidden;
}
.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s, opacity 0.6s;
}
.ripple:active::before {
  width: 300px;
  height: 300px;
  opacity: 0;
}

/* --- 1.3 数字计数器动画 --- */
@keyframes count-up {
  from { opacity: 0.4; }
  to   { opacity: 1; }
}
.counter-animate {
  animation: count-up 0.8s ease;
  display: inline-block;
}

/* --- 1.4 加载骨架屏增强 --- */
@keyframes shimmer {
  0%   { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton-shimmer {
  display: inline-block;
  min-width: 60px;
  min-height: 1.2em;
  background: linear-gradient(90deg, #e7eee9 25%, #f4f7f4 50%, #e7eee9 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

/* --- 1.5 Toast 通知组件 --- */
.toast-container {
  position: fixed;
  top: 88px;
  right: 20px;
  z-index: 9999;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(23,32,28,0.12);
  font-weight: 700;
  pointer-events: auto;
  animation: toast-in 0.35s ease forwards;
  max-width: 400px;
}
.toast.success { border-left: 4px solid var(--green); color: var(--ink); }
.toast.error   { border-left: 4px solid #b42318; color: #b42318; }
.toast.info    { border-left: 4px solid var(--amber); color: var(--steel); }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(60px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(60px); }
}
.toast.removing {
  animation: toast-out 0.3s ease forwards;
}

/* --- 1.6 确认对话框 (自定义 Modal) --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: grid;
  place-items: center;
  background: rgba(23,32,28,0.45);
  animation: modal-overlay-in 0.25s ease;
}
@keyframes modal-overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.modal-box {
  max-width: 420px;
  width: 90vw;
  padding: 28px 30px 22px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(23,32,28,0.18);
  animation: modal-in 0.3s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-box h3 {
  margin-bottom: 10px;
  font-size: 20px;
}
.modal-box p {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.6;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* --- 1.7 进度条指示器 --- */
.progress-bar {
  width: 100%;
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar-fill {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.4s ease;
}
.progress-bar-fill.indeterminate {
  width: 30%;
  animation: progress-indeterminate 1.5s ease infinite;
}
@keyframes progress-indeterminate {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(400%); }
}

/* --- 1.8 导航高亮增强 --- */
.nav a.active {
  background: rgba(31,107,80,0.1);
  color: var(--green);
  font-weight: 800;
}

/* --- 1.9 空状态美化 --- */
.empty-state-icon {
  display: grid;
  place-items: center;
  padding: 40px 20px;
  color: var(--muted);
  text-align: center;
}
.empty-state-icon .icon-big {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 12px;
}
.empty-state-icon p {
  max-width: 300px;
  margin: 0 auto;
  color: var(--muted);
}

/* --- 1.10 平滑滚动增强 --- */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- 1.11 加载状态微调 --- */
.loading-dots::after {
  content: '';
  animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
  100% { content: ''; }
}

/* ============================================================
   移动端优化 (2026-05-15)
   ============================================================ */

/* --- 2.1 全局触摸优化 --- */
* {
  -webkit-tap-highlight-color: transparent;
  tap-highlight-color: transparent;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  /* 防止 iOS 上输入框被缩放 */
  -webkit-text-size-adjust: 100%;
}

/* 所有按钮/链接最小触摸区域 44px */
button,
a,
input[type="button"],
input[type="submit"],
input[type="reset"],
.nav a,
.module,
.folder-list a,
.primary-button,
.secondary-button,
.tab-button,
.table-delete,
.process-panel a {
  min-height: 44px;
  min-width: 44px;
}

/* 修复 .compact 等内联按钮 */
.compact {
  min-height: 44px;
}

/* --- 2.2 安全区域适配 (刘海屏) --- */
.topbar {
  padding-top: calc(12px + var(--safe-top));
  padding-left: calc(clamp(20px, 4vw, 56px) + var(--safe-left));
  padding-right: calc(clamp(20px, 4vw, 56px) + var(--safe-right));
}

.contact {
  padding-bottom: calc(76px + var(--safe-bottom));
}

.toast-container {
  top: calc(88px + var(--safe-top));
  right: calc(20px + var(--safe-right));
}

/* --- 2.3 汉堡菜单按钮 (桌面隐藏) --- */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 0;
  margin-left: auto;
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: var(--steel);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}
.hamburger.active span:nth-child(2) {
  opacity: 0;
}
.hamburger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* 导航遮罩 */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 8;
  background: rgba(23, 32, 28, 0.45);
  animation: modal-overlay-in 0.25s ease;
}

/* --- 2.4 移动端弹窗/全屏导航 --- */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-overlay {
    display: none;
  }
  .nav-overlay.visible {
    display: block;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -280px;
    z-index: 9;
    flex-direction: column;
    width: 260px;
    height: 100vh;
    height: calc(100vh - var(--safe-top) - var(--safe-bottom));
    padding: calc(80px + var(--safe-top)) 20px 20px;
    background: var(--white);
    border-left: 1px solid var(--line);
    box-shadow: -4px 0 24px rgba(23, 32, 28, 0.12);
    transition: right 0.3s ease;
    overflow-y: auto;
    gap: 4px;
  }

  .nav.open {
    right: 0;
  }

  .nav a {
    font-size: 16px;
    padding: 14px 12px;
    border-radius: 8px;
    border-bottom: 1px solid var(--line);
    min-height: 52px;
    display: flex;
    align-items: center;
  }

  .nav a:last-child {
    border-bottom: none;
  }

  .nav a:hover,
  .nav a:active {
    background: var(--paper);
  }

  .nav a.active {
    background: rgba(31, 107, 80, 0.1);
    color: var(--green);
    font-weight: 800;
  }
}

/* --- 2.5 480px 以下断点增强 --- */
@media (max-width: 480px) {
  .topbar {
    min-height: 60px;
    padding: 8px 14px;
    padding-top: calc(8px + var(--safe-top));
    padding-left: calc(14px + var(--safe-left));
    padding-right: calc(14px + var(--safe-right));
  }

  .brand {
    min-width: 0;
    gap: 8px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }

  .brand strong {
    font-size: 14px;
    line-height: 1.3;
  }

  .brand small {
    font-size: 11px;
  }

  .hero {
    min-height: 100vh;
    min-height: calc(100vh - 60px);
  }

  .hero-content {
    min-height: 100vh;
    min-height: calc(100vh - 60px);
    padding: 60px 18px 80px;
    justify-content: flex-end;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(12, 22, 18, 0.30) 0%, rgba(12, 22, 18, 0.85) 100%);
  }

  h1 {
    font-size: clamp(28px, 8vw, 42px);
    line-height: 1.12;
    margin-bottom: 14px;
  }

  .hero-copy {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 22px;
  }

  .eyebrow,
  .label,
  .section-heading p {
    font-size: 12px;
    margin-bottom: 8px;
  }

  h2 {
    font-size: clamp(22px, 6vw, 28px);
    line-height: 1.2;
  }

  .hero-actions {
    flex-direction: column;
    gap: 10px;
  }

  .hero-actions .primary-button,
  .hero-actions .secondary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 16px;
  }

  .section,
  .split-section,
  .contact {
    padding: 42px 16px;
  }

  .split-section {
    padding: 42px 16px;
    gap: 28px;
  }

  .metric-strip article {
    min-height: 80px;
    padding: 14px 18px;
  }

  .metric-strip span {
    font-size: 12px;
    margin-bottom: 8px;
  }

  .metric-strip strong {
    font-size: 24px;
  }

  .module-grid {
    gap: 12px;
  }

  .module {
    padding: 18px;
  }

  .module h3 {
    font-size: 17px;
    margin-bottom: 6px;
  }

  .module p {
    font-size: 14px;
  }

  .icon {
    width: 38px;
    height: 38px;
    margin-bottom: 14px;
    font-size: 14px;
  }

  .process-panel {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    min-height: auto;
    padding: 16px;
  }

  .process-panel a {
    min-height: 56px;
    font-size: 13px;
    padding: 8px;
    text-align: center;
  }

  /* 文档区全宽按钮 */
  .document-layout .compact {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .section-heading {
    margin-bottom: 20px;
  }

  .document-layout {
    gap: 12px;
  }

  .document-layout article {
    padding: 18px;
  }

  .document-layout h3 {
    font-size: 17px;
  }

  .folder-list {
    gap: 8px;
  }

  .folder-list a,
  .folder-list span {
    padding: 10px 12px;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .contact-grid {
    flex-direction: column;
    width: 100%;
  }

  .contact-grid span {
    width: 100%;
    font-size: 14px;
    padding: 14px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }

  .contact-grid b {
    margin-left: 4px;
  }

  .check-list li {
    font-size: 14px;
    padding: 12px 14px;
  }

  .process-panel {
    grid-column: 1 / -1;
  }

  /* Toast 移动端全宽 */
  .toast-container {
    top: calc(72px + var(--safe-top));
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
    padding: 14px 16px;
    font-size: 14px;
    min-height: 50px;
  }
}

/* --- 2.6 375px 以下超小屏 --- */
@media (max-width: 380px) {
  .hero-content {
    padding: 40px 14px 70px;
  }

  h1 {
    font-size: clamp(24px, 7vw, 28px);
  }

  .hero-copy {
    font-size: 14px;
  }

  .topbar {
    padding: 6px 10px;
    padding-top: calc(6px + var(--safe-top));
    padding-left: calc(10px + var(--safe-left));
    padding-right: calc(10px + var(--safe-right));
  }

  .brand strong {
    font-size: 13px;
  }

  .process-panel {
    grid-template-columns: repeat(3, 1fr);
    padding: 12px;
    gap: 6px;
  }

  .process-panel a {
    min-height: 48px;
    font-size: 12px;
    padding: 6px;
    text-align: center;
  }

  .section,
  .split-section,
  .contact {
    padding: 32px 12px;
  }

  .metric-strip article {
    padding: 12px 14px;
    min-height: 72px;
  }

  .metric-strip strong {
    font-size: 20px;
  }

  .module-grid {
    gap: 10px;
  }

  .module {
    padding: 14px;
  }

  .nav {
    width: 240px;
    right: -240px;
  }
}

/* --- 2.7 表格横向滚动提示 --- */
.data-table-wrap::before {
  content: '← 左右滑动查看完整表格 →';
  display: none;
  padding: 8px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

@media (max-width: 768px) {
  .data-table-wrap {
    position: relative;
  }
  .data-table-wrap::before {
    display: block;
  }
  .data-table-wrap:active::before,
  .data-table-wrap:hover::before {
    opacity: 0.6;
  }
  .data-table {
    min-width: 640px;
  }
}

/* --- 2.8 后台管理页移动端 --- */
@media (max-width: 768px) {
  .admin-shell {
    padding: 28px 12px;
  }

  .admin-panel {
    padding: 20px 16px;
  }

  .admin-panel h1 {
    font-size: 24px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  label {
    font-size: 14px;
  }

  input {
    min-height: 48px;
    font-size: 16px; /* 防止 iOS 缩放 */
    padding: 0 14px;
  }

  .admin-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 6px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .admin-tabs::-webkit-scrollbar {
    display: none;
  }

  .tab-button {
    white-space: nowrap;
    font-size: 13px;
    padding: 0 12px;
    min-height: 38px;
  }

  .excel-import {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .excel-import h2 {
    font-size: 18px;
  }

  .excel-import .primary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .photo-uploader {
    flex-direction: column;
    align-items: stretch;
  }

  .photo-uploader label {
    min-width: 0;
  }

  .photo-uploader .primary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .admin-table {
    min-width: 560px;
  }

  .admin-table input {
    min-width: 80px;
    min-height: 44px;
    font-size: 14px;
  }

  .panel-heading {
    flex-direction: column;
    gap: 12px;
  }

  .panel-heading h2 {
    font-size: 20px;
  }

  .panel-heading .secondary-button.light {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .staff-section {
    padding: 14px;
  }

  .staff-fields {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .staff-actions {
    flex-direction: column;
  }

  .staff-actions .secondary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  .admin-actions {
    flex-direction: column;
    gap: 10px;
  }

  .admin-actions .primary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 16px;
  }

  .password-line {
    max-width: 100%;
  }

  /* 后台tab按钮触摸优化 */
  .tab-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  /* 删除按钮触摸优化 */
  .table-delete {
    min-height: 44px;
    min-width: 44px;
    padding: 0 16px;
  }
}

/* --- 2.9 模块详情页移动端 --- */
@media (max-width: 768px) {
  .page-hero {
    padding: 52px 16px 36px;
  }

  .module-hero {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    min-height: auto;
    padding-top: 36px;
    padding-bottom: 30px;
  }

  .module-hero h1 {
    font-size: clamp(24px, 6vw, 34px);
  }

  .module-hero-actions {
    width: 100%;
    justify-content: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .module-hero-actions .primary-button,
  .module-hero-actions .secondary-button {
    width: 100%;
    justify-content: center;
    min-height: 48px;
    font-size: 15px;
  }

  .module-stats {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .module-stats article {
    padding: 14px 16px;
  }

  .module-stats strong {
    font-size: 22px;
  }

  .module-stats span {
    font-size: 13px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .detail-panel {
    padding: 16px;
  }

  .photo-panel {
    position: static;
  }

  .module-photo {
    max-height: 240px;
  }

  .page-section {
    padding-top: 24px;
  }
}

/* --- 2.10 底部留白防止遮挡 --- */
@media (max-width: 768px) {
  .section:last-of-type,
  .contact:last-of-type {
    padding-bottom: calc(42px + var(--safe-bottom));
  }
}

/* ═══════════════════════════════════════════════
   3.0 生产趋势图表
   ═══════════════════════════════════════════════ */
.chart-section {
  scroll-margin-top: 80px;
}

.chart-container {
  margin-top: 12px;
  padding: 24px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.chart-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.chart-tab {
  padding: 6px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-tab:hover {
  border-color: var(--green);
  color: var(--green);
}

.chart-tab.active {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
}

.chart-wrap {
  position: relative;
  width: 100%;
  max-height: 360px;
}

.chart-wrap canvas {
  display: block;
  width: 100% !important;
  max-height: 360px;
}

.chart-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ── 图表 skeleton 加载状态 ── */
.chart-skeleton {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 6px;
  height: 200px;
  padding: 20px 0;
}

.chart-skeleton-bar {
  width: 20px;
  background: #e7eee9;
  border-radius: 4px 4px 0 0;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* ── 无数据时 ── */
.chart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 200px;
  color: var(--muted);
  font-size: 14px;
}

.chart-empty-icon {
  font-size: 36px;
  opacity: 0.6;
}

@media (max-width: 768px) {
  .chart-container {
    padding: 16px;
    margin-left: -4px;
    margin-right: -4px;
    border-radius: 8px;
  }

  .chart-wrap {
    max-height: 260px;
  }

  .chart-wrap canvas {
    max-height: 260px;
  }

  .chart-tab {
    padding: 5px 12px;
    font-size: 12px;
  }
}

/* ─── 语言切换器 ───────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  padding: 0 8px;
  flex-shrink: 0;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
}

.lang-btn:hover {
  color: var(--ink);
  background: rgba(0,0,0,0.04);
}

.lang-btn.active {
  color: var(--white);
  background: var(--green);
  border-color: var(--green);
  font-weight: 600;
}

.lang-btn.active:hover {
  background: var(--green-dark);
}

@media (max-width: 768px) {
  .topbar {
    position: relative;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    overflow: visible;
  }

  .lang-btn {
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 4px;
    min-height: 32px;
    min-width: 36px;
  }

  .lang-btn:hover {
    background: rgba(31,107,80,0.08);
  }

  .lang-btn.active {
    color: var(--white);
    background: var(--green);
    border-color: var(--green);
    font-weight: 700;
  }

  .topbar .lang-switcher {
    display: flex;
    position: static;
    top: auto;
    right: auto;
    transform: none;
    margin-left: auto;
    gap: 2px;
    z-index: 15;
    flex-shrink: 0;
  }
}

/* ─── 登录按钮（topbar 中） ────────────────────────────── */
.auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: 1px solid var(--green);
  border-radius: 4px;
  background: transparent;
  color: var(--green);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  line-height: 1.4;
  font-weight: 500;
  margin: 0 4px;
  flex-shrink: 0;
}
.auth-btn:hover {
  background: var(--green);
  color: var(--white);
}
.auth-btn.logged-in {
  background: var(--green);
  color: var(--white);
}
.auth-btn.logged-in:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

@media (max-width: 768px) {
  .auth-btn {
    padding: 5px 8px;
    font-size: 11px;
    margin: 0 2px;
    min-height: 32px;
    min-width: 56px;
  }
}

/* ─── 登录模态框 ────────────────────────────────────────── */
.auth-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(23,32,28,0.5);
  align-items: center;
  justify-content: center;
  animation: modal-overlay-in 0.2s ease;
}
.auth-modal-overlay.active {
  display: flex;
}
.auth-modal {
  background: var(--white);
  border-radius: 12px;
  padding: 32px;
  max-width: 380px;
  width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  animation: modal-in 0.25s ease;
  position: relative;
}
.auth-modal h2 {
  margin: 0 0 4px;
  font-size: 20px;
  color: var(--ink);
}
.auth-modal p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.auth-modal .auth-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}
.auth-modal .auth-input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(31,107,80,0.12);
}
.auth-modal .auth-error {
  color: #b42318;
  font-size: 12px;
  margin: 8px 0 0;
  display: none;
}
.auth-modal .auth-error.show {
  display: block;
}
.auth-modal .auth-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.auth-modal .auth-actions button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}
.auth-modal .auth-btn-primary {
  background: var(--green);
  color: var(--white);
}
.auth-modal .auth-btn-primary:hover {
  background: var(--green-dark);
}
.auth-modal .auth-btn-cancel {
  background: var(--paper);
  color: var(--muted);
}
.auth-modal .auth-btn-cancel:hover {
  background: var(--line);
}

/* 登录模态框移动端适配 */
@media (max-width: 480px) {
  .auth-modal {
    padding: 24px 20px;
    max-width: 92vw;
  }

  .auth-modal h2 {
    font-size: 18px;
  }

  .auth-modal .auth-actions button {
    min-height: 48px;
    font-size: 15px;
    padding: 12px;
  }
}

/* ─── 受保护区域遮罩 ───────────────────────────────────── */
.protected-overlay {
  position: relative;
}
.protected-overlay::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(244,247,244,0.85);
  backdrop-filter: blur(4px);
  border-radius: inherit;
}
.protected-overlay .protected-hint {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--muted);
  font-weight: 500;
  pointer-events: none;
}
.protected-overlay .protected-hint::before {
  content: '🔒 ';
  margin-right: 6px;
}

/* 导航打开时隐藏语言切换器和登录按钮（移动端） */
.nav.open ~ .lang-switcher,
.nav.open + .lang-switcher,
.nav.open ~ .auth-btn,
.nav.open + .auth-btn {
  display: none;
}

/* 移动端 — hero 区域宏观按钮 */
@media (max-width: 768px) {
.macro-button {
  width: 100%;
  justify-content: center;
}
.macro-badge {
  margin-left: auto;
}
}

/* 移动端 topbar 元素紧凑排列防止溢出 */
@media (max-width: 768px) {
  .topbar {
    flex-wrap: nowrap;
    overflow: visible;
  }

  .topbar .auth-btn {
    order: 1;
    flex-shrink: 0;
  }

  .topbar .lang-switcher {
    position: static;
    top: auto;
    right: auto;
    transform: none;
    order: 1;
    margin-left: auto;
    margin-right: 4px;
    flex-shrink: 0;
    gap: 2px;
    z-index: 15;
  }

  .topbar .hamburger {
    order: 2;
    flex-shrink: 0;
    margin-left: 0;
  }

  .topbar .brand {
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    margin-right: auto;
    gap: 6px;
  }

  .topbar .brand strong {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 30vw;
  }

  .topbar .brand small {
    display: none;
  }

  .topbar .brand-mark {
    flex-shrink: 0;
  }
}

/* 模块卡片移动端全宽按钮 */
@media (max-width: 480px) {
  .hero-actions .primary-button,
  .hero-actions .secondary-button,
  .hero-actions .macro-button {
    width: 100%;
    justify-content: center;
  }

  .document-layout article .primary-button.compact {
    width: 100%;
    justify-content: center;
  }

  .check-list li {
    font-size: 13px;
    padding: 12px 14px;
    line-height: 1.5;
  }

  /* 模块页面的相关操作卡片按钮全宽 */
  .documents .primary-button.compact {
    width: 100%;
    justify-content: center;
    min-height: 48px;
  }

  /* 处理选厂流程在超小屏适配 */
  .process-panel {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 769px) {
  .topbar {
    position: relative;
  }

  .lang-switcher {
    margin-left: 0;
    order: 10;
  }

  .lang-btn {
    padding: 5px 10px;
    font-size: 13px;
  }
}

/* ═══════════════════════════════════════════════
   AI 助手浮动按钮 & 聊天面板
   ═══════════════════════════════════════════════ */
.ai-float-btn {
  position: fixed;
  left: 20px;
  right: auto;
  bottom: 20px;
  z-index: 999;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, #112033 0%, #081018 72%);
  color: #fff;
  border: 2px solid rgba(66, 220, 255, 0.55);
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(18, 69, 52, 0.35), 0 0 18px rgba(66, 220, 255, 0.22);
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: all 0.25s ease;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
  padding: 0;
}
.ai-float-icon {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  pointer-events: none;
}
.ai-float-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 10px 30px rgba(18, 69, 52, 0.45), 0 0 26px rgba(66, 220, 255, 0.34);
}
.ai-float-btn:active {
  transform: scale(0.95);
}
.ai-float-btn .ai-pulse-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #00e6c8;
  box-shadow: 0 0 8px rgba(0, 230, 200, 0.6);
  animation: aiPulse 2s ease-in-out infinite;
}
@keyframes aiPulse {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

/* AI 助手 iframe 弹出面板 */
.ai-chat-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(23, 32, 28, 0.45);
  animation: modal-overlay-in 0.2s ease;
}
.ai-chat-overlay.active {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding-left: 86px;
}
.ai-chat-panel {
  width: min(92vw, 480px);
  height: min(85vh, 700px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(23, 32, 28, 0.22);
  animation: modal-in 0.3s ease;
  display: flex;
  flex-direction: column;
}
.ai-chat-panel iframe {
  width: 100%;
  height: 100%;
  border: none;
  flex: 1;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .ai-float-btn {
    left: 14px;
    right: auto;
    bottom: 14px;
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  .ai-chat-panel {
    width: 100vw;
    height: 100vh;
    height: calc(100vh - var(--safe-bottom, 0px));
    border-radius: 0;
  }
  .ai-chat-overlay.active {
    padding-left: 0;
  }
}
