/* ============================================
   日报系统 - 全局样式
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  /* ===== 表面层级（Layered Surfaces，从远到近） =====
     设计哲学：依靠层级 + 阴影制造深度，不靠厚边框 */
  --surface-1:    #F4F1EC;     /* 页面底色（最远） */
  --surface-2:    #FBFAF7;     /* 主卡片 */
  --surface-3:    #FEFDFA;     /* 卡内 elevated（弹窗、popover） */
  --surface-input: #EFE9DF;    /* 输入框 sunken */

  /* ===== 中性色（兼容旧别名，全部指向新 token） ===== */
  --bg-page: var(--surface-1);
  --bg-card: var(--surface-2);
  --bg-input: var(--surface-input);

  /* ===== 极细发丝线（替代厚 border） ===== */
  --hairline:        rgba(42, 39, 36, 0.08);
  --hairline-strong: rgba(42, 39, 36, 0.14);
  --border-primary:   var(--hairline);
  --border-secondary: var(--hairline-strong);
  --border-light:     rgba(42, 39, 36, 0.06);
  --bg-label:         #F0EBE3;

  --text-primary: #2A2724;      /* 主文字：深棕墨 */
  --text-secondary: #5A5249;    /* 次要文字 */
  --text-muted: #8A8378;       /* 弱化文字 / 占位 */
  --text-placeholder: #A89F92;  /* 极弱占位 */

  /* ===== 强调色 ===== */
  --color-primary: #2A4A3A;     /* 深松绿：主操作色 */
  --color-primary-light: #4A5A7A; /* 雾蓝灰 */
  --color-accent: #C8633F;     /* 燃橙：必填星号 / 警示 */
  --color-primary-dark: #1F3A2D; /* 深松绿 hover */
  --text-on-primary: #F4F1EC;   /* 按钮文字：米白 */

  /* ===== 信息提示色（暖色系） ===== */
  --bg-info: #EAEFEC;          /* 信息横幅底色：浅松绿 */
  --border-info: #B8C9C0;      /* 信息横幅边框 */
  --text-info: #1F3A2D;        /* 信息横幅文字 */

  /* ===== 字段状态色条 ===== */
  --bar-progress: #2A4A3A;     /* 今日进展 */
  --bar-plan: #4A5A7A;          /* 明日计划 */
  --bar-issue: #C8633F;        /* 存在的问题 */

  /* ===== 排行榜配色 ===== */
  /* 第一名 - 冠军 */
  --rank1-bg: #2A2724;
  --rank1-glow: rgba(200, 155, 92, 0.35);
  --rank1-trophy: #D4A86A;
  --rank1-trophy-stroke: #8B6A38;
  --rank1-trophy-base: #B8894A;
  --rank1-text: #C89B5C;
  --rank1-name: #FBFAF7;
  --rank1-count: #9A8E7A;
  --rank1-bar-bg: rgba(200, 155, 92, 0.2);
  --rank1-bar-fill: #C89B5C;
  /* 第二名 - 亚军 */
  --rank2-bg: #FBFAF7;
  --rank2-glow: rgba(184, 176, 164, 0.3);
  --rank2-trophy: #C8C0B4;
  --rank2-trophy-stroke: #6B645A;
  --rank2-trophy-base: #A8A095;
  --rank2-text: #6B645A;
  --rank2-bar-bg: #E8E2D8;
  --rank2-bar-fill: #8A8378;
  /* 第三名 - 季军 */
  --rank3-bg: #FBFAF7;
  --rank3-glow: rgba(184, 117, 77, 0.25);
  --rank3-trophy: #C88563;
  --rank3-trophy-stroke: #6F3F25;
  --rank3-trophy-base: #A8633F;
  --rank3-text: #6F3F25;
  --rank3-bar-bg: #E8E2D8;
  --rank3-bar-fill: #B8754D;

  /* ===== 历史记录板块标签 ===== */
  --pill-data: #F0E5D2; --pill-data-text: #6F4E1F;
  --pill-ai-review: #EDDDD1; --pill-ai-review-text: #6F3F25;
  --pill-ai-econ: #E8E2D8; --pill-ai-econ-text: #4A4540;
  --pill-warn-bg: #F2DCD0; --pill-warn-text: #8B3D1F;

  /* ===== 功能色（保留兼容） ===== */
  --success: #2A4A3A;
  --success-light: #EAEFEC;
  --warning: #C8633F;
  --warning-light: #FEF3C7;
  --danger: #EF4444;
  --danger-light: #FEE2E2;
  --info: #2A4A3A;
  --info-light: #EAEFEC;

  /* ===== 布局 ===== */
  --sidebar-width: 260px;

  /* ===== 半径（更"枕头化"的曲线） ===== */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius:    10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* ===== 阴影（多层叠加产生真实景深） ===== */
  --shadow-xs: 0 1px 2px rgba(42, 39, 36, 0.04);
  --shadow-sm: 0 1px 3px rgba(42, 39, 36, 0.05), 0 1px 2px rgba(42, 39, 36, 0.03);
  --shadow:    0 2px 6px rgba(42, 39, 36, 0.06), 0 1px 2px rgba(42, 39, 36, 0.04);
  --shadow-md: 0 6px 16px rgba(42, 39, 36, 0.08), 0 2px 4px rgba(42, 39, 36, 0.04);
  --shadow-lg: 0 16px 32px rgba(42, 39, 36, 0.10), 0 4px 8px rgba(42, 39, 36, 0.04);
  --shadow-xl: 0 28px 56px rgba(42, 39, 36, 0.14), 0 8px 16px rgba(42, 39, 36, 0.06);
  /* 主操作色光晕：用于 focus / 主按钮 hover */
  --glow-primary: 0 0 0 4px rgba(42, 74, 58, 0.10);
  --glow-accent:  0 0 0 4px rgba(200, 99, 63, 0.10);

  /* ===== AI 主题渐变（贯穿 AI 相关 surface / button / 边框） ===== */
  --ai-gradient:      linear-gradient(135deg, #2A4A3A 0%, #4A6B5A 55%, #7DA889 100%);
  --ai-gradient-soft: linear-gradient(135deg, rgba(42, 74, 58, 0.06), rgba(125, 168, 137, 0.10));
  --ai-glow:          0 0 24px rgba(107, 142, 118, 0.35);

  /* ===== 缓动曲线（Apple 经典曲线） ===== */
  --ease-out:    cubic-bezier(0.32, 0.72, 0, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* ===== 字号（更细的层级） ===== */
  --font-title: 14px;
  --font-body:  13px;
  --font-label: 12px;
  --font-hint:  11px;

  /* ===== 控件统一高度（4px 网格） ===== */
  --h-sm: 28px;
  --h:    36px;
  --h-lg: 44px;
}

@keyframes pulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.4); }
}

