    :root {
      /* 深色主题（默认） */
      --spring: cubic-bezier(.34, 1.56, .64, 1);
      --blue: #4d7cff;
      --blue-deep: #2f5cff;
      --blue-soft: rgba(77, 124, 255, 0.12);
      --blue-glow: rgba(77, 124, 255, 0.35);
      --lime: #c8f31d;
      --bg: #0b0e14;
      --bg-2: #0f131c;
      --card: #151a25;
      --panel-2: #1a2130;
      --ink: #e9edf6;
      --ink-2: #a3adc2;
      --ink-3: #6b7488;
      --line: #232b3a;
      --green: #2adfa0;
      --orange: #ffb347;
      --red: #ff5d6c;
      --radius: 18px;
      --hero-bg: linear-gradient(160deg, #16204a 0%, #101736 55%, #0c1029 100%);
      --shadow-card: 0 2px 12px rgba(0,0,0,0.35);
      --hero-bubble: rgba(200,243,29,0.10);
    }
    html[data-theme="light"] {
      /* 浅色主题（蓝白 · 经典） */
      --blue: #2f5cff;
      --blue-deep: #1f3fd0;
      --blue-soft: #eef2ff;
      --blue-glow: rgba(47, 92, 255, 0.30);
      --lime: #7fb300;
      --bg: #f5f7fb;
      --card: #ffffff;
      --ink: #10192e;
      --ink-2: #5a6478;
      --ink-3: #8a94a8;
      --line: #e6eaf2;
      --green: #16c784;
      --orange: #ff7a2c;
      --red: #ff4d5e;
      --hero-bg: linear-gradient(160deg, #2f5cff 0%, #2148e8 55%, #1a38c4 100%);
      --shadow-card: 0 2px 12px rgba(16,25,46,0.06);
      --hero-bubble: rgba(255,255,255,0.14);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    html, body { height: 100%; }
    body {
      font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
      background: var(--bg); color: var(--ink);
      display: flex; flex-direction: column; overflow: hidden;
    }

    /* ===== 英雄区（滚动收缩式，不再遮挡内容） ===== */
    .hero {
      background: var(--hero-bg);
      color: #fff; padding: 20px 32px 22px; position: relative; overflow: hidden;
      transition: padding .35s ease;
      z-index: 10;
      border-bottom: 1px solid var(--line);
    }
    .hero.collapsed { padding: 10px 32px 12px; }
    .hero::before { content: ""; position: absolute; right: -60px; top: -80px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(circle, var(--hero-bubble), transparent 70%); }
    .hero::after { content: ""; position: absolute; right: 100px; bottom: -130px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(circle, var(--hero-bubble), transparent 70%); }
    .hero-top { display: flex; align-items: center; gap: 12px; position: relative; z-index: 2; }
    /* ===== 40LIFE Sport 叠字标志（美式运动风） ===== */
    .brand-logo {
      display: flex; flex-direction: column; align-items: flex-start;
      line-height: 1; user-select: none; cursor: default;
      font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-style: italic; font-weight: 900;
      transition: transform .35s ease;
    }
    .hero.collapsed .brand-logo { transform: scale(.78); transform-origin: left center; }
    .bl-top {
      font-size: 34px; letter-spacing: 1px; color: #fff;
      -webkit-text-stroke: 2px #0a0c10;
      paint-order: stroke fill;
      text-shadow: 3px 3px 0 #0a0c10;
      transform: rotate(-2deg);
    }
    .bl-sub {
      font-size: 30px; letter-spacing: 1px; color: #f5e663;
      -webkit-text-stroke: 2px #0a0c10;
      paint-order: stroke fill;
      text-shadow: 3px 3px 0 #0a0c10;
      margin-top: -8px; margin-left: 22px;
      transform: rotate(-2deg);
    }
    /* 大版标志（hero 中部展示） */
    .hero-logo-big {
      display: flex; flex-direction: column; align-items: flex-start;
      line-height: .95; user-select: none;
      font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; font-style: italic; font-weight: 900;
      position: relative; z-index: 2; margin-top: 22px;
    }
    .hero-logo-big .bl-top { font-size: 64px; -webkit-text-stroke: 3px #0a0c10; text-shadow: 5px 5px 0 #0a0c10; }
    .hero-logo-big .bl-sub { font-size: 56px; -webkit-text-stroke: 3px #0a0c10; text-shadow: 5px 5px 0 #0a0c10; margin-left: 40px; margin-top: -14px; }
    /* 励志语 */
    .hero-quote {
      position: relative; z-index: 2; margin-top: 18px;
      font-size: 16px; font-weight: 600; letter-spacing: .5px;
      color: rgba(255,255,255,0.92); font-style: italic;
      max-width: 640px;
    }
    .hero-quote::before { content: "— "; opacity: .6; }
    .app-icon {
      width: 52px; height: 52px; border-radius: 13px;
      background: linear-gradient(135deg, #2f5cff, #1f3fd0);
      display: flex; align-items: center; justify-content: center;
      font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
      font-size: 26px; font-weight: 700; color: #fff; letter-spacing: 1px;
      box-shadow: 0 6px 20px rgba(0,0,0,0.25);
      transition: width .35s ease, height .35s ease, font-size .35s ease;
    }
    .hero.collapsed .app-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; }
    .hero-title h1 { font-size: 21px; font-weight: 900; letter-spacing: .5px; transition: font-size .35s ease; }
    .hero.collapsed .hero-title h1 { font-size: 16px; }
    .hero-title p { font-size: 12px; opacity: .85; margin-top: 2px; letter-spacing: 2px; transition: font-size .35s ease; }
    .hero.collapsed .hero-title p { font-size: 10px; }
    .hero-slogan {
      position: relative; z-index: 2; margin-top: 16px; font-size: 28px; font-weight: 900; letter-spacing: 4px;
      transform-origin: top left;
      transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease, margin .3s ease;
    }
    .hero-slogan small { display: block; font-size: 13px; font-weight: 500; letter-spacing: 3px; opacity: .8; margin-top: 5px; }
    .hero-stats {
      position: relative; z-index: 2; display: flex; gap: 26px; margin-top: 14px;
      transform-origin: top left;
      transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease, margin .3s ease;
    }
    .hero.collapsed .hero-slogan { transform: scaleY(0); opacity: 0; margin-top: -56px; pointer-events: none; }
    .hero.collapsed .hero-stats { transform: scaleY(0); opacity: 0; margin-top: -40px; pointer-events: none; }
    .hero-logo-big, .hero-quote { transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .3s ease, margin .3s ease; }
    .hero.collapsed .hero-logo-big { transform: scaleY(0); opacity: 0; margin-top: -70px; pointer-events: none; }
    .hero.collapsed .hero-quote { transform: scaleY(0); opacity: 0; margin-top: -30px; pointer-events: none; }
    .hstat .num { font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 21px; font-weight: 600; }
    .hstat .lbl { font-size: 11px; opacity: .75; letter-spacing: 1px; }

    /* ===== 主体 ===== */
    .main { flex: 1; display: flex; overflow: hidden; }
    .sidebar {
      width: 232px; background: var(--card); border-right: 1px solid var(--line);
      padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
      border-radius: 0; z-index: 5;
    }
    .sec-label { font-size: 11px; font-weight: 700; color: var(--ink-3); letter-spacing: 2px; margin: 14px 8px 6px; }
    .nav-item {
      display: flex; align-items: center; gap: 10px; padding: 11px 12px;
      border-radius: 12px; cursor: pointer; font-size: 14px; font-weight: 500;
      color: var(--ink-2); transition: all .18s; border: 1px solid transparent;
    }
    .nav-item:hover { background: var(--blue-soft); color: var(--blue); }
    .nav-item.active { background: var(--blue); color: #fff; box-shadow: 0 6px 16px var(--blue-glow); }
    .nav-item .ic { width: 20px; text-align: center; font-size: 15px; }
    .tip-card { margin-top: auto; background: var(--blue-soft); border-radius: 14px; padding: 12px 14px; font-size: 12px; line-height: 1.7; color: var(--ink-2); }
    .tip-card b { color: var(--blue); }

    .content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
    .view { display: none; flex: 1; min-height: 0; flex-direction: column; }
    .view.active { display: flex; }
    /* 苹果式错峰入场：页面切换时内容依次上浮浮现 */
    .view.active > * { animation: viewStagger .5s var(--spring) backwards; }
    .view.active > *:nth-child(2) { animation-delay: .06s; }
    .view.active > *:nth-child(3) { animation-delay: .12s; }
    .view.active > *:nth-child(4) { animation-delay: .18s; }
    .view.active > *:nth-child(5) { animation-delay: .24s; }
    @keyframes viewStagger { from { opacity: 0; transform: translateY(16px) scale(.98); } to { opacity: 1; transform: none; } }

    /* ===== AI 聊天 ===== */
    #chat { flex: 1; overflow-y: auto; padding: 26px 36px; display: flex; flex-direction: column; gap: 16px; -webkit-overflow-scrolling: touch; }
    .msg { max-width: 82%; padding: 14px 18px; border-radius: 16px; line-height: 1.8; font-size: 15px; word-break: break-word; animation: msgIn .45s cubic-bezier(.34,1.56,.64,1); contain: content; }
    @keyframes msgIn { 0% { opacity: 0; transform: translateY(14px) scale(.96); } 60% { opacity: 1; transform: translateY(-2px) scale(1.01); } 100% { opacity: 1; transform: none; } }
    .msg.user { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 5px; font-weight: 500; box-shadow: 0 4px 14px var(--blue-glow); white-space: pre-wrap; }
    .msg.assistant {
      align-self: flex-start; background: var(--card); border: 1px solid var(--line);
      border-bottom-left-radius: 5px; box-shadow: var(--shadow-card);
    }
    .msg.assistant.medical { border: 1.5px solid var(--red); background: #fff5f6; }
    .msg .role-tag { font-size: 11px; font-weight: 700; letter-spacing: 1.5px; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
    .msg.user .role-tag { color: rgba(255,255,255,0.65); }
    .msg.assistant .role-tag { color: var(--blue); }
    .role-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

    /* Markdown 内容样式（柔和） */
    .md h1, .md h2, .md h3 { font-weight: 800; margin: 18px 0 10px; line-height: 1.4; }
    .md h1 { font-size: 19px; } .md h2 { font-size: 17px; } .md h3 { font-size: 15.5px; }
    .md h2 { color: var(--blue); padding-bottom: 6px; border-bottom: 1px solid var(--line); }
    .md p { margin: 8px 0; }
    .md ul, .md ol { margin: 8px 0 8px 20px; }
    .md li { margin: 5px 0; }
    .md strong { color: var(--blue-deep); font-weight: 700; }
    .md blockquote { margin: 10px 0; padding: 10px 14px; background: var(--blue-soft); border-left: 3px solid var(--blue); border-radius: 0 10px 10px 0; color: var(--ink-2); font-size: 14px; }
    .md code { background: var(--blue-soft); color: var(--blue-deep); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
    .md pre { background: #10192e; color: #dce4ff; padding: 14px; border-radius: 12px; overflow-x: auto; margin: 10px 0; }
    .md pre code { background: transparent; color: inherit; }
    .md table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: 13.5px; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
    .md th { background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; }
    .md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--line); text-align: left; }
    .md tr:last-child td { border-bottom: none; }
    .md hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }

    /* 打字机光标 */
    .cursor { display: inline-block; width: 7px; height: 16px; background: var(--blue); border-radius: 2px; margin-left: 2px; vertical-align: -2px; animation: blink .8s infinite; }
    @keyframes blink { 50% { opacity: 0; } }

    /* 思考动画（柔和呼吸点） */
    .thinking { display: inline-flex; gap: 5px; align-items: center; }
    .thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--blue); opacity: .3; animation: breathe 1.1s infinite; }
    .thinking i:nth-child(2) { animation-delay: .15s; }
    .thinking i:nth-child(3) { animation-delay: .3s; }
    .thinking em { font-style: normal; margin-left: 6px; font-size: 13px; color: var(--ink-3); }
    @keyframes breathe { 0%,100% { opacity: .25; transform: translateY(0) scale(.85); } 50% { opacity: 1; transform: translateY(-4px) scale(1.1); } }

    /* ===== 通用面板页（计划/数据/知识库） ===== */
    .panel { flex: 1; overflow-y: auto; padding: 24px 36px 32px; }
    .panel h2 { font-size: 20px; font-weight: 900; margin-bottom: 4px; }
    .panel .sub { font-size: 13px; color: var(--ink-3); margin-bottom: 18px; }
    .card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
    .card {
      background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
      padding: 18px; cursor: pointer; transition: all .2s;
    }
    .card:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(16,25,46,0.10); border-color: rgba(47,92,255,0.4); }
    .card .c-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 12px; }
    .card .c-t { font-size: 14.5px; font-weight: 700; margin-bottom: 4px; }
    .card .c-d { font-size: 12px; color: var(--ink-3); line-height: 1.6; }

    .btn {
      background: var(--blue); color: #fff; border: none; border-radius: 12px;
      padding: 10px 22px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit;
      box-shadow: 0 4px 14px var(--blue-glow); transition: all .15s;
    }
    .btn:hover { transform: translateY(-1px); }
    .btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
    select, input[type=number] {
      font-family: inherit; font-size: 14px; color: var(--ink);
      background: var(--card); border: 1.5px solid var(--line); border-radius: 10px;
      padding: 9px 12px; outline: none;
    }
    select:focus { border-color: var(--blue); }
    .form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
    .form-row label { font-size: 13px; color: var(--ink-2); font-weight: 600; }

    .result-card {
      background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
      padding: 22px 24px; margin-top: 16px; box-shadow: var(--shadow-card);
      animation: msgIn .4s ease; line-height: 1.8; font-size: 14.5px;
    }

    /* 柱状图（数据分析） */
    .bars { display: flex; align-items: flex-end; gap: 18px; height: 160px; padding: 10px 6px 0; }
    .bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
    .bar { width: 38px; border-radius: 8px 8px 4px 4px; background: linear-gradient(180deg, var(--blue), var(--blue-deep)); animation: grow .8s ease; box-shadow: 0 4px 10px var(--blue-glow); }
    @keyframes grow { from { height: 0 !important; } }
    .bar-label { font-size: 12px; color: var(--ink-2); font-weight: 600; }
    .bar-val { font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 12px; color: var(--ink-3); }

    .empty { color: var(--ink-3); font-size: 13.5px; padding: 30px 0; text-align: center; }

    /* ===== 即时训练（深色训练卡片风） ===== */
    .ex-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
    .ex-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
    .ex-name { font-weight: 800; font-size: 15px; }
    .ex-pr { font-size: 12px; color: var(--green); font-weight: 700; }

    /* 训练中的大卡片（深色） */
    .session-card {
      background: #10192e; color: #e8ecf8; border-radius: 22px;
      padding: 22px 24px; max-width: 560px; margin: 0 auto;
      box-shadow: 0 16px 40px rgba(16,25,46,0.35);
    }
    .sc-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
    .sc-tag { background: var(--blue); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 8px; }
    .sc-setno { font-size: 15px; font-weight: 800; }
    .sc-ex { font-size: 12px; color: #8fa0c9; }
    .sc-name { font-size: 22px; font-weight: 900; margin-bottom: 2px; }
    .sc-name small { display: block; font-size: 12px; font-weight: 500; color: #8fa0c9; letter-spacing: 1px; }
    .sc-e1rm { text-align: right; font-size: 12px; color: #8fa0c9; line-height: 1.7; }
    .sc-e1rm b { color: var(--green); font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 16px; }

    .sc-targets { display: flex; gap: 8px; margin: 14px 0; }
    .sc-target { flex: 1; background: rgba(255,255,255,0.06); border-radius: 12px; padding: 10px 6px; text-align: center; font-size: 11px; color: #8fa0c9; }
    .sc-target .v { font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 16px; color: #e8ecf8; margin-top: 2px; }

    /* 杠铃示意 */
    .barbell { background: rgba(255,255,255,0.05); border-radius: 14px; padding: 14px 16px; margin-bottom: 14px; }
    .barbell .bb-head { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: #8fa0c9; margin-bottom: 8px; }
    .barbell .bb-weight { font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 24px; color: #fff; font-weight: 600; }
    .plates-note { font-size: 11px; color: #6f7fa8; margin-top: 6px; letter-spacing: 1px; }
    .bb-svg { width: 100%; height: 64px; }

    /* 输入三大块 */
    .sc-inputs { display: flex; gap: 8px; margin-bottom: 12px; }
    .sc-input-box { flex: 1; background: rgba(255,255,255,0.08); border-radius: 14px; padding: 12px 8px; text-align: center; }
    .sc-input-box .lbl { font-size: 11px; color: #8fa0c9; margin-bottom: 6px; }
    .stepper { display: flex; align-items: center; justify-content: center; gap: 8px; }
    .stepper button {
      width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
      background: rgba(255,255,255,0.12); color: #fff; font-size: 17px; line-height: 1;
      transition: background .12s;
    }
    .stepper button:hover { background: rgba(255,255,255,0.22); }
    .stepper .val { font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 26px; font-weight: 600; min-width: 64px; }
    .sc-input-box.rpe-box .val { font-size: 22px; }

    /* RPE 快选 */
    .rpe-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
    .rpe-chip {
      flex: 1; min-width: 44px; text-align: center; padding: 7px 4px; border-radius: 9px;
      background: rgba(255,255,255,0.08); color: #8fa0c9; font-size: 12px; cursor: pointer;
      border: 1px solid transparent; transition: all .12s; font-family: -apple-system, "Helvetica Neue", sans-serif; font-weight: 600;
    }
    .rpe-chip:hover { background: rgba(255,255,255,0.15); }
    .rpe-chip.on { background: var(--blue); color: #fff; border-color: rgba(255,255,255,0.35); }

    .sc-note {
      width: 100%; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
      border-radius: 10px; color: #e8ecf8; font-family: inherit; font-size: 13px;
      padding: 10px 12px; outline: none; margin-bottom: 12px;
    }
    .sc-note::placeholder { color: #6f7fa8; }

    /* 休息计时 */
    .rest-row { display: flex; gap: 8px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
    .rest-chip {
      padding: 8px 16px; border-radius: 20px; background: rgba(255,255,255,0.08);
      color: #cdd6f0; font-size: 13px; cursor: pointer; border: none; font-family: -apple-system, "Helvetica Neue", sans-serif; font-weight: 600;
      transition: all .12s;
    }
    .rest-chip.on { background: var(--blue); color: #fff; }
    .rest-clock { margin-left: auto; font-family: -apple-system, "Helvetica Neue", sans-serif; font-size: 24px; font-weight: 600; color: #fff; }
    .rest-clock.ring { color: var(--orange); }

    /* 完成按钮 */
    .sc-actions { display: flex; gap: 10px; }
    .sc-btn-end { flex: 1; background: rgba(255,255,255,0.1); color: #cdd6f0; border: none; border-radius: 12px; padding: 13px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: inherit; }
    .sc-btn-done { flex: 2; background: var(--blue); color: #fff; border: none; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 800; cursor: pointer; font-family: inherit; box-shadow: 0 6px 18px var(--blue-glow); }
    .sc-btn-done:hover { filter: brightness(1.1); }

    /* 动作选择器（弹层） */
    .picker-mask { position: fixed; inset: 0; background: rgba(10,14,24,0.5); z-index: 100; display: none; align-items: flex-end; justify-content: center; backdrop-filter: blur(4px); }
    .picker-mask.open { display: flex; animation: fadeIn .2s ease; }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    .picker {
      background: var(--card); border-radius: 22px 22px 0 0; width: min(560px, 100%);
      max-height: 72vh; display: flex; flex-direction: column; animation: slideUp .28s cubic-bezier(.4,0,.2,1);
    }
    @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
    .picker-head { padding: 16px 20px 10px; display: flex; align-items: center; justify-content: space-between; }
    .picker-head b { font-size: 16px; }
    .picker-close { background: var(--bg); border: none; border-radius: 50%; width: 32px; height: 32px; cursor: pointer; font-size: 15px; }
    .picker-cats { display: flex; gap: 8px; padding: 0 20px 10px; overflow-x: auto; }
    .picker-cat { flex: 0 0 auto; padding: 7px 14px; border-radius: 20px; background: var(--bg); border: 1px solid var(--line); font-size: 13px; cursor: pointer; color: var(--ink-2); }
    .picker-cat.on { background: var(--blue); color: #fff; border-color: var(--blue); }
    .picker-list { overflow-y: auto; padding: 6px 12px 20px; }
    .picker-item { display: flex; justify-content: space-between; align-items: center; padding: 13px 14px; border-radius: 12px; cursor: pointer; transition: background .12s; }
    .picker-item:hover { background: var(--blue-soft); }
    .picker-item .pi-name { font-weight: 700; font-size: 14.5px; }
    .picker-item .pi-en { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
    .picker-item .pi-eq { font-size: 11px; color: var(--blue); background: var(--blue-soft); padding: 3px 9px; border-radius: 12px; }
    .history-sets { font-size: 12px; color: var(--ink-3); margin: 6px 0 10px; }
    .history-sets b { color: var(--ink); }

    /* 恢复评分星级 */
    .r-rate { display: flex; gap: 6px; }
    .r-dot {
      width: 26px; height: 26px; border-radius: 50%; cursor: pointer;
      background: var(--bg); border: 2px solid var(--line); transition: all .12s;
    }
    .r-dot.on { background: var(--blue); border-color: var(--blue); transform: scale(1.05); }
    .r-dot.on.high { background: var(--green); border-color: var(--green); }
    .r-dot.on.low { background: var(--orange); border-color: var(--orange); }

    /* 快捷卡片行 */
    .quick-row { display: flex; gap: 12px; padding: 4px 36px 12px; overflow-x: auto; flex-shrink: 0; }
    .qcard { flex: 0 0 auto; width: 168px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; cursor: pointer; transition: all .18s; text-align: left; }
    .qcard:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(16,25,46,0.10); border-color: rgba(47,92,255,0.4); }
    .qcard .qic { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-soft); display: flex; align-items: center; justify-content: center; font-size: 16px; margin-bottom: 10px; }
    .qcard .qt { font-size: 13.5px; font-weight: 700; line-height: 1.4; }
    .qcard .qd { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

    #inputbar { padding: 6px 36px 20px; display: flex; gap: 12px; align-items: flex-end; flex-shrink: 0; }
    .input-shell { flex: 1; display: flex; align-items: flex-end; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 12px 16px; transition: all .15s; box-shadow: 0 2px 10px rgba(16,25,46,0.04); }
    .input-shell:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(47,92,255,0.10); }
    #input { flex: 1; background: transparent; border: none; outline: none; color: var(--ink); font-size: 15px; resize: none; font-family: inherit; max-height: 130px; line-height: 1.5; }
    #input::placeholder { color: var(--ink-3); }
    #send { background: var(--blue); color: #fff; border: none; border-radius: 13px; padding: 12px 26px; font-size: 15px; cursor: pointer; font-weight: 700; font-family: inherit; letter-spacing: 1px; box-shadow: 0 6px 16px var(--blue-glow); transition: transform .12s, box-shadow .12s; }
    #send:hover { transform: translateY(-1px); }
    #send:disabled { opacity: .45; cursor: not-allowed; transform: none; }

    ::-webkit-scrollbar { width: 7px; height: 7px; }
    ::-webkit-scrollbar-thumb { background: #d4dae6; border-radius: 4px; }

    @media (max-width: 760px) {
      .sidebar { display: none; }
      .msg { max-width: 94%; }
      #chat { padding: 20px 16px; }
      .panel { padding: 20px 16px; }
      .quick-row, #inputbar { padding-left: 16px; padding-right: 16px; }
      .hero { padding: 20px 20px 50px; }
      .hero-slogan { font-size: 24px; }
    }

    /* ===== 悬浮 AI 教练（训练随时问） ===== */
    .fab-coach {
      position: fixed; right: 26px; bottom: 26px; z-index: 90;
      width: 58px; height: 58px; border-radius: 50%;
      background: linear-gradient(135deg, var(--blue), var(--blue-deep));
      color: #fff; border: none; cursor: pointer;
      display: flex; align-items: center; justify-content: center; font-size: 26px;
      box-shadow: 0 8px 24px var(--blue-glow);
      transition: transform .18s cubic-bezier(.4,0,.2,1), box-shadow .18s;
    }
    .fab-coach:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 30px var(--blue-glow); }
    .fab-coach .pulse { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--blue); opacity: 0; animation: fabPulse 2.4s infinite; }
    @keyframes fabPulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.7); opacity: 0; } }
    .coach-pop {
      position: fixed; right: 26px; bottom: 96px; z-index: 91; width: 360px; max-width: calc(100vw - 40px);
      background: var(--card); border: 1px solid var(--line); border-radius: 18px;
      box-shadow: 0 20px 50px rgba(0,0,0,0.3); overflow: hidden;
      display: none; flex-direction: column; animation: popIn .25s cubic-bezier(.4,0,.2,1);
    }
    .coach-pop.open { display: flex; }
    @keyframes popIn { from { opacity: 0; transform: translateY(16px) scale(.96); } to { opacity: 1; transform: none; } }
    .coach-head { padding: 14px 16px; display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
    .coach-head b { font-size: 15px; flex: 1; }
    .coach-close { background: transparent; border: none; color: var(--ink-3); font-size: 18px; cursor: pointer; }
    .coach-body { max-height: 320px; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
    .coach-msg { padding: 10px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.7; }
    .coach-msg.q { align-self: flex-end; background: var(--blue); color: #fff; border-bottom-right-radius: 4px; }
    .coach-msg.a { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
    .coach-input { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
    .coach-input input { flex: 1; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; color: var(--ink); font-family: inherit; font-size: 13.5px; outline: none; }
    .coach-input input:focus { border-color: var(--blue); }
    .coach-input button { background: var(--blue); color: #fff; border: none; border-radius: 10px; padding: 0 16px; cursor: pointer; font-size: 13px; font-weight: 700; }

    /* ===== 进入网站过渡动画（光线渐暗自然过渡） ===== */
    /* 入场遮罩：深色遮罩从下往上/从中心淡出，模拟光线渐亮 */
    #entry-overlay {
      position: fixed; inset: 0; z-index: 9999;
      background: radial-gradient(ellipse at 50% 30%, rgba(20,30,70,0.4), #05070c 80%);
      pointer-events: none;
      opacity: 1;
      transition: opacity .9s cubic-bezier(.4,0,.2,1);
    }
    #entry-overlay.done { opacity: 0; }
    /* 主体内容：从轻微模糊+下沉 渐入 */
    body.entering .main, body.entering .hero {
      opacity: 0; transform: translateY(10px);
    }
    body .main, body .hero {
      transition: opacity .8s cubic-bezier(.4,0,.2,1), transform .8s cubic-bezier(.4,0,.2,1);
    }
    body.entered .main, body.entered .hero { opacity: 1; transform: none; }
    /* 品牌 Logo 逐字浮现（错峰动画） */
    body.entering .brand-logo, body.entering .hero-logo-big { opacity: 0; transform: translateY(14px) scale(.98); }
    body.entered .brand-logo, body.entered .hero-logo-big { opacity: 1; transform: none; }
    .brand-logo, .hero-logo-big { transition: opacity .7s ease .1s, transform .7s cubic-bezier(.4,0,.2,1) .1s; }
    /* 励志语与统计延迟浮现 */
    body.entering .hero-quote, body.entering .hero-stats { opacity: 0; transform: translateY(10px); }
    body.entered .hero-quote { opacity: 1; transform: none; }
    body.entered .hero-stats { opacity: 1; transform: none; }
    .hero-quote { transition: opacity .6s ease .25s, transform .6s ease .25s; }
    .hero-stats { transition: opacity .6s ease .35s, transform .6s ease .35s; }

    /* ===== 励志视频弹幕 ===== */
    .danmaku {
      position: absolute; white-space: nowrap; font-weight: 800;
      font-size: 16px; color: #fff; text-shadow: 0 0 4px rgba(0,0,0,0.9), 1px 1px 0 #000;
      animation: dmMove linear forwards; will-change: transform;
    }
    @keyframes dmMove {
      from { transform: translateX(0); opacity: 1; }
      to { transform: translateX(-120%); opacity: 0; }
    }
    .mv-card-title { font-weight:800; font-size:14px; line-height:1.4; }
    .mv-card-meta { font-size:12px; color:var(--ink-3); margin-top:4px; }

    /* ===== 移动端适配 ===== */
    /* 底部导航栏（默认隐藏，移动端显示） */
    .m-nav {
      display: none;
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
      background: var(--card); border-top: 1px solid var(--line);
      padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
      justify-content: space-around; align-items: stretch;
      box-shadow: 0 -4px 16px rgba(0,0,0,0.12);
    }
    .m-tab {
      flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
      padding: 6px 2px; cursor: pointer; color: var(--ink-3); border-radius: 10px;
      font-size: 11px; transition: all .15s; -webkit-tap-highlight-color: transparent;
    }
    .m-tab span { font-size: 20px; line-height: 1; }
    .m-tab em { font-style: normal; }
    .m-tab.active { color: var(--blue); }
    .m-tab.active em { font-weight: 700; }
    /* 更多抽屉 */
    .m-drawer {
      position: fixed; left: 0; right: 0; bottom: 0; z-index: 101;
      background: var(--card); border-radius: 20px 20px 0 0;
      border-top: 1px solid var(--line);
      max-height: 70vh; display: flex; flex-direction: column;
      transform: translateY(105%); transition: transform .28s cubic-bezier(.4,0,.2,1);
      box-shadow: 0 -10px 40px rgba(0,0,0,0.25);
    }
    .m-drawer.open { transform: translateY(0); }
    .m-drawer-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 16px 18px 10px; border-bottom: 1px solid var(--line);
    }
    .m-drawer-head b { font-size: 16px; }
    .m-drawer-head button { background: transparent; border: none; font-size: 24px; color: var(--ink-3); cursor: pointer; }
    .m-drawer-body {
      overflow-y: auto; padding: 10px 14px 20px;
      display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
    }
    .m-drawer-item {
      display: flex; flex-direction: column; align-items: center; gap: 6px;
      padding: 14px 6px; border-radius: 14px; background: var(--bg);
      cursor: pointer; font-size: 12px; color: var(--ink-2);
      -webkit-tap-highlight-color: transparent;
    }
    .m-drawer-item span { font-size: 24px; }
    .m-drawer-item.active { background: var(--blue); color: #fff; }
    .m-mask {
      position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,0.4);
      opacity: 0; pointer-events: none; transition: opacity .25s;
    }
    .m-mask.show { opacity: 1; pointer-events: auto; }

    @media (max-width: 760px) {
      /* 1. 移动端文档流滚动：用浏览器原生滚动（html 滚动，body 不设 overflow，避免 iOS 触摸滚动失效） */
      html { height: auto !important; min-height: 100%; }
      body { display: block; overflow: visible !important; height: auto !important; min-height: 100%; }

      /* 2. 布局改为纵向文档流 */
      .sidebar { display: none; }
      .main { display: block; overflow: visible; }
      .content { overflow: visible; }
      .view { display: none; }
      .view.active { display: block; }
      .panel { overflow: visible; height: auto; padding: 18px 14px 110px; }

      /* 3. 底部导航 */
      .m-nav { display: flex; }

      /* 4. hero 紧凑 */
      .hero { padding: 12px 14px 14px; }
      .hero-logo-big, .hero-quote, .hero-slogan { display: none; }
      .hero-stats { gap: 12px; margin-top: 10px; flex-wrap: wrap; }
      .hero-stats .hstat { flex: 1; min-width: 60px; }
      .hstat .num { font-size: 17px; }
      .hstat .lbl { font-size: 10px; }
      .brand-logo .bl-top { font-size: 22px; -webkit-text-stroke: 1.5px #0a0c10; text-shadow: 2px 2px 0 #0a0c10; }
      .brand-logo .bl-sub { font-size: 20px; -webkit-text-stroke: 1.5px #0a0c10; text-shadow: 2px 2px 0 #0a0c10; margin-left: 14px; }
      .hero-title p { display: none; }
      #theme-btn { padding: 5px 10px; font-size: 12px; white-space: nowrap; }

      /* 5. 聊天：消息文档流 + 输入框 sticky 固定 */
      #view-chat { min-height: calc(100dvh - 120px); }
      #view-chat.active { display: flex; flex-direction: column; }
      #chat { flex: 1; min-height: 30vh; overflow: visible; padding: 16px 12px 20px; }
      #inputbar { position: sticky; bottom: 56px; z-index: 95; }
      .quick-row { padding: 4px 12px 12px; }
      .msg { max-width: 94%; }

      /* 6. 表单横向排列改为纵向，避免溢出 */
      .form-row { flex-wrap: wrap; }
      .form-row select, .form-row input { max-width: 100%; }

      /* 7. 悬浮教练按钮避让底部导航和聊天输入框 */
      .fab-coach { right: 10px; bottom: 74px; width: 46px; height: 46px; font-size: 20px; }
      .coach-pop { right: 8px; bottom: 130px; width: 300px; }

      /* 8. canvas 与卡片 */
      canvas { max-width: 100%; }
      .card-grid { grid-template-columns: repeat(2, 1fr); }

      /* 9. iOS 输入框不自动缩放 + 触摸优化 */
      input, textarea, select { font-size: 16px !important; }
      .nav-item, .m-tab, .m-drawer-item, .card, button, .qcard { touch-action: manipulation; }
    }

    /* ===== 增量教练建议条 ===== */
    .inc-bar {
      background: var(--blue-soft); border: 1px solid var(--blue);
      border-radius: 12px; padding: 10px 14px; margin-bottom: 12px;
      font-size: 13px; line-height: 1.7; color: var(--ink-2);
    }
    .inc-bar b { color: var(--ink); }
    .inc-bar span { color: var(--ink); }

    /* ===== 训练吨位 ===== */
    .sc-tonnage {
      margin-left: auto; font-size: 12px; font-weight: 700;
      color: var(--lime); white-space: nowrap;
    }

    /* ===== 苹果式交互反馈 ===== */
    /* 按压反馈：卡片/按钮按下轻微缩放 */
    .card, .qcard, .nav-item, .m-tab, .m-drawer-item, .mv-card {
      transition: transform .2s var(--spring), background .18s ease, box-shadow .18s ease;
    }
    .card:active, .qcard:active, .nav-item:active, .m-tab:active, .m-drawer-item:active, .mv-card:active {
      transform: scale(.96);
    }
    .btn:active { transform: scale(.96); }
    /* 导航图标弹跳（选中态放大） */
    .nav-item .ic, .m-tab span {
      display: inline-block; transition: transform .35s var(--spring);
    }
    .nav-item.active .ic, .m-tab.active span { transform: scale(1.22); }
    .nav-item:active .ic, .m-tab:active span { transform: scale(1.1); }
