/* ================================================================
   LED工具箱 · 艾比森橙风格门户样式
   核心特征: 磨砂导航 / Banner英雄区 / 卡片悬浮 / 波形装饰 / 统计面板
   ================================================================ */

/* ==============================
   CSS 变量 — 艾比森橙 为主色调
   ============================== */
:root {
  /* -- 浅色模式 (默认) -- */
  --bg: #fcfaf7;
  --bg-secondary: #ffffff;
  --bg-tertiary: #faf3eb;
  --card-bg: rgba(255, 255, 255, 0.82);
  --card-bg-hover: rgba(255, 255, 255, 0.95);
  --card-border: rgba(0, 0, 0, 0.06);
  --card-border-hover: rgba(243, 152, 0, 0.25);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);

  --text: #1e293b;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* 艾比森橙主色系 */
  --primary: #f39800;
  --primary-dark: #d48400;
  --primary-light: #f5b840;
  --primary-glow: rgba(243, 152, 0, 0.12);

  --accent-purple: #f39800;
  --accent-green: #e8a020;
  --accent-orange: #f39800;
  --accent-pink: #ff6b35;
  --accent-rose: #e87d00;

  --header-bg: rgba(255, 255, 255, 0.78);
  --header-border: rgba(0, 0, 0, 0.06);
  --header-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);

  --nav-hover-bg: rgba(243, 152, 0, 0.06);
  --nav-active-bg: rgba(243, 152, 0, 0.1);

  --status-bg: rgba(252, 250, 247, 0.6);
  --status-border: rgba(0, 0, 0, 0.05);

  --tag-bg: rgba(243, 152, 0, 0.04);
  --tag-border: rgba(0, 0, 0, 0.05);

  --btn-outline-border: rgba(0, 0, 0, 0.1);
  --btn-outline-hover: rgba(243, 152, 0, 0.06);

  --radius: 18px;
  --radius-sm: 10px;
  --radius-xs: 6px;
  --transition: 0.28s cubic-bezier(0.4, 0, 0.2, 1);

  --banner-gradient: linear-gradient(135deg, #f39800 0%, #e87d00 50%, #ff6b35 100%);
  --banner-gradient-soft: linear-gradient(135deg, rgba(243,152,0,0.08) 0%, rgba(232,125,0,0.08) 50%, rgba(255,107,53,0.06) 100%);

  --grid-color: rgba(0, 0, 0, 0.03);
}

/* ---- 深色模式 ---- */
[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-secondary: #0f172a;
  --bg-tertiary: #131b2e;
  --card-bg: rgba(15, 23, 42, 0.85);
  --card-bg-hover: rgba(20, 30, 55, 0.95);
  --card-border: rgba(71, 85, 105, 0.3);
  --card-border-hover: rgba(243, 152, 0, 0.4);
  --card-shadow: 0 2px 12px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.15);
  --card-shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.4), 0 4px 12px rgba(0, 0, 0, 0.2);

  --text: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #ffffff;

  --primary: #f5b840;
  --primary-dark: #f39800;
  --primary-light: #ffcc80;
  --primary-glow: rgba(243, 152, 0, 0.15);

  --header-bg: rgba(11, 15, 26, 0.82);
  --header-border: rgba(71, 85, 105, 0.25);
  --header-shadow: 0 1px 20px rgba(0, 0, 0, 0.25);

  --nav-hover-bg: rgba(255, 255, 255, 0.05);
  --nav-active-bg: rgba(243, 152, 0, 0.15);

  --status-bg: rgba(11, 15, 26, 0.45);
  --status-border: rgba(71, 85, 105, 0.2);

  --tag-bg: rgba(255, 255, 255, 0.04);
  --tag-border: rgba(71, 85, 105, 0.18);

  --btn-outline-border: rgba(71, 85, 105, 0.35);
  --btn-outline-hover: rgba(255, 255, 255, 0.05);

  --banner-gradient-soft: linear-gradient(135deg, rgba(243,152,0,0.06) 0%, rgba(232,125,0,0.06) 50%, rgba(255,107,53,0.04) 100%);

  --grid-color: rgba(255, 255, 255, 0.015);
}

