/* ============================================================
   源音律动 web /learn —— 小程序设计 1:1 镜像地基
   翻自 miniprogram/app.wxss + 设计系统蓝图。
   rpx→web:1rem = 100rpx;root font-size = 100vw/7.5(750rpx=屏宽),
   ≥500px 视口封顶(桌面居中 500px)。故 CSS 里 rpx 值 ÷100 = rem。
   1rpx hairline 边框统一用 1px(更脆)。纯浅色单主题,文字 ≥7:1 AAA。
   ============================================================ */

:root {
  font-size: calc(100vw / 7.5);        /* 1rem = 100rpx */

  --coral: #e54b3c;
  --coral-deep: #c93d30;
  --coral-tint: #fdeeec;
  --sun: #f7c948;
  --sun-soft: #fdf3d0;
  --blue: #1aa3ff;

  --bg: #ffffff;
  --bg2: #faf8f3;
  --cream: #faf7f2;              /* orders/redeem 整页略冷奶油 */
  --press: #faf7f0;             /* row/卡片 :active */
  --card: #ffffff;
  --line: #ededed;

  --ink: #1a1a1a;
  --ink2: #555555;
  --ink3: #5f6368;

  --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;

  --nav-h: 46px;                /* 顶部 navbar 逻辑高度 */
  --tab-h: 52px;                /* 底部 tabBar 逻辑高度 */
}
@media (min-width: 500px) {
  :root { font-size: 66.67px; } /* 750rpx = 500px 封顶 */
}

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

/* iOS Safari 对 <16px 的输入框会自动放大整页且不缩回(已删 maximum-scale,
   无兜底)。注意:此元素选择器特异性 0,0,1,会被任何带 font-size 的类覆盖 —— 
   真正的防护写在各输入框自己的类上(.lf-field / .code-input)。 */
input, textarea, select { font-size: max(16px, 1em); }

html, body { background: #e9e4da; }   /* 桌面 500px 容器外的空白区 */

body {
  font-family: var(--font-sans);
  font-size: 0.28rem;
  line-height: 1.5;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ── app 外壳:居中移动容器 ── */
.app {
  max-width: 500px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

/* ── 顶部 navbar(还原小程序原生导航栏)── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: calc(var(--nav-h) + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}
.navbar-title {
  font-size: 0.34rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.01rem;
}
.navbar-back {
  position: absolute;
  left: 0.16rem;
  top: env(safe-area-inset-top);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0 0.16rem;
  min-width: 0.88rem;             /* 44px 命中区 */
  justify-content: center;
  font-size: 0.44rem;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
}
/* navbar 右上角动作(资料页的兑换冗余入口)*/
.navbar-right {
  position: absolute;
  right: 0.12rem;
  min-width: 0.88rem;             /* 44px 命中区 */
  justify-content: flex-end;
  padding: 0 0.12rem;
  top: env(safe-area-inset-top);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: 0.08rem;
  font-size: 0.28rem;
  font-weight: 600;
  color: var(--coral-deep);   /* 文字用 deep */
  text-decoration: none;
}
.navbar-right:active, .navbar-back:active, .kf-close:active { opacity: 0.6; }
.navbar-right img { width: 0.32rem; height: 0.32rem; }

/* ── 页面内容区 ── */
.page {
  min-height: calc(100vh - var(--nav-h));
  background: var(--bg);
}
.page.has-tabbar { padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 0.2rem); }

/* ── 底部 tabBar(还原小程序原生 tabBar,仅术语/我的两 tab 页显示)── */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 500px;
  z-index: 100;
  height: calc(var(--tab-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg);
  border-top: 1px solid var(--line);
  display: flex;
}
.tabbar-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: #6e6e6e;          /* 4.48:1 → 5.10:1 */
  font-size: 0.2rem;
}
.tabbar-item.on { color: var(--coral-deep); }   /* 珊瑚红作文字用 deep(3.89→5.01)*/
.tabbar-item:active { opacity: 0.6; }
.tabbar-ic { width: 24px; height: 24px; }

/* ── 页头标题(小程序 pagehead)── */
.pagehead { padding: 0.24rem 0.48rem 0.08rem; }
.brand { display: flex; align-items: center; }
.brand-dot {
  width: 0.18rem; height: 0.18rem; border-radius: 50%;
  background: var(--coral); margin-right: 0.14rem;
}
.brand-name {
  font-family: var(--font-serif); font-weight: 700;
  font-size: 0.32rem; letter-spacing: 0.02rem; color: var(--ink);
}
.page-title {
  font-weight: 700; font-size: 0.6rem; line-height: 1.2;
  letter-spacing: -0.02rem; color: var(--ink); margin-top: 0.28rem;
}

