/* ---------- src/styles/tokens.css ---------- */
/* ============================================================
   h-portal 设计变量（浅色主题）
   独立维护，不引用主项目 internal/web/static 下的任何样式

   分层约定：
     1) 品牌与语义色  —— 只表达含义，不做装饰
     2) 中性色阶      —— 承载 95% 的界面，靠灰度拉开层次
     3) 圆角 3 档 + 胶囊 —— 不再逐组件发明半径
     4) 阴影 3 档     —— 用「描边 + 柔和投影」双层，替代重边框
   ============================================================ */
:root {
  /* 品牌色（单一主色，装饰性图标不得派生新色相） */
  --hp-primary: #1d4ed8;
  --hp-primary-hover: #1a43bf;
  --hp-primary-active: #16379c;
  --hp-primary-soft: #eef3ff;
  --hp-primary-softer: #f6f8ff;
  --hp-primary-border: #cfddff;
  --hp-accent: #f97316;
  --hp-accent-soft: #fff4ea;

  /* 语义色：仅用于状态，不用于图标底色轮换 */
  --hp-success: #12703a;
  --hp-success-soft: #e9f7ef;
  --hp-success-border: #c2e7d1;
  --hp-warning: #9a5b06;
  --hp-warning-soft: #fff7e8;
  --hp-warning-border: #f6dfae;
  --hp-danger: #c62828;
  --hp-danger-soft: #fdf2f2;
  --hp-danger-border: #f6cccc;
  --hp-info: #0369a1;
  --hp-info-soft: #eaf6fd;
  --hp-info-border: #bfe3f6;

  /* 中性色：蓝灰相但压低饱和度，避免整页发青 */
  --hp-bg: #f5f6f9;
  --hp-surface: #ffffff;
  --hp-surface-2: #f7f8fb;
  --hp-surface-3: #eef0f5;
  --hp-text: #101828;
  --hp-text-2: #3d4757;
  --hp-muted: #67717f;
  --hp-border: #e8eaef;
  --hp-border-strong: #d3d8e0;

  /* 侧栏（深色，仅导航区域） */
  --hp-side: #0e1a33;
  --hp-side-2: #17233d;
  --hp-side-text: #b9c6de;
  --hp-side-muted: #7a8aa6;

  /* 圆角：小控件 8 / 卡片 12 / 大容器 16 / 胶囊 */
  --hp-r-xs: 6px;
  --hp-r-sm: 8px;
  --hp-r-btn: 10px;
  --hp-r: 12px;
  --hp-r-lg: 16px;
  --hp-r-pill: 999px;

  /* 阴影：第 1 层是 1px 描边替代品，第 2 层才是投影 */
  --hp-shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --hp-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 24px -14px rgba(16, 24, 40, .18);
  --hp-shadow-lg: 0 18px 44px -16px rgba(16, 24, 40, .28);
  --hp-ring: 0 0 0 3px rgba(29, 78, 216, .14);

  /* 尺寸 */
  --hp-sidebar-w: 236px;
  --hp-topbar-h: 64px;
  --hp-max-w: 1180px;
  --hp-hit: 44px;

  --hp-font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, "Noto Sans CJK SC", sans-serif;
}

/* 高对比度与减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- src/styles/base.css ---------- */
/* ===== reset & 基础排版 ===== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--hp-font);
  font-size: 15px;
  line-height: 1.65;
  color: var(--hp-text);
  background: var(--hp-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, h5, p { margin: 0; }
h1 { font-size: 24px; line-height: 1.35; letter-spacing: -.01em; }
h2 { font-size: 18px; line-height: 1.4; letter-spacing: -.005em; }
h3 { font-size: 16px; line-height: 1.45; }
a { color: var(--hp-primary); text-decoration: none; }
a:hover { color: var(--hp-primary-hover); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--hp-primary); outline-offset: 2px; border-radius: var(--hp-r-xs); }
::selection { background: var(--hp-primary-soft); color: var(--hp-primary-active); }

/* 跳转到主内容：平时隐藏，键盘聚焦时出现在左上角 */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 4000;
  padding: 10px 16px; border-radius: var(--hp-r-sm, 8px);
  background: var(--hp-primary); color: #fff; font-size: 14px; font-weight: 600;
  text-decoration: none; box-shadow: var(--hp-shadow-lg, 0 8px 24px rgba(16,24,40,.2));
  transform: translateY(-160%); opacity: 0; transition: transform .18s ease, opacity .18s ease;
}
.skip-link:focus, .skip-link:focus-visible { transform: translateY(0); opacity: 1; color: #fff; }
#view:focus { outline: none; }

/* ===== 文字层级 ===== */
.muted { color: var(--hp-muted); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.micro { font-size: 11px; }          /* 仅用于角标 / 计数 */
.strong { font-weight: 700; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }

/* ===== 间距工具（替代页面里的 inline style） ===== */
.mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; }
.mt-6 { margin-top: 6px; }
.mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; } .mt-32 { margin-top: 32px; }
.gap-8 { gap: 8px; }
.center-wrap { justify-content: center; flex-wrap: wrap; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.stack { display: grid; gap: 16px; }
.stack-sm { display: grid; gap: 12px; }
.spacer { flex: 1; }

/* 区块标题行：左标题 + 右说明，统一各页「快捷入口」「我的课程」等写法 */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.section-head h2 { font-size: 17px; }
.section-head .sub { font-size: 12px; color: var(--hp-muted); }

/* ===== 卡片 ===== */
.card {
  background: var(--hp-surface);
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-r);
  box-shadow: var(--hp-shadow-sm);
}
.card-pad { padding: 20px; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--hp-border);
}
.card-head h2, .card-head h3 { font-size: 16px; }
.card-body { padding: 20px; }
.card-body-tight { padding-top: 6px; padding-bottom: 6px; }
/* 列表行内的说明文字（课程教师 / 进度） */
.row-meta { font-size: 12px; color: var(--hp-muted); margin: 3px 0 7px; }
/* 卡片内首尾元素不再额外撑高：避免「卡片套卡片」式的双层留白 */
.card-pad > :first-child { margin-top: 0; }
.card-pad > :last-child { margin-bottom: 0; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--hp-r-btn);
  background: var(--hp-primary); color: #fff; font-weight: 600; font-size: 14px;
  letter-spacing: .01em;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--hp-primary-hover); color: #fff; }