/* ==============================
   基础重置
   ============================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.4s ease, color 0.4s ease;
}

/* ==============================
   全局背景纹理
   ============================== */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 15% 15%, rgba(243,152,0,0.04) 0%, transparent 55%),
    radial-gradient(ellipse 55% 45% at 85% 75%, rgba(232,125,0,0.04) 0%, transparent 55%),
    var(--bg);
  transition: background 0.4s ease;
}
body::after {
  content: '';
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, black 30%, transparent 70%);
  transition: background-image 0.4s ease;
}

/* ==============================
   顶部导航栏 — 磨砂玻璃
   ============================== */
.portal-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--header-border);
  box-shadow: var(--header-shadow);
  transition: background 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 32px;
  display: flex; align-items: center; height: 62px; gap: 32px;
}

/* -- Logo 区 -- */
.logo {
  display: flex; align-items: center; gap: 9px;
  text-decoration: none; flex-shrink: 0; cursor: pointer;
  user-select: none;
}
.logo-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px rgba(243,152,0,0.3));
  transition: filter 0.35s ease, transform 0.35s ease;
}
.logo:hover .logo-icon {
  filter: drop-shadow(0 0 14px rgba(243,152,0,0.5));
  transform: scale(1.05);
}
.logo-text {
  font-size: 18px; line-height: 1.2; font-weight: 800; color: var(--text);
  letter-spacing: -0.5px; transition: color 0.4s ease;
}
.logo-badge {
  font-size: 10px; line-height: 1;
  background: var(--banner-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;  /* fallback */
  padding: 2px 6px; border: 1.5px solid rgba(243,152,0,0.3);
  border-radius: 5px; font-weight: 700; letter-spacing: 0.4px;
}

/* -- 导航链接 -- */
.header-nav {
  display: flex; gap: 4px; flex: 1; align-items: center;
}
.nav-link {
  padding: 8px 16px; border-radius: var(--radius-sm);
  text-decoration: none; color: var(--text-secondary);
  font-size: 14px; line-height: 1.3; font-weight: 500;
  transition: all 0.25s ease; white-space: nowrap;
  border: none; background: none; cursor: pointer;
  font-family: inherit; position: relative;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 0; height: 2px; border-radius: 2px;
  background: var(--primary);
  transition: width 0.25s ease;
}
.nav-link:hover {
  color: var(--text); background: var(--nav-hover-bg);
}
.nav-link:hover::after { width: 16px; }
.nav-link.active {
  color: var(--primary); background: var(--nav-active-bg);
  font-weight: 600;
}
.nav-link.active::after { width: 20px; }

.nav-link.nav-admin {
  color: var(--text-muted); font-size: 13.5px;
  font-weight: 500; padding: 8px 14px;
}
.nav-link.nav-admin:hover { color: var(--primary); background: rgba(243,152,0,0.08); }

/* -- 右侧分组：管理后台 + 主题切换靠右 -- */
.header-right {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0;
}

/* -- 主题切换按钮 -- */
.theme-toggle {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1.5px solid var(--btn-outline-border);
  background: var(--card-bg); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; transition: all 0.3s ease;
  color: var(--text-secondary); flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--primary);
  background: var(--nav-active-bg);
  transform: rotate(15deg);
}

/* -- 移动端 -- */
.mobile-menu-btn {
  display: none; background: none; border: none;
  color: var(--text); cursor: pointer; padding: 8px;
  border-radius: 8px; transition: background 0.2s;
}
.mobile-menu-btn:hover { background: var(--nav-hover-bg); }

.hamburger { display: flex; flex-direction: column; gap: 5px; width: 20px; }
.hamburger i {
  display: block; height: 2px; background: var(--text);
  border-radius: 2px; transition: 0.3s ease; transform-origin: center;
}
.mobile-menu-btn.open .hamburger i:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-menu-btn.open .hamburger i:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-menu-btn.open .hamburger i:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column; padding: 6px 24px 14px;
  border-top: 1px solid var(--header-border);
  background: var(--header-bg);
  backdrop-filter: blur(20px);
}
.mobile-menu button, .mobile-menu a {
  display: block; padding: 11px 0; color: var(--text-secondary);
  text-decoration: none; font-size: 14.5px; line-height: 1.3;
  border-bottom: 1px solid var(--card-border);
  background: none; border-left: none; border-right: none; border-top: none;
  cursor: pointer; text-align: left; font-family: inherit;
  transition: color 0.2s;
}
.mobile-menu button:last-child, .mobile-menu a:last-child { border-bottom: none; }
.mobile-menu button:hover, .mobile-menu a:hover { color: var(--primary); }