/* ── 身份卡 ── */
.idcard {
  margin: 0.36rem 0.32rem 0;
  background: var(--bg2);
  border-radius: 0.4rem;
  padding: 0.4rem 0.36rem;
  display: flex;
  align-items: center;
}
.avatar {
  width: 1.28rem; height: 1.28rem; border-radius: 50%;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  /* 音符头像(2026-07-23 jojo:弃用珊瑚红渐变+「丽」字):暖金,v2b 暖黄点缀同族 */
  background: linear-gradient(135deg, #a87c2e 0%, #d4af37 100%);
  box-shadow: 0 0.08rem 0.24rem rgba(168, 124, 46, 0.28);
  margin-right: 0.3rem;
}
.avatar img { width: 0.56rem; height: 0.56rem; filter: brightness(0) invert(1); }   /* 图标强制反白 */
.id-info { flex: 1; min-width: 0; }
.id-top { display: flex; align-items: center; flex-wrap: wrap; }
.id-name { font-weight: 700; font-size: 0.4rem; color: var(--ink); letter-spacing: -0.006rem; margin-right: 0.18rem; }
.id-badge { font-size: 0.22rem; font-weight: 700; padding: 0.08rem 0.22rem; border-radius: 9999px; letter-spacing: 0.01rem; }
.id-badge.paid { background: var(--coral); color: #fff; }
.id-meta { display: block; color: var(--ink3); font-size: 0.24rem; margin-top: 0.18rem; font-weight: 500; letter-spacing: 0.006rem; }

/* ── section 标题(珊瑚红短下划线 = 全站识别符)── */
.sec { margin: 0.52rem 0.48rem 0; }
.sec-head { display: flex; align-items: baseline; }
.sec-title {
  font-weight: 700; font-size: 0.42rem; letter-spacing: -0.01rem;
  color: var(--ink); position: relative; display: inline-block;
}
.sec-title::after {
  content: ""; position: absolute; left: 0; bottom: -0.1rem;
  width: 0.56rem; height: 0.06rem; background: var(--coral); border-radius: 0.04rem;
}

/* ── 功能列表 list + row ── */
.list {
  margin-top: 0.36rem; background: var(--bg);
  border: 1px solid var(--line); border-radius: 0.28rem;
  overflow: hidden; box-shadow: 0 0.04rem 0.2rem rgba(30, 20, 10, 0.04);
}
.row {
  display: flex; align-items: center; padding: 0.3rem 0.32rem;
  border: none;                        /* button UA 边框 reset(联系客服行)*/
  border-bottom: 1px solid var(--line);
  text-decoration: none; color: inherit;
  background: var(--bg); width: 100%; text-align: left;
  font-family: inherit; font-size: inherit; cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row:active { background: var(--press); }
.row-ic {
  width: 0.76rem; height: 0.76rem; border-radius: 0.2rem;
  background: var(--coral-tint); display: flex; align-items: center;
  justify-content: center; flex-shrink: 0; margin-right: 0.26rem;
}
.row-ic-img { width: 0.4rem; height: 0.4rem; }
.row-t { flex: 1; font-weight: 700; font-size: 0.3rem; color: var(--ink); }
.row-chev { width: 0.32rem; height: 0.32rem; flex-shrink: 0; }
.row-val { font-size: 0.26rem; color: var(--ink2); margin-right: 0.12rem; flex-shrink: 0; }

/* ── footer ── */
.foot { text-align: center; padding: 0.6rem 0.56rem 0.36rem; }
.foot-line { display: block; color: var(--ink3); font-size: 0.22rem; line-height: 1.9; letter-spacing: 0.004rem; font-weight: 500; }

/* ── 主按钮(胶囊/圆角)── */
.pill-btn { display: block; width: 100%; border: none; cursor: pointer; border-radius: 9999px; padding: 0.24rem 0.44rem; font-size: 0.3rem; font-weight: 700; text-align: center; letter-spacing: 0.01rem; font-family: inherit; }
.btn-coral { background: var(--coral); color: #fff; }
.btn-coral:active { opacity: 0.9; }
.btn-coral[disabled] { background: #f0cbc5; color: #82463e; cursor: not-allowed; }   /* 白字 1.49 → 4.85,与 redeem 禁用态同源 */

/* ── 客服弹窗 kefu-modal(styleIsolation:字面 hex 自包含)── */
.kf-mask {
  position: fixed; inset: 0; background: rgba(30, 20, 10, 0.45); z-index: 200;
  display: none; align-items: center; justify-content: center; box-sizing: border-box;
  overflow-y: auto; overscroll-behavior: contain;
  padding: calc(0.48rem + env(safe-area-inset-top)) 0.48rem calc(0.48rem + env(safe-area-inset-bottom));
}
.kf-mask.open { display: flex; }
.kf-card { margin: auto;   /* 溢出时顶部可达(center 对齐会锁死起始边)*/ width: 100%; max-width: 6.2rem; background: #fff; border-radius: 0.4rem; padding: 0.44rem 0.4rem 0.4rem; box-sizing: border-box; box-shadow: 0 0.16rem 0.48rem rgba(30, 20, 10, 0.2); }
.kf-head { display: flex; align-items: center; justify-content: space-between; }
.kf-title { font-weight: 700; font-size: 0.36rem; color: #1a1a1a; letter-spacing: -0.005rem; }
.kf-close { font-size: 0.56rem; line-height: 1; color: #5f6368; background: none; border: none; cursor: pointer;
  min-width: 0.88rem; min-height: 0.88rem; display: flex; align-items: center; justify-content: center; padding: 0; }
.kf-sub { display: block; margin-top: 0.16rem; font-size: 0.26rem; color: #555; line-height: 1.6; }
.kf-id-row { display: flex; align-items: stretch; gap: 0.16rem; margin-top: 0.32rem; }
.kf-id-box { flex: 1; min-width: 0; background: #faf8f3; border-radius: 0.2rem; padding: 0.2rem 0.26rem; display: flex; flex-direction: column; justify-content: center; }
.kf-id-label { font-size: 0.22rem; font-weight: 600; color: #555; letter-spacing: 0.01rem; }
.kf-id-val { font-size: 0.38rem; font-weight: 700; color: #1a1a1a; letter-spacing: 0.005rem; margin-top: 0.06rem; word-break: break-all; }
.kf-copy { flex-shrink: 0; display: flex; align-items: center; justify-content: center; padding: 0 0.4rem; background: #e54b3c; color: #fff; font-size: 0.3rem; font-weight: 700; border-radius: 0.2rem; border: none; cursor: pointer; }
.kf-copy:active { opacity: 0.9; }
.kf-qr-wrap { margin-top: 0.32rem; display: flex; flex-direction: column; align-items: center; background: #faf8f3; border-radius: 0.24rem; padding: 0.36rem 0 0.28rem; }
.kf-qr { width: 3.6rem; height: 3.6rem; border-radius: 0.16rem; background: #fff; object-fit: contain; }
.kf-qr-tip { margin-top: 0.22rem; font-size: 0.24rem; font-weight: 500; color: #555; }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: 1.6rem; transform: translateX(-50%);
  background: rgba(26, 26, 26, 0.92); color: #fff; font-size: 0.26rem;
  padding: 0.18rem 0.34rem; border-radius: 0.16rem; z-index: 400;   /* 高于弹窗 200 / 大图 300 */
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.toast.show { opacity: 1; }

/* ── 协议/隐私长文 legal-doc ── */
.doc { padding: 0.4rem 0.44rem 0.8rem; }
.doc-head { padding-bottom: 0.28rem; border-bottom: 1px solid var(--line); margin-bottom: 0.32rem; }
.doc-title { font-family: var(--font-serif); font-weight: 700; font-size: 0.48rem; letter-spacing: -0.01rem; color: var(--ink); }
.doc-meta { margin-top: 0.1rem; font-size: 0.24rem; color: var(--ink2); line-height: 1.6; }
.doc-intro { font-size: 0.28rem; line-height: 1.85; color: var(--ink); margin-bottom: 0.2rem; }
.doc-sec { margin-top: 0.36rem; }
.doc-sec-h { font-weight: 700; font-size: 0.32rem; color: var(--ink); margin-bottom: 0.14rem; line-height: 1.5; }
.doc-sec-p { font-size: 0.28rem; line-height: 1.85; color: var(--ink); margin-bottom: 0.12rem; }
.doc-sec.alert { background: var(--coral-tint); border-left: 0.08rem solid var(--coral); border-radius: 0.2rem; padding: 0.24rem 0.28rem; }
.doc-sec.alert .doc-sec-h { color: #b32d21; }   /* 浅珊瑚底 4.44→5.62 */
.doc-sec.alert .doc-sec-p { font-weight: 600; color: var(--ink); }
.doc-foot { margin-top: 0.56rem; padding-top: 0.28rem; border-top: 1px solid var(--line); text-align: center; }
.doc-foot-line { display: block; font-size: 0.22rem; line-height: 1.9; color: var(--ink3); }