/* ===== 通用入场动画（首次渲染 fade-up） ===== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* 首屏卡片错峰入场：父级加 .stagger-in，子卡片读取 --i 决定延迟 */
.stagger-in > .card,
.stagger-in > .ranking-widget,
.stagger-in > .header {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
/* stat-card 入场只用 opacity（避免 forwards 锁死 translateY(0)，挤掉磁吸 tilt 的 transform） */
.stagger-in > .stats-row > .stat-card {
  opacity: 0;
  animation: fadeOpacity 0.7s var(--ease-out) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes fadeOpacity {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Scroll-reveal：JS 用 IntersectionObserver 给元素加 .in-view 触发 fade-up
   未进入时保持 opacity:0，避免页面长滚动时下方内容突然亮起 */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
  will-change: opacity, transform;
}
.reveal-on-scroll.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 标题文字 shimmer：极淡的扫光，强调"AI 在工作" */
.shimmer-text {
  background: linear-gradient(
    100deg,
    var(--text-primary) 0%,
    var(--text-primary) 40%,
    #6B8E76 50%,
    var(--text-primary) 60%,
    var(--text-primary) 100%
  );
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerSweep 4.5s ease-in-out infinite;
}
@keyframes shimmerSweep {
  0%, 100% { background-position: 100% 50%; }
  50%      { background-position:   0% 50%; }
}

/* 主操作按钮在 ready 状态轻微"呼吸"，引导用户点击 */
.btn-ai-pulse {
  position: relative;
  background: linear-gradient(135deg, var(--color-primary), #4A6B5A) !important;
  color: var(--text-on-primary) !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(42, 74, 58, 0.25);
  overflow: hidden;
}
.btn-ai-pulse::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.18) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: btnSweep 3.2s ease-in-out infinite;
}
.btn-ai-pulse:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(42, 74, 58, 0.32);
  background: linear-gradient(135deg, #1F3A2D, #3A5A4A) !important;
}
.btn-ai-pulse:disabled {
  background: linear-gradient(135deg, #8a9d92, #98a89e) !important;
  box-shadow: none;
}
.btn-ai-pulse:disabled::before { animation: none; opacity: 0; }
@keyframes btnSweep {
  0%   { transform: translateX(-100%); }
  60%, 100% { transform: translateX(120%); }
}

/* 数据更新时的高亮闪一下（统计数字、徽标等） */
@keyframes valueFlash {
  0%   { background-color: rgba(42, 74, 58, 0.18); }
  100% { background-color: transparent; }
}
.value-flash {
  animation: valueFlash 0.7s ease-out;
  border-radius: 4px;
  padding: 0 4px;
  margin: 0 -4px;
}

/* 偏好减少动画的用户：尊重系统设置 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--surface-1);
  color: var(--text-primary);
  line-height: 1.55;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  position: relative;
  overflow-x: hidden;
}

/* 极淡的噪点 + 暖色 vignette：让纸感更真实，不抢戏（仅 ~3% 不透明度） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(at 20% 0%, rgba(42, 74, 58, 0.04) 0%, transparent 50%),
    radial-gradient(at 80% 100%, rgba(200, 99, 63, 0.035) 0%, transparent 55%),
    url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0.165 0 0 0 0 0.155 0 0 0 0 0.142 0 0 0 0.7 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: auto, auto, 160px 160px;
  opacity: 0.55;
  mix-blend-mode: multiply;
}
body > * { position: relative; z-index: 1; }

/* ===== 数字等宽 ===== */
.number,
.rank-count,
.stat-card .number,
.date-big {
  font-variant-numeric: tabular-nums;
}

/* ============================================
   布局容器
   ============================================ */

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px;
}

.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* ============================================
   全局通用：小尺寸下也保留的微动效（mobile-friendly）
   ============================================ */

/* "实时同步" 状态点：大小 8px 的呼吸圆点，可贴在任何位置 */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6B8E76;
  position: relative;
  vertical-align: middle;
  margin-right: 6px;
  box-shadow: 0 0 0 0 rgba(107, 142, 118, 0.6);
  animation: liveDotPulse 1.6s ease-out infinite;
}
@keyframes liveDotPulse {
  0%   { box-shadow: 0 0 0 0   rgba(107, 142, 118, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(107, 142, 118, 0);    }
  100% { box-shadow: 0 0 0 0   rgba(107, 142, 118, 0);    }
}

/* 提交日报按钮：成功提交时短暂播一波"成功"波纹 */
.btn-success-burst {
  animation: successBurst 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes successBurst {
  0%   { box-shadow: 0 0 0 0 rgba(42, 74, 58, 0.45); }
  60%  { box-shadow: 0 0 0 14px rgba(42, 74, 58, 0); }
  100% { box-shadow: 0 0 0 0 rgba(42, 74, 58, 0); }
}

/* 输入框聚焦时极淡的"被注意到"动画（仅非键盘聚焦时跑） */
.form-group textarea:focus,
.form-group input[type="text"]:focus {
  animation: inputAttention 0.5s ease-out;
}
@keyframes inputAttention {
  from { box-shadow: 0 0 0 0 rgba(42, 74, 58, 0.18); }
  to   { box-shadow: 0 0 0 3px rgba(42, 74, 58, 0.10); }
}

/* 卡片组件 hover 时图标轻微跳动（针对 .card 内的 emoji/svg 图标） */
.card .card-icon {
  display: inline-block;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.card:hover .card-icon {
  transform: translateY(-1px) scale(1.08);
}

/* ============================================
   头部右侧 AI 数据流水线场景（SVG 动画）
   ============================================ */

.header-scene {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
  max-width: 320px;
  height: 64px;
  margin: 0 8px;
  pointer-events: none;
  position: relative;
}
.header-scene-svg {
  width: 100%;
  height: 100%;
  max-width: 280px;
  display: block;
}

/* 板块小卡片右上角的状态点：闪烁 */
.hs-blink {
  transform-origin: center;
  animation: hsBlink 2.4s ease-in-out infinite;
}
@keyframes hsBlink {
  0%, 60%, 100% { opacity: 0.3; }
  30%           { opacity: 1; }
}

/* AI 内核：内外圈反向旋转 + 中心呼吸 */
.hs-core-orbit-out {
  transform-origin: 0 0;
  animation: hsRotateCW 14s linear infinite;
}
.hs-core-orbit-in {
  transform-origin: 0 0;
  animation: hsRotateCCW 7s linear infinite;
}
@keyframes hsRotateCW  { to { transform: rotate(360deg);  } }
@keyframes hsRotateCCW { to { transform: rotate(-360deg); } }

.hs-core-pulse {
  transform-origin: center;
  animation: hsCorePulse 2.6s ease-in-out infinite;
}
@keyframes hsCorePulse {
  0%, 100% { transform: scale(1);    opacity: 0.95; }
  50%      { transform: scale(1.18); opacity: 0.7; }
}

/* 右侧输出火花：周期性爆发 */
.hs-output-burst {
  transform-origin: center;
  animation: hsBurst 3.2s ease-out infinite;
  animation-delay: 1.2s;
}
@keyframes hsBurst {
  0%   { transform: scale(0.4); opacity: 0; }
  20%  { transform: scale(1.4); opacity: 1; }
  60%  { transform: scale(1);   opacity: 0.5; }
  100% { transform: scale(1);   opacity: 0; }
}

/* prefers-reduced-motion 已经在全局兜底，这里无需重复 */

/* ============================================
   头部 Banner（提交页顶栏，新设计）
   ============================================ */

.header {
  background: var(--bg-card);
  border: 0.5px solid var(--border-primary);
  color: var(--text-primary);
  padding: 20px 20px;
  text-align: left;
  border-radius: var(--radius-md);
  margin-bottom: 16px;
  box-shadow: none;
  position: relative;
  overflow: hidden;
}

.header::before,
.header::after {
  display: none;
}

.header h1 {
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.2px;
  position: relative;
  z-index: 1;
  color: var(--text-primary);
}

.header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 1px;
  font-weight: 400;
  position: relative;
  z-index: 1;
}

/* ============================================
   卡片
   ============================================ */

/* 卡片：靠 shadow + 微弱 hairline 表达层级，不靠厚 border */
.card {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--hairline);
  transition: box-shadow 0.4s var(--ease-out), border-color 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--hairline-strong);
}