/* -- 页面加载进度条 -- */
.progress-bar {
  position: absolute; bottom: 0; left: 0; height: 2.5px;
  background: var(--banner-gradient); border-radius: 0 2px 2px 0;
  transition: width 0.15s ease; z-index: 101;
  width: 0;
}
.progress-bar.loading { animation: progressPulse 1.2s ease-in-out infinite; }
@keyframes progressPulse {
  0% { width: 5%; }
  50% { width: 70%; }
  100% { width: 98%; }
}

/* ==============================
   Banner 英雄区 — 首页入口
   ============================== */
.banner-section {
  position: relative; overflow: hidden;
  background: var(--banner-gradient-soft);
  padding: 56px 28px 48px; text-align: center;
  border-bottom: 1px solid var(--card-border);
  transition: background 0.4s ease;
}
.banner-section::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0; height: 80px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 80'%3E%3Cpath fill='none' stroke='rgba(243,152,0,0.15)' stroke-width='1.5' d='M0 40 C240 0 480 80 720 40 C960 0 1200 80 1440 40'/%3E%3C/svg%3E") center bottom no-repeat;
  background-size: 100% 80px; pointer-events: none; opacity: 0.6;
  transition: opacity 0.4s ease;
}
[data-theme="dark"] .banner-section::after { opacity: 0.35; }

.banner-inner { max-width: 800px; margin: 0 auto; position: relative; z-index: 2; }

.banner-tagline {
  font-size: 14px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase;
  background: var(--banner-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: transparent;
  margin-bottom: 12px;
}
.banner-title {
  font-size: 2.6rem; font-weight: 900; line-height: 1.25;
  letter-spacing: -1px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: var(--text);
  transition: all 0.4s ease;
}
.banner-subtitle {
  font-size: 1rem; color: var(--text-muted); line-height: 1.7;
  margin-bottom: 28px; max-width: 520px; margin-left: auto; margin-right: auto;
}
.banner-actions {
  display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
}

/* ==============================
   快速统计面板
   ============================== */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1200px; margin: -24px auto 0; padding: 0 28px;
  position: relative; z-index: 10;
}
.stat-item {
  background: var(--card-bg);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 18px 20px; text-align: center;
  box-shadow: var(--card-shadow);
  transition: all 0.3s ease;
  cursor: default;
}
.stat-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
}
.stat-icon { font-size: 1.6rem; line-height: 1; margin-bottom: 6px; }
.stat-value {
  font-family: 'JetBrains Mono', 'Consolas', monospace;
  font-size: 1.5rem; font-weight: 800; line-height: 1.2;
  background: var(--banner-gradient);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text; color: var(--primary);
}
.stat-label {
  font-size: 0.78rem; color: var(--text-muted); margin-top: 2px;
  font-weight: 500;
}

/* ==============================
   门户主体区域
   ============================== */
.portal-main {
  max-width: 1200px; margin: 0 auto; padding: 40px 28px 48px;
}

/* 区域标题 */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.section-title {
  font-size: 1.25rem; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.section-title::before {
  content: '';
  width: 4px; height: 22px; border-radius: 4px;
  background: var(--banner-gradient);
}
.section-desc {
  font-size: 0.82rem; color: var(--text-muted);
}

/* ==============================
   功能卡片网格
   ============================== */
.portal-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

/* ---- 卡片本体 ---- */
.module-card {
  position: relative; display: block; text-decoration: none; color: inherit;
  border-radius: var(--radius); overflow: hidden;
  min-height: 240px; cursor: pointer;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.module-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--card-shadow-hover);
  border-color: var(--card-border-hover);
}
.module-card:hover .card-arrow {
  transform: translateX(5px); opacity: 1;
}

/* 卡片内容 */
.card-content {
  position: relative; z-index: 2;
  padding: 30px 26px 22px;
  display: flex; flex-direction: column; height: 100%;
}

/* 图标区 */
.card-icon-wrap {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px; font-size: 1.5rem;
  transition: transform 0.3s ease;
}
.module-card:hover .card-icon-wrap { transform: scale(1.08) rotate(-3deg); }