.btn:active { background: var(--hp-primary-active); }
.btn:focus-visible { outline: none; box-shadow: var(--hp-ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }
.btn-outline { background: var(--hp-surface); color: var(--hp-primary); border-color: var(--hp-primary-border); }
.btn-outline:hover { background: var(--hp-primary-soft); border-color: var(--hp-primary); color: var(--hp-primary); }
.btn-ghost { background: transparent; color: var(--hp-text-2); }
.btn-ghost:hover { background: var(--hp-surface-3); color: var(--hp-text); }
.btn-soft { background: var(--hp-primary-soft); color: var(--hp-primary); }
.btn-soft:hover { background: #e3ecff; color: var(--hp-primary-hover); }
.btn-danger { background: var(--hp-danger-soft); color: var(--hp-danger); border-color: var(--hp-danger-border); }
.btn-danger:hover { background: #fbe6e6; color: var(--hp-danger); }
.btn-light { background: rgba(255,255,255,.16); color: #fff; border-color: rgba(255,255,255,.32); }
.btn-light:hover { background: rgba(255,255,255,.26); color: #fff; }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: 13px; border-radius: var(--hp-r-sm); }
.btn-lg { min-height: 50px; padding: 0 24px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 42px; padding: 0 10px; }

/* ===== 标签 ===== */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 9px; border-radius: var(--hp-r-pill);
  font-size: 12px; font-weight: 600; line-height: 1.75; white-space: nowrap;
  background: var(--hp-surface-3); color: var(--hp-muted); border: 1px solid transparent;
}
.tag-blue { background: var(--hp-primary-soft); color: var(--hp-primary); border-color: var(--hp-primary-border); }
.tag-green { background: var(--hp-success-soft); color: var(--hp-success); border-color: var(--hp-success-border); }
.tag-orange { background: var(--hp-accent-soft); color: #b45309; border-color: #fbd6ae; }
.tag-red { background: var(--hp-danger-soft); color: var(--hp-danger); border-color: var(--hp-danger-border); }
.tag-gray { background: var(--hp-surface-3); color: var(--hp-muted); }
.tag-warning { background: var(--hp-warning-soft); color: var(--hp-warning); border-color: var(--hp-warning-border); }

/* ===== 表单 ===== */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field > label { font-size: 13px; font-weight: 600; color: var(--hp-text-2); }
.field .req::after { content: " *"; color: var(--hp-danger); }
.input, .textarea, .select {
  width: 100%; min-height: 44px; padding: 10px 12px;
  border: 1px solid var(--hp-border-strong); border-radius: var(--hp-r-btn);
  background: var(--hp-surface); font-size: 15px;
  transition: border-color .16s ease, box-shadow .16s ease;
}
.textarea { min-height: 92px; resize: vertical; line-height: 1.7; }
.input:hover, .textarea:hover, .select:hover { border-color: #b9c2cf; }
.input:focus, .textarea:focus, .select:focus {
  outline: none; border-color: var(--hp-primary);
  box-shadow: var(--hp-ring);
}
.input::placeholder, .textarea::placeholder { color: #98a2b1; }
.field-error { font-size: 12px; color: var(--hp-danger); min-height: 0; }
.field.is-error .input, .field.is-error .textarea, .field.is-error .select { border-color: var(--hp-danger); }
.field.is-error .input:focus { box-shadow: 0 0 0 3px rgba(198, 40, 40, .13); }
.field-hint { font-size: 12px; color: var(--hp-muted); line-height: 1.7; display: flex; gap: 6px; align-items: flex-start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.checkline { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--hp-text-2); }
.checkline input { width: 16px; height: 16px; accent-color: var(--hp-primary); }

/* ===== 进度条 ===== */
.progress { height: 6px; border-radius: var(--hp-r-pill); background: var(--hp-surface-3); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: inherit; background: var(--hp-primary); transition: width .3s ease; }
.progress.thin { height: 4px; }

/* ===== 列表行 ===== */
.list-row {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--hp-border);
}
.list-row:last-child { border-bottom: 0; }
.list-row .row-title { font-weight: 600; color: var(--hp-text); }
.list-row .row-sub { font-size: 12px; color: var(--hp-muted); }
/* 列表内的方形图标块：统一尺寸，不再逐处 inline 覆盖 */
.row-chip {
  width: 38px; height: 38px; flex: none; border-radius: var(--hp-r-sm);
  display: grid; place-items: center; font-size: 18px;
  background: var(--hp-primary-soft); color: var(--hp-primary);
}

/* ===== 空状态 ===== */
.empty {
  display: grid; justify-items: center; gap: 8px;
  padding: 40px 20px; text-align: center; color: var(--hp-muted);
}
.empty .empty-icon {
  width: 56px; height: 56px; border-radius: 50%; margin-bottom: 2px;
  display: grid; place-items: center;
  background: var(--hp-surface-3); color: #94a0b0; font-size: 24px;
}
.empty p { font-size: 13px; max-width: 320px; line-height: 1.7; }

/* ===== 启动屏 ===== */
.boot-screen {
  min-height: 100dvh; display: grid; place-content: center; justify-items: center;
  gap: 14px; color: var(--hp-muted); background: var(--hp-bg);
}
.boot-spinner {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid var(--hp-primary-border); border-top-color: var(--hp-primary);
  animation: hp-spin .8s linear infinite;
}
@keyframes hp-spin { to { transform: rotate(360deg); } }

/* ===== toast ===== */
/* 下移到顶栏之下，避免盖住顶栏标题与首页欢迎区；aria-live 由 ui.js 注入 */
.toast-wrap {
  position: fixed; z-index: 3000;
  top: calc(var(--hp-topbar-h, 64px) + 12px); left: 50%; transform: translateX(-50%);
  display: grid; gap: 8px; width: min(92vw, 420px); pointer-events: none;
}
.toast {
  padding: 11px 16px; border-radius: var(--hp-r-btn);
  background: #16233a; color: #fff; font-size: 14px;
  box-shadow: var(--hp-shadow-lg); animation: hp-toast-in .2s ease-out;
}
.toast.ok { background: #12643a; }
.toast.err { background: #a51f1f; }
@keyframes hp-toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===== 弹窗 ===== */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(16, 24, 40, .5);
  display: grid; place-items: center; padding: 20px;
  animation: hp-fade-in .16s ease-out;
}
.modal {
  width: min(100%, 480px); max-height: 86vh; overflow: auto;
  background: var(--hp-surface); border-radius: var(--hp-r-lg);
  box-shadow: var(--hp-shadow-lg); padding: 24px;
  animation: hp-modal-in .2s cubic-bezier(.2, .8, .2, 1);
}
.modal h2 { margin-bottom: 10px; font-size: 19px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }
@keyframes hp-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes hp-modal-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }

/* ===== 文本 ===== */
.eyebrow {
  font-size: 12px; font-weight: 700; letter-spacing: .06em;
  color: var(--hp-primary);
}
.divider { height: 1px; background: var(--hp-border); margin: 16px 0; }
.link-btn { border: 0; background: none; padding: 0; color: var(--hp-primary); font-weight: 600; }
.link-btn:hover { text-decoration: underline; }

/* ===== 登录页局部排版（原为页面内 inline style） ===== */
.auth-eyebrow-row { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.hero-eyebrow { color: rgba(255, 255, 255, .72); font-size: 12px; font-weight: 600; letter-spacing: .04em; }
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 72px; }
.pwd-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; padding: 4px 6px; }

/* ---------- src/styles/layout.css ---------- */
/* ============================================================
   h-portal 响应式布局
   PC(>=1024) 左侧栏 + 顶栏 ；平板(768~1023) 顶部横向导航 ；
   手机(<768) 精简顶栏 + 底部 TabBar + 单列内容
   ============================================================ */
.app-shell {
  display: grid;
  grid-template-columns: var(--hp-sidebar-w) minmax(0, 1fr);
  min-height: 100dvh;
}

/* ---------- 左侧栏（PC） ---------- */
.sidebar {
  position: sticky; top: 0; height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--hp-side); color: var(--hp-side-text);
  padding: 0 12px; overflow-y: auto;
  scrollbar-width: thin;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--hp-topbar-h); padding: 0 8px; color: #fff;
  font-size: 16px; font-weight: 700; letter-spacing: .01em;
}
.side-brand .mark {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: var(--hp-primary);
  display: grid; place-items: center; color: #fff; font-size: 16px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.side-group-label {
  padding: 18px 12px 6px; font-size: 11px; letter-spacing: .1em;
  color: var(--hp-side-muted); font-weight: 600;
}
.side-nav { display: grid; gap: 2px; }
.side-link {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  min-height: 42px; padding: 0 12px; border-radius: var(--hp-r-sm);
  color: var(--hp-side-text); font-size: 14px; font-weight: 500;
  transition: background-color .16s ease, color .16s ease;
}
.side-link:hover { background: var(--hp-side-2); color: #fff; }
/* 选中态：淡底 + 左侧 3px 主色条，替代整块高饱和蓝 */
.side-link.active {
  background: rgba(255, 255, 255, .07);
  color: #fff; font-weight: 600;
}
.side-link.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: var(--hp-r-pill);
  background: #4d7cf5;
}
.side-link .ico { width: 18px; flex: none; color: var(--hp-side-muted); font-size: 17px; }
.side-link:hover .ico { color: currentColor; }
.side-link.active .ico { color: #7ea2ff; }
.side-link .badge {
  margin-left: auto; min-width: 18px; padding: 0 6px; border-radius: var(--hp-r-pill);
  background: var(--hp-accent); color: #fff; font-size: 11px; text-align: center; line-height: 18px;
}
.side-foot {
  margin-top: auto; padding: 14px 12px 18px; font-size: 11px; line-height: 1.7;
  color: var(--hp-side-muted); border-top: 1px solid rgba(255,255,255,.07);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--hp-topbar-h); background: var(--hp-surface);
  border-bottom: 1px solid var(--hp-border);
  display: flex; align-items: center; gap: 16px; padding: 0 28px;
}
.topbar-title { font-size: 15px; font-weight: 700; color: var(--hp-text); white-space: nowrap; }
.topbar-sub { font-size: 12px; color: var(--hp-muted); line-height: 1.4; }
.top-nav { display: none; align-items: center; gap: 2px; overflow-x: auto; }
.top-nav a {
  padding: 7px 12px; border-radius: var(--hp-r-sm); font-size: 14px;
  color: var(--hp-text-2); white-space: nowrap;
}
.top-nav a:hover { background: var(--hp-surface-2); color: var(--hp-text); }
.top-nav a.active { background: var(--hp-primary-soft); color: var(--hp-primary); font-weight: 600; }
.top-user { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 13px; font-weight: 700;
  background: var(--hp-primary-soft); color: var(--hp-primary);
  border: 1px solid var(--hp-primary-border);
}
.top-user .who { font-size: 13px; line-height: 1.25; text-align: right; }
.top-user .who b { display: block; font-weight: 600; }
.top-user .who span { color: var(--hp-muted); font-size: 11px; }

/* ---------- 内容区 ---------- */
.main { min-width: 0; }
.content { max-width: var(--hp-max-w); margin: 0 auto; padding: 24px 28px 56px; }
.content-narrow { max-width: 820px; }
.page-head { margin-bottom: 18px; }
.page-head h1 { font-size: 22px; }
.page-head p { color: var(--hp-muted); font-size: 13px; margin-top: 4px; }

/* ---------- 底部 TabBar（H5） ---------- */
.bottom-nav { display: none; }

/* ---------- 登录页（全屏独立布局） ---------- */
.auth-page {
  min-height: 100dvh; display: grid;
  grid-template-columns: 1.05fr .95fr;
  background: var(--hp-surface);
}
.auth-aside {
  position: relative; overflow: hidden;
  padding: 44px 52px; color: #fff;
  background: linear-gradient(155deg, #0f2350 0%, #1a3fa0 52%, #2f6bea 100%);
  display: flex; flex-direction: column;
}
/* 单侧弱光晕替代大圆环，减少「模板感」 */
.auth-aside::after {
  content: ""; position: absolute; width: 520px; height: 520px; right: -190px; bottom: -240px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.10), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.auth-brand { display: flex; align-items: center; gap: 11px; font-size: 19px; font-weight: 700; position: relative; z-index: 1; }
.auth-brand .mark {
  width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.26); font-size: 19px;
}
.auth-hero { margin-top: auto; position: relative; z-index: 1; }
.auth-hero h1 { font-size: 34px; line-height: 1.28; margin-bottom: 12px; letter-spacing: -.01em; }
.auth-hero p { color: rgba(255,255,255,.78); max-width: 400px; font-size: 14px; line-height: 1.8; }
.auth-features { display: grid; gap: 12px; margin: 30px 0 auto; position: relative; z-index: 1; }
.auth-feature { display: flex; align-items: center; gap: 11px; font-size: 13px; color: rgba(255,255,255,.86); }
.auth-feature .ico {
  width: 32px; height: 32px; border-radius: var(--hp-r-sm); flex: none; display: grid; place-items: center;
  background: rgba(255,255,255,.12); font-size: 16px;
}
.auth-foot { position: relative; z-index: 1; font-size: 12px; color: rgba(255,255,255,.5); }
.auth-panel { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(100%, 396px); }
.auth-card h1 { font-size: 25px; }
.auth-card .sub { color: var(--hp-muted); font-size: 14px; margin: 8px 0 26px; }
.auth-tip {
  margin-top: 18px; padding: 12px 14px; border-radius: var(--hp-r-sm);
  background: var(--hp-primary-softer); color: var(--hp-text-2);
  border: 1px solid var(--hp-primary-border);
  font-size: 12px; line-height: 1.75;
}
.auth-mode {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--hp-muted); margin-top: 18px;
}
.auth-mode .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hp-success); }