.card h2 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
}

.card h2::before {
  display: none;
}

.card h3 {
  font-size: 14px;
  margin-bottom: 16px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ============================================
   表单
   ============================================ */

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: var(--font-label);
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.form-group label .required {
  color: var(--color-accent);
  margin-left: 2px;
}

.form-group select,
.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="date"],
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface-input);
  /* 顶端微弱 inset，制造"凹陷"输入面的物理感 */
  box-shadow: inset 0 1px 1.5px rgba(42, 39, 36, 0.04);
  transition:
    background-color 0.2s var(--ease-out),
    border-color    0.2s var(--ease-out),
    box-shadow      0.2s var(--ease-out);
  appearance: none;
  -webkit-appearance: none;
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none' stroke='%235A5249' stroke-width='1'%3E%3Cpolyline points='2 4 6 8 10 4'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  background: var(--surface-2);
  box-shadow:
    inset 0 1px 1.5px rgba(42, 39, 36, 0.02),
    var(--glow-primary);
}

/* 键盘 Tab 聚焦：通用焦点环（按钮 / 链接等） */
:focus-visible {
  outline: 2px solid rgba(42, 74, 58, 0.5);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(42, 74, 58, 0.6);
  outline-offset: 2px;
}
/* 鼠标点击的元素不要双重高亮 */
.form-group select:focus,
.form-group input:focus,
.form-group textarea:focus { outline: none; }

.form-group textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.7;
  max-width: 100%;
}

.form-group .hint {
  font-size: var(--font-hint);
  color: var(--text-muted);
  margin-top: 6px;
  line-height: 1.5;
}

/* ============================================
   按钮
   ============================================ */

/* ============================================
   按钮（基于 4px 网格统一高度，多层 shadow + 内反光制造按下的物理感）
   ============================================ */
.btn {
  --_btn-h: var(--h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--_btn-h);
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition:
    background-color 0.18s var(--ease-out),
    box-shadow      0.18s var(--ease-out),
    transform       0.18s var(--ease-out),
    color           0.18s var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  position: relative;
}

/* Primary：深松绿渐变 + 顶端内反光 + 多层 shadow */
.btn-primary,
.btn-success {
  background: linear-gradient(180deg, #325744 0%, var(--color-primary) 50%, #1F3A2D 100%);
  color: var(--text-on-primary);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(42, 74, 58, 0.30),
    0 2px 6px rgba(42, 74, 58, 0.18);
  border-color: rgba(0, 0, 0, 0.10);
}
.btn-primary:hover,
.btn-success:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.20),
    0 4px 12px rgba(42, 74, 58, 0.34),
    0 2px 4px rgba(42, 74, 58, 0.20);
  background: linear-gradient(180deg, #3A6451 0%, #2F5341 50%, #1A3326 100%);
}
.btn-primary:active,
.btn-success:active {
  transform: translateY(0) scale(0.985);
  box-shadow:
    inset 0 2px 4px rgba(0, 0, 0, 0.18),
    0 1px 2px rgba(42, 74, 58, 0.20);
}

/* Outline：透明 + hairline border，hover 时充入 token 背景 */
.btn-outline {
  background: var(--surface-2);
  color: var(--text-primary);
  border: 1px solid var(--hairline-strong);
  box-shadow: var(--shadow-xs);
}
.btn-outline:hover {
  background: var(--surface-3);
  border-color: rgba(42, 39, 36, 0.22);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.btn-outline:active { transform: translateY(0); box-shadow: var(--shadow-xs); }

/* Ghost：完全透明，仅 hover 背景；适合次要操作 */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: 0 14px;
}
.btn-ghost:hover {
  background: var(--bg-label);
  color: var(--text-primary);
}

/* Danger：低调红色描边，hover 实色 */
.btn-danger {
  background: var(--surface-2);
  color: var(--color-accent);
  border: 1px solid rgba(200, 99, 63, 0.35);
  box-shadow: var(--shadow-xs);
}
.btn-danger:hover {
  background: var(--color-accent);
  color: #FFF;
  border-color: var(--color-accent);
  box-shadow: 0 4px 12px rgba(200, 99, 63, 0.28);
  transform: translateY(-1px);
}
.btn-danger:active { transform: translateY(0); }

.btn-sm {
  --_btn-h: var(--h-sm);
  padding: 0 12px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  gap: 4px;
}
.btn-block {
  display: flex;
  width: 100%;
  --_btn-h: var(--h-lg);
  font-size: 14px;
  border-radius: var(--radius-md);
}
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: var(--shadow-xs) !important;
}

/* ============================================
   Toast 提示
   ============================================ */

.toast {
  position: fixed;
  top: calc(24px + env(safe-area-inset-top, 0px));
  right: 24px;
  padding: 14px 24px;
  border-radius: var(--radius);
  color: var(--bg-card);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
}

.toast::before {
  font-size: 18px;
  flex-shrink: 0;
}

.toast-success {
  background: var(--color-primary);
}
.toast-success::before { content: '✓'; }

.toast-error {
  background: var(--color-accent);
}
.toast-error::before { content: '✕'; }

.toast-info {
  background: var(--color-primary);
}
.toast-info::before { content: 'ℹ'; }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 滑出动画：JS 给 .toast 加 .toast-leaving 即触发 */
.toast.toast-leaving {
  animation: toastOut 0.3s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(40px); opacity: 0; }
}

/* ===== Tab 切换淡入（admin 后台主内容区，JS 给 .tab-enter 触发） ===== */
.tab-enter {
  animation: tabFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes tabFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================
   管理员布局
   ============================================ */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-page);
}

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 0.5px solid var(--border-primary);
  padding: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 28px 24px 20px;
  border-bottom: 0.5px solid var(--border-primary);
}

.sidebar-header h2 {
  font-size: 16px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.sidebar-header p {
  font-size: var(--font-hint);
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: var(--font-body);
  font-weight: 500;
  cursor: pointer;
  transition:
    color 0.25s var(--ease-out),
    background-color 0.25s var(--ease-out);
  margin: 1px 0;
  letter-spacing: -0.005em;
}

/* 左侧 active 指示条：从 0 高度增长到 60% 高度 */
.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  transform-origin: center;
  width: 3px;
  height: 60%;
  background: var(--color-primary);
  border-radius: 0 3px 3px 0;
  transition: transform 0.35s var(--ease-spring);
}
.nav-item.active::before { transform: translateY(-50%) scaleY(1); }