.card-calc .card-icon-wrap { background: rgba(243,152,0,0.1); color: var(--primary); }
.card-diagram .card-icon-wrap { background: rgba(232,125,0,0.1); color: #e87d00; }
.card-quote .card-icon-wrap { background: rgba(255,167,38,0.1); color: #ffa726; }
.card-sim .card-icon-wrap { background: rgba(255,107,53,0.1); color: var(--accent-pink); }

/* 标题 */
.card-title {
  font-size: 1.2rem; font-weight: 800; margin-bottom: 8px;
  letter-spacing: -0.3px;
}
.card-calc .card-title { color: var(--primary); }
.card-diagram .card-title { color: #e87d00; }
.card-quote .card-title { color: #ffa726; }
.card-sim .card-title { color: var(--accent-pink); }

/* 描述 */
.card-desc {
  font-size: 0.84rem; color: var(--text-secondary);
  line-height: 1.7; margin-bottom: 14px; flex: 1;
}

/* 特性标签 */
.card-features {
  display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 14px;
}
.feature-tag {
  font-size: 0.7rem; padding: 3px 9px; border-radius: 20px;
  font-weight: 600; background: var(--tag-bg);
  color: var(--text-muted); border: 1px solid var(--tag-border);
  transition: all 0.2s ease;
}
.module-card:hover .feature-tag {
  border-color: var(--card-border-hover);
}

/* 状态行 */
.card-status {
  font-size: 0.78rem; color: var(--text-muted);
  display: flex; align-items: center; gap: 7px;
}
.card-status.has-data { color: var(--primary); font-weight: 500; }
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: all 0.3s;
}
.status-dot.active-dot {
  background: #ffa726;
  box-shadow: 0 0 8px rgba(255,167,38,0.5);
}

/* 箭头 */
.card-arrow {
  position: absolute; right: 24px; bottom: 24px;
  font-size: 1.3rem; color: var(--text-muted);
  opacity: 0.4; transition: all 0.3s ease;
}

/* ---- 卡片装饰线条（hover亮起） ---- */
.module-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  border-radius: 3px 3px 0 0; opacity: 0; transition: opacity 0.35s ease;
}
.module-card:hover::before { opacity: 1; }
.card-calc::before { background: var(--primary); }
.card-diagram::before { background: #e87d00; }
.card-quote::before { background: #ffa726; }
.card-sim::before { background: var(--accent-pink); }

/* ==============================
   工作流状态栏
   ============================== */
.status-bar {
  background: var(--status-bg);
  border-bottom: 1px solid var(--status-border);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.status-inner {
  max-width: 1200px; margin: 0 auto; padding: 12px 28px;
  display: flex; align-items: center; gap: 14px; overflow-x: auto;
}
.status-step {
  display: flex; align-items: center; gap: 7px; flex-shrink: 0;
}
.step-num {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--tag-bg); border: 1.5px solid var(--tag-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  transition: all 0.3s ease;
}
.status-step.done .step-num {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 0 10px var(--primary-glow);
}
.step-label {
  font-size: 11px; color: var(--text-muted); font-weight: 600; white-space: nowrap;
}
.step-value {
  font-size: 11px; color: var(--text-muted);
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.step-value.active { color: var(--primary); font-weight: 600; }
.status-arrow { color: var(--text-muted); font-size: 12px; opacity: 0.5; }

/* ==============================
   页脚
   ============================== */
.portal-footer {
  text-align: center; padding: 28px; color: var(--text-muted);
  font-size: 0.78rem; border-top: 1px solid var(--card-border);
}
.portal-footer a { color: var(--primary); text-decoration: none; font-weight: 500; }
.portal-footer a:hover { text-decoration: underline; }

/* ==============================
   按钮系统
   ============================== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 22px; border-radius: var(--radius-sm);
  border: none; cursor: pointer; font-size: 0.88rem;
  font-weight: 600; transition: all 0.25s ease;
  text-decoration: none; font-family: inherit;
}
.btn-sm { padding: 5px 12px; font-size: 0.76rem; border-radius: var(--radius-xs); }

.btn-primary {
  background: var(--banner-gradient); color: #fff;
  box-shadow: 0 4px 16px rgba(243,152,0,0.25);
}
.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(243,152,0,0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent; border: 1.5px solid var(--btn-outline-border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--btn-outline-hover); color: var(--text);
  border-color: var(--text-muted);
}

/* ==============================
   SPA 外壳布局
   ============================== */
body.spa-shell {
  display: flex; flex-direction: column;
  height: 100vh; overflow: hidden;
}
body.spa-shell .portal-header { flex-shrink: 0; }
body.spa-shell .status-bar { flex-shrink: 0; }

.spa-content {
  flex: 1; position: relative; overflow: hidden;
  background: var(--bg); transition: background 0.4s ease;
}
.spa-content iframe {
  width: 100%; height: 100%; border: none; display: block;
}

/* iframe 加载 */
.iframe-loader {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  pointer-events: none; opacity: 0; transition: opacity 0.25s ease;
  z-index: 10;
}
.iframe-loader.show { opacity: 1; pointer-events: auto; }

.loader-spin {
  width: 34px; height: 34px;
  border: 3px solid var(--card-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: loaderSpin 0.65s linear infinite;
}
@keyframes loaderSpin { to { transform: rotate(360deg); } }

/* ==============================
   home.html — iframe内首页专用
   ============================== */
body.home-content-page {
  background: transparent !important;
  overflow-x: hidden; overflow-y: auto; min-height: 100vh;
}
body.home-content-page::before,
body.home-content-page::after { display: none; }
body.home-content-page .portal-main { padding-top: 40px; padding-bottom: 40px; }

/* ==============================
   动画
   ============================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
.module-card { animation: fadeUp 0.5s ease backwards; }
.module-card:nth-child(1) { animation-delay: 0.05s; }
.module-card:nth-child(2) { animation-delay: 0.13s; }
.module-card:nth-child(3) { animation-delay: 0.21s; }
.module-card:nth-child(4) { animation-delay: 0.29s; }

.stat-item { animation: fadeInScale 0.4s ease backwards; }
.stat-item:nth-child(1) { animation-delay: 0.02s; }
.stat-item:nth-child(2) { animation-delay: 0.08s; }
.stat-item:nth-child(3) { animation-delay: 0.14s; }
.stat-item:nth-child(4) { animation-delay: 0.20s; }

/* ==============================
   响应式 — 多级自适应
   ============================== */

/* -- 中屏 (1000px~)：导航压缩，减小间距 -- */
@media (max-width: 1000px) {
  .header-inner { gap: 16px; padding: 0 22px; }
  .nav-link { padding: 6px 12px; font-size: 13px; }
  .logo-text { font-size: 16px; }
  .logo-badge { font-size: 9px; padding: 1px 4px; }
  .theme-toggle { width: 30px; height: 30px; font-size: 14px; }
  .header-right { gap: 4px; }
  .header-right .nav-link.nav-admin { font-size: 12px; padding: 6px 9px; }
  .banner-title { font-size: 2rem; }
}

/* -- 窄屏 (860px~)：进一步压缩，隐藏logo文字 -- */
@media (max-width: 860px) {
  .header-inner { gap: 6px; padding: 0 14px; height: 54px; }
  .nav-link { padding: 4px 7px; font-size: 11.5px; }
  .logo-text { display: none; }
  .logo-badge { display: none; }
  .logo-icon { width: 26px; height: 26px; }
  .logo-icon svg { width: 22px; height: 22px; }
  .theme-toggle { width: 28px; height: 28px; font-size: 13px; }
  .header-right .nav-link.nav-admin { font-size: 11px; padding: 4px 7px; }
  .nav-link::after { display: none; } /* 窄屏去掉hover下划线 */
  .portal-grid { grid-template-columns: 1fr; gap: 16px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .banner-title { font-size: 1.75rem; }
}

/* -- 移动端 (768px↓)：汉堡菜单 -- */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .header-right .nav-link.nav-admin { display: none; }
  .mobile-menu-btn { display: block; }
  .header-inner { padding: 0 16px; height: 56px; }
  .logo-text { display: inline; font-size: 16px; }
  .logo-badge { display: inline; }
  .logo-icon { width: 28px; height: 28px; }
  .logo-icon svg { width: 24px; height: 24px; }
  .stats-row { grid-template-columns: repeat(2, 1fr); padding: 0 16px; margin-top: -20px; }
  .stat-item { padding: 14px 12px; }
  .stat-value { font-size: 1.2rem; }

  .banner-section { padding: 36px 16px 32px; }
  .banner-title { font-size: 1.6rem; }
  .portal-main { padding: 28px 16px 36px; }
  .module-card { min-height: 200px; }
  .card-content { padding: 22px 18px 18px; }
  .card-title { font-size: 1.05rem; }
  .card-desc { font-size: 0.8rem; }

  .status-inner { padding: 10px 16px; gap: 8px; }
  .step-label { display: none; }
  .status-arrow { font-size: 0.6rem; }
}
@media (max-width: 480px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .banner-title { font-size: 1.4rem; }
}