/* ============================================================
   断点 1：平板 / 小屏笔电 —— 收起侧栏，改用顶部横向导航
   ============================================================ */
@media (max-width: 1023px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { display: none; }
  .topbar { padding: 0 18px; gap: 12px; backdrop-filter: none; background: var(--hp-surface); }
  .top-nav { display: flex; }
  .topbar-title { display: none; }
  .content { padding: 20px 18px 48px; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { padding: 26px 24px; min-height: 230px; }
  .auth-hero { margin-top: 26px; }
  .auth-hero h1 { font-size: 25px; }
  .auth-features { display: none; }
  .auth-foot { margin-top: 18px; }
  .auth-panel { padding: 30px 24px 44px; align-items: start; }
}

/* ============================================================
   断点 2：手机 H5 —— 底部 TabBar、单列、大点击区、安全区
   ============================================================ */
@media (max-width: 767px) {
  body { font-size: 14px; }
  .topbar { height: 56px; padding: 0 14px; }
  .top-nav { display: none; }
  .topbar-title { display: block; font-size: 16px; }
  .topbar-sub { font-size: 11px; }
  .top-user .who { display: none; }
  .avatar { width: 32px; height: 32px; }
  .content { padding: 14px 14px calc(94px + env(safe-area-inset-bottom)); }
  .page-head { margin-bottom: 14px; }
  .page-head h1 { font-size: 19px; }
  .card-pad, .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .card-head h2 { font-size: 15px; }
  .form-grid { grid-template-columns: 1fr; }
  .section-head h2 { font-size: 16px; }

  .bottom-nav {
    display: flex; position: fixed; z-index: 100;
    left: 0; right: 0; bottom: 0;
    height: calc(60px + env(safe-area-inset-bottom));
    padding-bottom: env(safe-area-inset-bottom);
    background: var(--hp-surface);
    border-top: 1px solid var(--hp-border);
  }
  .bottom-item {
    flex: 1; position: relative;
    display: grid; place-content: center; justify-items: center; gap: 3px;
    color: var(--hp-muted); font-size: 11px; min-height: var(--hp-hit);
  }
  .bottom-item .ico { font-size: 21px; line-height: 1; }
  .bottom-item.active { color: var(--hp-primary); font-weight: 600; }
  .bottom-item.active::before {
    content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 20px; height: 2.5px; border-radius: 0 0 var(--hp-r-pill) var(--hp-r-pill);
    background: var(--hp-primary);
  }

  /* 登录页：品牌区压到最小，把空间让给表单 */
  .auth-aside { min-height: 0; padding: 20px 20px 22px; }
  .auth-hero { margin-top: 18px; }
  .auth-hero h1 { font-size: 21px; margin-bottom: 8px; }
  .auth-hero p { font-size: 13px; line-height: 1.65; }
  .auth-panel { padding: 24px 20px 40px; }
  .auth-card h1 { font-size: 21px; }
  .btn { min-height: 44px; }
  .btn-sm { min-height: 34px; }
  .btn-lg { min-height: 50px; }
  .input, .textarea, .select { min-height: 46px; font-size: 16px; } /* 16px 防 iOS 自动缩放 */
  /* 顶栏 56px，toast 必须落在它下面，否则会盖住页面标题 */
  .toast-wrap { top: calc(56px + 10px); }
  .modal { padding: 20px; border-radius: var(--hp-r); }
}

@media (max-width: 380px) {
  .topbar-sub { display: none; }
  .content { padding-left: 12px; padding-right: 12px; }
}

/* ---------- src/styles/components.css ---------- */
/* ============================================================
   h-portal 业务组件样式（全部为自研轻量组件，不依赖任何 UI 库）
   设计约束：
     · 装饰性图标统一主色，不再按位置轮换色相（降低视觉噪声）
     · 圆角只用 --hp-r-xs / sm / r / lg / pill 五档
     · 悬浮态优先改边框与阴影，避免 transform 触发大面积重排
   ============================================================ */
.ico { display: inline-flex; align-items: center; justify-content: center; flex: none; }
.ico svg { width: 1.1em; height: 1.1em; display: block; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: start; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  border-radius: var(--hp-r-lg); padding: 26px 28px; color: #fff;
  background: linear-gradient(118deg, #16326c 0%, #1d4ed8 58%, #3a72e8 100%);
  box-shadow: 0 1px 2px rgba(16,24,40,.06), 0 14px 32px -20px rgba(22,50,108,.55);
}
/* 右上一处极淡光晕，替代原来的粗描边圆环 */
.hero::after {
  content: ""; position: absolute; right: -120px; top: -160px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.14), rgba(255,255,255,0) 66%);
  pointer-events: none;
}
.hero-inner { position: relative; z-index: 1; }
.hero h1 { font-size: 24px; margin-bottom: 6px; letter-spacing: -.01em; }
.hero p { color: rgba(255,255,255,.82); font-size: 14px; line-height: 1.75; max-width: 560px; }
.hero-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.hero-actions .btn { min-height: 40px; }
.hero-chips { display: flex; gap: 6px; margin-top: 14px; flex-wrap: wrap; }
.hero-chip {
  padding: 4px 11px; border-radius: var(--hp-r-pill); font-size: 12px;
  background: rgba(255,255,255,.13); border: 1px solid rgba(255,255,255,.16);
  white-space: nowrap;
}

/* ---------- 统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat-card { padding: 15px 17px 16px; }
.stat-label {
  font-size: 12px; color: var(--hp-muted); font-weight: 500;
  display: flex; align-items: center; gap: 6px;
}
.stat-value {
  font-size: 27px; font-weight: 700; line-height: 1.3; margin-top: 8px;
  letter-spacing: -.025em; color: var(--hp-text);
  font-variant-numeric: tabular-nums;
}
.stat-value small { font-size: 13px; font-weight: 500; color: var(--hp-muted); margin-left: 4px; letter-spacing: 0; }
.stat-foot { font-size: 12px; color: var(--hp-muted); margin-top: 2px; }
/* 图标统一主色；.orange/.green/.blue2 保留类名以兼容页面，不再切换色相 */
.stat-ico {
  width: 32px; height: 32px; border-radius: var(--hp-r-sm); display: grid; place-items: center;
  background: var(--hp-primary-soft); color: var(--hp-primary); font-size: 16px; flex: none;
}
.stat-ico.orange, .stat-ico.green, .stat-ico.blue2 {
  background: var(--hp-primary-soft); color: var(--hp-primary);
}

/* ---------- 快捷入口 ---------- */
.quick-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.quick-card {
  display: flex; align-items: center; gap: 12px; padding: 14px;
  border: 1px solid var(--hp-border); border-radius: var(--hp-r);
  background: var(--hp-surface); box-shadow: var(--hp-shadow-sm);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.quick-card:hover {
  border-color: var(--hp-primary-border);
  box-shadow: var(--hp-shadow); color: inherit;
}
.quick-ico {
  width: 38px; height: 38px; flex: none; border-radius: var(--hp-r-sm); display: grid; place-items: center;
  background: var(--hp-primary-soft); color: var(--hp-primary); font-size: 19px;
}
/* 统一主色后，用透明度做层次，避免四个不同色块 */
.quick-card:nth-child(2) .quick-ico,
.quick-card:nth-child(3) .quick-ico,
.quick-card:nth-child(4) .quick-ico {
  background: var(--hp-primary-soft); color: var(--hp-primary);
}
.quick-card b { display: block; font-size: 14px; font-weight: 600; color: var(--hp-text); }
.quick-card span { font-size: 12px; color: var(--hp-muted); }

/* ---------- 首页列表 ---------- */
.notice-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--hp-border); }
.notice-item:last-child { border-bottom: 0; }
.notice-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hp-primary); margin-top: 8px; flex: none; }
.notice-item .t { font-size: 14px; font-weight: 600; line-height: 1.5; }
.notice-item .d { font-size: 12px; color: var(--hp-muted); margin-top: 2px; }
.todo-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--hp-border);
}
.todo-item:last-child { border-bottom: 0; }
.todo-date {
  width: 46px; flex: none; text-align: center; padding: 5px 0;
  border-radius: var(--hp-r-sm); background: var(--hp-surface-3); color: var(--hp-text-2);
}
.todo-date b { display: block; font-size: 16px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.todo-date span { font-size: 10px; color: var(--hp-muted); }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 18px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.search-box .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--hp-muted); font-size: 17px; }
.search-box .input { padding-left: 38px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 8px 14px; border-radius: var(--hp-r-pill); font-size: 13px;
  border: 1px solid var(--hp-border); background: var(--hp-surface); color: var(--hp-text-2);
  min-height: 38px; transition: border-color .16s ease, background-color .16s ease, color .16s ease;
}
.chip:hover { border-color: var(--hp-primary-border); color: var(--hp-primary); }
.chip.active { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff; font-weight: 600; }