.nav-item .nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  opacity: 0.85;
  transition: transform 0.3s var(--ease-spring), opacity 0.25s var(--ease-out);
}
/* sidebar nav-icon 内的 SVG 跟随当前文字色 */
.nav-item .nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
}

.nav-item:hover {
  background: var(--bg-label);
  color: var(--text-secondary);
}
.nav-item:hover .nav-icon { transform: translateX(2px); }

.nav-item.active {
  background: linear-gradient(90deg, rgba(42, 74, 58, 0.07), transparent);
  color: var(--color-primary);
  font-weight: 600;
}
.nav-item.active .nav-icon { opacity: 1; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 0.5px solid var(--border-primary);
}

.sidebar-footer .nav-item {
  padding: 10px 0;
  border-left: none;
  font-size: var(--font-label);
}

/* 主内容区 */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  padding: 32px;
  max-width: calc(100% - var(--sidebar-width));
}

.page-title {
  font-size: 22px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 22px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

/* ============================================
   统计卡片
   ============================================ */

.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  /* 3D 透视：让 stat-card 的 rotateX 有透视感而不是变形 */
  perspective: 1000px;
}

.stat-card {
  background:
    linear-gradient(180deg, var(--surface-3) 0%, var(--surface-2) 100%);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
  border: 1px solid var(--hairline);
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  /* 磁吸悬停：JS 会写入 --mx / --my (-0.5 → 0.5)，CSS 把它转为 rotateX/Y */
  --mx: 0; --my: 0;
  transform: perspective(900px)
             rotateY(calc(var(--mx) * 7deg))
             rotateX(calc(var(--my) * -5deg));
  /* 质感三件套——让卡片像一块"被光照亮、被提起"的实体薄片：
     ① 顶缘 inset 高光：斜面受光的亮边，给出厚度感
     ② 动态抬升投影：随倾斜方向反向偏移（--mx/--my），阴影会"甩"到卡片背光侧
     ③ 基础环境阴影兜底 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    calc(var(--mx) * -18px) calc(var(--my) * -18px + 12px) 30px -10px rgba(42, 74, 58, 0.22),
    var(--shadow-sm);
  /* transform / box-shadow 移动时即时跟随 var（不写进 transition）：
     否则含 var() 的 transform 会被"锁"在 0deg，阴影也会滞后于倾斜。
     回位的弹性平滑交给 .tilt-reset 临时接管。 */
  transition: border-color 0.4s var(--ease-out);
  will-change: transform;
}
/* 指针离开时由 JS 临时挂上：让卡片"弹"回水平，而不是生硬归位 */
.stat-card.tilt-reset {
  transition:
    transform 0.55s var(--ease-out),
    box-shadow 0.55s var(--ease-out),
    border-color 0.4s var(--ease-out);
}
.stat-card:hover {
  border-color: var(--hairline-strong);
}
/* 尊重系统"减少动态效果"偏好：关掉倾斜与视差，仅保留静态卡面 */
@media (prefers-reduced-motion: reduce) {
  .stat-card { transform: none; }
  .stat-card:hover .number,
  .stat-card:hover .label { transform: none; }
}

/* 跟随指针的镜面高光 + 环境光晕：
   紧致的白色高光核制造"光斑扫过釉面"的镜面反射感，外层是原有的柔和绿色光晕。 */
.stat-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background:
    radial-gradient(
      120px circle at calc(50% + var(--mx) * 85%) calc(50% + var(--my) * 85%),
      rgba(255, 255, 255, 0.28),
      transparent 45%),
    radial-gradient(
      460px circle at calc(50% + var(--mx) * 100%) calc(50% + var(--my) * 100%),
      rgba(42, 74, 58, 0.11),
      transparent 48%);
  opacity: 0;
  transition: opacity 0.45s var(--ease-out);
  pointer-events: none;
  z-index: 0;
}
.stat-card:hover::before { opacity: 1; }

.stat-card > * { position: relative; z-index: 1; }
/* 分层视差：数字浮在最前、标签次之，倾斜时前后景拉开距离，"实体感"来自这层次差 */
.stat-card .number {
  transition: transform 0.4s var(--ease-out), letter-spacing 0.4s var(--ease-out);
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.stat-card:hover .number {
  transform: translateZ(26px);
  letter-spacing: -1px;
}
.stat-card .label {
  transition: transform 0.4s var(--ease-out), color 0.4s var(--ease-out);
}
.stat-card:hover .label {
  transform: translateZ(12px);
}

.stat-card::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 70px;
  height: 70px;
  border-radius: 0 0 0 70px;
  opacity: 0.1;
}

.stat-card:nth-child(1)::after { background: var(--color-accent); }
.stat-card:nth-child(2)::after { background: var(--color-primary); }
.stat-card:nth-child(3)::after { background: var(--color-primary-light); }

.stat-card .number {
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -1.2px;
  line-height: 1;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.stat-card:nth-child(1) .number { color: var(--color-accent); }
.stat-card:nth-child(2) .number { color: var(--color-primary); }
.stat-card:nth-child(3) .number { color: var(--color-primary-light); }

.stat-card .label {
  font-size: var(--font-label);
  color: var(--text-muted);
  margin-top: 8px;
  font-weight: 500;
}

/* ============================================
   日报卡片
   ============================================ */

.report-card {
  background: var(--bg-page);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  box-shadow: none;
  border: none;
  transition: all 0.2s ease;
  position: relative;
  overflow: visible;
}

.report-card::before {
  display: none;
}

.report-card:hover {
  box-shadow: none;
  border-color: transparent;
}

.report-card .report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 0;
  border-bottom: none;
}

