/* ============ Reset & Variables ============ */
  *, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
  html {
    overscroll-behavior-y: none;
  }
  body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    overscroll-behavior-y: none;
  }
  :root {
    /* 中性色阶 — 冷静克制的基底 */
    --c-bg: #f8f9fa;
    --c-card: #ffffff;
    --c-text: #1e293b;
    --c-sub: #64748b;
    --c-muted: #94a3b8;
    --c-border: #e2e8f0;
    --c-hover: #f1f5f9;
    /* 语义色 — 降低饱和度，仅用于状态标记 */
    --c-green: #4a9d6c;
    --c-green-bg: #f0faf3;
    --c-yellow: #c4933a;
    --c-yellow-bg: #fdfaf0;
    --c-red: #d15454;
    --c-red-bg: #fdf6f6;
    --c-blue: #4a6fa5;
    --c-blue-bg: #f1f5fa;
    /* 统一主色 — 替代此前紫/青/橙等分散强调色 */
    --c-accent: #475569;
    --c-accent-bg: #f1f5f9;
    --c-accent-light: #64748b;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 2px 12px rgba(0,0,0,0.06);
  }

  /* ============ Dark Theme (非纯黑中性深色) ============ */
  [data-theme="dark"] {
    --c-bg: #14171c;
    --c-card: #1b212a;
    --c-text: #e7ebf0;
    --c-sub: #9aa6b5;
    --c-muted: #6b7686;
    --c-border: #2a323d;
    --c-hover: #232c38;
    --c-green: #5fbf87;
    --c-green-bg: #16271e;
    --c-yellow: #e0a94e;
    --c-yellow-bg: #2b2415;
    --c-red: #e67878;
    --c-red-bg: #2e1d1d;
    --c-blue: #7aa3d9;
    --c-blue-bg: #16273f;
    --c-accent: #94a3b8;
    --c-accent-bg: #232c38;
    --c-accent-light: #b3bccb;
    --shadow: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-lg: 0 2px 12px rgba(0,0,0,0.5);

    /* 覆写写死的颜色（暗色下不搭的元素） */
    .hidden-corr-card { background: var(--c-card); }
    .hidden-corr-card.placeholder { background: #181d24; }
    .corr-strength .strength-bar,
    .corr-progress-row .corr-progress-bar,
    .score-detail .dim-bar,
    .insight-score-bars .dim-bar,
    .upload-progress .progress-bar-outer { background: #2a323d; }
    .entry-chip { background: var(--c-card); }
    .ai-chip { background: var(--c-card); }
    .sync-hint code { background: #232c38; }
    .risk-callout { border-color: #5a2e2e; color: #e67878; }
    .upload-result.success { color: #7fc89a; }
    .upload-result.error { color: #f0a0a0; }
    .report-badge.normal { background: #16271e; color: #7fc89a; }
    .report-badge.warn { background: #2b2415; color: #e0a94e; }
    .report-badge.danger { background: #2e1d1d; color: #f0a0a0; }
    .summary-item.abnormal { background: var(--c-red-bg); }
    .encyc-card { background: var(--c-hover); }

    /* 表单控件暗色基底（覆盖浏览器默认白底） */
    input, textarea, select { background: var(--c-card); color: var(--c-text); }

    /* 暗色下 Hero 渐变更明显 */
    .hero-bg {
      background:
        radial-gradient(120% 130% at 0% 0%, rgba(122,163,217,0.14), transparent 55%),
        radial-gradient(120% 130% at 100% 100%, rgba(95,191,135,0.10), transparent 50%);
    }

    /* 主题切换按钮：暗色时显示太阳 */
    .theme-toggle .ic-moon { display: none; }
    .theme-toggle .ic-sun { display: block; }
  }

  /* ============ Theme Toggle Button ============ */
  .theme-toggle {
    width: 38px; height: 38px;
    border-radius: 10px;
    border: 1.5px solid var(--c-border);
    background: var(--c-card);
    color: var(--c-sub);
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    flex-shrink: 0;
  }
  .theme-toggle:hover { color: var(--c-text); border-color: var(--c-accent-light); }
  .theme-toggle:active { transform: scale(0.94); }
  .theme-toggle svg { width: 18px; height: 18px; }
  .theme-toggle .ic-sun { display: none; }

  /* ============ Layout ============ */
  .app {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px 80px;
  }

  /* ============ Header Hero ============ */
  .hero {
    padding: 32px 0 24px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
  }
  .hero-left h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--c-text);
  }
  .hero-left .tagline {
    font-size: 14px;
    color: var(--c-sub);
    margin-top: 4px;
    font-weight: 400;
  }
  .hero-right {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .hero-date {
    font-size: 14px;
    color: var(--c-muted);
    text-align: right;
  }
  .hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
  }
  .hero-badge.good { background: var(--c-green-bg); color: var(--c-green); }
  .hero-badge.warn { background: var(--c-yellow-bg); color: var(--c-yellow); }
  .hero-badge.bad  { background: var(--c-red-bg); color: var(--c-red); }

  /* ---- Hero 重构：有温度的头部 ---- */
  .hero { position: relative; overflow: hidden; }
  .hero-bg {
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background:
      radial-gradient(120% 130% at 0% 0%, rgba(74,111,165,0.10), transparent 55%),
      radial-gradient(120% 130% at 100% 100%, rgba(74,157,108,0.08), transparent 50%);
    border-radius: 0 0 24px 24px;
  }
  .hero-left, .hero-right { position: relative; z-index: 1; }
  .hero-brand { display: flex; align-items: center; gap: 10px; }
  .hero-pulse {
    position: relative;
    width: 34px; height: 34px; border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    background: var(--c-blue-bg); color: var(--c-blue);
    box-shadow: inset 0 0 0 1px rgba(74,111,165,0.15);
  }
  .hero-pulse svg { width: 20px; height: 20px; }
  .hero-pulse::after {
    content: ''; position: absolute; inset: -3px; border-radius: 12px;
    border: 1.5px solid var(--c-blue); opacity: 0.5;
    animation: heroPulse 2.4s ease-out infinite;
  }
  @keyframes heroPulse {
    0% { transform: scale(0.9); opacity: 0.5; }
    70% { transform: scale(1.5); opacity: 0; }
    100% { transform: scale(1.5); opacity: 0; }
  }
  .hero-left h1 { display: inline; }
  .hero-tagline {
    font-size: 14px; color: var(--c-sub); margin-top: 8px; font-weight: 400;
    max-width: 420px; line-height: 1.5;
  }
  .hero-status {
    display: flex; align-items: center; gap: 8px; margin-top: 14px;
    font-size: 13px; color: var(--c-muted);
  }
  .status-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--c-green); flex-shrink: 0;
    animation: statusPulse 2s ease-in-out infinite;
  }
  @keyframes statusPulse {
    0%,100% { opacity: 1; }
    50% { opacity: 0.5; }
  }
  @media (prefers-reduced-motion: reduce) {
    .hero-pulse::after, .status-dot { animation: none !important; }
  }

  /* ============ Story Flow Sections ============ */
  .story-section {
    margin-bottom: 28px;
  }
  .story-section .section-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
  }
  .story-section .section-head .icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
  }
  .icon.blood { background: var(--c-red-bg); }
  .icon.ph   { background: var(--c-accent-bg); }
  .icon.link { background: var(--c-blue-bg); }
  .icon.health { background: var(--c-green-bg); }
  .icon.ai   { background: var(--c-yellow-bg); }
  .icon.record { background: var(--c-hover); }
  .icon.discover { background: var(--c-accent-bg); }
  .story-section .section-head h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--c-text);
  }
  .story-section .section-head .section-sub {
    font-size: 12px;
    color: var(--c-muted);
    margin-left: auto;
  }

  /* ============ Cards ============ */
  .card {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
  }
  .card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }
  .card-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: var(--c-sub);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }
  .card-header .badge {
    font-size: 12px;
    padding: 3px 10px;
    border-radius: 10px;
    font-weight: 500;
  }
  .badge.ok  { background: var(--c-green-bg); color: var(--c-green); }
  .badge.warn { background: var(--c-yellow-bg); color: var(--c-yellow); }
  .badge.info { background: var(--c-blue-bg); color: var(--c-blue); }

  /* ============ Pin Button ============ */
  .pin-btn {
    width: 28px; height: 28px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    opacity: 0.4;
    transition: opacity 0.2s, transform 0.15s;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
  }
  .pin-btn:hover { opacity: 1; transform: scale(1.15); }
  .pin-btn.pinned { opacity: 1; }

  /* ============ Insight Box ============ */
  .insight-box {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    border: 1px solid var(--c-border);
  }
  .insight-box .insight-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--c-text);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .insight-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .insight-item {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.7;
    position: relative;
  }
  .insight-item.positive { background: var(--c-green-bg); border-left: 4px solid var(--c-green); }
  .insight-item.warning  { background: var(--c-yellow-bg); border-left: 4px solid var(--c-yellow); }
  .insight-item.info     { background: var(--c-blue-bg); border-left: 4px solid var(--c-blue); }
  .insight-item.danger   { background: var(--c-red-bg); border-left: 4px solid var(--c-red); }
  .insight-item .tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
  }
  .tag.positive { background: var(--c-green); color: white; }
  .tag.warning  { background: var(--c-yellow); color: white; }
  .tag.info     { background: var(--c-blue); color: white; }
  .tag.danger   { background: var(--c-red); color: white; }
  .tag.discover { background: var(--c-accent); color: white; }

  /* ============ AI Refresh Button (v0.2) ============ */
  .ai-refresh-btn {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid var(--c-blue);
    background: var(--c-blue-bg);
    color: var(--c-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .ai-refresh-btn:hover { background: var(--c-blue); color: white; }
  .ai-refresh-btn:disabled { opacity: 0.55; cursor: not-allowed; }

  /* ============ Hidden Correlation Cards ============ */
  .hidden-corr-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
  }
  .hidden-corr-card {
    background: white;
    border-radius: var(--radius);
    border: 1.5px solid var(--c-border);
    padding: 18px;
    transition: border-color 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
  }
  .hidden-corr-card:hover {
    border-color: var(--c-accent-light);
    box-shadow: 0 2px 12px rgba(71,85,105,0.08);
  }
  .hidden-corr-card.placeholder {
    background: #f7fafc;
    border-style: dashed;
  }
  .hidden-corr-card .corr-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
  }
  .hidden-corr-card .corr-pair {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
  }
  .hidden-corr-card .corr-pair .metric-pair-icon {
    font-size: 20px;
  }
  .hidden-corr-card .corr-pair .connector {
    color: var(--c-accent);
    font-size: 16px;
    font-weight: 900;
  }
  .corr-strength {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
  }
  .corr-strength .strength-bar {
    width: 50px;
    height: 5px;
    border-radius: 3px;
    background: #edf2f7;
    overflow: hidden;
  }
  .corr-strength .strength-fill {
    height: 100%;
    border-radius: 3px;
  }
  .strength-fill.strong { background: var(--c-accent); }
  .strength-fill.moderate { background: var(--c-yellow); }
  .strength-fill.weak { background: var(--c-muted); }
  .corr-strength .strength-label {
    font-weight: 600;
    color: var(--c-sub);
  }
  .hidden-corr-card .corr-mini-chart {
    height: 80px;
    margin: 8px 0 10px;
  }
  .hidden-corr-card .corr-explanation {
    font-size: 13px;
    color: var(--c-text);
    line-height: 1.65;
    background: var(--c-accent-bg);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    border-left: 3px solid var(--c-accent);
  }
  .hidden-corr-card.placeholder .corr-explanation {
    background: #fff;
    border-left-color: var(--c-muted);
    color: var(--c-sub);
  }
  .hidden-corr-card .corr-explanation .ai-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: 3px;
    background: var(--c-accent);
    color: white;
    margin-right: 4px;
    vertical-align: middle;
  }
  .hidden-corr-card .corr-source {
    font-size: 11px;
    color: var(--c-muted);
    margin-top: 8px;
    font-style: italic;
  }
  .corr-progress {
    padding: 10px 0;
  }
  .corr-progress-row {
    margin-bottom: 10px;
  }
  .corr-progress-row:last-child { margin-bottom: 0; }
  .corr-progress-row .corr-progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--c-sub);
    margin-bottom: 4px;
  }
  .corr-progress-row .corr-progress-bar {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #edf2f7;
    overflow: hidden;
  }
  .corr-progress-row .corr-progress-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.4s;
  }

  /* ============ Grid Layouts ============ */
  .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
  .grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
  .grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }
  .grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }

  /* ============ Chart Containers ============ */
  .chart-wrap { width: 100%; }
  .chart-wrap.short { height: 260px; }
  .chart-wrap.medium { height: 320px; }
  .chart-wrap.tall { height: 380px; }

  /* ============ Summary Strip ============ */
  .summary-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
  }
  .summary-item {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    position: relative;
    overflow: hidden;
  }
  .summary-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
  }
  .summary-item.good::after { background: var(--c-green); }
  .summary-item.warn::after { background: var(--c-yellow); }
  .summary-item.bad::after  { background: var(--c-red); }
  .summary-item.empty::after { background: transparent; }
  .summary-item.empty { opacity: 0.65; }
  .summary-item.empty .metric-value { font-size: 20px; }
  /* B3: 异常预警边框 */
  .summary-item.abnormal {
    border: 2px solid var(--c-red);
    background: var(--c-red-bg);
    box-shadow: 0 1px 6px rgba(209,84,84,0.08);
  }
  .summary-item .metric-icon {
    font-size: 22px;
    margin-bottom: 4px;
  }
  .summary-item .metric-label {
    font-size: 12px;
    color: var(--c-sub);
    margin-bottom: 4px;
  }
  .summary-item .metric-value {
    font-size: 22px;
    font-weight: 700;
  }
  .summary-item .metric-unit {
    font-size: 12px;
    color: var(--c-muted);
    margin-left: 2px;
  }
  .summary-item .metric-sub {
    font-size: 11px;
    color: var(--c-muted);
    margin-top: 2px;
  }
  .summary-item .metric-arrow {
    font-size: 11px;
    font-weight: 600;
  }
  .metric-arrow.up   { color: var(--c-green); }
  .metric-arrow.down { color: var(--c-red); }
  .metric-arrow.flat { color: var(--c-sub); }

  /* ============ Risk Zone Highlight ============ */
  .risk-callout {
    background: var(--c-red-bg);
    border: 1px solid #e8c8c8;
    border-radius: var(--radius);
    padding: 14px 18px;
    margin-top: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #8b3a3a;
  }
  .risk-callout .risk-icon {
    font-size: 24px;
    flex-shrink: 0;
  }

  /* ============ Score Display ============ */
  .score-ring {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
  }
  .score-value {
    font-size: 48px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -2px;
  }
  .score-value.good { color: var(--c-green); }
  .score-value.warn { color: var(--c-yellow); }
  .score-value.bad  { color: var(--c-red); }
  .score-label {
    font-size: 13px;
    color: var(--c-sub);
    margin-top: 6px;
  }
  .score-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 14px;
    font-size: 12px;
    color: var(--c-sub);
  }
  .score-detail .dim {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .score-detail .dim-bar {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #edf2f7;
    overflow: hidden;
  }
  .score-detail .dim-bar-fill {
    height: 100%;
    border-radius: 3px;
  }
  .dim-bar-fill.high { background: var(--c-green); }
  .dim-bar-fill.mid  { background: var(--c-yellow); }
  .dim-bar-fill.low  { background: var(--c-red); }

  /* ============ Entry Zone ============ */
  .entry-zone {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
  }
  .entry-zone h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
  }
  .entry-hint {
    font-size: 12px;
    color: var(--c-muted);
    margin-bottom: 12px;
  }
  .entry-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
  }
  .entry-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1.5px solid var(--c-border);
    background: white;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .entry-chip:hover, .entry-chip.active {
    border-color: var(--c-blue);
    background: var(--c-blue-bg);
    color: var(--c-blue);
  }
  .entry-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
  }
  .entry-row input {
    flex: 1;
    min-width: 120px;
    padding: 10px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border 0.2s;
  }
  .entry-row input:focus {
    border-color: var(--c-blue);
  }
  .entry-row .btn {
    padding: 10px 22px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
  }
  .btn-primary {
    background: var(--c-blue);
    color: white;
  }
  .btn-primary:hover { background: #2b6cb0; }
  .btn-secondary {
    background: #edf2f7;
    color: var(--c-text);
  }
  .btn-ocr {
    background: var(--c-accent-bg);
    color: var(--c-accent);
    border: 1px solid var(--c-border) !important;
  }
  /* A1: 防抖禁用态 */
  .btn:disabled, .sticky-save-btn:disabled, .ai-refresh-btn:disabled, #csvImportBtn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
  }

  /* ============ AI Float Button ============ */
  .ai-float {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 200;
  }
  .ai-float-btn {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #4a6fa5, #3a5a8a);
    color: white;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(74,111,165,0.35);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  .ai-float-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 28px rgba(74,111,165,0.45);
  }
  .ai-float-btn:active {
    transform: scale(0.96);
  }
  /* 呼吸光环 — 暗示"AI 待命中" */
  .ai-float-btn::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(74,111,165,0.4);
    animation: aiPulse 2.5s ease-out infinite;
    pointer-events: none;
  }
  .ai-float-btn::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid rgba(74,111,165,0.3);
    animation: aiPulse 2.5s ease-out infinite;
    animation-delay: 1.25s;
    pointer-events: none;
  }
  @keyframes aiPulse {
    0%   { transform: scale(1);    opacity: 0.6; }
    70%  { transform: scale(1.35); opacity: 0;   }
    100% { transform: scale(1.35); opacity: 0;   }
  }
  .ai-float-btn svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    position: relative;
    z-index: 1;
  }
  /* hover 时展开文字标签 */
  .ai-float-label {
    position: absolute;
    right: 68px;
    top: 50%;
    transform: translateY(-50%) translateX(8px);
    background: var(--c-text);
    color: white;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
  }
  .ai-float-label::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%);
    border-left: 5px solid var(--c-text);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
  }
  .ai-float:hover .ai-float-label {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
  }
  @media (max-width: 768px) {
    .ai-float { bottom: 20px; right: 20px; }
    .ai-float-label { display: none; }
  }
  .back-to-top {
    position: fixed;
    bottom: 100px;
    right: 32px;
    z-index: 200;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    transform: translateY(10px);
  }
  .back-to-top.show {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
  }
  .back-to-top button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--c-border);
    background: var(--c-card);
    color: var(--c-text);
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .back-to-top button:hover {
    transform: scale(1.08);
    background: var(--c-hover);
  }
  .ai-panel-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 300;
    opacity: 0; pointer-events: none;
    transition: opacity 0.3s;
  }
  .ai-panel-overlay.show {
    opacity: 1; pointer-events: all;
  }
  .ai-panel {
    position: fixed;
    top: 0; right: 0;
    width: 420px; max-width: 100vw;
    height: 100vh;
    background: var(--c-card);
    z-index: 310;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column;
  }
  .ai-panel.show { transform: translateX(0); }
  .ai-panel-header {
    padding: 18px 20px;
    border-bottom: 1px solid var(--c-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    font-size: 16px;
  }
  .ai-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }
  .ai-suggestion-chips {
    display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px;
  }
  .ai-chip {
    padding: 6px 14px;
    border-radius: 16px;
    border: 1px solid var(--c-border);
    background: white;
    font-size: 13px;
    cursor: pointer;
    color: var(--c-sub);
    transition: all 0.15s;
  }
  .ai-chip:hover {
    border-color: var(--c-accent);
    color: var(--c-accent);
  }
  .ai-chat-msg {
    margin-bottom: 14px;
    display: flex;
    gap: 10px;
  }
  .ai-chat-msg.user {
    flex-direction: row-reverse;
  }
  .ai-chat-msg .msg-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .ai-chat-msg.assistant .msg-avatar { background: var(--c-accent-bg); }
  .ai-chat-msg.user .msg-avatar { background: var(--c-accent); color: white; }
  .ai-chat-msg .msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
  }
  .ai-chat-msg.assistant .msg-bubble {
    background: var(--c-hover);
    border-bottom-left-radius: 4px;
  }
  .ai-chat-msg.user .msg-bubble {
    background: var(--c-accent);
    color: white;
    border-bottom-right-radius: 4px;
  }
  .ai-panel-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--c-border);
    display: flex;
    gap: 8px;
  }
  .ai-panel-footer input {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--c-border);
    border-radius: 20px;
    font-size: 14px;
    outline: none;
  }
  .ai-panel-footer input:focus { border-color: var(--c-accent); }
  .ai-panel-footer .send-btn {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: var(--c-accent);
    color: white;
    border: none;
    font-size: 16px;
    cursor: pointer;
  }

  /* ============ Sync Zone ============ */
  .sync-zone {
    background: var(--c-card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
  }
  .sync-zone h3 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
  }
  .sync-hint {
    font-size: 12px;
    color: var(--c-muted);
    margin-bottom: 16px;
    line-height: 1.7;
  }
  .sync-hint code {
    background: #edf2f7;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: var(--c-text);
  }
  .upload-area {
    border: 2px dashed var(--c-border);
    border-radius: 14px;
    padding: 32px 20px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
  }
  .upload-area:hover, .upload-area.dragover {
    border-color: var(--c-blue);
    background: var(--c-blue-bg);
  }
  .upload-area .upload-icon {
    font-size: 36px;
    margin-bottom: 8px;
  }
  .upload-area .upload-text {
    font-size: 14px;
    color: var(--c-sub);
    margin-bottom: 4px;
  }
  .upload-area .upload-sub {
    font-size: 12px;
    color: var(--c-muted);
  }
  .upload-area .upload-btn {
    margin-top: 12px;
    padding: 8px 20px;
    border-radius: 10px;
    border: none;
    background: var(--c-blue);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
  }
  .upload-area .upload-btn:hover { background: #2b6cb0; }
  .upload-progress {
    display: none;
    margin-top: 16px;
  }
  .upload-progress.show { display: block; }
  .progress-bar-outer {
    width: 100%;
    height: 10px;
    border-radius: 5px;
    background: #edf2f7;
    overflow: hidden;
  }
  .progress-bar-inner {
    height: 100%;
    border-radius: 5px;
    background: var(--c-blue);
    transition: width 0.3s;
    width: 0%;
  }
  .progress-bar-inner.parse {
    background: var(--c-accent);
  }
  .progress-text {
    font-size: 12px;
    color: var(--c-sub);
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
  }
  .upload-result {
    display: none;
    margin-top: 16px;
    padding: 16px;
    border-radius: 12px;
    font-size: 13px;
  }
  .upload-result.show { display: block; }
  .upload-result.success {
    background: var(--c-green-bg);
    border-left: 4px solid var(--c-green);
    color: #22543d;
  }
  .upload-result.error {
    background: var(--c-red-bg);
    border-left: 4px solid var(--c-red);
    color: #742a2a;
  }
  .upload-result .result-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
  }
  .upload-result .result-row strong { font-weight: 700; }
  .sync-collapse {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }
  .sync-collapse.open { max-height: 800px; }
  .sync-toggle {
    font-size: 12px;
    color: var(--c-blue);
    cursor: pointer;
    border: none;
    background: none;
    font-weight: 600;
    padding: 4px 0;
  }

  /* ============ CSV Import Section (C2 v0.2) ============ */
  .csv-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--c-border);
  }
  .csv-section .csv-row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .csv-template-link {
    color: var(--c-blue);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    margin-left: 8px;
  }
  .csv-template-link:hover { text-decoration: underline; }

  /* ============ Collapsible Section ============ */
  .collapse-arrow {
    margin-left: auto;
    font-size: 14px;
    color: var(--c-muted);
    transition: transform 0.3s;
    cursor: pointer;
  }
  .collapse-arrow.open { transform: rotate(180deg); }
  .collapse-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }
  .collapse-body.open { max-height: 1200px; }

  /* ============ Insight Score (compact, inside insight box) ============ */
  .insight-score-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 20px;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
  }
  .insight-score-left {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .insight-score-num {
    font-size: 42px;
    font-weight: 700;
    line-height: 1;
    color: var(--c-green);
    letter-spacing: -2px;
    transition: color 0.3s;
  }
  .insight-score-label {
    font-size: 12px;
    color: var(--c-sub);
    line-height: 1.4;
  }
  .insight-score-label strong { color: var(--c-text); font-size: 14px; }
  .insight-score-bars {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px 16px;
  }
  .insight-score-bars .dim {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--c-sub);
  }
  .insight-score-bars .dim-bar {
    flex: 1;
    height: 5px;
    border-radius: 3px;
    background: #edf2f7;
    overflow: hidden;
    min-width: 40px;
  }
  .insight-score-bars .dim-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s;
  }

  /* ============ Clickable Summary Cards ============ */
  .summary-item {
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .summary-item.enterable:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
  }
  .summary-item.enterable .metric-icon::after {
    content: '✏';
    font-size: 10px;
    position: absolute;
    top: 8px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.15s;
  }
  .summary-item.enterable:hover .metric-icon::after {
    opacity: 0.5;
  }

  /* ============ Sticky Entry Bar ============ */
  .sticky-entry {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--c-bg);
    padding: 10px 0;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
  }
  .sticky-entry-inner {
    background: var(--c-card);
    border-radius: 12px;
    padding: 10px 14px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
  }
  .sticky-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
  }
  .sticky-chips .entry-chip {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 16px;
  }
  .sticky-input-row {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
  }
  .sticky-input-row input {
    width: 120px;
    padding: 8px 12px;
    border: 1.5px solid var(--c-border);
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border 0.2s;
  }
  .sticky-input-row input:focus {
    border-color: var(--c-blue);
  }
  .sticky-save-btn {
    padding: 8px 18px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
  }

  /* ============ Toast (v0.2) ============ */
  .toast-msg {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    z-index: 9999;
    max-width: 90vw;
    white-space: pre-line;
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
    line-height: 1.6;
    animation: toastIn 0.25s ease-out;
  }
  @keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, 10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
  }

  /* ============ Responsive ============ */
  @media (max-width: 900px) {
    .grid-2, .grid-3, .grid-2-1, .grid-1-2 {
      grid-template-columns: 1fr;
    }
    .hidden-corr-grid { grid-template-columns: 1fr; }
    .hero { flex-direction: column; }
    .hero-right { align-self: flex-start; }
    .ai-panel { width: 100vw; max-width: 100vw; }
    .summary-strip { grid-template-columns: 1fr 1fr; }
    .chart-wrap.tall { height: 280px; }
    .chart-wrap.medium { height: 250px; }
    .back-to-top { bottom: 84px; right: 20px; }
    .insight-score-row { grid-template-columns: 1fr; }
    .insight-score-bars { grid-template-columns: 1fr 1fr; }
  }

  @media (max-width: 480px) {
    .app { padding: 0 12px 80px; }
    .hero h1 { font-size: 22px; }
    .entry-row input { min-width: 80px; }
    .entry-metrics { gap: 6px; }
    .entry-chip { padding: 6px 12px; font-size: 12px; }
    .corr-pair { font-size: 12px; }
    .sticky-entry-inner { padding: 8px 10px; gap: 6px; }
    .sticky-chips .entry-chip { padding: 5px 10px; font-size: 11px; }
    .sticky-input-row { margin-left: 0; width: 100%; }
    .sticky-input-row input { flex: 1; width: auto; }
    .sticky-save-btn { padding: 8px 14px; }
  }

  /* ============ Sidebar Navigation ============ */
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 68px; background: var(--c-card);
    border-right: 1px solid var(--c-border);
    z-index: 250; display: flex; flex-direction: column;
    align-items: center; padding: 12px 0; gap: 4px;
    transition: width 0.25s ease, box-shadow 0.25s ease;
  }
  .sidebar:hover { width: 76px; box-shadow: var(--shadow-lg); }
  .sidebar-item {
    width: 56px; height: 52px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    border-radius: 10px; cursor: pointer; position: relative;
    color: var(--c-sub); font-size: 9.5px; transition: all 0.2s ease;
    text-decoration: none; border: none; background: none;
  }
  .sidebar-item svg { width: 24px; height: 24px; flex-shrink: 0; }
  .sidebar-item:hover { background: var(--c-hover); color: var(--c-text); }
  .sidebar-item.active { background: var(--c-blue-bg); color: var(--c-blue); }
  .sidebar-item.active svg { stroke: var(--c-blue); }
  .sidebar-badge {
    position: absolute; top: 5px; right: 4px;
    width: 7px; height: 7px; border-radius: 50%;
    border: 1.5px solid var(--c-card);
  }
  .sidebar-badge.red { background: var(--c-red); }
  .sidebar-badge.blue { background: var(--c-blue); }

  /* Main content offset for sidebar */
  .app { margin-left: 68px !important; }

  /* ============ Mobile Tab Bar ============ */
  .tab-bar {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    min-height: calc(60px + env(safe-area-inset-bottom, 0));
    background: var(--c-card); border-top: 1px solid var(--c-border);
    z-index: 250; align-items: center; justify-content: space-around;
    padding: 10px 6px calc(10px + env(safe-area-inset-bottom, 0));
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    flex: 1; max-width: 72px; padding: 5px 2px 3px; cursor: pointer;
    color: var(--c-sub); font-size: 9.5px; transition: color 0.15s;
    border: none; background: none; position: relative;
  }
  .tab-item svg { width: 22px; height: 22px; }
  .tab-item.active { color: var(--c-blue); }
  .tab-item.active svg { stroke: var(--c-blue); stroke-width: 2.5; }
  .tab-center-btn {
    width: 44px; height: 44px; border-radius: 50%;
    background: linear-gradient(135deg, #4a6fa5, #3a5a8a);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 3px 12px rgba(74,111,165,0.35);
    margin-top: -16px; border: none; cursor: pointer;
  }
  .tab-center-btn svg { stroke: #fff; stroke-width: 2.5; }

  @media (max-width: 768px) {
    html, body { height: 100%; }
    body { overflow-y: auto; -webkit-overflow-scrolling: touch; }
    .sidebar { display: none; }
    .app { margin-left: 0 !important; padding-bottom: calc(76px + env(safe-area-inset-bottom, 0)); }
    .tab-bar { display: flex; }
    .ai-float { bottom: 70px !important; }
    .back-to-top { bottom: 136px !important; }
  }

  /* ============ Encyclopedia Panel ============ */
  .encyc-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.35);
    z-index: 300; opacity: 0; visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
  }
  .encyc-overlay.show { opacity: 1; visibility: visible; }
  .encyc-panel {
    position: fixed; top: 0; right: 0;
    width: 480px; max-width: 92vw; height: 100vh; height: 100dvh;
    background: var(--c-card); z-index: 310;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .encyc-panel.show { transform: translateX(0); }
  .encyc-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--c-border);
    flex-shrink: 0;
  }
  .encyc-title { font-size: 15px; font-weight: 500; display:flex; align-items:center; gap:8px; }
  .encyc-close {
    background:none; border:none; font-size:20px; cursor:pointer; color:var(--c-sub);
    padding: 4px; line-height:1;
  }
  .encyc-tabs {
    display: flex; gap: 4px; padding: 10px 14px; overflow-x: auto;
    flex-shrink: 0; scrollbar-width:none;
  }
  .encyc-tabs::-webkit-scrollbar { display: none; }
  .encyc-tab {
    padding: 6px 14px; border-radius: 20px; font-size: 12px; white-space: nowrap;
    cursor:pointer; border: 1px solid var(--c-border); background:var(--c-card);
    color:var(--c-sub); transition:all 0.2s;
  }
  .encyc-tab.active { background:var(--c-blue); color:#fff; border-color:var(--c-blue); }
  .encyc-content {
    flex: 1; overflow-y: auto; padding: 0 18px 18px; -webkit-overflow-scrolling:touch;
  }
  .encyc-card {
    background: var(--c-hover); border-radius: var(--radius-sm); padding: 16px;
    margin-bottom: 12px; animation: fadeIn 0.4s ease-out;
  }
  .encyc-card h3 { font-size:14px; font-weight:500; margin-bottom:8px; color:var(--c-text); }
  .encyc-card p { font-size:13px; color:var(--c-sub); line-height:1.7; }
  .encyc-card .source-tag {
    font-size:11px; color:var(--c-muted); margin-top:10px; padding-top:8px;
    border-top:1px solid var(--c-border);
  }
  .encyc-loading {
    display:flex; flex-direction:column; align-items:center; justify-content:center;
    flex:1; gap:12px; color:var(--c-muted); font-size:13px;
  }
  .encyc-loading-spinner {
    width:32px; height:32px; border:2.5px solid var(--c-border); border-top-color:var(--c-blue);
    border-radius:50%; animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ============ Skeleton Loading ============ */
  .skeleton { background: linear-gradient(90deg, var(--c-hover) 25%, var(--c-border) 50%, var(--c-hover) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 4px; }
  @keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
  .skeleton-line { height: 14px; margin-bottom: 8px; }
  .skeleton-line.short { width: 60%; }
  .skeleton-card { padding: 16px; margin-bottom: 12px; border-radius: var(--radius-sm); background: var(--c-hover); }
  .skeleton-card .skeleton-line:last-child { margin-bottom: 0; }
  .skeleton-pulse { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c-blue); animation: pulse 1.2s infinite; margin-right: 6px; }
  @keyframes pulse { 0%,100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

  @media (max-width: 600px) {
    .encyc-panel { width: 100vw; max-width: 100vw; }
    .encyc-tabs { padding: 8px 10px; }
    .encyc-tab { padding: 5px 12px; font-size:11px; }
  }

  /* ============ Report Panel ============ */
  .report-panel {
    position: fixed; top: 0; right: 0;
    width: 520px; max-width: 92vw; height: 100vh; height: 100dvh;
    background: var(--c-card); z-index: 310;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
    display: flex; flex-direction: column; overflow: hidden;
  }
  .report-panel.show { transform: translateX(0); }
  .report-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px; border-bottom: 1px solid var(--c-border); flex-shrink: 0;
  }
  .report-title { font-size: 15px; font-weight: 500; display:flex; align-items:center; gap:8px; }
  .report-close { background:none; border:none; font-size:20px; cursor:pointer; color:var(--c-sub); padding:4px; line-height:1; }
  .report-toolbar { display:flex; gap:8px; padding:10px 14px; border-bottom:1px solid var(--c-border); flex-shrink:0; }
  .report-toolbar select, .report-toolbar button {
    padding: 6px 12px; border-radius: 6px; font-size: 12px; border: 1px solid var(--c-border);
    background: var(--c-card); color: var(--c-text); cursor: pointer;
  }
  .report-toolbar button.primary { background: var(--c-blue); color:#fff; border-color: var(--c-blue); }
  .report-content { flex:1; overflow-y:auto; padding: 14px 18px; -webkit-overflow-scrolling:touch; }
  .report-section { margin-bottom: 20px; }
  .report-section h3 { font-size:14px; font-weight:500; margin-bottom:10px; color:var(--c-text); display:flex; align-items:center; gap:6px; }
  .report-table { width:100%; border-collapse:collapse; font-size:12px; }
  .report-table th { text-align:left; padding:8px 10px; background:var(--c-hover); color:var(--c-sub); font-weight:500; border-bottom:1px solid var(--c-border); }
  .report-table td { padding:8px 10px; border-bottom:1px solid var(--c-border); color:var(--c-text); }
  .report-table tr:hover td { background: var(--c-hover); }
  .report-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:500; }
  .report-badge.normal { background:#e6f4ea; color:#1e7e34; }
  .report-badge.warn { background:#fff3cd; color:#856404; }
  .report-badge.danger { background:#f8d7da; color:#721c24; }
  .report-score-box { display:flex; align-items:center; gap:16px; padding:16px; background:var(--c-hover); border-radius:8px; margin-bottom:16px; }
  .report-score-num { font-size:36px; font-weight:700; color:var(--c-blue); }
  .report-score-label { font-size:12px; color:var(--c-muted); }
  .trend-up { color: #d15454; }
  .trend-down { color: #4a6fa5; }
  .trend-flat { color: var(--c-muted); }
  @media (max-width: 600px) { .report-panel { width: 100vw; max-width: 100vw; } }

  /* ============ 健康计划 Panel 表单 ============ */
  .plan-form { display:flex; flex-direction:column; gap:8px; margin-bottom:6px; }
  .plan-form input, .plan-form textarea {
    width:100%; box-sizing:border-box; padding:9px 12px; border:1px solid var(--c-border);
    border-radius:8px; font-size:13px; background:var(--c-card); color:var(--c-text);
    font-family:inherit; resize:vertical;
  }
  .plan-form input:focus, .plan-form textarea:focus { outline:none; border-color:var(--c-blue); }
  .plan-btn {
    padding:9px 12px; border:none; border-radius:8px; background:var(--c-blue); color:#fff;
    font-size:13px; font-weight:600; cursor:pointer;
  }
  .plan-item { display:flex; align-items:flex-start; justify-content:space-between; gap:10px; background:var(--c-hover); border-radius:8px; padding:12px 14px; margin-bottom:8px; }
  .plan-item .pi-title { font-size:13px; font-weight:500; color:var(--c-text); }
  .plan-item .pi-meta { font-size:12px; color:var(--c-sub); margin-top:4px; line-height:1.6; }
  .plan-del { background:none; border:none; color:var(--c-muted); cursor:pointer; font-size:16px; line-height:1; padding:2px; flex-shrink:0; }
  .plan-del:hover { color:#d15454; }
  .plan-empty { font-size:13px; color:var(--c-muted); padding:10px 2px; }

  /* 子导航（数据 / 目标与事件）— PC 与手机一致 */
  .subnav { display:flex; gap:8px; margin:4px 0 16px; border-bottom:1px solid var(--c-border); }
  .subnav-tab {
    flex:1; padding:10px 12px; border:none; background:none; cursor:pointer;
    font-size:14px; font-weight:600; color:var(--c-sub); border-bottom:2px solid transparent;
    margin-bottom:-1px; transition:color .15s, border-color .15s;
  }
  .subnav-tab:hover { color:var(--c-text); }
  .subnav-tab.active { color:var(--c-blue); border-bottom-color:var(--c-blue); }
  .plan-wrap { background:var(--c-card); border:1px solid var(--c-border); border-radius:12px; padding:18px 20px; }
  @media (max-width: 600px) {
    .subnav-tab { font-size:13px; padding:9px 6px; }
    .plan-wrap { padding:14px 14px; }
  }

  /* ============ Transitions ============ */
  .fade-in {
    animation: fadeIn 0.5s ease-out;
  }
  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ============ Auth Modal (multi-user) ============ */
  .auth-overlay {
    position: fixed; inset: 0; z-index: 9999;
    display: none; align-items: center; justify-content: center;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    padding: 20px;
  }
  .auth-overlay.show { display: flex; }
  .auth-card {
    width: 100%; max-width: 360px;
    background: var(--c-card, #fff);
    border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 18px;
    padding: 32px 28px 26px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.25);
    text-align: center;
  }
  .auth-brand { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
  .auth-brand h2 { margin: 0; font-size: 24px; color: var(--c-text, #1e293b); letter-spacing: -0.5px; }
  .auth-pulse { color: var(--c-blue, #4a6fa5); display: inline-flex; }
  .auth-pulse svg { width: 26px; height: 26px; }
  .auth-sub { font-size: 13px; color: var(--c-sub, #64748b); margin: 4px 0 20px; }
  .auth-tabs { display: flex; gap: 6px; background: var(--c-bg, #f1f5f9); border-radius: 10px; padding: 4px; margin-bottom: 18px; }
  .auth-tab {
    flex: 1; border: none; background: transparent; cursor: pointer;
    padding: 9px 0; border-radius: 8px; font-size: 14px; font-weight: 600;
    color: var(--c-sub, #64748b); transition: all 0.18s;
  }
  .auth-tab.active { background: var(--c-card, #fff); color: var(--c-blue, #4a6fa5); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
  .auth-input {
    width: 100%; box-sizing: border-box; padding: 12px 14px; margin-bottom: 12px;
    border: 1.5px solid var(--c-border, #e2e8f0); border-radius: 10px;
    font-size: 14px; outline: none; color: var(--c-text, #1e293b); background: var(--c-bg, #f8fafc);
  }
  .auth-input:focus { border-color: var(--c-blue, #4a6fa5); }
  .auth-error { color: #d15454; font-size: 13px; min-height: 18px; margin-bottom: 6px; }
  .auth-submit {
    width: 100%; padding: 12px 0; border: none; border-radius: 10px;
    background: var(--c-blue, #4a6fa5); color: #fff; font-size: 15px; font-weight: 600;
    cursor: pointer; transition: opacity 0.18s;
  }
  .auth-submit:hover { opacity: 0.92; }
  .auth-hint { font-size: 12px; color: var(--c-muted, #94a3b8); margin-top: 14px; line-height: 1.6; }

  .user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--c-card, #fff); border: 1px solid var(--c-border, #e2e8f0);
    border-radius: 999px; padding: 4px 6px 4px 12px; font-size: 13px; color: var(--c-text, #1e293b);
  }
  .user-chip-name { font-weight: 600; }
  .user-chip-logout {
    border: none; background: var(--c-bg, #f1f5f9); color: var(--c-sub, #64748b);
    border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  }
  .user-chip-logout:hover { background: #fee2e2; color: #d15454; }
  .user-chip-verified { color: #16a34a; font-weight: 700; font-size: 14px; }

  /* 注册专属 / 条款 / 链接 / 找回密码 */
  .auth-terms { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--c-sub, #64748b); text-align: left; margin-bottom: 12px; line-height: 1.5; }
  .auth-terms input { width: auto; margin: 0; }
  .auth-link { color: var(--c-blue, #4a6fa5); cursor: pointer; text-decoration: underline; font-size: 13px; }
  .auth-alt { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 10px; }
  .auth-hint-inline { font-size: 12px; color: var(--c-muted, #94a3b8); }

  /* 账号设置 */
  .acct-info { text-align: left; font-size: 13px; color: var(--c-sub, #64748b); margin-bottom: 14px; }
  .acct-row { display: flex; justify-content: space-between; padding: 4px 0; border-bottom: 1px solid var(--c-border, #f1f5f9); }
  .acct-section { text-align: left; margin-top: 16px; }
  .acct-title { font-size: 13px; font-weight: 600; color: var(--c-text, #1e293b); margin-bottom: 8px; }
  .acct-btn { width: 100%; padding: 10px 0; margin-bottom: 8px; border: 1px solid var(--c-border, #e2e8f0); border-radius: 10px; background: var(--c-bg, #f8fafc); color: var(--c-text, #1e293b); font-size: 14px; cursor: pointer; }
  .acct-btn:hover { border-color: var(--c-blue, #4a6fa5); }
  .acct-btn.danger { color: #d15454; border-color: #fecaca; }
  .acct-btn.danger:hover { background: #fee2e2; }
  }