/* ---------- 课程卡片 ---------- */
.course-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.course-card {
  overflow: hidden; display: flex; flex-direction: column;
  transition: box-shadow .18s ease, border-color .18s ease;
}
.course-card:hover { border-color: var(--hp-primary-border); box-shadow: var(--hp-shadow); }
.course-cover {
  height: 124px; position: relative; display: grid; place-items: center;
  color: rgba(255,255,255,.94); font-size: 40px;
  background: linear-gradient(135deg, #1b3f8f, #2f6be0);
}
.course-cover.c2 { background: linear-gradient(135deg, #12574f, #17897c); }
.course-cover.c3 { background: linear-gradient(135deg, #8a4115, #c96a1f); }
.course-cover.c4 { background: linear-gradient(135deg, #4a2a86, #6f52b8); }
.course-cover .cover-tag {
  position: absolute; left: 12px; top: 12px; font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--hp-r-pill);
  background: rgba(255,255,255,.2); color: #fff;
}
.course-cover .cover-ring {
  position: absolute; right: -26px; bottom: -54px; width: 132px; height: 132px;
  border: 22px solid rgba(255,255,255,.07); border-radius: 50%;
}
.course-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-title { font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--hp-text); }
.course-desc { font-size: 12px; color: var(--hp-muted); min-height: 36px; line-height: 1.6; }
.course-meta { display: flex; gap: 14px; font-size: 12px; color: var(--hp-muted); flex-wrap: wrap; }
.course-meta span { display: inline-flex; align-items: center; gap: 4px; }
.course-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--hp-border); }
.course-foot .between { font-size: 12px; color: var(--hp-muted); margin-bottom: 8px; }

/* ---------- 课程详情 ---------- */
.course-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 16px; align-items: start; }
.chapter-panel { position: sticky; top: calc(var(--hp-topbar-h) + 16px); max-height: calc(100dvh - 100px); overflow: auto; }
.chapter-item {
  display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left;
  padding: 10px 11px; border: 0; background: transparent; border-radius: var(--hp-r-sm);
  color: var(--hp-text-2); font-size: 13px; line-height: 1.5;
  transition: background-color .14s ease, color .14s ease;
}
.chapter-item:hover { background: var(--hp-surface-2); }
.chapter-item.active { background: var(--hp-primary-soft); color: var(--hp-primary); font-weight: 600; }
.chapter-num {
  width: 22px; height: 22px; flex: none; border-radius: var(--hp-r-xs); display: grid; place-items: center;
  background: var(--hp-surface-3); color: var(--hp-muted); font-size: 11px; font-weight: 700;
}
.chapter-item.active .chapter-num { background: var(--hp-primary); color: #fff; }
.chapter-item.done .chapter-num { background: var(--hp-success-soft); color: var(--hp-success); }
.chapter-item .dur { display: block; font-size: 11px; color: var(--hp-muted); font-weight: 400; }
.player {
  position: relative; aspect-ratio: 16 / 8; border-radius: var(--hp-r); overflow: hidden;
  background: linear-gradient(135deg, #0e1c3c, #1b3a7d); display: grid; place-items: center;
  color: #fff;
}
.player::after {
  content: ""; position: absolute; width: 380px; height: 380px; right: -150px; top: -180px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(255,255,255,.1), rgba(255,255,255,0) 66%);
  pointer-events: none;
}
.player-inner { position: relative; z-index: 1; text-align: center; }
.player-btn {
  width: 58px; height: 58px; margin: 0 auto 12px; border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,.55); background: rgba(255,255,255,.14);
  color: #fff; font-size: 22px; display: grid; place-items: center;
  transition: background-color .16s ease, border-color .16s ease;
}
.player-btn:hover { background: rgba(255,255,255,.26); border-color: rgba(255,255,255,.8); }
.player-label { font-size: 12px; color: rgba(255,255,255,.68); }
.lesson-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.lesson-text { font-size: 14px; line-height: 1.9; color: var(--hp-text-2); }
.lesson-text h3 { margin: 18px 0 6px; color: var(--hp-text); }
.lesson-text ul { list-style: disc; padding-left: 20px; margin: 8px 0; }
.lesson-text li { margin: 5px 0; }
.lesson-actions {
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hp-border);
}
.note-box { margin-top: 18px; }
.note-box .textarea { min-height: 76px; }

/* ---------- 考试卡片 ---------- */
.exam-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.exam-card { padding: 20px; }
.exam-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.exam-title { font-size: 16px; font-weight: 700; line-height: 1.45; }
.exam-desc { font-size: 13px; color: var(--hp-muted); margin: 8px 0 16px; line-height: 1.65; }
.exam-meta-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  padding: 14px 0; border-top: 1px solid var(--hp-border); border-bottom: 1px solid var(--hp-border);
}
.exam-meta-item span { display: block; font-size: 11px; color: var(--hp-muted); }
.exam-meta-item b { font-size: 15px; font-variant-numeric: tabular-nums; }
.exam-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

/* ---------- 答题页 ---------- */
.exam-bar {
  position: sticky; top: var(--hp-topbar-h); z-index: 40;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 11px 14px; margin-bottom: 16px;
  background: var(--hp-surface); border: 1px solid var(--hp-border);
  border-radius: var(--hp-r); box-shadow: var(--hp-shadow-sm);
}
.timer { display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 16px; }
.timer.warn { color: var(--hp-danger); }
.taking-layout { display: grid; grid-template-columns: minmax(0, 1fr) 244px; gap: 16px; align-items: start; }
.q-card { padding: 22px; }
.q-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.q-index { font-size: 12px; color: var(--hp-muted); font-variant-numeric: tabular-nums; }
.q-stem { font-size: 16px; font-weight: 600; line-height: 1.7; margin-bottom: 18px; }
.option-list { display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 11px; width: 100%; text-align: left;
  padding: 13px 14px; min-height: 48px;
  border: 1px solid var(--hp-border-strong); border-radius: var(--hp-r-btn);
  background: var(--hp-surface); font-size: 14px; line-height: 1.6;
  transition: border-color .14s ease, background-color .14s ease;
}
.option:hover { border-color: var(--hp-primary-border); background: var(--hp-primary-softer); }
.option .key {
  width: 24px; height: 24px; flex: none; border-radius: var(--hp-r-xs); display: grid; place-items: center;
  background: var(--hp-surface-3); color: var(--hp-text-2); font-size: 12px; font-weight: 700;
}
.option.selected { border-color: var(--hp-primary); background: var(--hp-primary-soft); }
.option.selected .key { background: var(--hp-primary); color: #fff; }
.option.correct { border-color: var(--hp-success); background: var(--hp-success-soft); }
.option.correct .key { background: var(--hp-success); color: #fff; }
.option.wrong { border-color: var(--hp-danger); background: var(--hp-danger-soft); }
.option.wrong .key { background: var(--hp-danger); color: #fff; }
.q-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hp-border); }
.q-nav-panel { position: sticky; top: calc(var(--hp-topbar-h) + 78px); padding: 18px; }
.q-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; }
.q-nav-item {
  aspect-ratio: 1; min-height: 34px; border-radius: var(--hp-r-xs); font-size: 13px; font-weight: 600;
  border: 1px solid var(--hp-border-strong); background: var(--hp-surface); color: var(--hp-text-2);
  font-variant-numeric: tabular-nums;
}
.q-nav-item.answered { background: var(--hp-primary-soft); border-color: var(--hp-primary-border); color: var(--hp-primary); }
.q-nav-item.current { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff; }
.q-legend { display: flex; gap: 12px; font-size: 11px; color: var(--hp-muted); margin-top: 14px; }
.q-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }

/* ---------- 成绩页 ---------- */
.result-hero { padding: 28px; text-align: center; }
.score-ring {
  width: 126px; height: 126px; margin: 0 auto 14px; border-radius: 50%;
  display: grid; place-content: center; justify-items: center;
  border: 8px solid var(--hp-primary); color: var(--hp-primary);
  font-variant-numeric: tabular-nums;
}
.score-ring.pass { border-color: var(--hp-success); color: var(--hp-success); }
.score-ring.fail { border-color: var(--hp-danger); color: var(--hp-danger); }
.score-ring b { font-size: 36px; line-height: 1.1; letter-spacing: -.02em; }
.score-ring span { font-size: 11px; color: var(--hp-muted); }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
.result-stats > div { padding: 12px; border-radius: var(--hp-r-sm); background: var(--hp-surface-2); }
.result-stats b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.result-stats span { font-size: 11px; color: var(--hp-muted); }
.review-item { padding: 16px 0; border-bottom: 1px solid var(--hp-border); }
.review-item:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 14px; font-weight: 600; }
.review-answer { font-size: 13px; color: var(--hp-text-2); margin-top: 8px; }
.review-analysis {
  margin-top: 8px; padding: 10px 12px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); font-size: 12px; color: var(--hp-text-2); line-height: 1.7;
}