.report-card .section-name {
  font-size: var(--font-label);
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-card .section-name::before {
  display: none;
}

.report-card .submit-time {
  font-size: var(--font-hint);
  color: var(--text-muted);
  font-weight: 400;
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.report-card .report-field {
  margin-bottom: 12px;
}

.report-card .report-field:last-of-type {
  margin-bottom: 0;
}

.report-card .report-field .field-label {
  font-size: var(--font-hint);
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.report-card .report-field .field-content {
  font-size: 14px;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.75;
}

.report-card .report-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 0.5px solid var(--border-light);
  text-align: right;
}

/* ============================================
   筛选栏
   ============================================ */

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 20px;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 0.5px solid var(--border-primary);
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 140px;
}

.filter-bar .form-group label {
  font-size: var(--font-hint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  font-weight: 500;
}

.filter-bar .form-group select,
.filter-bar .form-group input {
  padding: 9px 12px;
  font-size: var(--font-body);
}

/* ============================================
   空状态
   ============================================ */

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 36px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: var(--font-body);
  font-weight: 500;
}

/* ============================================
   模态框
   ============================================ */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(42, 39, 36, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 28px;
  width: 90%;
  max-width: 700px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border: 0.5px solid var(--border-primary);
}

.modal h3 {
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { transform: scale(0.95) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ============================================
   提炼结果
   ============================================ */

.summary-box {
  background: var(--bg-label);
  border: 0.5px solid var(--border-primary);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 12px;
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.85;
  max-height: 500px;
  overflow-y: auto;
  color: var(--text-primary);
}

.summary-box.prompt-box {
  background: #FFFBEB;
  border-color: #FDE68A;
}

.summary-box.ai-box {
  background: #ECFDF5;
  border-color: #A7F3D0;
}

/* ===== AI 提炼结果的 markdown 富文本渲染 ===== */
.summary-box.ai-box .md-body {
  white-space: normal; /* 覆盖 .summary-box 的 pre-wrap，避免块级元素之间出现多余空行 */
}
.md-body > :first-child { margin-top: 0; }
.md-body > :last-child { margin-bottom: 0; }
.md-body h1, .md-body h2, .md-body h3,
.md-body h4, .md-body h5, .md-body h6 {
  margin: 14px 0 6px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}
.md-body h1 { font-size: 19px; }
.md-body h2 { font-size: 17px; }
.md-body h3 { font-size: 15px; }
.md-body h4, .md-body h5, .md-body h6 { font-size: 14px; }
.md-body p { margin: 8px 0; }
.md-body ul, .md-body ol { margin: 8px 0; padding-left: 22px; }
.md-body li { margin: 3px 0; }
.md-body strong { font-weight: 600; color: var(--text-primary); }
.md-body em { font-style: italic; }
.md-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(42, 74, 58, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
}
.md-body pre {
  background: rgba(42, 74, 58, 0.06);
  border: 0.5px solid var(--border-primary);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-x: auto;
  margin: 10px 0;
}
.md-body pre code { background: none; padding: 0; font-size: 12.5px; }
.md-body blockquote {
  margin: 8px 0;
  padding: 4px 12px;
  border-left: 3px solid var(--color-primary);
  color: var(--text-secondary);
  background: rgba(42, 74, 58, 0.04);
  border-radius: 0 6px 6px 0;
}
.md-body hr { border: none; border-top: 0.5px solid var(--border-primary); margin: 14px 0; }
.md-body a { color: var(--color-primary); text-decoration: underline; }

/* ============================================
   AI 提炼区动效：流光边框 + 思考轨道 + 星光迸射
   ============================================ */

/* AI 结果区出现时整体 fadeIn，不让用户感觉"突然出现" */
.summary-box.ai-box {
  position: relative;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  animation: aiBoxIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes aiBoxIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1); }
}

/* 流式输出时：极光流光边框，沿着卡片四周缓慢流动 */
.summary-box.ai-box.streaming::before {
  content: '';
  position: absolute;
  /* 盒子是滚动容器（overflow-y:auto → overflow-x 计算成 auto），负 inset 的光环会被裁掉，
     用 inset:0 让流光边框贴着内边缘画，避免裁切 */
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: linear-gradient(
    120deg,
    rgba(42, 74, 58, 0.0) 0%,
    rgba(42, 74, 58, 0.55) 25%,
    rgba(107, 142, 118, 0.85) 50%,
    rgba(200, 99, 63, 0.5) 75%,
    rgba(42, 74, 58, 0.0) 100%
  );
  background-size: 300% 300%;
  animation: auroraFlow 4s ease-in-out infinite;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}
@keyframes auroraFlow {
  0%, 100% { background-position:   0% 50%; }
  50%      { background-position: 200% 50%; }
}

/* 流式输出时的"正在打字"光标 —— 柔和的呼吸方块 */
.summary-box.ai-box.streaming::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 1em;
  vertical-align: -2px;
  margin-left: 3px;
  background: var(--color-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(42, 74, 58, 0.45);
  animation: streamingCursor 1.05s ease-in-out infinite;
}
@keyframes streamingCursor {
  0%, 100% { opacity: 1;   transform: scaleY(1); }
  50%      { opacity: 0.2; transform: scaleY(0.7); }
}

/* ===== AI 正在思考：神经轨道动画 =====
   3 个粒子绕着中心轨道做反向旋转，外圈缓慢呼吸，中心有 spark
*/
.summary-box.thinking {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  color: var(--text-muted);
  font-size: 13px;
  padding-left: 8px;
}

.ai-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
}
/* 外圈淡淡的呼吸光环 */
.ai-orbit::before {
  content: '';
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid rgba(42, 74, 58, 0.18);
  animation: orbitBreath 2.4s ease-in-out infinite;
}
.ai-orbit::after {
  content: '';
  position: absolute;
  inset: 12px;
  border-radius: 50%;
  border: 1px dashed rgba(42, 74, 58, 0.22);
  animation: orbitSpinSlow 8s linear infinite;
}
/* 中心 spark */
.ai-orbit-core {
  position: absolute;
  top: 50%; left: 50%;
  width: 10px; height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle, #6B8E76 0%, var(--color-primary) 60%, transparent 100%);
  box-shadow: 0 0 14px rgba(107, 142, 118, 0.7);
  animation: orbitCorePulse 1.4s ease-in-out infinite;
}
/* 三个轨道粒子：用 transform-origin 旋转产生圆周轨迹 */
.ai-orbit-dot {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: var(--color-primary);
  box-shadow: 0 0 8px rgba(42, 74, 58, 0.55);
  animation: orbitSpin 2s linear infinite;
}
.ai-orbit-dot:nth-child(2) {
  background: #C8633F;
  box-shadow: 0 0 8px rgba(200, 99, 63, 0.55);
  animation: orbitSpinB 2.6s linear infinite;
}
.ai-orbit-dot:nth-child(3) {
  background: #6B8E76;
  box-shadow: 0 0 8px rgba(107, 142, 118, 0.6);
  animation: orbitSpin 3.2s linear infinite reverse;
  animation-delay: -0.6s;
}
@keyframes orbitSpin {
  from { transform: rotate(0deg)   translateX(20px) rotate(0deg); }
  to   { transform: rotate(360deg) translateX(20px) rotate(-360deg); }
}
@keyframes orbitSpinB {
  from { transform: rotate(120deg) translateX(16px) rotate(-120deg); }
  to   { transform: rotate(480deg) translateX(16px) rotate(-480deg); }
}
@keyframes orbitSpinSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}
@keyframes orbitBreath {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%      { transform: scale(1.08); opacity: 1; }
}
@keyframes orbitCorePulse {
  0%, 100% { transform: scale(1);   opacity: 1; }
  50%      { transform: scale(1.4); opacity: 0.7; }
}

