:root {
  /* —— 源楷科技 品牌色（与官网协调）—— */
  --ink: #0a1424;          /* 最深墨蓝 */
  --navy: #0e1c33;         /* 主墨蓝 */
  --navy-2: #102544;       /* 次墨蓝 */
  --gold: #c9a86a;         /* 香槟金 */
  --gold-soft: #d9bd86;    /* 浅金 */
  --gold-deep: #a9863f;    /* 深金 */
  --gold-ink: #1a1206;     /* 金底上的深色文字 */
  --paper: #f7f4ed;        /* 暖米纸背景 */
  --paper-2: #efe9dd;      /* 暖米纸二段 */
  --line: rgba(201,168,106,.35);   /* 金线 */
  --white: #ffffff;

  --bg: var(--paper);
  --card: #ffffff;
  --text: #2a2f38;
  --muted: #5b6470;
  --border: #e6ddcc;
  --primary: var(--gold);
  --primary-dark: var(--gold-deep);

  --success: #2e7d5b;
  --warning: #b8860b;
  --danger: #c0392b;

  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--sans); background: var(--bg); color: var(--text); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin-bottom: 16px; color: var(--navy); font-family: var(--serif); font-weight: 700; letter-spacing: .5px; }

/* 顶部栏 */
.topbar {
  height: 56px; background: linear-gradient(135deg, var(--navy), var(--ink));
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line);
}
.topbar .brand {
  font-family: var(--serif); font-size: 18px; font-weight: 700; letter-spacing: 1px;
  display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none;
}
.topbar .brand:hover { color: var(--gold-soft); }
.topbar .brand .mark {
  width: 30px; height: 30px; border: 1.5px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--gold);
  font-size: 14px; font-weight: 700; letter-spacing: 0; flex: none;
}
.topbar .user { font-size: 14px; display: flex; gap: 14px; align-items: center; }
.topbar .user a { color: var(--gold-soft); }
.topbar .user a:hover { color: #fff; }
.topbar .user .hi { color: rgba(255,255,255,.72); }
/* 官网首页入口：带淡金描边，与「退出登录」区分开 */
.topbar .user .home-link {
  border: 1px solid rgba(201,168,106,.55); border-radius: 999px;
  padding: 4px 12px; font-size: 13px; white-space: nowrap;
  background: rgba(201,168,106,.10); transition: background .15s, border-color .15s;
}
.topbar .user .home-link:hover { background: rgba(201,168,106,.22); border-color: var(--gold); color: #fff; }

/* 布局 */
.layout { display: flex; min-height: calc(100vh - 56px); }
.sidebar {
  width: 220px; background: linear-gradient(180deg, var(--navy), var(--ink));
  color: rgba(255,255,255,.82); padding: 16px 0; flex-shrink: 0; border-right: 1px solid var(--line);
}
.sidebar a {
  display: block; padding: 12px 24px; color: rgba(255,255,255,.78); font-size: 14px;
}
.sidebar a:hover, .sidebar a.active {
  background: var(--navy-2); color: var(--gold-soft); text-decoration: none;
  box-shadow: inset 3px 0 0 var(--gold);
}
.sidebar .group { font-size: 12px; color: rgba(201,168,106,.65); padding: 12px 24px 4px; letter-spacing: 1px; }

/* 折叠子菜单（企业管理） */
.sidebar .nav-group { margin: 0; }
.sidebar .nav-parent {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; font-family: inherit;
  padding: 12px 24px; color: rgba(255,255,255,.78); font-size: 14px;
}
.sidebar .nav-parent:hover { background: var(--navy-2); color: var(--gold-soft); }
.sidebar .nav-parent .caret { float: right; transition: transform .2s ease; }
.sidebar .nav-parent.open .caret { transform: rotate(90deg); }
.sidebar .nav-sub { display: none; }
.sidebar .nav-sub.open { display: block; }
.sidebar .nav-sub a { padding-left: 46px; font-size: 13px; }
.sidebar .nav-sub a.active { box-shadow: inset 3px 0 0 var(--gold); }

.content { flex: 1; padding: 28px; overflow-x: auto; }
.container { max-width: 1100px; margin: 0 auto; }

/* 卡片/统计 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px;
  transition: .25s; box-shadow: 0 1px 0 rgba(201,168,106,.08);
}
.card:hover { border-color: var(--gold); box-shadow: 0 8px 24px rgba(10,20,36,.08); }
.card .label { color: var(--muted); font-size: 13px; }
.card .value { font-size: 22px; font-weight: 700; margin-top: 6px; color: var(--navy); font-family: var(--serif); }
.card .value.green { color: var(--success); }
.card.hl { border-color: var(--gold); background: linear-gradient(135deg, rgba(201,168,106,.10), rgba(201,168,106,.02)); }
.card.hl .value { color: var(--gold-deep); }

/* 入口页：门户分区 */
.portal-title {
  font-family: var(--serif); font-size: 15px; color: var(--muted); font-weight: 600;
  margin: 6px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
  letter-spacing: .5px;
}
.portal-card { display: flex; flex-direction: column; }
.portal-card .portal-host {
  margin-top: 10px; font-size: 12px; color: var(--gold-deep);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: rgba(201,168,106,.10); border-radius: 6px; padding: 4px 8px;
  display: inline-block; align-self: flex-start;
}
.home-panel { max-width: 720px; margin-top: 8px; }
.home-panel .list li a { color: var(--navy); font-weight: 600; }

/* 积分商城：积分标签 + 商品卡 */
.points-tag {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(201,168,106,.16), rgba(201,168,106,.04));
  border: 1px solid var(--gold); border-radius: 12px; padding: 14px 18px; margin-bottom: 22px;
}
.pts-label { font-size: 14px; color: var(--muted); }
.pts-value { font-size: 30px; font-weight: 800; color: var(--gold-deep); font-family: var(--serif); line-height: 1; }
.pts-hint { font-size: 12px; color: var(--muted); }
/* 商品卡：电商网格样式（参考截图：正方形浅灰底图 + NEW角标 + 标题一行省略 + 橙色积分） */
.product-card {
  display: flex; flex-direction: column; gap: 8px; padding: 0;
  background: transparent; border: none; box-shadow: none;
}
.product-card:hover { border: none; box-shadow: none; }
.product-media { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: 8px; overflow: hidden; background: #f5f5f5; }
.product-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.product-new { position: absolute; top: 0; left: 0; background: #ff6a00; color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .5px; padding: 5px 10px; border-radius: 8px 0 10px 0; z-index: 2; }
.product-title { font-size: 15px; font-weight: 600; color: #333; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-desc { font-size: 12.5px; color: #999; line-height: 1.5; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-cost { color: #ff6a00; font-size: 14px; font-weight: 600; }
.product-cost b { font-size: 18px; font-weight: 800; }
.product-card .btn.sm { margin-top: 2px; align-self: flex-start; min-width: 96px; justify-content: center; border-radius: 999px; }
.product-card .btn.sm.redeem-toggle { background: #ff6a00; border-color: #ff6a00; color: #fff; }
.product-card .btn.sm.redeem-toggle:hover { background: #e85f00; }
.product-card .btn.sm:disabled { background: #f0ede6; border-color: #e7e2d8; color: #b7b1a5; }
.redeem-form { width: 100%; }
.redeem-form input { width: 100%; box-sizing: border-box; }
.redeem-fail { color: #c0392b; font-size: 12px; margin: 6px 0 0; }

/* 业绩概览：时间段切换 + 分区标题 */
.period-tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 20px; }
.period-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.ptab {
  padding: 7px 16px; border-radius: 999px; font-size: 14px; text-decoration: none;
  color: var(--navy); background: var(--card); border: 1px solid var(--border); transition: .2s;
}
.ptab:hover { border-color: var(--gold); }
.ptab.active { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--gold); border-color: var(--navy); font-weight: 600; }
.section-title { font-size: 15px; font-weight: 700; color: var(--gold-ink); margin: 26px 0 12px; padding-left: 10px; border-left: 4px solid var(--gold); }

/* 表格 */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--border); }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: 14px; }
th { background: var(--paper-2); color: var(--muted); font-weight: 600; }
tr:hover td { background: #faf6ee; }
tr.total-row td { background: rgba(201,168,106,.12); font-weight: 700; color: var(--gold-ink); }
tr.total-row:hover td { background: rgba(201,168,106,.18); }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-wrap table { min-width: 920px; }
.table-wrap th, .table-wrap td { white-space: nowrap; }
.table-wrap td.ellip { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap th.actions, .table-wrap td.actions { width: 80px; min-width: 80px; text-align: center; }
.table-wrap td.actions form { display: inline; }

/* 表单 */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 24px; max-width: 460px; box-shadow: 0 8px 30px rgba(10,20,36,.05); }
.panel.wide { max-width: 720px; }
.top-actions { margin: 4px 0 18px; }
.top-actions .btn { margin-right: 8px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input-group { display: flex; gap: 8px; }
.input-group input { flex: 1; }
.input-group .btn { flex: 0 0 auto; width: auto; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px;
  font-family: inherit; background: #fff; color: var(--text);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,168,106,.15); }

.btn {
  display: inline-block; background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  color: var(--gold-ink); border: none; padding: 10px 20px; border-radius: 999px;
  cursor: pointer; font-size: 14px; font-weight: 600; letter-spacing: .5px; transition: .25s;
}
.btn:hover { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); color: var(--gold-ink); text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(201,168,106,.35); }
.btn.sm { padding: 6px 14px; font-size: 13px; }
.btn.danger { background: var(--danger); color: #fff; border: 1px solid var(--danger); }
.btn.danger:hover { background: #a93226; box-shadow: 0 10px 24px rgba(192,57,43,.3); transform: translateY(-1px); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 6px 0; }
.check { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 500; }
.btn.ghost { background: #fff; color: var(--gold-deep); border: 1px solid var(--gold); }
.btn.ghost:hover { background: rgba(201,168,106,.1); box-shadow: none; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge.pending { background: rgba(201,168,106,.15); color: var(--gold-deep); }
.badge.approved { background: #dcf0e3; color: var(--success); }
.badge.rejected { background: #fbe3df; color: var(--danger); }
.badge.active { background: rgba(201,168,106,.18); color: var(--gold-deep); }
.badge.inactive { background: rgba(120,120,120,.14); color: #888; }

/* 提示 */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: rgba(201,168,106,.12); color: var(--gold-deep); border: 1px solid var(--line); }
.ok-tip { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; background: rgba(46,160,67,.12); color: #2e7d32; border: 1px solid rgba(46,160,67,.3); font-size: 15px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.hint-gray { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 4px 0 16px; }
.mt { margin-top: 16px; }
.search-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 16px; }
.search-bar input[type="text"] { flex: 1 1 260px; min-width: 200px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--card); color: inherit; }
.search-bar .ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); text-decoration: none; line-height: 1; display: inline-flex; align-items: center; }
.combo { position: relative; }
.combo-list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); max-height: 260px; overflow-y: auto; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 12px 30px rgba(10,20,36,.12); display: none; }
.combo-item { padding: 9px 12px; cursor: pointer; font-size: 14px; border-bottom: 1px solid var(--border); }
.combo-item:last-child { border-bottom: none; }
.combo-item:hover { background: rgba(10,20,36,.05); }
.combo-item .ci-id { font-weight: 600; color: var(--gold-deep); }
.combo-item .ci-mail { color: var(--muted); font-size: 12px; }
.mt-sm { margin-top: 8px; }
.row-form { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.inp-sm { width: 120px; padding: 6px 8px; font-size: 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); color: var(--ink); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.code-box {
  background: var(--paper-2); border: 1px dashed var(--border); border-radius: 8px;
  padding: 10px 12px; font-family: monospace; font-size: 13px; word-break: break-all;
}
.list { list-style: none; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--border); }

/* 待签协议：行标红 */
tr.row-red { background: #fbe9e6 !important; }
tr.row-red td { box-shadow: inset 3px 0 0 var(--danger); }

/* 账户协议弹窗 */
.agree-overlay {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,20,36,.62); padding: 24px;
}
.agree-modal {
  width: min(760px, 96vw); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.4); border: 1px solid var(--line);
}
.agree-head {
  padding: 16px 20px; font-size: 17px; font-weight: 700; color: var(--gold-ink);
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--gold);
}
.agree-box {
  flex: 1; overflow-y: auto; padding: 18px 22px; white-space: pre-wrap; word-break: break-word;
  font-size: 13.5px; line-height: 1.85; color: var(--ink); background: var(--paper);
}
.agree-foot {
  display: flex; align-items: center; gap: 12px; padding: 14px 20px;
  border-top: 1px solid var(--line); background: var(--paper-2);
}
.agree-hint { flex: 1; font-size: 13px; color: var(--muted); }
.btn.sm[disabled] { opacity: .45; cursor: not-allowed; }

/* 客户待办提醒强制弹窗（不可关闭，仅确认） */
.remind-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,20,36,.72); padding: 24px;
}
.remind-modal {
  width: min(520px, 96vw); max-height: 86vh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); border: 1px solid var(--line);
}
.remind-head {
  padding: 16px 20px; font-size: 17px; font-weight: 700;
  background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--gold);
}
.remind-list { list-style: none; margin: 0; padding: 8px 20px; overflow-y: auto; }
.remind-list li { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.remind-list li:last-child { border-bottom: none; }
.remind-title { font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.remind-meta { font-size: 12.5px; color: var(--gold-deep); }
.remind-note { font-size: 13px; color: var(--muted); margin-top: 2px; }
.remind-foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--paper-2); text-align: right; }