/* ---------- 活动 ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--hp-border); margin-bottom: 18px; }
.tab {
  padding: 10px 15px; min-height: 44px; border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--hp-muted); font-size: 14px; font-weight: 600;
  transition: color .14s ease, border-color .14s ease;
}
.tab:hover { color: var(--hp-text); }
.tab.active { color: var(--hp-primary); border-bottom-color: var(--hp-primary); }
.event-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.event-card { display: flex; gap: 14px; padding: 18px; }
.event-date-block {
  width: 62px; flex: none; text-align: center; padding: 8px 0; border-radius: var(--hp-r-sm);
  background: var(--hp-primary-soft); color: var(--hp-primary);
}
.event-date-block.closed { background: var(--hp-surface-3); color: var(--hp-muted); }
.event-day { font-size: 23px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.event-month { font-size: 11px; }
.event-title { font-size: 15px; font-weight: 700; line-height: 1.45; }
.event-meta { display: grid; gap: 5px; margin: 9px 0; font-size: 12px; color: var(--hp-muted); }
.event-meta span { display: flex; align-items: center; gap: 6px; }
.event-slots { margin: 10px 0; }
.event-slots .between { font-size: 11px; color: var(--hp-muted); margin-bottom: 6px; }
.event-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- 个人中心 ---------- */
.profile-top { display: flex; align-items: center; gap: 16px; padding: 22px; }
.profile-avatar {
  width: 60px; height: 60px; flex: none; border-radius: var(--hp-r-lg); display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
  background: linear-gradient(140deg, #2f6be8, #1d4ed8); color: #fff;
  box-shadow: 0 6px 16px -8px rgba(29,78,216,.6);
}
.info-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 20px; }
.info-item { padding: 11px 13px; border-radius: var(--hp-r-sm); background: var(--hp-surface-2); }
.info-item span { display: block; font-size: 12px; color: var(--hp-muted); }
.info-item b { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--hp-border);
}
.setting-row:last-child { border-bottom: 0; }
.setting-row .label { font-size: 14px; font-weight: 600; }
.setting-row .desc { font-size: 12px; color: var(--hp-muted); line-height: 1.6; }

/* ============================================================
   响应式微调
   ============================================================ */
@media (max-width: 1023px) {
  .course-layout { grid-template-columns: 236px minmax(0, 1fr); }
  .taking-layout { grid-template-columns: minmax(0, 1fr) 208px; }
  .stat-grid, .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .course-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4, .two-col,
  .course-grid, .exam-grid, .event-grid,
  .course-layout, .taking-layout { grid-template-columns: 1fr; }

  .hero { padding: 18px 16px; border-radius: var(--hp-r); }
  .hero h1 { font-size: 19px; }
  .hero p { font-size: 13px; line-height: 1.7; }
  .hero-actions { margin-top: 14px; gap: 8px; }
  .hero-actions .btn { flex: 1; min-width: 0; }
  .hero-chips { margin-top: 12px; gap: 6px; }
  .hero-chip { padding: 3px 9px; font-size: 11px; }

  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 12px 13px 13px; }
  .stat-value { font-size: 23px; margin-top: 6px; }
  .stat-value small { font-size: 12px; margin-left: 3px; }
  .stat-label { font-size: 11px; }
  .stat-foot { font-size: 11px; }
  .stat-ico { width: 28px; height: 28px; font-size: 15px; }
  .quick-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .quick-card { padding: 12px; gap: 9px; }
  .quick-ico { width: 34px; height: 34px; font-size: 17px; }
  .quick-card b { font-size: 13px; }
  .quick-card span { font-size: 11px; }

  .toolbar { gap: 10px; }
  .search-box { max-width: none; width: 100%; flex: 1 1 100%; }
  .chips { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .chip { flex: none; }

  .course-cover { height: 104px; font-size: 34px; }
  .chapter-panel { position: static; max-height: 260px; }
  .player { aspect-ratio: 16 / 10; }
  .lesson-actions .btn { flex: 1; min-width: 120px; }
  .q-card { padding: 16px; }
  .q-stem { font-size: 15px; }
  .q-nav-panel { position: static; }
  .q-nav-grid { grid-template-columns: repeat(8, 1fr); }
  .exam-bar { top: 56px; padding: 10px 12px; }
  .exam-bar .btn { flex: 1; }
  .exam-meta-grid { gap: 6px; }
  .event-card { padding: 14px; gap: 12px; }
  .event-date-block { width: 56px; }
  .info-grid { grid-template-columns: 1fr; padding: 16px; }
  .profile-top { padding: 18px; }
  .result-hero { padding: 20px 14px; }
  .tabs { overflow-x: auto; }
  .tab { flex: none; padding: 10px 13px; }
  .empty { padding: 32px 16px; }
}

/* ============================================================
   登录模块：方式切换 / 状态反馈 / 验证码 / 扫码 / 手机号绑定
   ============================================================ */
.auth-tabs {
  display: flex; gap: 4px; margin: 4px 0 22px;
  border-bottom: 1px solid var(--hp-border);
}
.auth-tab {
  flex: 1; min-height: 44px; padding: 8px 4px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-bottom: 2px solid transparent;
  background: none; color: var(--hp-muted); font-size: 13px; font-weight: 600;
  white-space: nowrap; transition: color .14s ease, border-color .14s ease;
}
.auth-tab:hover { color: var(--hp-primary); }
.auth-tab.active { color: var(--hp-primary); border-bottom-color: var(--hp-primary); }

.auth-status { margin-top: 14px; }
.auth-status:empty { display: none; }
.auth-status > * { display: inline; }
.auth-status.loading, .auth-status.error, .auth-status.ok {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 10px 12px; border-radius: var(--hp-r-sm); font-size: 13px; line-height: 1.6;
}
.auth-status .ico { margin-top: 2px; }
.auth-status.loading { background: var(--hp-primary-soft); color: var(--hp-primary); }
.auth-status.loading .ico svg { animation: hp-spin 1s linear infinite; }
.auth-status.error { background: var(--hp-danger-soft); color: var(--hp-danger); }
.auth-status.ok { background: var(--hp-success-soft); color: var(--hp-success); }

.auth-banner {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 11px 13px; margin-bottom: 16px; border-radius: var(--hp-r-sm);
  font-size: 13px; line-height: 1.65;
}
.auth-banner .ico { margin-top: 2px; }
.auth-banner.warn { background: var(--hp-warning-soft); color: var(--hp-warning); border: 1px solid var(--hp-warning-border); }
.auth-banner.info { background: var(--hp-info-soft); color: var(--hp-info); border: 1px solid var(--hp-info-border); }

.auth-options {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; flex-wrap: wrap;
}
.code-row { display: flex; gap: 8px; }
.code-row .input { flex: 1; min-width: 0; }
.code-row .btn { flex: none; min-width: 112px; padding: 0 12px; }

.qr-panel { text-align: center; }
.qr-box {
  width: 188px; height: 188px; margin: 0 auto 14px; padding: 12px;
  border: 1px solid var(--hp-border); border-radius: var(--hp-r);
  background: #fff; color: #101828; display: grid; place-items: center;
  box-shadow: var(--hp-shadow-sm);
}
.qr-title {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-weight: 700; font-size: 15px;
}
.qr-note {
  margin-top: 14px; padding: 10px 12px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); color: var(--hp-muted);
  font-size: 12px; line-height: 1.7; text-align: left;
  display: flex; gap: 8px; align-items: flex-start;
}
.qr-note .ico { margin-top: 2px; }

.bind-alert {
  margin: 18px 0 22px; padding: 16px; border-radius: var(--hp-r);
  background: var(--hp-warning-soft); border: 1px solid var(--hp-warning-border);
  color: #7a4a08; font-size: 13px; line-height: 1.75;
}
.bind-alert-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 14px; font-weight: 700; margin-bottom: 6px;
}
.bind-alert p { margin: 0; }
.bind-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; font-size: 11px; }
.bind-steps span { padding: 3px 9px; border-radius: var(--hp-r-pill); background: rgba(255,255,255,.72); }

.demo-tools {
  margin-top: 16px; padding-top: 12px;
  border-top: 1px solid var(--hp-border); font-size: 12px;
}
.demo-tools summary { cursor: pointer; color: var(--hp-muted); }
.demo-tools > *:not(summary) { margin-top: 10px; }
.is-busy .btn:disabled { opacity: .65; }

.boot-screen .small { color: var(--hp-muted); }

@media (max-width: 767px) {
  .auth-tab { font-size: 12px; gap: 3px; min-height: 42px; }
  .code-row .btn { min-width: 96px; font-size: 13px; padding: 0 8px; }
  .qr-box { width: 172px; height: 172px; }
  .auth-options { gap: 8px; }
}

/* ---------- src/styles/badges.css ---------- */
/* ============================================================
   个人中心 · 胸章展示区域
   复用 tokens.css 设计变量与 card / tag / btn / empty 组件；
   PC / 平板 / H5 共用同一套 DOM，仅由断点调整列数与排版节奏。
   ============================================================ */