/* 思考态文字 */
.ai-thinking-text {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
}
.ai-thinking-text strong {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 14px;
  background: linear-gradient(90deg, var(--color-primary), #6B8E76, var(--color-primary));
  background-size: 200% 100%;
  -webkit-background-clip: text;
          background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shimmerText 2.4s ease-in-out infinite;
}
.ai-thinking-text small {
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}
@keyframes shimmerText {
  0%, 100% { background-position:   0% 50%; }
  50%      { background-position: 200% 50%; }
}

/* ===== AI 完成时的星光迸射 =====
   JS 给 .summary-box.ai-box 加 .ai-celebrate，触发 7 颗星光从中心爆开
*/
.ai-sparkle {
  position: absolute;
  top: 50%; left: 50%;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  pointer-events: none;
  z-index: 2;
  --tx: 0px; --ty: 0px; --rot: 0deg;
}
.ai-sparkle::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, #FFE9B0 0%, #C89B5C 40%, transparent 70%);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(200, 155, 92, 0.85);
  animation: sparkleBurst 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes sparkleBurst {
  0%   { transform: translate(0, 0) scale(0.4) rotate(0deg);     opacity: 0; }
  20%  { opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.1) rotate(var(--rot)); opacity: 0; }
}

/* ============================================
   板块管理列表
   ============================================ */

.section-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
  margin-bottom: 4px;
}

.section-list-item:hover {
  background: var(--bg-label);
}

.section-list-item .section-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-list-item .section-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.section-list-item .section-name {
  font-size: var(--font-body);
  font-weight: 500;
  color: var(--text-secondary);
}

.section-list-item .actions {
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.section-list-item:hover .actions {
  opacity: 1;
}

/* ============================================
   登录页
   ============================================ */

.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
  background: var(--bg-page);
  position: relative;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 10%;
  left: 10%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(42, 74, 58, 0.08) 0%, transparent 70%);
  border-radius: 50%;
}

.login-container::after {
  content: '';
  position: absolute;
  bottom: 10%;
  right: 10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(200, 99, 63, 0.06) 0%, transparent 70%);
  border-radius: 50%;
}

.login-box {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
  border: 0.5px solid var(--border-primary);
}

.login-box .login-icon {
  width: 56px;
  height: 56px;
  background: var(--color-primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  font-size: 28px;
  /* 主题松绿色阴影，替换早期遗留的 indigo */
  box-shadow: 0 8px 20px rgba(42, 74, 58, 0.28);
}

.login-box h1 {
  text-align: center;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-box .subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 32px;
  font-size: 14px;
  font-weight: 400;
}

/* ============================================
   底部导航
   ============================================ */

.bottom-nav {
  text-align: center;
  padding: 24px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  font-size: 13px;
  color: var(--text-muted);
}

.bottom-nav a {
  color: var(--color-primary);
  text-decoration: none;
  margin: 0 8px;
  font-weight: 500;
  transition: color 0.2s;
}

.bottom-nav a:hover {
  color: var(--color-primary-dark);
}

/* ============================================
   复制按钮
   ============================================ */

.copy-btn {
  background: white;
  color: var(--color-primary);
  border: 0.5px solid var(--bg-label);
  padding: 7px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.copy-btn::before {
  content: '📋';
  font-size: 14px;
}

.copy-btn:hover {
  background: var(--bg-label);
}

/* ============================================
   Section 顶部操作栏
   ============================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  /* AI 提炼结果卡内同时挂着 标题 + 多个下载/复制按钮，窄屏要允许换行 */
  flex-wrap: wrap;
  gap: 8px;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}

/* ============================================
   时间选择快捷按钮组
   ============================================ */

.quick-btns {
  display: flex;
  gap: 8px;
}

.quick-btns .btn {
  font-size: 12px;
  padding: 6px 14px;
}

/* ============================================
   添加板块输入组
   ============================================ */

.input-group {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.input-group .form-group {
  flex: 1;
  margin-bottom: 0;
}

.input-group .btn {
  flex-shrink: 0;
  align-self: flex-end;
}

/* ============================================
   移动端响应式导航
   ============================================ */

.mobile-nav {
  display: none;
  overflow-x: auto;
  background: white;
  padding: 8px;
  gap: 6px;
  margin-bottom: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 0.5px solid var(--border-primary);
  -webkit-overflow-scrolling: touch;
  position: relative;
}

/* 右侧渐变遮罩，暗示可横向滚动 */
.mobile-nav::after {
  content: '';
  position: sticky;
  right: 0;
  width: 24px;
  flex-shrink: 0;
  background: linear-gradient(to right, transparent, white);
  pointer-events: none;
}

.mobile-nav-sep {
  width: 0.5px;
  height: 20px;
  background: var(--border-primary);
  flex-shrink: 0;
  align-self: center;
}

.mobile-nav .nav-item {
  padding: 10px 18px;
  border-radius: 24px;
  border: 0.5px solid var(--border-primary);
  white-space: nowrap;
  font-size: 13px;
  border-left: none;
  text-align: center;
  margin: 0;
}

.mobile-nav .nav-item.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  border-color: transparent;
}

/* ============================================
   响应式
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-content {
    margin-left: 0;
    max-width: 100%;
    padding: 16px;
  }

  .mobile-nav {
    display: flex;
  }

  .filter-bar {
    flex-direction: column;
  }

  .filter-bar .form-group {
    width: 100%;
  }

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

  .stat-card {
    padding: 16px;
  }

  .stat-card .number {
    font-size: 28px;
  }

  .header {
    padding: 28px 20px;
    margin-bottom: 20px;
  }

  .header h1 {
    font-size: 22px;
  }

  .card {
    padding: 20px;
  }

  .container {
    padding: 16px;
  }

  .report-card .report-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .section-list-item .actions {
    opacity: 1;
  }
}

/* ============================================
   滚动条美化
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bg-label);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ============================================
   加载动画
   ============================================ */

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   历史记录页的日期分组标题
   ============================================ */

.date-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 16px;
}

.date-divider .date-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.date-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-primary);
}

/* ============================================
   排行榜（新设计：三列卡片式）
   ============================================ */

/* ============================================
   排行榜（新设计：三列卡片式）
   ============================================ */

.ranking-widget {
  background: var(--bg-card);
  border: 0.5px solid var(--border-primary);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 16px;
  overflow: visible;
}

/* ============================================
   板块活跃度紧凑 tile 网格（rank-board，最新）
   ============================================ */
.rank-board { padding: 12px 14px; margin-bottom: 12px; }
.rank-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.rank-board-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}
.rank-board-icon {
  display: inline-flex;
  align-items: center;
  color: var(--color-primary);
}
.rank-board-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  padding: 2px 8px;
  background: var(--bg-label);
  border-radius: 999px;
  margin-left: 4px;
}
.rank-board-toggle {
  background: transparent;
  border: 0.5px solid var(--border-primary);
  color: var(--color-primary);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.rank-board-toggle:hover {
  background: var(--bg-label);
  border-color: var(--color-primary);
}

.rank-board-loading {
  padding: 18px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 紧凑 tile 网格：桌面一排 4-6 个，移动端默认折叠到第一排 ===== */
.rank-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 8px;
}

/* 每个板块 tile：[名次] [图标] [名称+柱条] [次数] 横向 */
.rank-tile {
  --h: 142;  /* 默认色相，JS 会按板块名 hash 覆盖 */
  position: relative;
  display: grid;
  grid-template-columns: 18px 22px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg,
      hsl(var(--h) 32% 96%) 0%,
      var(--bg-card) 70%);
  border: 0.5px solid hsl(var(--h) 22% 80% / 0.7);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.2s ease,
              border-color 0.2s ease;
  overflow: hidden;
  cursor: default;
  /* 入场：每张依次 fadeUp，--i 由 JS 设 */
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
  animation-delay: calc(var(--i, 0) * 50ms);
}
.rank-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px hsl(var(--h) 30% 50% / 0.18);
  border-color: hsl(var(--h) 35% 60% / 0.6);
}
/* hover 时给图标一个轻微弹跳，呼应"鼠标到了" */
.rank-tile:hover .rank-tile-icon {
  transform: scale(1.15) rotate(-4deg);
}

