/* ============================================================
   h5Pay H5 静态页样式 —— 暖橙适老化：大字号 / 高对比 / 大按钮
   ============================================================ */
:root {
  --orange: #E8663C;
  --orange-deep: #C9502A;
  --orange-light: #FFF3ED;
  --ink: #2B2118;
  --ink-2: #6B5D51;
  --bg: #F7F3EF;
  --card: #FFFFFF;
  --line: #EADFD5;
  --ok: #2E8B57;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(232, 102, 60, .10);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;          /* 适老化基准字号 */
  line-height: 1.6;
}

/* ---------- 顶部固定栏（右上角固定登录入口） ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: 56px;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1000px; height: 100%; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
}
.topbar .brand {
  display: flex; align-items: center; gap: 8px;
  font-size: 20px; font-weight: 700; color: var(--orange-deep);
  cursor: pointer;
}
.topbar .brand .logo {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--orange), #F5A05C);
  color: #fff; font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.login-btn {
  border: 2px solid var(--orange);
  background: #fff; color: var(--orange-deep);
  font-size: 16px; font-weight: 600;
  padding: 6px 16px; border-radius: 999px;
  cursor: pointer;
}
.login-btn.primary { background: var(--orange); color: #fff; }
.login-btn:active { opacity: .8; }
.user-chip {
  display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ink-2);
}
.user-chip .phone { color: var(--orange-deep); font-weight: 600; }
.user-chip .logout {
  font-size: 14px; color: var(--ink-2); text-decoration: underline; cursor: pointer;
}

/* ---------- 页面容器 ---------- */
.page { padding: 72px 0 90px; max-width: 520px; margin: 0 auto; min-height: 100vh; }
.section { padding: 16px; }
.section-title { font-size: 22px; font-weight: 700; margin: 8px 0 14px; }
.section-title .accent { color: var(--orange); }