.badge-section { margin-top: 16px; overflow: hidden; }
.badge-head { align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.badge-head h2 { display: flex; align-items: center; gap: 8px; }
.badge-head h2 .ico { color: var(--hp-primary); font-size: 18px; }
.badge-head-title p { margin-top: 3px; }
.badge-head-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-body { padding: 18px 20px 20px; }

/* ---------- 概览 ---------- */
.badge-summary {
  display: grid; grid-template-columns: auto minmax(180px, 1fr) auto;
  align-items: center; gap: 20px;
  padding: 16px 18px; border-radius: var(--hp-r);
  background: var(--hp-primary-soft); border: 1px solid var(--hp-primary-border);
}
.badge-summary-value { font-size: 34px; font-weight: 700; line-height: 1; color: var(--hp-primary); letter-spacing: -.02em; }
.badge-summary-value small { font-size: 15px; font-weight: 600; color: var(--hp-muted); }
.badge-summary-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.badge-summary-info b { font-size: 13px; }
.badge-summary-info .badge-bar { max-width: 260px; }
.badge-summary-types { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge-type-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: var(--hp-r-pill); font-size: 11px;
  background: var(--hp-surface); color: var(--hp-muted); border: 1px solid var(--hp-border);
  white-space: nowrap;
}
.badge-type-chip.on { color: var(--hp-primary); border-color: var(--hp-primary-border); font-weight: 600; }

.badge-bar { display: block; flex: 1; min-width: 0; height: 6px; border-radius: var(--hp-r-pill); background: var(--hp-surface-3); overflow: hidden; }
.badge-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--hp-primary); transition: width .3s; }
.is-earned .badge-bar > i, .badge-detail.is-earned .badge-bar > i { background: var(--hp-success); }

/* ---------- 空状态 ---------- */
.badge-empty-state {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin-top: 14px; padding: 14px 16px;
  border: 1px dashed var(--hp-primary-border); border-radius: var(--hp-r);
  background: var(--hp-surface-2);
}
.badge-empty-ico {
  width: 44px; height: 44px; flex: none; border-radius: var(--hp-r); display: grid; place-items: center;
  background: var(--hp-surface); color: var(--hp-primary); font-size: 22px; border: 1px solid var(--hp-border);
}
.badge-empty-text { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 200px; }
.badge-empty-text b { font-size: 14px; }
.badge-empty-text span { font-size: 12px; color: var(--hp-muted); line-height: 1.65; }
.badge-empty-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge-grid-empty { padding: 6px 0 2px; }
.badge-grid-empty .empty { padding: 30px 16px; }
.badge-empty-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: -8px; padding-bottom: 14px; }