.rank-tile-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  background: hsl(var(--h) 30% 88%);
  color: hsl(var(--h) 40% 28%);
  flex-shrink: 0;
}

.rank-tile-icon {
  font-size: 16px;
  line-height: 1;
  text-align: center;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.rank-tile-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.rank-tile-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.rank-tile-bar {
  height: 3px;
  border-radius: 999px;
  background: hsl(var(--h) 25% 88%);
  overflow: hidden;
}
.rank-tile-bar > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, hsl(var(--h) 35% 55%), hsl(var(--h) 45% 42%));
  /* 入场时由 0 → 目标宽度，错峰显得有节奏 */
  transition: width 0.7s cubic-bezier(0.16, 1, 0.3, 1);
  transition-delay: calc(150ms + var(--i, 0) * 50ms);
}

.rank-tile-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.rank-tile-count small {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  margin-left: 2px;
}

/* Leader：金色徽章 + 金色 bar + 微光呼吸 */
.rank-tile.is-leader {
  border-color: rgba(200, 155, 92, 0.55);
  background: linear-gradient(135deg, #FBF1DC, var(--bg-card) 75%);
  animation: fadeUp 0.45s cubic-bezier(0.16, 1, 0.3, 1) both,
             tileLeaderPulse 3.4s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 50ms), calc(0.5s + var(--i, 0) * 50ms);
}
.rank-tile.is-leader .rank-tile-rank {
  background: linear-gradient(135deg, #E6C28A, #C89B5C);
  color: #4A3416;
  box-shadow: 0 1px 4px rgba(200, 155, 92, 0.45);
}
.rank-tile.is-leader .rank-tile-bar > span {
  background: linear-gradient(90deg, #E6C28A, #C89B5C, #B8894A);
}
@keyframes tileLeaderPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 155, 92, 0.0); }
  50%      { box-shadow: 0 0 0 4px rgba(200, 155, 92, 0.15); }
}

/* 桌面默认全展开；只有移动端 + collapsed 时才隐藏第二排起 */
.rank-board-grid.is-collapsed > .rank-tile { /* 桌面 noop */ }

.ranking-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  margin-bottom: 14px;
}

.ranking-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ranking-badge {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 8px;
  background: var(--bg-label);
  border-radius: 999px;
  font-weight: 400;
}

.ranking-toggle {
  margin-left: auto;
  color: var(--text-muted);
  flex-shrink: 0;
  font-size: 12px;
}
.ranking-bar:hover .ranking-toggle { color: var(--color-primary); }

.ranking-podium {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.ranking-podium-loading {
  font-size: 12px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* 排行榜前三名卡片 */
.rank-card {
  border-radius: var(--radius);
  padding: 14px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
}
.rank-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.rank-card-1 {
  background: var(--rank1-bg);
  /* 冠军：金色脉冲呼吸光环 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 0 0 0 rgba(200, 155, 92, 0.3);
  animation: championGlow 3.4s ease-in-out infinite;
}
.rank-card-1:hover {
  animation-play-state: paused;
}
@keyframes championGlow {
  0%, 100% { box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 0  0px 0 rgba(200, 155, 92, 0.0); }
  50%      { box-shadow: 0 1px 2px rgba(0,0,0,0.05), 0 0 24px 2px rgba(200, 155, 92, 0.35); }
}
/* 冠军杯子轻微飘动 */
.rank-card-1 .rank-card-trophy {
  animation: trophyFloat 3s ease-in-out infinite;
}
@keyframes trophyFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-2px) rotate(-3deg); }
}

.rank-card-2, .rank-card-3 {
  background: var(--bg-card);
  border: 0.5px solid var(--border-primary);
}

.rank-card-glow {
  position: absolute;
  top: 0; right: 0;
  width: 70px; height: 70px;
  border-radius: 0 0 0 70px;
  pointer-events: none;
}
.rank-card-1 .rank-card-glow { background: radial-gradient(circle at top right, var(--rank1-glow) 0%, transparent 70%); }
.rank-card-2 .rank-card-glow { background: radial-gradient(circle at top right, var(--rank2-glow) 0%, transparent 70%); }
.rank-card-3 .rank-card-glow { background: radial-gradient(circle at top right, var(--rank3-glow) 0%, transparent 70%); }