/* 重置密码成功弹窗 */
.ok-overlay {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,20,36,.72); padding: 24px;
}
.ok-modal {
  width: min(420px, 92vw); text-align: center;
  background: var(--paper); border-radius: 16px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,.45); border: 1px solid var(--line); padding: 32px 28px;
}
.ok-icon { font-size: 52px; line-height: 1; margin-bottom: 14px; }
.ok-modal h3 { margin: 0 0 12px; font-size: 20px; color: var(--ink); }
.ok-modal .btn { margin-top: 18px; }

/* 活动卡片 */
.activity-card { overflow: hidden; padding: 0 !important; }
.activity-img { width: 100%; height: 150px; object-fit: cover; display: block; }
.activity-body { padding: 14px 16px; }
.activity-title { font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.activity-text { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.activity-rules { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 12px; }
.activity-rules .rules-inner { font-size: 13px; color: var(--ink); line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.thumb { width: 80px; height: 54px; object-fit: cover; border-radius: 6px; }
.row-ops { white-space: nowrap; }
.row-ops .inline-form { display: inline-block; margin-right: 6px; }


/* 考试报名费提交成功提示弹窗 */
.success-box { padding: 22px 24px; font-size: 14.5px; line-height: 1.95; color: var(--ink); background: var(--paper); }
.success-box p { margin: 0 0 12px; }
.success-box p:last-child { margin-bottom: 0; }
.success-box .em { color: var(--gold-deep); font-weight: 700; }
.success-box .warn { color: #c0392b; font-weight: 600; }

/* 右下角在线客服组件 */
.cs-widget { position: fixed; right: 24px; bottom: 24px; z-index: 50; font-family: inherit; }
.cs-fab {
  display: flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep)); color: var(--gold-ink); border: none; border-radius: 999px;
  padding: 12px 18px; font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 22px rgba(201,168,106,.4);
}
.cs-fab:hover { background: linear-gradient(135deg, var(--gold-soft), var(--gold)); }
.cs-panel {
  width: 300px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 12px 36px rgba(10,20,36,.22); overflow: hidden; display: none;
}
.cs-head {
  background: linear-gradient(135deg, var(--navy), var(--ink)); color: var(--gold-soft); padding: 12px 14px; font-size: 14px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; font-family: var(--serif);
}
.cs-close { background: transparent; border: none; color: var(--gold-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.cs-body { padding: 14px; }
.cs-tip { font-size: 14px; margin-bottom: 10px; color: var(--text); }
.cs-row { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 14px; }
.cs-row span { width: 42px; color: var(--muted); }
.cs-row b { flex: 1; word-break: break-all; }
.cs-copy {
  background: rgba(201,168,106,.12); color: var(--gold-deep); border: none; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; text-decoration: none;
}
.cs-copy:hover { background: rgba(201,168,106,.22); }
.cs-foot { margin-top: 10px; font-size: 12px; color: var(--muted); }
.cs-qr { text-align: center; margin: 10px 0; }
.cs-qr img { width: 160px; height: 160px; object-fit: contain; border: 1px solid var(--border); border-radius: 8px; display: block; margin: 0 auto 6px; }
.cs-qr span { font-size: 12px; color: var(--muted); }
.cs-qr-preview { max-width: 180px; max-height: 180px; border: 1px solid var(--border); border-radius: 8px; }

/* 导航待办角标 */
.nav-badge {
  display: inline-block; margin-left: 6px; min-width: 18px; text-align: center;
  background: var(--danger); color: #fff; border-radius: 999px; font-size: 11px; padding: 0 6px; line-height: 18px;
}
.nav-badge.soft { background: var(--gold); color: var(--gold-ink); }

/* 手写签名板 */
.agree-sign { padding: 12px 20px 0; background: var(--paper-2); }
.agree-sign-head { font-size: 13px; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.sig-pad {
  width: 100%; height: 170px; border: 1.5px dashed var(--gold-deep); border-radius: 10px;
  background: #fff; touch-action: none; cursor: crosshair; display: block;
}
.sig-img {
  max-width: 320px; height: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px; box-shadow: 0 2px 8px rgba(10,20,36,.08);
}

/* 待办提醒 */
.todo-mini { list-style: none; }
.todo-mini li { padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px; display: flex; align-items: center; gap: 8px; }
.todo-mini li:last-child { border-bottom: none; }
.row-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.badge.overdue { background: #fbe3df; color: var(--danger); }
.badge.today { background: rgba(201,168,106,.2); color: var(--gold-deep); }
.badge.soon { background: rgba(46,125,91,.12); color: var(--success); }

/* 客户提醒：未读高亮 + 圆点 */
tr.row-unread { background: rgba(201,168,106,.10) !important; }
tr.row-unread td { box-shadow: inset 3px 0 0 var(--gold-deep); }
.dot-unread { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--gold-deep); margin-right: 4px; }

/* 考试报名费通道选择 */
.channels { display: flex; gap: 12px; flex-wrap: wrap; }
.channel {
  flex: 1 1 140px; min-width: 140px; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 16px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  background: #fff; transition: border-color .15s, box-shadow .15s;
}
.channel:hover { border-color: var(--gold); }
.channel input { accent-color: var(--navy); width: 16px; height: 16px; }
.channel:has(input:checked) { border-color: var(--gold-deep); box-shadow: 0 0 0 3px rgba(201,168,106,.18); background: rgba(201,168,106,.06); }
.ch-name { font-weight: 600; color: var(--ink); }
.pay-info { margin-top: 14px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--paper); }
.pay-title { font-weight: 700; color: var(--navy); margin-bottom: 10px; }
.pay-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 14px; }
.pay-row span { width: 84px; color: var(--muted); flex-shrink: 0; }
.pay-row b { font-size: 15px; color: var(--ink); word-break: break-all; }
.qr { max-width: 240px; width: 240px; height: 240px; object-fit: contain; background: #fff;
  border: 1px solid var(--border); border-radius: 10px; padding: 8px; display: block; margin-top: 8px; }

/* 考试报名费两步式：通道选择卡片 */
.deposit-channels { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin: 8px 0 20px; }
.deposit-card {
  display: block; text-decoration: none; color: var(--ink);
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 20px;
  box-shadow: 0 8px 24px rgba(10,20,36,.05); transition: border-color .15s, box-shadow .15s, transform .15s;
}
.deposit-card:hover { border-color: var(--gold); box-shadow: 0 12px 30px rgba(10,20,36,.10); transform: translateY(-2px); }
.deposit-icon { font-size: 34px; line-height: 1; }
.deposit-name { font-weight: 700; color: var(--navy); font-family: var(--serif); font-size: 18px; margin-top: 10px; }
.deposit-desc { color: var(--muted); font-size: 13px; margin-top: 6px; min-height: 34px; }
.deposit-go { margin-top: 12px; color: var(--gold-deep); font-weight: 600; font-size: 14px; }
.qr-big { max-width: 280px; width: 280px; height: 280px; object-fit: contain; background: #fff;
  border: 1px solid var(--border); border-radius: 12px; padding: 10px; display: block; margin: 10px 0; }
.pay-info b { word-break: break-all; }

/* 搜索框 + 分页 */
.search-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.search-form input { flex: 1 1 260px; max-width: 420px; }
.search-form .btn { flex: 0 0 auto; }
.pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 16px; }
.pgbtn {
  min-width: 34px; padding: 7px 12px; text-align: center; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--ink);
  text-decoration: none; transition: .15s;
}
.pgbtn:hover { border-color: var(--gold); color: var(--gold-deep); text-decoration: none; }
.pgbtn.active { background: linear-gradient(135deg, var(--navy), var(--navy-2)); color: var(--gold); border-color: var(--navy); }
.pgbtn.disabled { opacity: .4; pointer-events: none; }
.pgdots { color: var(--muted); padding: 0 2px; }

/* ====== 注册 / 登录 专用分栏布局 ====== */
.auth-wrap { display: flex; min-height: calc(100vh - 56px); }
.auth-aside {
  flex: 1 1 46%; max-width: 560px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--navy), var(--ink) 72%);
  color: #fff; padding: 60px 54px; display: flex; flex-direction: column; justify-content: center;
}
.auth-aside::before {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 360px; height: 360px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,106,.20), transparent 70%);
}
.auth-aside::after {
  content: ""; position: absolute; left: -100px; bottom: -120px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(201,168,106,.12), transparent 70%);
}
.auth-aside .a-brand {
  display: flex; align-items: center; gap: 12px; font-family: var(--serif);
  font-size: 20px; font-weight: 700; color: #fff; margin-bottom: 44px; position: relative;
}
.auth-aside .a-brand .mark {
  width: 32px; height: 32px; border: 1.5px solid var(--gold); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: var(--gold);
  font-size: 15px; font-weight: 700;
}
.auth-aside h1 { color: #fff; font-size: 30px; line-height: 1.45; margin-bottom: 16px; position: relative; }
.auth-aside p.a-sub { color: rgba(255,255,255,.72); font-size: 15px; line-height: 1.9; max-width: 420px; position: relative; }
.auth-aside ul.a-points { list-style: none; margin-top: 34px; position: relative; }
.auth-aside ul.a-points li { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 18px; font-size: 14.5px; color: rgba(255,255,255,.88); }
.auth-aside ul.a-points li b { color: #fff; font-weight: 600; }
.auth-aside ul.a-points .ico {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  background: rgba(201,168,106,.18); color: var(--gold-soft);
  display: flex; align-items: center; justify-content: center; font-size: 15px;
}
.auth-aside .a-foot { margin-top: 44px; font-size: 12.5px; color: rgba(255,255,255,.42); position: relative; }

.auth-main {
  flex: 1 1 54%; display: flex; align-items: center; justify-content: center;
  padding: 44px 32px; background: var(--paper);
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card h2 { font-size: 25px; color: var(--navy); margin-bottom: 6px; }
.auth-card .a-tip { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; line-height: 1.6; }
.auth-card .field { margin-bottom: 15px; text-align: left; }
.auth-card .field label { text-align: left; }
.auth-card .field input { width: 100%; }
.auth-card .actions { display: flex; gap: 12px; align-items: center; margin-top: 10px; }
.auth-card .actions .btn { flex: 0 0 auto; }
.auth-card .alt { margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.auth-card .alt a { color: var(--gold-deep); font-weight: 600; }

@media (max-width: 860px) {
  .auth-aside { display: none; }
  .auth-main { flex-basis: 100%; padding: 36px 20px; }
  .auth-card { max-width: 460px; }
}

/* ===== 移动端布局：sidebar 抽屉化 ===== */
@media (max-width: 768px) {
  .layout { position: relative; }
  .sidebar { position: fixed; left: 0; top: 56px; bottom: 0; width: 240px; z-index: 60;
    transform: translateX(-100%); transition: transform .25s ease; overflow-y: auto; }
  .sidebar.open { transform: translateX(0); box-shadow: 8px 0 24px rgba(0,0,0,.35); }
  .content { padding: 14px 12px; width: 100%; }
  .topbar { padding: 0 12px; gap: 8px; }
  .topbar .menu-toggle { display: inline-flex; align-items:center; justify-content:center;
    width:36px; height:36px; background:transparent; border:none; color:#fff; font-size:22px; cursor:pointer; flex:none; }
  .topbar .brand { font-size: 16px; gap: 8px; white-space: nowrap; }
  .topbar .brand .mark { width: 26px; height: 26px; font-size: 12px; }
  .topbar .user { gap: 8px; margin-left: auto; }
  .topbar .user .hi { display: none; }        /* 手机端收起「你好，xx」，避免顶栏溢出 */
  .topbar .user .home-link { padding: 3px 9px; font-size: 12px; }
  .topbar .user a[href*="logout"] { font-size: 13px; white-space: nowrap; }
  .sidebar-backdrop { display: none; position: fixed; inset: 56px 0 0 0; background: rgba(0,0,0,.4); z-index: 55; }
  .sidebar-backdrop.show { display: block; }
}
@media (min-width: 769px) {
  .topbar .menu-toggle { display: none; }
  .sidebar-backdrop { display: none !important; }
}

/* ====== 入金三步流程：金额展示 / 优惠预览 ====== */
.pay-amount { color: var(--muted); font-size: 14px; }
.pay-amount-num { font-size: 34px; font-weight: 700; color: var(--navy); font-family: var(--serif); margin: 6px 0; line-height: 1.2; }
.pay-coupon { display: inline-block; margin-top: 8px; padding: 4px 12px; border-radius: 999px; background: rgba(201,168,106,.15); color: var(--gold-deep); font-size: 13px; font-weight: 600; }
.pay-preview { margin: 8px 0 18px; padding: 12px 16px; border-radius: 10px; background: rgba(201,168,106,.10); border: 1px solid var(--line); font-size: 15px; }
.pay-preview b { color: var(--gold-deep); font-size: 18px; }
.mt-sm { margin-top: 8px; }

/* ===================== 成就勋章 ===================== */
.medals-strip { display:flex; flex-wrap:wrap; gap:36px 22px; justify-content:center; padding:24px 4px 12px; }
.medals-strip.mode-compact { gap:14px 18px; padding:10px 2px; }

.medal-item { width:160px; text-align:center; position:relative; padding-bottom:14px; }
.medals-strip.mode-compact .medal-item { width:118px; padding-bottom:0; }

.medal-coin { position:relative; width:100px; height:100px; margin:20px auto 24px; }
.medal-ribbon { position:absolute; top:62px; width:20px; height:60px; z-index:0; }
.medal-ribbon.ribbon-l { left:26px; transform:rotate(9deg);
  background:linear-gradient(180deg,#c0392b,#7d1f1a);
  clip-path:polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }
.medal-ribbon.ribbon-r { right:26px; transform:rotate(-9deg);
  background:linear-gradient(180deg,#c0392b,#7d1f1a);
  clip-path:polygon(0 0,100% 0,100% 100%,50% 80%,0 100%); }

.medal-ring { position:absolute; inset:0; border-radius:50%; z-index:2;
  background:conic-gradient(from 210deg,#f7ecc4,#c9a86a,#7e5e27,#f7ecc4,#c9a86a,#7e5e27,#f7ecc4);
  box-shadow:0 8px 16px rgba(10,20,36,.28), inset 0 0 0 3px rgba(255,255,255,.4); }
.medal-face { position:absolute; inset:8px; border-radius:50%; z-index:3;
  display:flex; flex-direction:column; align-items:center; justify-content:center; overflow:hidden;
  box-shadow:inset 0 3px 8px rgba(255,255,255,.45), inset 0 -6px 12px rgba(0,0,0,.25); }
.medal-face svg { width:30px; height:30px; filter:drop-shadow(0 1px 1px rgba(0,0,0,.35)); margin-top:6px; }
.medal-source { font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",serif;
  font-size:18px; font-weight:900; letter-spacing:0; color:rgba(255,255,255,.92);
  text-shadow:0 1px 2px rgba(0,0,0,.35); line-height:1; pointer-events:none; }
.medal-icon { display:flex; align-items:center; justify-content:center; width:100%; }

/* 缎带按勋章主题调色（避免清一色红，与对应面盘融合） */
.m-refund_3  .medal-ribbon { background:linear-gradient(180deg,#d77a8a,#8a3a4a); }
.m-refund_6  .medal-ribbon { background:linear-gradient(180deg,#9eb4c8,#52677a); }
.m-clear_15  .medal-ribbon { background:linear-gradient(180deg,#f1c764,#a06a14); }
.m-clear_29  .medal-ribbon { background:linear-gradient(180deg,#b89dff,#5b3fb0); }
.m-lifetime  .medal-ribbon { background:linear-gradient(180deg,#1c1c1c,#000); }

/* 各勋章主题配色 —— 颜色明显区分 */
.m-refund_3 .medal-ring { background:conic-gradient(from 210deg,#ffe2e6,#f7a8b6,#d77a8a,#ffe2e6,#f7a8b6,#d77a8a,#ffe2e6); }
.m-refund_3 .medal-face { background:radial-gradient(circle at 34% 28%,#fff0f3,#f29ab0 65%,#a83a5a); }

.m-refund_6 .medal-ring { background:conic-gradient(from 210deg,#f4f9ff,#bcd0e3,#6e8aac,#f4f9ff,#bcd0e3,#6e8aac,#f4f9ff); }
.m-refund_6 .medal-face { background:radial-gradient(circle at 34% 28%,#fdfeff,#bcd0e3 70%,#4d6480); }

.m-clear_15 .medal-ring { background:conic-gradient(from 210deg,#fff5cf,#f3c969,#a06a14,#fff5cf,#f3c969,#a06a14,#fff5cf); }
.m-clear_15 .medal-face { background:radial-gradient(circle at 34% 28%,#fff0bf,#f1c764 60%,#a06a14); }

.m-clear_29 .medal-ring { background:conic-gradient(from 210deg,#ece1ff,#b89dff,#5b3fb0,#ece1ff,#b89dff,#5b3fb0,#ece1ff); }
.m-clear_29 .medal-face { background:radial-gradient(circle at 34% 28%,#ece1ff,#b89dff 65%,#5b3fb0); }

.m-lifetime .medal-ring { background:conic-gradient(from 200deg,#f6e7a8,#caa44a,#1a1a1a,#f6e7a8,#caa44a,#1a1a1a,#f6e7a8,#caa44a); }
.m-lifetime .medal-face { background:radial-gradient(circle at 32% 26%,#fff3c4,#f6e7a8 38%,#1a1a1a 92%); }
.m-lifetime .medal-coin { transform:scale(1.06); }

/* 终身成就奖默认渲染皇冠描边 */
.m-lifetime .medal-face svg { stroke:#f6e7a8; fill:none; stroke-width:1.6; }

.medal-count { position:absolute; top:-6px; right:-6px; z-index:8; min-width:22px; height:22px; padding:0 5px;
  border-radius:999px; background:linear-gradient(135deg,#e0473b,#9a201a); color:#fff; font-size:12px; font-weight:800;
  display:flex; align-items:center; justify-content:center; border:2px solid #fff; box-shadow:0 2px 6px rgba(0,0,0,.35); }

.medal-lock { position:absolute; inset:8px; z-index:6; border-radius:50%; display:flex; align-items:center; justify-content:center;
  font-size:26px; background:rgba(18,22,30,.34); }

.medal-name { display:block; margin-top:18px; font-weight:700; font-size:15px; color:var(--ink); line-height:1.45; letter-spacing:.5px; }
.medal-tag  { display:block; margin-top:6px; font-size:12px; color:var(--gold-deep); letter-spacing:2px; line-height:1.5; }
.medal-state { display:inline-block; margin-top:12px; font-size:12px; padding:4px 14px; border-radius:999px; line-height:1.5; }
.medal-state.on  { background:rgba(30,142,62,.14); color:#1e8e3e; font-weight:700; }
.medal-state.off { background:rgba(120,120,120,.14); color:#8a8a8a; }
.medal-legend { display:block; font-size:12px; color:#8a8a8a; margin-top:10px; max-width:160px; margin-left:auto; margin-right:auto; line-height:1.7; }
.medals-strip.mode-compact .medal-legend,
.medals-strip.mode-compact .medal-tag,
.medals-strip.mode-compact .medal-state { display:none; }

.medal-progress { text-align:center; margin:8px 0 0; font-size:14px; color:var(--text); }
.medal-progress b { color:var(--gold-deep); font-size:18px; }
.medal-tip { font-size:12px; color:#8a8a8a; text-align:center; max-width:680px; margin:6px auto 0; line-height:1.6; }

/* 勋章图例：卡片化展示（桌面2列 / 手机单列） */
.medal-legend-cards { display:grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap:12px; }
.legend-card { display:flex; align-items:flex-start; gap:12px; padding:12px 14px;
  border:1px solid var(--line); border-radius:10px; background:rgba(201,168,106,.05); }
.legend-card .lc-emoji { font-size:24px; line-height:1; flex-shrink:0; }
.legend-card b { display:block; font-size:15px; color:var(--ink); margin-bottom:4px; }
.legend-card .lc-cat { display:inline-block; font-size:11px; color:var(--gold-deep);
  background:rgba(201,168,106,.18); padding:2px 10px; border-radius:999px; margin-bottom:6px; }
.legend-card p { margin:0; font-size:13px; color:#666; line-height:1.65; }
.legend-card.lifetime { background:rgba(246,231,168,.10); border-color:rgba(202,164,74,.4); }

/* 已点亮勋章的微光呼吸 —— 每枚勋章呼吸颜色与主题匹配 */
.medal-item.is-active .medal-coin { animation:medalGlow 3s ease-in-out infinite; }
.m-refund_3.is-active .medal-coin { animation:medalGlowPink 3s ease-in-out infinite; }
.m-refund_6.is-active .medal-coin { animation:medalGlowBlue 3s ease-in-out infinite; }
.m-clear_15.is-active .medal-coin { animation:medalGlowGold 3s ease-in-out infinite; }
.m-clear_29.is-active .medal-coin { animation:medalGlowPurple 3s ease-in-out infinite; }
.m-lifetime.is-active .medal-coin { animation:medalGlowBlackGold 3s ease-in-out infinite; }
@keyframes medalGlowPink   { 0%,100% { filter:drop-shadow(0 0 3px rgba(247,168,182,.55)); } 50% { filter:drop-shadow(0 0 12px rgba(255,180,200,.95)); } }
@keyframes medalGlowBlue   { 0%,100% { filter:drop-shadow(0 0 3px rgba(188,208,227,.55)); } 50% { filter:drop-shadow(0 0 12px rgba(160,200,255,.95)); } }
@keyframes medalGlowGold   { 0%,100% { filter:drop-shadow(0 0 3px rgba(243,201,105,.55)); } 50% { filter:drop-shadow(0 0 12px rgba(255,212,120,.95)); } }
@keyframes medalGlowPurple { 0%,100% { filter:drop-shadow(0 0 3px rgba(184,157,255,.55)); } 50% { filter:drop-shadow(0 0 12px rgba(200,170,255,.95)); } }
@keyframes medalGlowBlackGold { 0%,100% { filter:drop-shadow(0 0 3px rgba(246,231,168,.45)); } 50% { filter:drop-shadow(0 0 14px rgba(255,225,150,.95)); } }

/* 待激活：整体去色压暗，但仍保留外圈本色（不会全部都是同一个金色灰） */
.medal-item.is-locked .medal-ring,
.medal-item.is-locked .medal-face,
.medal-item.is-locked .medal-ribbon { filter:grayscale(1) brightness(.85); opacity:.55; }
.medal-item.is-locked .medal-face { background:#cfd3d9 !important; }
.medal-item.is-locked .medal-face svg { opacity:.55; }
.medal-item.is-locked .medal-count { display:none; }

/* 总后台客户详情页：终身成就奖 500w 盈利资格开关 */
.lifetime-500w-box { background:linear-gradient(135deg,rgba(246,231,168,.10),rgba(26,26,26,.04));
  border:1px solid rgba(202,164,74,.35); border-radius:12px; padding:16px 18px; }
.lifetime-500w-form { display:flex; align-items:center; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.lt-title { font-weight:700; font-size:15px; color:var(--ink); }
.lt-sub { font-size:12px; margin-top:4px; color:#666; }
.lt-on  { color:#1e8e3e; font-weight:700; }
.lt-off { color:#8a8a8a; }

/* 退费类型徽章 */
.rate-badge { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:600; white-space:nowrap; }
.rate-rate_3  { background:rgba(176,125,54,.16); color:#8a5a23; }
.rate-rate_6  { background:rgba(120,134,150,.20); color:#46535f; }
.rate-rate_15 { background:rgba(214,167,46,.18); color:#a16a00; border:1px solid rgba(214,167,46,.45); }
.rate-rate_29 { background:rgba(120,72,168,.18); color:#6b3fb0; border:1px solid rgba(120,72,168,.45); }
.rate-other   { background:rgba(120,120,120,.14); color:#666; }
.badge-clear { display:inline-block; padding:2px 10px; border-radius:999px; font-size:12px; font-weight:700;
  background:rgba(30,142,62,.16); color:#1e8e3e; }

/* ============ 移动端适配（<=768px） ============ */
@media (max-width: 768px) {
  /* 通用移动端基础 */
  .panel { padding: 18px 14px; border-radius: 10px; }
  .panel.wide { max-width: 100%; }
  body { font-size: 14px; }
  h1 { font-size: 22px !important; }
  h3 { font-size: 16px; }
  /* 在线客服：缩小并下移避免遮挡勋章 */
  .cs-widget { right: 12px; bottom: 12px; }
  .cs-fab { padding: 10px 14px; font-size: 13px; }
  /* 内容底部留白，避免客服 FAB 遮挡 */
  .content { padding-bottom: 96px !important; }
  /* 表格：水平滚动 + 手指滑动 */
  table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }
  /* 移动端图例卡片：单列 */
  .medal-legend-cards { display:flex; flex-direction:column; gap:10px; }
  .legend-card { display:flex; align-items:flex-start; gap:10px; padding:10px 12px;
    border:1px solid var(--line); border-radius:10px; background:rgba(201,168,106,.05); }
  .legend-card .lc-emoji { font-size:22px; line-height:1; flex-shrink:0; }
  .legend-card b { display:block; font-size:14px; color:var(--ink); margin-bottom:2px; }
  .legend-card .lc-cat { display:inline-block; font-size:11px; color:var(--gold-deep);
    background:rgba(201,168,106,.18); padding:1px 8px; border-radius:999px; margin-bottom:4px; }
  .legend-card p { margin:0; font-size:12px; color:#666; line-height:1.55; }
  .legend-card.lifetime { background:rgba(246,231,168,.10); border-color:rgba(202,164,74,.4); }
  /* 勋章墙 */
  .medals-strip { gap:20px 12px; padding:14px 4px 8px; }
  .medals-strip.mode-compact { gap:10px 12px; }
  .medal-item { width:calc(50% - 6px); max-width:none; padding-bottom:12px; }
  .medals-strip.mode-compact .medal-item { width:calc(50% - 6px); max-width:none; }
  .medal-coin { width:96px; height:96px; margin:8px auto 22px; }
  .medal-ribbon { top:60px; height:60px; }
  .medal-ribbon.ribbon-l { left:24px; }
  .medal-ribbon.ribbon-r { right:24px; }
  .medal-source { font-size:18px; }
  .medal-face svg { width:28px; height:28px; margin-top:6px; }
  .medal-name { font-size:14px; margin-top:18px; }
  .medal-tag  { font-size:11px; margin-top:5px; letter-spacing:2px; }
  .medal-state { font-size:11px; padding:3px 12px; margin-top:10px; }
  .medal-legend { font-size:11px; line-height:1.6; }
  .medal-progress { font-size:14px; }
  .medal-progress b { font-size:18px; }
  .medal-tip { font-size:12px; padding:0 6px; }
  .lifetime-500w-box { padding:14px 14px; }
  .lifetime-500w-form { flex-direction:column; align-items:stretch; }
  .lifetime-500w-form .btn { width:100%; }
}
@media (max-width: 480px) {
  .medals-strip { gap:18px 8px; }
  .medal-item { width:calc(50% - 4px); padding-bottom:12px; }
  .medals-strip.mode-compact .medal-item { width:calc(50% - 4px); }
  .medal-coin { width:84px; height:84px; margin:6px auto 20px; }
  .medal-ribbon { top:52px; height:54px; width:18px; }
  .medal-ribbon.ribbon-l { left:21px; }
  .medal-ribbon.ribbon-r { right:21px; }
  .medal-source { font-size:15px; }
  .medal-face svg { width:22px; height:22px; margin-top:4px; }
  .medal-name { font-size:13px; margin-top:16px; line-height:1.35; }
  .medal-tag  { font-size:10px; letter-spacing:1px; }
  .medal-state { font-size:11px; padding:3px 10px; }
}
/* ===== 触摸设备点击区域扩大 + 防止 iOS Safari 自动缩放 ===== */
@supports (-webkit-touch-callout: none) {
  .medal-item { -webkit-tap-highlight-color: transparent; }
}

/* ============================================================
   登录页 · 分屏式高级布局（auth_base.html）
   左：品牌叙事（墨蓝渐变 × 香槟金）  右：精致登录卡片
   ============================================================ */
body.auth {
  background: var(--paper);
}

.auth-wrap {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ---------- 左侧品牌区 ---------- */
.auth-brand {
  position: relative;
  flex: 0 0 46%;
  max-width: 620px;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 12% 8%, rgba(201,168,106,.16), transparent 42%),
    linear-gradient(150deg, #0a1424 0%, #0e1c33 48%, #102544 100%);
  color: #fff;
  display: flex;
  align-items: center;
  padding: 56px 64px;
}
.auth-brand::before {
  /* 右侧金线收边 */
  content: "";
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--gold) 40%, var(--gold) 60%, transparent);
  opacity: .55;
}
.auth-brand-glow {
  position: absolute;
  width: 520px; height: 520px;
  right: -180px; bottom: -200px;
  background: radial-gradient(circle, rgba(201,168,106,.22), transparent 65%);
  filter: blur(8px);
  pointer-events: none;
}
.auth-brand-inner {
  position: relative;
  z-index: 1;
  width: 100%;
}
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  text-decoration: none;
}
.auth-logo .mark {
  width: 36px; height: 36px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gold);
  font-size: 17px; font-weight: 700;
}
.auth-slogan {
  margin: 48px 0 18px;
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.32;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
}
.auth-slogan::after {
  content: "";
  display: block;
  width: 56px; height: 3px;
  margin-top: 22px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-deep));
}
.auth-desc {
  max-width: 430px;
  font-size: 14.5px;
  line-height: 1.9;
  color: rgba(255,255,255,.66);
  margin-bottom: 34px;
}
.auth-feats {
  list-style: none;
  padding: 0; margin: 0 0 40px;
  max-width: 430px;
}
.auth-feats li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 14px;
  font-size: 14px;
  color: rgba(255,255,255,.78);
}
.auth-feats .dot {
  position: absolute;
  left: 0; top: 8px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold-deep));
  box-shadow: 0 0 0 3px rgba(201,168,106,.18);
}
.auth-foot {
  font-size: 12.5px;
  color: rgba(255,255,255,.4);
  letter-spacing: .5px;
}

/* ---------- 右侧表单区 ---------- */
.auth-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(201,168,106,.06), transparent 60%),
    var(--paper);
}
.auth-card {
  width: 100%;
  max-width: 380px;
}
.auth-head { margin-bottom: 28px; }
.auth-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--navy);
}
.auth-sub {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* 卡片内的表单沿用 .field，但加宽并加图标 */
.auth-card .flash { margin-bottom: 18px; }
.auth-field { margin-bottom: 18px; }
.auth-field label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.auth-input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 14px;
  transition: border-color .18s, box-shadow .18s;
}
.auth-input:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(201,168,106,.16);
}
.auth-ic {
  width: 19px; height: 19px;
  flex: none;
  color: var(--gold-deep);
  opacity: .85;
}
.auth-input input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 13px 0;
  font-size: 15px;
  color: var(--text);
  font-family: inherit;
}
.auth-input input::placeholder { color: #b3a892; }

.auth-submit {
  width: 100%;
  margin-top: 6px;
  padding: 13px 16px;
  font-size: 15.5px;
  letter-spacing: 4px;
  border-radius: 11px;
}
.auth-row {
  margin-top: 16px;
  text-align: right;
}
.auth-link {
  font-size: 13.5px;
  color: var(--gold-deep);
}
.auth-link:hover { color: var(--gold); text-decoration: underline; }

.auth-home {
  display: inline-block;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
}
.auth-home:hover { color: var(--gold-deep); }

/* ---------- 响应式：窄屏隐藏品牌区，表单居中 ---------- */
@media (max-width: 860px) {
  .auth-brand { display: none; }
  .auth-main { background: var(--paper); }
  .auth-card { max-width: 420px; }
}

/* ==========================================================================
   客户后台 · 移动端适配
   作用域限定：≤768px 且 body.role-customer
   → 桌面端、员工端 / 管理端 / 客服端 一律不受影响
   表格部分为渐进增强：脚本未执行时自动退化为原有的横向滚动，不会更差
   ========================================================================== */
@media (max-width: 768px) {

  /* ---------- 1. 基础排版与留白 ---------- */
  body.role-customer { font-size: 15px; -webkit-text-size-adjust: 100%; }
  body.role-customer h2 { font-size: 19px; margin-bottom: 12px; }
  body.role-customer h3 { font-size: 16px; margin-bottom: 12px; }
  /* 底部留白沿用全局 .content 的 96px（带 !important），此处不重复声明以免互相覆盖 */
  body.role-customer .content { padding: 12px 10px; }
  body.role-customer .panel,
  body.role-customer .panel.wide { max-width: 100%; padding: 16px 14px; border-radius: 10px; }
  body.role-customer .muted,
  body.role-customer .hint-gray { font-size: 13.5px; line-height: 1.75; }
  body.role-customer .flash { font-size: 14px; padding: 12px 14px; line-height: 1.7; }

  /* ---------- 2. 触控目标：主按钮 ≥44px，次按钮 ≥40px ---------- */
  body.role-customer .btn {
    min-height: 44px; padding: 11px 22px; font-size: 15px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  body.role-customer .btn.sm { min-height: 40px; padding: 8px 16px; font-size: 14px; }
  body.role-customer .ptab { min-height: 40px; padding: 8px 16px; display: inline-flex; align-items: center; }
  body.role-customer .top-actions .btn { margin: 0 8px 8px 0; }
  body.role-customer .cs-fab { min-height: 44px; padding: 11px 16px; font-size: 14px; }
  body.role-customer .cs-copy { min-height: 34px; padding: 5px 12px; display: inline-flex; align-items: center; }
  body.role-customer .sidebar { -webkit-tap-highlight-color: transparent; }

  /* ---------- 3. iOS 聚焦防自动缩放：表单字号一律 ≥16px ---------- */
  body.role-customer input,
  body.role-customer select,
  body.role-customer textarea { font-size: 16px; min-height: 46px; padding: 11px 12px; }
  body.role-customer .inp-sm { font-size: 16px; min-height: 40px; }
  body.role-customer .search-bar input[type="text"] { font-size: 16px; min-height: 44px; flex: 1 1 100%; }
  body.role-customer .check { font-size: 15px; padding: 7px 0; }
  body.role-customer .check input[type="checkbox"],
  body.role-customer .check input[type="radio"] { width: 20px; height: 20px; min-height: 0; flex: none; }
  body.role-customer .field { margin-bottom: 18px; }
  body.role-customer .field label { font-size: 13.5px; margin-bottom: 7px; }
  /* 输入框 + 按钮并排时窄屏改为上下堆叠，避免按钮被挤变形 */
  body.role-customer .input-group { flex-wrap: wrap; }
  body.role-customer .input-group input { flex: 1 1 100%; }
  body.role-customer .input-group .btn { width: 100%; }
  body.role-customer .row-form,
  body.role-customer .search-bar { gap: 10px; }

  /* ---------- 4. 抽屉菜单：条目加高到 52px，文字更易点 ---------- */
  body.role-customer .sidebar a,
  body.role-customer .sidebar .nav-parent {
    padding: 0 18px; min-height: 52px; font-size: 15px;
    display: flex; align-items: center; gap: 10px; line-height: 1.45;
  }
  body.role-customer .sidebar .nav-sub a { padding-left: 34px; min-height: 48px; }
  body.role-customer .sidebar .nav-parent .caret { float: none; margin-left: auto; }
  body.role-customer .sidebar .group { padding: 14px 18px 6px; font-size: 12.5px; }

  /* ---------- 5. 顶栏：窄屏压缩，「官网首页」收成图标 ---------- */
  body.role-customer .topbar { padding: 0 10px; gap: 6px; }
  body.role-customer .topbar .menu-toggle { width: 44px; height: 44px; font-size: 24px; margin-left: -8px; }
  body.role-customer .topbar .brand { font-size: 15px; gap: 7px; }
  body.role-customer .topbar .user { gap: 10px; }
  body.role-customer .topbar .user a { min-height: 36px; display: inline-flex; align-items: center; }
  body.role-customer .topbar .user .home-link { font-size: 0; padding: 6px 12px; min-height: 36px; display: inline-flex; align-items: center; }
  body.role-customer .topbar .user .home-link::before { content: '🏠'; font-size: 15px; }

  /* ---------- 6. 统计卡片 / 商城：两列排布，字图不糊 ---------- */
  body.role-customer .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 18px; }
  body.role-customer .card { padding: 14px 12px; }
  body.role-customer .card .label { font-size: 12.5px; }
  body.role-customer .card .value { font-size: 19px; margin-top: 4px; }
  body.role-customer .points-tag { padding: 12px 14px; gap: 8px; }
  body.role-customer .pts-value { font-size: 26px; }
  /* 商品卡：电商网格（去掉卡片内边距，灰色正方形图 + 列表文字） */
  body.role-customer .card.product-card { padding: 0; gap: 6px; }
  body.role-customer .product-title { font-size: 14px; }
  body.role-customer .product-cost b { font-size: 17px; }
  body.role-customer .product-card .btn.sm { align-self: flex-start; min-width: 88px; }
  body.role-customer .code-box { font-size: 14px; word-break: break-all; }

  /* ---------- 7. 表格：卡片视图 / 横滑表格视图 ---------- */
  /* 7.0 先解除全局的 table{display:block;overflow-x:auto;white-space:nowrap} 兜底，
         它会让表格失去列对齐并把长文本撑到极宽。
         数据表交给下面 7.2/7.3 接管；「标签-值」两列表格保持两列自然换行。 */
  body.role-customer table { display: table; white-space: normal; }
  body.role-customer table th,
  body.role-customer table td { white-space: normal; word-break: break-word; }
  body.role-customer table:not(.rtable) th { width: 38%; }

  /* 7.1 视图切换条（仅窄屏出现） */
  body.role-customer .rtable-bar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px; margin: 2px 0 10px;
  }
  body.role-customer .rtable-info { font-size: 12.5px; color: var(--muted); }
  body.role-customer .rtable-toggle {
    min-height: 36px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--gold); background: #fff; color: var(--gold-deep);
    font-size: 13px; font-weight: 600; font-family: inherit; flex: none;
  }
  body.role-customer .rtable-toggle:active { background: rgba(201,168,106,.14); }

  /* 7.2 表格视图：横向滚动，放开 nowrap 让长文本正常换行 */
  body.role-customer .rtable-wrap[data-view="table"] {
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border); border-radius: 12px; background: var(--card);
  }
  body.role-customer .rtable-wrap[data-view="table"] table.rtable {
    display: table; width: 100%; min-width: 620px; border: none; border-radius: 0;
  }
  body.role-customer .rtable-wrap[data-view="table"] table.rtable th,
  body.role-customer .rtable-wrap[data-view="table"] table.rtable td {
    white-space: normal; word-break: break-word; font-size: 14px;
  }

  /* 7.3 卡片视图：每行数据变一张卡片，左侧列名右侧值 */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable {
    display: block; border: none; background: none; border-radius: 0;
  }
  /* 浏览器会自动补 tbody/thead，它们仍是 table-row-group，宽度会收缩到内容宽，
     导致内部 tr 的网格算不出多列 —— 这里强制撑满 */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tbody,
  body.role-customer .rtable-wrap[data-view="card"] table.rtable thead {
    display: block; width: 100%;
  }
  /* 首行是表头（本项目表格无 thead，表头即第一行 tr） */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable thead,
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr:first-child { display: none; }
  /* 网格排布：短字段两两并排，避免 7 个字段各占一行把卡片拉得很长 */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    gap: 1px 6px; background: var(--card); border: 1px solid var(--border);
    border-radius: 10px; margin-bottom: 10px; padding: 6px 4px; overflow: hidden;
    box-shadow: 0 1px 0 rgba(201,168,106,.08);
  }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr.row-red { border-color: rgba(192,57,43,.45); }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr.row-unread { border-left: 3px solid var(--gold); }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr.total-row { border-color: var(--gold); }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    border-bottom: none; padding: 3px 8px; font-size: 14px; text-align: right;
    white-space: normal; word-break: break-word; line-height: 1.45;
    min-width: 0;   /* 允许 grid item 收缩，否则长文本会把网格撑破 */
  }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td::before {
    content: attr(data-label); flex: none; max-width: 44%;
    color: var(--muted); font-size: 12.5px; font-weight: 600; text-align: left; line-height: 1.45;
  }
  /* 含操作按钮的单元格独占整行，按钮才好点 */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td[data-span="full"] {
    grid-column: 1 / -1;
  }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td:empty { display: none; }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable tr:hover td { background: none; }
  /* 卡片里的操作按钮撑满整行，便于点按 */
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td form { flex: 1 1 auto; }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td form .btn { width: 100%; }

  /* ---------- 8. 弹窗：协议签署 / 公司提醒 / 通用提示 ---------- */
  body.role-customer .agree-overlay,
  body.role-customer .remind-overlay { padding: 12px; }
  body.role-customer .agree-modal,
  body.role-customer .remind-modal { width: 100%; max-height: 92vh; border-radius: 14px; }
  body.role-customer .agree-head,
  body.role-customer .remind-head { padding: 14px 16px; font-size: 16px; line-height: 1.45; }
  body.role-customer .agree-box { padding: 14px 16px; font-size: 14px; line-height: 1.85; }
  body.role-customer .agree-sign { padding: 0 14px 12px; }
  body.role-customer .agree-sign-head { font-size: 13.5px; flex-wrap: wrap; gap: 8px; }
  body.role-customer .sig-pad { height: auto; }
  body.role-customer .agree-foot,
  body.role-customer .remind-foot { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  /* 提示语单独占一行置于按钮上方，按钮左右平分 */
  body.role-customer .agree-hint { flex: 1 1 100%; order: -1; font-size: 12.5px; line-height: 1.5; }
  body.role-customer .agree-foot > .btn,
  body.role-customer .agree-foot > form { flex: 1 1 40%; }
  body.role-customer .agree-foot > form .btn { width: 100%; }
  body.role-customer .remind-foot .btn { width: 100%; }
  body.role-customer .remind-list { padding: 8px 14px; }
  body.role-customer .remind-list li { padding: 10px 0; }
  body.role-customer .remind-title { font-size: 15px; }

  /* ---------- 9. 在线客服浮窗 ---------- */
  body.role-customer .cs-panel { width: min(300px, calc(100vw - 24px)); }
  body.role-customer .cs-body { padding: 12px 14px; }
  body.role-customer .cs-qr img { width: 140px; height: 140px; }

  /* ---------- 10. 成就勋章：手机竖屏 2 列 ----------
     桌面基础宽度 160px，而手机可用宽度约 323px，160+22 间距放不下两个，
     会塌成单列长条；这里改成弹性两列，并整体收紧一档 */
  body.role-customer .medals-strip { gap: 18px 10px; padding: 12px 2px 8px; }
  body.role-customer .medals-strip .medal-item {
    flex: 0 0 calc(50% - 5px); width: calc(50% - 5px); max-width: none; padding-bottom: 10px;
  }
  body.role-customer .medal-coin { width: 88px; height: 88px; margin: 6px auto 0; }
  body.role-customer .medal-ribbon { top: 52px; height: 48px; }
  body.role-customer .medal-ribbon.ribbon-l { left: 22px; }
  body.role-customer .medal-ribbon.ribbon-r { right: 22px; }
  /* 勋章面盘内「源」字与图标容易重叠，增加 flex 间隙并整体下移文字 */
  body.role-customer .medal-face { gap: 3px; justify-content: center; padding-top: 2px; }
  body.role-customer .medal-source { font-size: 14px; transform: translateY(1px); }
  body.role-customer .medal-icon { font-size: 18px; }
  body.role-customer .medal-face svg { width: 22px; height: 22px; margin-top: 0; }
  /* 勋章名称/标签/状态整体下移，避免与缎带底部重叠 */
  body.role-customer .medal-name { font-size: 13.5px; margin-top: 26px; line-height: 1.4; }
  body.role-customer .medal-tag { font-size: 10.5px; margin-top: 6px; letter-spacing: 1px; }
  body.role-customer .medal-state { font-size: 11px; padding: 3px 10px; margin-top: 10px; }
  body.role-customer .medal-legend { font-size: 11.5px; line-height: 1.6; margin-top: 6px; }
  /* 缩略模式（概览页）：同样两列，去掉图例更紧凑 */
  body.role-customer .medals-strip.mode-compact { gap: 12px 8px; }
  body.role-customer .medals-strip.mode-compact .medal-item {
    flex: 0 0 calc(50% - 4px); width: calc(50% - 4px); padding-bottom: 0;
  }
  body.role-customer .medals-strip.mode-compact .medal-coin { width: 72px; height: 72px; margin: 4px auto 0; }
  /* 缩略模式缎带上移收短，避免盖住下方勋章名称 */
  body.role-customer .medals-strip.mode-compact .medal-ribbon { top: 44px; height: 40px; width: 16px; }
  body.role-customer .medals-strip.mode-compact .medal-ribbon.ribbon-l { left: 20px; }
  body.role-customer .medals-strip.mode-compact .medal-ribbon.ribbon-r { right: 20px; }
  /* 缩略模式面盘极小（56px 内容区），字/图必须真正居中有间隙，否则挤成一团 */
  body.role-customer .medals-strip.mode-compact .medal-face { gap: 4px; justify-content: center; padding-top: 0; }
  body.role-customer .medals-strip.mode-compact .medal-source { font-size: 11px; transform: none; line-height: 1; }
  body.role-customer .medals-strip.mode-compact .medal-icon { font-size: 14px; }
  body.role-customer .medals-strip.mode-compact .medal-face svg { width: 15px; height: 15px; margin-top: 0; }
  /* 缩略模式的名称下移，避免贴到硬币/缎带底部 */
  body.role-customer .medals-strip.mode-compact .medal-name { font-size: 12.5px; margin-top: 14px; line-height: 1.35; }
}

/* 大屏手机 / 横屏 / 小平板：勋章排 3 列 */
@media (min-width: 521px) and (max-width: 768px) {
  body.role-customer .medals-strip .medal-item,
  body.role-customer .medals-strip.mode-compact .medal-item {
    flex-basis: calc(33.333% - 8px); width: calc(33.333% - 8px);
  }
}

/* 桌面端不显示表格视图切换条 */
@media (min-width: 769px) {
  .rtable-bar { display: none; }
}

/* ---------- 10. 极窄屏（≤380px，如 iPhone SE）再收紧一档 ---------- */
@media (max-width: 380px) {
  body.role-customer .content { padding: 10px 8px; }
  body.role-customer .cards { gap: 10px; }
  body.role-customer .card { padding: 12px 10px; }
  body.role-customer .card.product-card { padding: 0; }
  body.role-customer .card .value { font-size: 17px; }
  body.role-customer .topbar .brand { font-size: 14px; }
  body.role-customer .topbar .brand .mark { width: 24px; height: 24px; font-size: 11px; }
  body.role-customer .topbar .user a[href*="logout"] { font-size: 12.5px; }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td { padding: 2px 6px; font-size: 13.5px; }
  body.role-customer .rtable-wrap[data-view="card"] table.rtable td::before { font-size: 12px; }
}
.cards.mall-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 220px)); }
@media (max-width: 768px) { body.role-customer .cards.mall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 380px) { body.role-customer .cards.mall-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