/* ---------- 筛选栏 ---------- */
.badge-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 18px 0 14px; flex-wrap: wrap; }
.badge-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.badge-filter {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 38px; padding: 6px 13px; border-radius: var(--hp-r-pill);
  border: 1px solid var(--hp-border); background: var(--hp-surface);
  color: var(--hp-text-2); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.badge-filter:hover { border-color: var(--hp-primary-border); }
.badge-filter.active { background: var(--hp-primary); border-color: var(--hp-primary); color: #fff; }
.badge-filter-count {
  min-width: 18px; padding: 0 5px; border-radius: var(--hp-r-pill); line-height: 18px;
  font-size: 11px; text-align: center; background: var(--hp-surface-2); color: var(--hp-muted);
}
.badge-filter.active .badge-filter-count { background: rgba(255,255,255,.22); color: #fff; }
.badge-count { white-space: nowrap; }

/* ---------- 胸章卡片 ---------- */
.badge-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.badge-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0; width: 100%;
  padding: 15px; text-align: left; font: inherit; color: inherit; cursor: pointer;
  background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: var(--hp-r);
  transition: border-color .16s ease, box-shadow .16s ease;
}
.badge-card:hover { border-color: var(--hp-primary-border); box-shadow: var(--hp-shadow); }
.badge-card.is-earned { border-color: var(--hp-primary-border); }
.badge-card.is-locked { background: var(--hp-surface-2); }

.badge-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
/* 徽章：去掉白描边与虚线外圈，只留一层柔和投影，避免「贴纸感」 */
.badge-medal {
  position: relative; width: 52px; height: 52px; flex: none;
  border-radius: 50%; display: grid; place-items: center;
  color: #fff; font-size: 24px; line-height: 1;
  box-shadow: 0 2px 8px -2px rgba(16, 24, 40, .35), inset 0 1px 0 rgba(255,255,255,.16);
}
.badge-medal::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); pointer-events: none;
}
.badge-medal.lg { width: 68px; height: 68px; font-size: 31px; }
/* 色相按「来源类型」区分，但统一压低饱和度与明度，整墙不刺眼 */
.badge-medal.tone-blue { background: linear-gradient(145deg, #24479b, #3d6fd6); }
.badge-medal.tone-orange { background: linear-gradient(145deg, #9c5a24, #c07a35); }
.badge-medal.tone-violet { background: linear-gradient(145deg, #4f3f95, #6d5ab8); }
.badge-medal.tone-teal { background: linear-gradient(145deg, #17655f, #2b8279); }
.badge-medal.tone-green { background: linear-gradient(145deg, #21664a, #2f8560); }
.badge-medal.tone-indigo { background: linear-gradient(145deg, #33418f, #4d5cb0); }
.badge-medal.is-locked {
  background: var(--hp-surface-3); color: #9aa5b4;
  box-shadow: none;
}
.badge-medal.is-locked::after { box-shadow: inset 0 0 0 1px rgba(16, 24, 40, .06); }
.badge-medal-lock {
  position: absolute; right: -3px; bottom: -3px;
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--hp-surface); color: var(--hp-muted); font-size: 11px;
  border: 1px solid var(--hp-border); box-shadow: var(--hp-shadow-sm);
}
.badge-medal-lock .ico svg { width: 12px; height: 12px; }

.badge-name { display: block; font-size: 15px; font-weight: 700; line-height: 1.4; }
.badge-desc { display: block; font-size: 12px; color: var(--hp-muted); line-height: 1.6; min-height: 38px; }
.badge-progress-row { display: flex; align-items: center; gap: 8px; }
.badge-progress-text { font-size: 11px; color: var(--hp-muted); white-space: nowrap; font-variant-numeric: tabular-nums; }

.badge-source {
  display: flex; flex-direction: column; gap: 6px;
  padding: 10px 11px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); border: 1px solid var(--hp-border);
}
.badge-card.is-locked .badge-source { background: var(--hp-surface); }
.badge-source-head { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; color: var(--hp-primary); }
.badge-source-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 13px; font-weight: 600; line-height: 1.5; color: var(--hp-text); word-break: break-word;
}
.badge-source-lines { display: flex; flex-direction: column; gap: 3px; }
.badge-source-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; font-size: 11px; }
.badge-source-line .k { color: var(--hp-muted); white-space: nowrap; }
.badge-source-line .v { color: var(--hp-text-2); text-align: right; word-break: break-word; }

.badge-card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--hp-border);
  font-size: 11px; color: var(--hp-muted); line-height: 1.5;
}
.badge-card-foot > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-more { display: inline-flex; align-items: center; gap: 2px; flex: none; color: var(--hp-primary); font-weight: 600; }

.badge-footnote { display: flex; align-items: flex-start; gap: 6px; margin-top: 16px; line-height: 1.7; }
.badge-footnote .ico { margin-top: 2px; }

/* ---------- 详情弹窗 ---------- */
.badge-detail { display: grid; gap: 16px; text-align: left; }
.badge-detail-head { display: flex; align-items: center; gap: 16px; }
.badge-detail-intro { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.badge-detail-intro b { font-size: 18px; }
.badge-detail-tags { display: flex; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.badge-detail-block {
  padding: 12px 14px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); border: 1px solid var(--hp-border);
}
.badge-detail-label { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--hp-primary); margin-bottom: 8px; }
.badge-detail-source { font-size: 14px; font-weight: 600; margin-bottom: 8px; word-break: break-word; }
.badge-detail-lines { display: grid; gap: 5px; }
.badge-detail-lines > div { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; }
.badge-detail-lines dt { color: var(--hp-muted); white-space: nowrap; }
.badge-detail-lines dd { margin: 0; color: var(--hp-text-2); text-align: right; word-break: break-word; }
.badge-detail-progress { display: flex; justify-content: space-between; font-size: 12px; margin: 10px 0 6px; color: var(--hp-muted); }
.badge-detail-progress b { color: var(--hp-text); font-variant-numeric: tabular-nums; }
.badge-detail-time { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--hp-success); }
.badge-detail-time.muted { color: var(--hp-muted); }

/* ============================================================
   断点 1：平板 / 小屏笔电（768 – 1279）
   ============================================================ */
@media (max-width: 1279px) {
  .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .badge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .badge-summary { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .badge-summary-types { grid-column: 1 / -1; justify-content: flex-start; }
  .badge-head { padding: 14px 16px; }
  .badge-body { padding: 16px; }
}

/* ============================================================
   断点 2：移动端 H5（< 768）—— 单列/双列、横向筛选、大点击区
   ============================================================ */
@media (max-width: 767px) {
  .badge-section { margin-top: 14px; }
  .badge-head { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
  .badge-head-actions { width: 100%; }
  .badge-head-actions .btn { flex: 1; min-width: 0; }
  .badge-body { padding: 14px; }
  .badge-summary { grid-template-columns: 1fr; padding: 14px; gap: 10px; }
  .badge-summary-value { font-size: 30px; }
  .badge-summary-types { grid-column: auto; }
  .badge-empty-state { flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; }
  .badge-empty-actions { width: 100%; }
  .badge-empty-actions .btn, .badge-empty-actions a { flex: 1; min-width: 0; }
  .badge-toolbar { align-items: flex-start; gap: 8px; margin: 14px 0 12px; }
  .badge-filters {
    width: 100%; flex-wrap: nowrap; overflow-x: auto;
    padding-bottom: 4px; -webkit-overflow-scrolling: touch;
  }
  .badge-filter { flex: none; min-height: 40px; }
  .badge-count { width: 100%; }
  .badge-grid { gap: 12px; }
  .badge-card { padding: 14px; }
  .badge-desc { min-height: 0; }
  .badge-footnote { font-size: 11px; }
  .badge-detail-head { gap: 12px; }
  .badge-medal.lg { width: 60px; height: 60px; font-size: 28px; }
}

/* 窄屏手机：单列，保证来源信息完整可读 */
@media (max-width: 640px) {
  .badge-grid { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .badge-head-actions { flex-direction: column; align-items: stretch; }
  .badge-empty-actions { flex-direction: column; align-items: stretch; }
  .badge-card-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* ---------- src/styles/records.css ---------- */
/* ============================================================
   个人中心 · 学员档案（学分 / 成绩 / 勋章 / 证书 / 订单）
   与 badges.css 共用同一套设计变量与断点，保证 PC / 平板 / H5 风格统一
   ============================================================ */
.records-section { margin-top: 14px; overflow: hidden; }

.records-head {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 18px; border-bottom: 1px solid var(--hp-border);
}
.records-head-title h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; }
.records-head h2 .ico { color: var(--hp-primary); font-size: 18px; }
.records-head-title p { margin-top: 4px; }
.records-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.records-body { padding: 18px; }

/* ---------- 顶部概览 ---------- */
.records-overview {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
}
.rec-stat {
  min-width: 0; padding: 12px 13px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); border: 1px solid var(--hp-border);
}
.rec-stat > span { display: block; font-size: 11px; color: var(--hp-muted); }
.rec-stat > b {
  display: block; margin-top: 4px; font-size: 23px; line-height: 1.2;
  color: var(--hp-primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.rec-stat > b small { font-size: 12px; font-weight: 600; color: var(--hp-muted); }
.rec-stat > em {
  display: block; margin-top: 4px; font-size: 11px; font-style: normal;
  color: var(--hp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ---------- 学分进度 ---------- */
.records-credit {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
  padding: 11px 14px; border-radius: var(--hp-r-sm);
  background: var(--hp-primary-soft); border: 1px solid var(--hp-primary-border);
}
.records-credit-label {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  font-size: 12px; font-weight: 600; color: var(--hp-primary);
}
.records-credit-label .ico { font-size: 15px; }
.records-credit-bar {
  display: block; flex: 1; min-width: 0; height: 8px; border-radius: var(--hp-r-pill);
  background: var(--hp-surface-3); overflow: hidden;
}
.records-credit-bar > i {
  display: block; height: 100%; border-radius: inherit;
  background: var(--hp-primary); transition: width .3s;
}
.records-credit-num {
  flex: none; font-size: 12px; font-weight: 700; color: var(--hp-primary);
  font-variant-numeric: tabular-nums;
}

/* ---------- 分类 Tab ---------- */
.records-tabs {
  display: flex; gap: 4px; margin-top: 16px; overflow-x: auto;
  border-bottom: 1px solid var(--hp-border); scrollbar-width: thin;
}
.records-tab {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  min-height: 44px; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--hp-muted); font-size: 13px; font-weight: 600;
  white-space: nowrap; cursor: pointer; font-family: inherit;
}
.records-tab .ico { font-size: 15px; }
.records-tab:hover { color: var(--hp-primary); }
.records-tab.active { color: var(--hp-primary); border-bottom-color: var(--hp-primary); }
.records-tab-count {
  min-width: 18px; padding: 0 5px; border-radius: var(--hp-r-pill);
  font-size: 11px; line-height: 18px; text-align: center;
  background: var(--hp-surface-2); color: var(--hp-muted);
}
.records-tab.active .records-tab-count { background: var(--hp-primary); color: #fff; }
.records-content { padding-top: 14px; min-height: 130px; }

/* ---------- Tab 说明与规则 ---------- */
.rec-tab-intro {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px; padding: 10px 12px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface-2); border: 1px solid var(--hp-border);
  font-size: 12px; color: var(--hp-text-2); line-height: 1.6;
}
.rec-tab-intro > span:first-child { display: inline-flex; align-items: flex-start; gap: 6px; }
.rec-tab-intro .ico { color: var(--hp-primary); flex: none; }
.rec-rules { display: flex; flex-wrap: wrap; gap: 6px; }
.rec-rule-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 9px; border-radius: var(--hp-r-pill); font-size: 11px;
  background: var(--hp-surface); color: var(--hp-muted); border: 1px solid var(--hp-border);
}
.rec-rule-chip .ico { color: var(--hp-primary); font-size: 13px; }
.rec-rule-chip b { color: var(--hp-primary); font-variant-numeric: tabular-nums; }

/* ---------- 明细列表 ---------- */
.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec-item {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto 16px;
  align-items: center; gap: 12px; width: 100%; min-height: 66px;
  padding: 11px 13px; text-align: left; font-family: inherit;
  background: var(--hp-surface); border: 1px solid var(--hp-border);
  border-radius: var(--hp-r-sm); cursor: pointer; transition: border-color .2s, box-shadow .2s;
}
.rec-item:hover { border-color: var(--hp-primary-border); box-shadow: var(--hp-shadow-sm); }
.rec-item:focus-visible { outline: 2px solid var(--hp-primary); outline-offset: 2px; }
.rec-item.is-pending { background: var(--hp-surface-2); }
.rec-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: var(--hp-r-sm); font-size: 20px; flex: none;
}
.tone-blue { background: var(--hp-primary-soft); color: var(--hp-primary); }
.tone-green { background: var(--hp-success-soft); color: var(--hp-success); }
.tone-orange { background: #fdf1e6; color: #a2571c; }
.tone-teal { background: #e6f5f2; color: #166b62; }
.tone-violet { background: #efecfa; color: #56439e; }
.rec-main { min-width: 0; }
.rec-title {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--hp-text); line-height: 1.5;
}
.rec-sub {
  display: block; margin-top: 3px; font-size: 11px; color: var(--hp-muted);
  line-height: 1.5; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rec-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; }
.rec-side b {
  font-size: 14px; color: var(--hp-primary); font-variant-numeric: tabular-nums; white-space: nowrap;
}
.rec-side > span { font-size: 11px; color: var(--hp-muted); white-space: nowrap; }
.is-pending .rec-side b { color: var(--hp-muted); }
.rec-arrow { color: var(--hp-border-strong); font-size: 14px; }
.rec-item:hover .rec-arrow { color: var(--hp-primary); }
.rec-footline { margin-top: 10px; font-size: 12px; color: var(--hp-muted); }
.rec-footline b { color: var(--hp-primary); }

/* ---------- 空状态 ---------- */
.rec-empty { padding: 6px 0 10px; }
.rec-empty .empty { padding: 18px 10px; }
.rec-empty-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.records-footnote { margin-top: 14px; }
.records-footnote code {
  padding: 1px 5px; border-radius: var(--hp-r-xs); background: var(--hp-surface-2);
  border: 1px solid var(--hp-border); font-size: 11px;
}

/* ---------- 详情弹窗 ---------- */
.rec-detail-title { font-size: 15px; font-weight: 700; color: var(--hp-text); margin-bottom: 12px; }
.rec-detail-lines { display: flex; flex-direction: column; gap: 0; margin: 0; }
.rec-detail-lines > div {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--hp-border); font-size: 13px;
}
.rec-detail-lines > div:last-child { border-bottom: 0; }
.rec-detail-lines dt { color: var(--hp-muted); flex: none; }
.rec-detail-lines dd { margin: 0; color: var(--hp-text-2); text-align: right; word-break: break-all; }
.rec-detail-note {
  display: flex; align-items: flex-start; gap: 6px; margin-top: 12px;
  padding: 10px 12px; border-radius: var(--hp-r-sm);
  background: var(--hp-primary-soft); color: var(--hp-primary);
  font-size: 12px; line-height: 1.6;
}
.rec-detail-note .ico { flex: none; }

/* ============================================================
   断点 1：平板 / 小屏 PC —— 概览降列、内边距收紧
   ============================================================ */
@media (max-width: 1279px) {
  .records-overview { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1023px) {
  .records-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .records-head { padding: 14px 16px; }
  .records-body { padding: 16px; }
  .rec-stat > b { font-size: 21px; }
}

/* ============================================================
   断点 2：移动端 H5（< 768）—— 横向 Tab、明细行转两行卡片
   ============================================================ */
@media (max-width: 767px) {
  .records-section { margin-top: 12px; }
  .records-head { flex-direction: column; align-items: stretch; gap: 10px; padding: 14px 14px; }
  .records-head-actions { width: 100%; }
  .records-head-actions .btn { flex: 1; min-width: 0; }
  .records-body { padding: 14px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
  .records-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .rec-stat { padding: 10px 11px; }
  .rec-stat > b { font-size: 19px; }
  .rec-stat:last-child { grid-column: 1 / -1; }
  .records-credit { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .records-credit-bar { flex-basis: 100%; order: 3; }
  .records-tab { min-height: 46px; padding: 8px 12px; }
  .rec-tab-intro { flex-direction: column; align-items: flex-start; }
  .rec-item {
    grid-template-columns: 36px minmax(0, 1fr) 14px;
    gap: 4px 10px; padding: 11px 12px; min-height: 0;
  }
  .rec-ico { width: 36px; height: 36px; grid-row: 1; font-size: 18px; }
  .rec-main { grid-column: 2; grid-row: 1; }
  .rec-arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; }
  .rec-side {
    grid-column: 2 / 4; grid-row: 2; flex-direction: row; align-items: baseline;
    justify-content: flex-start; gap: 8px; margin-top: 2px;
  }
  .rec-side b { font-size: 13px; }
  .rec-sub { white-space: normal; }
  .rec-detail-lines > div { font-size: 12px; }
}

@media (max-width: 640px) {
  .records-tabs { margin-left: -14px; margin-right: -14px; padding: 0 10px; }
  .rec-rules { width: 100%; }
  .rec-rule-chip { flex: 1 1 auto; justify-content: center; }
}
@media (max-width: 380px) {
  .records-overview { grid-template-columns: 1fr; }
  .rec-stat:last-child { grid-column: auto; }
  .records-head-actions { flex-direction: column; }
  .rec-empty-links .btn, .rec-empty-links a { flex: 1 1 100%; }
}

/* ---------- src/styles/profile.css ---------- */
/* ============================================================
   个人中心 · 分区容器与五个功能面板
   ------------------------------------------------------------
   结构：身份卡 → 左栏分区导航（PC）+ 右栏面板内容
   断点沿用全站：1023（平板，导航转横向） / 767（手机，卡片改堆叠）
   色彩只取 tokens.css 的设计变量，不新造色值。
   ============================================================ */

/* ---------- 身份卡 ---------- */
.pf-identity { padding: 18px 20px; margin-bottom: 16px; }
.pf-identity-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf-identity-name { font-size: 19px; font-weight: 700; color: var(--hp-text); }
.pf-identity-stats { display: flex; align-items: center; gap: 22px; margin-left: auto; }
.pf-identity-stats > div { text-align: center; min-width: 72px; }
.pf-identity-stats b {
  display: block; font-size: 20px; line-height: 1.2; color: var(--hp-primary);
  font-variant-numeric: tabular-nums; letter-spacing: -.01em;
}
.pf-identity-stats b small { font-size: 12px; font-weight: 600; color: var(--hp-muted); }
.pf-identity-stats span { display: block; margin-top: 3px; font-size: 11px; color: var(--hp-muted); }
.pf-identity-tip {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-top: 14px; padding: 9px 12px; border-radius: var(--hp-r-sm);
  background: var(--hp-warning-soft); border: 1px solid var(--hp-warning-border);
  color: var(--hp-warning); font-size: 12px;
}
.pf-identity-tip a {
  display: inline-flex; align-items: center; gap: 2px;
  color: inherit; font-weight: 700; text-decoration: underline;
}

/* ---------- 两栏骨架 ---------- */
.pf-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 16px; align-items: start; }
.pf-nav {
  display: grid; gap: 4px; padding: 8px; border-radius: var(--hp-r);
  background: var(--hp-surface); border: 1px solid var(--hp-border);
  box-shadow: var(--hp-shadow-sm); position: sticky; top: 12px;
}
.pf-nav-item {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px;
  border-radius: var(--hp-r-sm); color: var(--hp-text-2);
  font-size: 14px; font-weight: 600; text-decoration: none;
  transition: background .14s ease, color .14s ease;
}
.pf-nav-item:hover { background: var(--hp-surface-2); color: var(--hp-text); }
.pf-nav-item .ico { font-size: 17px; }
.pf-nav-item.is-active { background: var(--hp-primary-soft); color: var(--hp-primary); }
.pf-nav-label { flex: 1; min-width: 0; }
.pf-nav-count {
  flex: none; padding: 1px 7px; border-radius: var(--hp-r-pill);
  font-size: 11px; font-weight: 700; background: var(--hp-surface-3); color: var(--hp-muted);
}
.pf-nav-item.is-active .pf-nav-count { background: var(--hp-primary); color: #fff; }
.pf-content { min-width: 0; }

/* ---------- 面板通用 ---------- */
.pf-panel { display: grid; gap: 14px; }
.pf-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pf-panel-head h2 { font-size: 17px; line-height: 1.3; }
.pf-panel-head p { margin-top: 4px; }
.pf-stack { display: grid; gap: 14px; }
.pf-card { padding: 18px 20px; }
.pf-note { margin-top: 2px; }

.pf-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pf-stat {
  min-width: 0; padding: 12px 14px; border-radius: var(--hp-r-sm);
  background: var(--hp-surface); border: 1px solid var(--hp-border);
}
.pf-stat > span { display: block; font-size: 12px; color: var(--hp-muted); }
.pf-stat > b {
  display: block; margin-top: 4px; font-size: 22px; line-height: 1.2;
  color: var(--hp-primary); font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.pf-stat > b small { font-size: 12px; font-weight: 600; color: var(--hp-muted); }
.pf-filters { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 列表行 ---------- */
.pf-list { display: grid; gap: 10px; }
.pf-row {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 14px 16px; border-radius: var(--hp-r);
  background: var(--hp-surface); border: 1px solid var(--hp-border);
}
.pf-row.is-dead { opacity: .64; }
.pf-thumb {
  width: 56px; height: 56px; border-radius: var(--hp-r-sm);
  display: grid; place-items: center; font-size: 22px; flex: none;
}
.pf-main { min-width: 0; display: grid; gap: 4px; }
.pf-title {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 14px; font-weight: 700; color: var(--hp-text); line-height: 1.45;
}
.pf-sub { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; font-size: 12px; color: var(--hp-muted); }
.pf-sub .ico { font-size: 13px; }
.pf-hint { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--hp-muted); }
.pf-hint.is-ok { color: var(--hp-success); }
.pf-progress { display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.pf-progress .progress { flex: 1; min-width: 60px; }
.pf-progress-label, .pf-progress-num { flex: none; font-size: 11px; color: var(--hp-muted); }
.pf-progress-num { font-weight: 700; color: var(--hp-primary); font-variant-numeric: tabular-nums; }
.pf-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.pf-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pf-amount { font-size: 16px; color: var(--hp-text); font-variant-numeric: tabular-nums; }

/* ---------- 空态 ---------- */
.pf-empty {
  display: grid; justify-items: center; gap: 6px; padding: 8px 16px 20px;
  background: var(--hp-surface); border: 1px solid var(--hp-border); border-radius: var(--hp-r);
}
.pf-empty .empty { padding: 18px 0 6px; }

/* ---------- 个人信息面板 ---------- */
.pf-profile-top { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.pf-info-grid { padding: 0; }
.pf-profile-view[hidden], .pf-profile-form[hidden] { display: none; }
.pf-profile-form .form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pf-form-actions { display: flex; justify-content: flex-end; gap: 10px; }
.pf-card .setting-row:first-of-type { padding-top: 4px; }

/* ---------- 平板：导航转横向 ---------- */
@media (max-width: 1023px) {
  .pf-layout { grid-template-columns: minmax(0, 1fr); }
  .pf-nav {
    position: static; grid-auto-flow: column; grid-auto-columns: max-content;
    overflow-x: auto; scrollbar-width: none; padding: 6px; gap: 6px;
  }
  .pf-nav::-webkit-scrollbar { display: none; }
  .pf-nav-item { padding: 0 12px; white-space: nowrap; }
  .pf-nav-label { flex: none; }
  .pf-identity-stats { width: 100%; margin-left: 0; justify-content: space-between; gap: 12px; }
}

/* ---------- 手机：卡片堆叠、按钮满宽 ---------- */
@media (max-width: 767px) {
  .pf-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pf-identity { padding: 16px; }
  .pf-identity-stats { gap: 8px; flex-wrap: wrap; }
  .pf-identity-stats > div { min-width: 64px; flex: 1 1 0; }
  .pf-card { padding: 16px; }
  .pf-row { grid-template-columns: 44px minmax(0, 1fr); padding: 13px 14px; }
  .pf-thumb { width: 44px; height: 44px; font-size: 18px; }
  .pf-actions, .pf-side {
    grid-column: 1 / -1; flex-direction: row; align-items: center;
    justify-content: flex-end; width: 100%;
  }
  .pf-actions .btn, .pf-side .btn { flex: 1 1 auto; }
  .pf-side { flex-wrap: wrap; }
  .pf-amount { width: 100%; text-align: right; }
  .pf-profile-form .form-grid { grid-template-columns: 1fr; gap: 0; }
  .pf-form-actions .btn { flex: 1; }
  .pf-panel-head { align-items: center; }
}

@media (max-width: 420px) {
  .pf-identity-stats b { font-size: 18px; }
  .pf-stat > b { font-size: 20px; }
  .pf-nav-item { font-size: 13px; }
}