/* ---------- 首页 Banner ---------- */
.hero {
  margin: 12px 16px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--orange) 0%, #F08A4B 60%, #F5A05C 100%);
  color: #fff; padding: 26px 22px;
  box-shadow: var(--shadow);
}
.hero h1 { font-size: 28px; line-height: 1.35; margin-bottom: 6px; }
.hero p { font-size: 17px; opacity: .95; }
.hero .tags { margin-top: 14px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero .tag {
  background: rgba(255, 255, 255, .22);
  border: 1px solid rgba(255, 255, 255, .55);
  padding: 4px 12px; border-radius: 999px; font-size: 15px;
}

/* ---------- 类目筛选 ---------- */
.cat-bar { display: flex; gap: 10px; padding: 4px 16px 8px; overflow-x: auto; }
.cat-item {
  flex: 0 0 auto; padding: 8px 20px;
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  font-size: 17px; color: var(--ink-2); cursor: pointer;
}
.cat-item.active { background: var(--orange-light); border-color: var(--orange); color: var(--orange-deep); font-weight: 700; }

/* ---------- 商品卡片 ---------- */
.course-list { display: flex; flex-direction: column; gap: 14px; padding: 8px 16px; }
.course-card {
  display: flex; gap: 14px; background: var(--card);
  border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); cursor: pointer;
}
.course-cover {
  flex: 0 0 104px; width: 104px; height: 104px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 44px; color: #fff;
}
.cover-vocal  { background: linear-gradient(135deg, #E8663C, #F5A05C); }
.course-cover img, .detail-cover img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit; display: block;
}
.cover-piano  { background: linear-gradient(135deg, #B05C3B, #E8956B); }
.cover-guitar { background: linear-gradient(135deg, #8C4A2F, #D07B4A); }
.cover-drum      { background: linear-gradient(135deg, #A8552F, #E09B5A); }
.cover-harmonica { background: linear-gradient(135deg, #C05A3A, #F0A868); }
.cover-recite    { background: linear-gradient(135deg, #9C4F35, #DE8F5C); }
.cover-shuhua    { background: linear-gradient(135deg, #7E5B3A, #C99A5B); }
.course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course-name { font-size: 19px; font-weight: 700; }
.course-sub  { font-size: 15px; color: var(--ink-2); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.course-meta { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.course-teacher { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 15px; color: var(--ink-2); flex-wrap: wrap; }
.t-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; border: 1.5px solid var(--line); background: var(--orange-light); }
.t-avatar-lg { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: var(--orange-light); flex: 0 0 auto; }
.t-avatar-ph { display: flex; align-items: center; justify-content: center; color: var(--orange-deep); font-size: 24px; font-weight: 700; }
.detail-teacher { display: flex; align-items: center; gap: 14px; margin: 10px 0; }
.dt-info b { font-size: 17px; }
.dt-info p { font-size: 15px; color: var(--ink-2); margin-top: 2px; }
.course-price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; }
.price { color: var(--orange-deep); font-size: 22px; font-weight: 800; }
.price .rmb { font-size: 15px; }
.origin-price { color: #B0A397; font-size: 14px; text-decoration: line-through; }
.price-unit { font-size: 14px; color: var(--ink-2); }

/* ---------- 学习效果承诺 ---------- */
.promise-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.promise-item {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; display: flex; gap: 14px; align-items: flex-start;
  box-shadow: var(--shadow);
}
.promise-item .icon {
  flex: 0 0 52px; width: 52px; height: 52px; border-radius: 12px;
  background: var(--orange-light);
  display: flex; align-items: center; justify-content: center; font-size: 28px;
}
.promise-item h3 { font-size: 18px; margin-bottom: 2px; }
.promise-item p { font-size: 15px; color: var(--ink-2); }

/* ---------- 详情页 ---------- */
.detail-cover {
  height: 220px; border-radius: var(--radius); margin: 12px 16px;
  display: flex; align-items: center; justify-content: center; font-size: 72px; color: #fff;
}
.detail-head { padding: 4px 16px 8px; }
.detail-head h1 { font-size: 24px; line-height: 1.4; }
.detail-head .sub { font-size: 16px; color: var(--ink-2); margin-top: 4px; }
.detail-price-row { display: flex; align-items: baseline; gap: 10px; margin: 12px 0; }
.detail-price-row .price { font-size: 30px; }
.detail-highlights { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.detail-highlights .hl {
  background: var(--orange-light); color: var(--orange-deep);
  font-size: 15px; padding: 4px 12px; border-radius: 8px;
}
.detail-block { background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin: 12px 16px; box-shadow: var(--shadow); }
.detail-block h2 { font-size: 19px; margin-bottom: 8px; padding-left: 10px; border-left: 4px solid var(--orange); }
.detail-block p, .detail-block li { font-size: 16px; color: var(--ink-2); }
.detail-block ul { padding-left: 20px; }
.detail-block li { margin: 6px 0; }
.detail-imgs img {
  width: 100%; display: block; border-radius: 12px;
  margin: 8px 0; border: 1px solid var(--line);
}

/* ---------- 底部操作栏 ---------- */
.action-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  display: flex; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
}
.btn {
  flex: 1; border: none; border-radius: 999px;
  font-size: 18px; font-weight: 700; padding: 14px 0; cursor: pointer;
  font-family: inherit;
}
.btn.outline { background: #fff; color: var(--orange-deep); border: 2px solid var(--orange); }
.btn.solid  { background: var(--orange); color: #fff; }
.btn:active { opacity: .82; }
.btn.back-home { flex: 0 0 auto; padding: 14px 20px; }

/* ---------- 购买页 ---------- */
.order-card { background: var(--card); border-radius: var(--radius); padding: 16px; margin: 12px 16px; box-shadow: var(--shadow); }
.order-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 17px; }
.order-row .label { color: var(--ink-2); }
.order-row.total { border-top: 1px dashed var(--line); margin-top: 8px; padding-top: 14px; font-size: 19px; font-weight: 700; }
.pay-channel { display: flex; align-items: center; gap: 10px; padding: 12px 0; font-size: 17px; }
.pay-channel .wx-icon {
  width: 34px; height: 34px; border-radius: 8px; background: #2AAE67; color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 17px; font-weight: 700;
}
.pay-channel .check { margin-left: auto; color: #2AAE67; font-weight: 700; }
.refund-note {
  margin: 0 16px; padding: 12px 14px; border-radius: 12px;
  background: var(--orange-light); color: var(--orange-deep); font-size: 15px;
}

/* ---------- 登录弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(43, 33, 24, .55);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-mask.show { display: flex; }
.modal {
  width: 100%; max-width: 520px;
  background: #fff; border-radius: 24px 24px 0 0;
  padding: 24px 22px calc(24px + env(safe-area-inset-bottom));
}
.modal h2 { font-size: 22px; text-align: center; margin-bottom: 4px; }
.modal .modal-tip { font-size: 15px; color: var(--ink-2); text-align: center; margin-bottom: 18px; }
.field { display: flex; align-items: center; gap: 10px; border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; }
.field.focus, .field:focus-within { border-color: var(--orange); }
.field input {
  flex: 1; border: none; outline: none; font-size: 18px; font-family: inherit;
  background: transparent; color: var(--ink);
}
.field input::placeholder { color: #B9ACA0; }
.code-btn {
  flex: 0 0 auto; border: none; background: var(--orange-light); color: var(--orange-deep);
  font-size: 15px; font-weight: 600; padding: 8px 12px; border-radius: 8px; cursor: pointer;
  font-family: inherit;
}
.code-btn:disabled { color: #B9ACA0; background: #F2EDE8; }
.modal .btn.solid { width: 100%; font-size: 19px; }
.agreement { font-size: 13px; color: var(--ink-2); text-align: center; margin-top: 12px; }
.modal-close {
  position: absolute; top: 14px; right: 16px; border: none; background: none;
  font-size: 26px; color: var(--ink-2); cursor: pointer;
}
.modal { position: relative; }

/* ---------- 反馈 / 合作页 ---------- */
.contact-card { background: var(--card); border-radius: var(--radius); padding: 18px 16px; margin: 12px 16px; box-shadow: var(--shadow); }
.contact-card h2 { font-size: 19px; margin-bottom: 10px; padding-left: 10px; border-left: 4px solid var(--orange); }
.user-menu { position: relative; }
.user-menu summary { cursor: pointer; color: var(--orange-deep); font-weight: 600; }
.user-menu nav {
  position: absolute;
  right: 0;
  z-index: 2;
  min-width: 130px;
  padding: 6px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.user-menu nav a, .user-menu nav button {
  display: block;
  width: 100%;
  padding: 10px;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
}
.user-menu nav a:hover, .user-menu nav button:hover { background: #fcf2eb; }
.feedback-form { display: grid; gap: 12px; }
.feedback-form textarea { width: 100%; padding: 10px; font: inherit; resize: vertical; }
/* 反馈表单提交按钮：与输入框等宽的大按钮，避免小胶囊贴在输入框下沿 */
.feedback-form button {
  justify-self: stretch;
  width: 100%;
  margin-top: 4px;
  box-shadow: 0 6px 16px rgba(232, 102, 60, .24);
}
.feedback-form button:disabled { box-shadow: none; }
.history-entry { padding: 12px 0; border-bottom: 1px solid #eee5dc; overflow-wrap: anywhere; }
.history-entry p { white-space: pre-wrap; }
.history-entry time { color: var(--ink-2); }
#historyList button { margin: 12px 8px 0 0; }

/* 未登录空状态：图标 + 说明 + 居中大按钮，避免小按钮缩在卡片角落 */
.login-empty { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 20px 8px 10px; }
.login-empty-icon { font-size: 46px; line-height: 1.1; margin-bottom: 12px; }
.login-empty-title { font-size: 20px; font-weight: 700; color: var(--ink); }
.login-empty-tip { font-size: 15px; color: var(--ink-2); margin-top: 6px; line-height: 1.7; }
#historyList .login-empty-btn {
  flex: 0 0 auto;
  width: min(280px, 100%);
  margin: 20px 0 0;
  padding: 14px 0;
  font-size: 18px;
  box-shadow: 0 6px 16px rgba(232, 102, 60, .24);
}

.contact-line { display: flex; justify-content: space-between; padding: 8px 0; font-size: 16px; }
.contact-line .k { color: var(--ink-2); }
.contact-line .v { color: var(--orange-deep); font-weight: 600; }

/* ---------- 页脚 ---------- */
.footer { padding: 20px 16px 30px; text-align: center; color: var(--ink-2); font-size: 14px; }
.footer .links { display: flex; justify-content: center; gap: 20px; margin-bottom: 10px; }
.footer .links a { color: var(--orange-deep); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* toast */
.toast {
  position: fixed; left: 50%; bottom: 120px; transform: translateX(-50%);
  background: rgba(43,33,24,.85); color: #fff; font-size: 16px;
  padding: 10px 22px; border-radius: 999px; z-index: 300;
  opacity: 0; pointer-events: none; transition: opacity .25s;
  white-space: nowrap;
}
.toast.show { opacity: 1; }

.empty-tip { text-align: center; color: var(--ink-2); padding: 40px 0; font-size: 16px; }

/* 温馨提示（非老年大学声明） */
.notice-bar {
  margin: 0 16px 8px; padding: 12px 14px; border-radius: 12px;
  background: #FFF9F0; border: 1px solid #F0DCC0;
  color: #8A6A3C; font-size: 15px; line-height: 1.7;
}

/* ---------- 会员卡 ---------- */
.member-list { display: flex; flex-direction: column; gap: 14px; padding: 0 16px 8px; }
.member-card {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
  border: 2px solid var(--line);
}
.member-card.m-gold    { border-color: #E3B14E; background: linear-gradient(180deg, #FFFBEF, #FFF7E2); }
.member-card.m-diamond { border-color: #7FA8D9; background: linear-gradient(180deg, #F2F8FF, #E9F2FC); }
.member-card.m-count   { border-color: var(--orange); }
.m-top { display: flex; align-items: center; gap: 10px; }
.m-name { font-size: 21px; font-weight: 800; color: var(--ink); }
.m-tag {
  font-size: 13px; color: #fff; background: var(--orange);
  padding: 3px 10px; border-radius: 999px;
}
.m-gold .m-tag { background: #D99A1F; }
.m-diamond .m-tag { background: #5B8EC7; }
.m-desc { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.m-meta { font-size: 15px; color: var(--orange-deep); font-weight: 600; margin-top: 2px; }
.m-price-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.m-price-row .price { font-size: 26px; }
.m-price-text { font-size: 17px; font-weight: 700; color: var(--orange-deep); }
.m-price-row .m-buy { flex: 0 0 auto; padding: 10px 22px; font-size: 16px; }
.member-notes {
  margin: 8px 16px 12px; padding: 12px 14px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow);
  font-size: 15px; color: var(--ink-2); line-height: 1.8;
}
.member-notes p { margin: 2px 0; }

/* 会员开通页：选课列表 */
.m-course-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.m-course {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px; padding: 10px 12px;
  box-shadow: var(--shadow); cursor: pointer;
}
.m-course input { flex: 0 0 auto; width: 20px; height: 20px; accent-color: var(--orange); }
.m-course-icon {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 22px; color: #fff;
}
.m-course-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.m-course-info b { font-size: 16px; font-weight: 700; }
.m-course-info i { font-style: normal; font-size: 14px; color: var(--ink-2); }
.m-note { flex: 0 0 auto; font-size: 13px; color: var(--orange-deep); background: var(--orange-light); padding: 3px 8px; border-radius: 8px; }
.m-guitar-opt {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 16px 0; padding: 12px 14px;
  background: #FFF7E2; border: 1px solid #E3B14E; border-radius: 12px;
  font-size: 15px; color: var(--ink); cursor: pointer;
}
.m-guitar-opt input { width: 18px; height: 18px; accent-color: var(--orange); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 底部操作栏（居中约束） ---------- */
.action-bar {
  position: fixed; left: 50%; bottom: 0; z-index: 100;
  transform: translateX(-50%);
  width: 100%;
  display: flex; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
}

/* 「返回首页」类操作栏静态跟随内容，避免固定底栏遮挡页面尾部信息 */
body[data-page="feedback"] .action-bar,
body[data-page="rules"] .action-bar,
body[data-page="coop"] .action-bar {
  position: static;
  transform: none;
  left: auto;
  width: auto;
  margin: 12px 16px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

/* ============================================================
   电脑端适配（≥768px）：宽屏多列布局，手机端保持单列
   ============================================================ */
@media (min-width: 768px) {
  /* 首页宽屏 1000px；详情/购买/会员页收窄到 760px 保证可读性 */
  .page { max-width: 1000px; }
  body[data-page="detail"] .page,
  body[data-page="buy"] .page,
  body[data-page="member-buy"] .page,
  body[data-page="feedback"] .page,
  body[data-page="coop"] .page { max-width: 760px; }

  .hero { padding: 40px 36px; }
  .hero h1 { font-size: 34px; }
  .hero p { font-size: 19px; }

  /* 类目栏居中换行，不横向滚动 */
  .cat-bar { justify-content: center; flex-wrap: wrap; overflow: visible; }

  /* 商品列表：两列卡片网格 */
  .course-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .course-cover { flex-basis: 96px; width: 96px; height: 96px; font-size: 40px; }
  .course-name { font-size: 20px; }

  /* 学习效果承诺：三列 */
  .promise-grid { grid-template-columns: repeat(3, 1fr); }
  .promise-item { flex-direction: column; gap: 10px; }
  .promise-item .icon { flex-basis: auto; }

  /* 会员卡：三列 */
  .member-list { display: grid; grid-template-columns: repeat(3, 1fr); align-items: stretch; }
  .member-card { display: flex; flex-direction: column; }
  .m-price-row { margin-top: auto; padding-top: 10px; }

  /* 会员选课列表：两列 */
  .m-course-list { display: grid; grid-template-columns: repeat(2, 1fr); }

  /* 详情页封面更高 */
  .detail-cover { height: 280px; font-size: 88px; }

  /* 底部操作栏随页面宽度约束 */
  .action-bar { width: min(1000px, 100%); }
  body[data-page="detail"] .action-bar,
  body[data-page="buy"] .action-bar,
  body[data-page="member-buy"] .action-bar { width: min(760px, 100%); }

  /* 登录弹窗桌面端不贴底，居中弹出 */
  .modal-mask { align-items: center; }
  .modal { border-radius: 24px; max-width: 480px; }
}