.rank-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  position: relative;
}
.rank-card-trophy { display: flex; align-items: center; gap: 6px; }
.rank-card-label { font-size: 10px; font-weight: 500; letter-spacing: 1.5px; }
.rank-card-1 .rank-card-label { color: var(--rank1-text); }
.rank-card-2 .rank-card-label { color: var(--rank2-text); }
.rank-card-3 .rank-card-label { color: var(--rank3-text); }
.rank-card-count { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.rank-card-name { font-size: 14px; font-weight: 500; margin-bottom: 10px; position: relative; }
.rank-card-1 .rank-card-name { color: var(--rank1-name); }
.rank-card-2 .rank-card-name, .rank-card-3 .rank-card-name { color: var(--text-primary); }

.rank-bar { position: relative; height: 2px; border-radius: 999px; overflow: hidden; }
.rank-card-1 .rank-bar { background: var(--rank1-bar-bg); }
.rank-card-2 .rank-bar { background: var(--rank2-bar-bg); }
.rank-card-3 .rank-bar { background: var(--rank3-bar-bg); }
/* 进度条宽度变化时平滑生长，避免每次重渲染时硬跳 */
.rank-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  width: 0;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.rank-card-1 .rank-bar-fill { background: var(--rank1-bar-fill); }
.rank-card-2 .rank-bar-fill { background: var(--rank2-bar-fill); }
.rank-card-3 .rank-bar-fill { background: var(--rank3-bar-fill); }

/* 展开的完整榜单 */
.ranking-full {
  border-top: 0.5px solid var(--border-light);
  padding: 12px 16px 14px;
  background: var(--bg-page);
  border-radius: var(--radius);
  margin-top: 10px;
}
[hidden].ranking-full { display: none !important; }
.ranking-full-inner { display: flex; flex-direction: column; gap: 6px; }

.rank-row {
  display: grid;
  grid-template-columns: 26px minmax(80px, 1fr) minmax(80px, 2fr) auto;
  align-items: center;
  gap: 10px;
  padding: 4px;
  border-radius: 6px;
}
.rank-row:hover { background: var(--bg-label); }
.rank-top { font-size: 13px; font-weight: 500; }
.rank-rest { font-size: 12px; color: var(--text-muted); }
.rank-rest:hover { color: var(--text-secondary); }
.rank-trophy { font-size: 16px; text-align: center; }
.rank-num {
  display: inline-flex; justify-content: center; align-items: center;
  width: 22px; height: 22px;
  font-size: 11px; font-weight: 500;
  color: var(--text-muted);
  background: var(--border-primary);
  border-radius: 50%;
}
.rank-name { color: inherit; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank-bar { position: relative; height: 4px; background: var(--border-light); border-radius: 3px; overflow: hidden; }
.rank-bar-fill { display: block; height: 100%; background: var(--color-primary); border-radius: 3px; }
.rank-bar-fill.gold   { background: var(--rank1-bar-fill); }
.rank-bar-fill.silver { background: var(--rank2-bar-fill); }
.rank-bar-fill.bronze { background: var(--rank3-bar-fill); }
.rank-count { font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; color: var(--text-muted); }
.rank-empty { padding: 16px 0; text-align: center; color: var(--text-muted); font-size: 13px; }

@media (max-width: 520px) {
  .ranking-podium { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 22px minmax(60px, 1fr) minmax(60px, 1.5fr) auto; gap: 8px; }
}

/* 管理后台筛选栏——小屏双列网格 */
@media (max-width: 480px) {
  .filter-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .filter-bar .btn {
    grid-column: span 1;
  }
}

/* ============================================
   提炼结果历史（admin 提炼页内嵌列表）
   ============================================ */

.summary-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}
.summary-history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 0.5px solid var(--border-primary);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}
.summary-history-item:hover {
  border-color: var(--color-primary);
  background: var(--bg-label);
  transform: translateX(2px);
}
.summary-history-item.active {
  border-color: var(--color-primary);
  background: var(--bg-label);
  box-shadow: 0 0 0 2px rgba(42, 74, 58, 0.12);
}
.summary-history-date {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
}
.summary-history-meta {
  flex: 1;
  font-size: 12px;
  color: var(--text-muted);
}
.summary-history-del {
  color: var(--danger);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.summary-history-del:hover { background: var(--danger-light); }

/* ============================================
   移动端适配（提交页 index.html 专用）
   ============================================ */

@media (max-width: 640px) {
  /* 容器 / 卡片间距收紧 */
  .container { padding: 16px 12px; }
  .card { padding: 16px 14px; margin-bottom: 12px; }

  /* 头部 banner：缩小内边距，标题行允许换行 */
  .header { padding: 14px 16px; }
  .header > div:first-child > div:last-child > div:first-child { font-size: 15px; }
  .header > div:last-child { flex-shrink: 0; }

  /* 头部 AI 数据流水线场景：移动端不再隐藏，简化为"AI 内核 + 单条数据流"
     （窄屏没空间放完整流水线，但保留 AI 在工作的视觉信号） */
  .header-scene {
    display: flex;
    flex: 0 0 auto;
    width: 56px;
    height: 44px;
    margin: 0 4px 0 0;
  }
  /* 隐藏完整版的左侧板块、右侧输出、长曲线、流动粒子 */
  .header-scene-svg .hs-sources,
  .header-scene-svg .hs-output,
  .header-scene-svg .hs-lines,
  .header-scene-svg .hs-particles { display: none; }
  /* 把 AI 内核挪到 viewBox 中央，并放大撑满 */
  .header-scene-svg .hs-core {
    transform: translate(140px, 32px) scale(1.5);
    transform-origin: 168px 32px;
  }
  /* 移动端再加一圈"信号"扩散环，让小尺寸下也有动感 */
  .header-scene-svg .hs-core::after { /* SVG 内不能用伪元素，下方用真元素 */ }

  /* 板块活跃度榜：列宽收紧 + 网格自动按窄屏排两列 */
  .rank-board { padding: 12px 12px; }
  .rank-board-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 6px;
  }
  .rank-tile {
    grid-template-columns: 16px 18px 1fr auto;
    gap: 6px;
    padding: 6px 8px;
  }
  .rank-tile-rank { width: 16px; height: 16px; font-size: 9px; }
  .rank-tile-icon { font-size: 14px; }
  .rank-tile-name { font-size: 11px; }
  .rank-tile-bar { height: 2.5px; }
  .rank-tile-count { font-size: 12px; }
  .rank-tile-count small { font-size: 9px; }
  .rank-board-toggle { font-size: 10px; padding: 3px 8px; }
  .rank-board-meta { font-size: 10px; padding: 1px 6px; }
  .rank-board-title { font-size: 11px; }

  /* ★ 移动端折叠：默认只显示前 2 个 tile（一行），其它 fade-out 隐藏 */
  .rank-board-grid.is-collapsed > .rank-tile:nth-child(n+3) {
    display: none;
  }

  /* 排行榜 widget：标题行单独占一行，下方放三张奖牌卡 */
  .ranking-widget { padding: 14px 14px; }
  .ranking-bar { flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
  .ranking-title { font-size: 12px; flex: 1; min-width: 0; }
  .ranking-toggle { margin-left: auto; }
  .ranking-podium {
    grid-column: 1 / -1;
    width: 100%;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 10px;
  }
  .rank-card { padding: 12px 14px; }
  .rank-card-name { font-size: 13px; margin-bottom: 8px; }

  /* 提交表单：日报日期 / 所属板块 双列 -> 单列 */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* 底部操作栏：草稿状态独占一行，两按钮平分 */
  .form-actions {
    flex-wrap: wrap;
    gap: 10px !important;
  }
  #draftStatus {
    flex: 1 1 100%;
    order: -1;
  }
  #saveDraftBtn,
  #submitBtn {
    flex: 1 1 0;
    justify-content: center;
    white-space: nowrap;
    padding: 10px 12px !important;
  }

  /* 历史记录筛选：清除筛选按钮换行不挤 */
  #historyFilterPills { gap: 6px; }
  #clearFilterBtn { margin-left: 0 !important; }

  /* 历史记录列表行：紧凑日期列 + 查看按钮自适应 */
  .history-item {
    gap: 10px !important;
    padding: 10px 12px !important;
  }
  .history-item .date-big { font-size: 18px !important; }

  /* 详情弹窗：移动端贴边、留出底部安全区 */
  .modal {
    max-width: 100%;
    width: calc(100% - 24px);
    margin: 12px;
    max-height: calc(100vh - 24px);
    overflow-y: auto;
  }

  /* 按钮触控区域优化 */
  .history-item button {
    min-height: 36px;
    min-width: 44px;
    padding: 8px 14px;
  }
  .date-shortcut {
    min-height: 36px;
    padding: 6px 12px;
  }
}

@media (max-width: 380px) {
  /* 极小屏：日期快捷按钮文字更紧凑 */
  .date-shortcut { padding: 8px 6px !important; min-height: 36px; font-size: 11px !important; }
  /* 排行榜卡片标签字号收紧 */
  .rank-card-label { font-size: 9px; letter-spacing: 1px; }
}
