:root {
  --bg: #f4f5f1; --panel: #ffffff; --ink: #1d2420; --muted: #6b746e; --line: #e3e6e0;
  --green: #1f6f4a; --green-2: #e6f2eb; --amber: #b7791f; --amber-2: #fbf1dd; --red: #b42318; --red-2: #fdecea;
  --blue: #2457a6; --blue-2: #e8eff9; --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 14px; }
a { color: var(--green); }
button { font: inherit; cursor: pointer; }
.btn { border: 1px solid var(--line); background: #fff; padding: 7px 12px; border-radius: 8px; }
.btn:hover { border-color: #c9cec6; }
.btn.primary { background: var(--green); color: #fff; border-color: var(--green); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 4px 9px; font-size: 12px; }
select, input, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

/* —— 后台布局 —— */
.app { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.side { background: #16201b; color: #cfd8d2; padding: 18px 12px; }
.side .logo { color: #fff; font-weight: 700; font-size: 15px; padding: 4px 10px 18px; line-height: 1.3; }
.side .logo small { display: block; color: #8fa197; font-weight: 400; font-size: 12px; }
.side a { display: block; color: inherit; text-decoration: none; padding: 9px 10px; border-radius: 8px; margin-bottom: 2px; }
.side a.on, .side a:hover { background: #24332b; color: #fff; }
.side .foot { margin-top: 24px; padding: 10px; font-size: 12px; color: #8fa197; }
.main { padding: 22px 28px; max-width: 1280px; }
.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; gap: 12px; }
.top h1 { font-size: 20px; margin: 0; }
.muted { color: var(--muted); }
.grid { display: grid; gap: 14px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .label { color: var(--muted); font-size: 12px; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.two { grid-template-columns: 2fr 1fr; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } .app { grid-template-columns: 1fr; } .side { display: none; } }
h3 { font-size: 14px; margin: 0 0 12px; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; background: #eef0ec; white-space: nowrap; }
.pill.confirmed { background: var(--blue-2); color: var(--blue); }
.pill.completed { background: var(--green-2); color: var(--green); }
.pill.no_show, .pill.cancelled { background: var(--red-2); color: var(--red); }
.pill.pending_payment { background: var(--amber-2); color: var(--amber); }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.bars .bar { width: 100%; background: var(--green); border-radius: 4px 4px 0 0; min-height: 2px; }
.bars .x { font-size: 10px; color: var(--muted); }
.bars .v { font-size: 10px; color: var(--muted); }
.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.lang-toggle { display: flex; gap: 4px; }
.lang-toggle button { border: 1px solid var(--line); background: #fff; padding: 4px 9px; border-radius: 6px; font-size: 12px; }
.lang-toggle button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* —— 教练端（手机） —— */
.mobile { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); }
.mhead { background: var(--green); color: #fff; padding: 14px 16px; position: sticky; top: 0; z-index: 2; }
.mhead .row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mhead select { background: rgba(255,255,255,.15); color: #fff; border-color: rgba(255,255,255,.3); }
.mhead select option { color: #000; }
.tabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 2; }
.tabs button { flex: 1; border: 0; background: none; padding: 12px; border-bottom: 2px solid transparent; color: var(--muted); }
.tabs button.on { color: var(--green); border-bottom-color: var(--green); font-weight: 600; }
.mbody { padding: 12px; }
.lesson { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 10px; }
.lesson .t { font-weight: 700; font-size: 16px; }
.lesson .who { margin: 4px 0; }
.lesson .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lesson textarea { width: 100%; margin-top: 8px; min-height: 54px; }
.datebar { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
.datebar button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; white-space: nowrap; }
.datebar button.on { background: var(--green); color: #fff; border-color: var(--green); }
.thread { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 8px; cursor: pointer; }
.chat { display: flex; flex-direction: column; height: calc(100vh - 110px); }
.chat .log { flex: 1; overflow-y: auto; padding: 12px; background: #ece5dd; }
.chat .compose { display: flex; gap: 8px; padding: 10px; background: #fff; border-top: 1px solid var(--line); }
.chat .compose input { flex: 1; }
.msg { max-width: 82%; padding: 8px 10px; border-radius: 8px; margin-bottom: 8px; background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.06); white-space: pre-wrap; word-wrap: break-word; }
.msg.me { margin-left: auto; background: #d9fdd3; }
.msg .orig { font-size: 12px; color: var(--muted); border-top: 1px dashed #c8cfc9; margin-top: 6px; padding-top: 4px; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; text-align: right; }

/* —— 模拟器 —— */
.simwrap { display: flex; gap: 28px; justify-content: center; padding: 24px; flex-wrap: wrap; }
.phone { width: 360px; height: 720px; background: #111; border-radius: 36px; padding: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.screen { background: #ece5dd; height: 100%; border-radius: 26px; overflow: hidden; display: flex; flex-direction: column; }
.wa-head { background: #075e54; color: #fff; padding: 12px 14px; display: flex; align-items: center; gap: 10px; }
.wa-head .av { width: 34px; height: 34px; border-radius: 50%; background: #25d366; display: grid; place-items: center; font-weight: 700; }
.wa-head .nm { font-weight: 600; } .wa-head .st { font-size: 11px; opacity: .8; }
.wa-log { flex: 1; overflow-y: auto; padding: 10px; }
.wa-log .msg { font-size: 13.5px; }
.wa-btns { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.wa-btns button { background: #fff; border: 0; border-top: 1px solid #eee; color: #027eb5; padding: 8px; border-radius: 6px; }
.wa-list { background: #fff; border-radius: 8px; margin-top: 6px; overflow: hidden; }
.wa-list button { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid #f0f0f0; background: #fff; padding: 8px 10px; }
.wa-list button small { display: block; color: var(--muted); font-size: 11px; }
.wa-list .lh { padding: 7px 10px; color: #027eb5; font-weight: 600; text-align: center; }
.wa-compose { display: flex; gap: 6px; padding: 8px; background: #f0f0f0; }
.wa-compose input { flex: 1; border-radius: 18px; border: 0; padding: 9px 12px; }
.wa-compose button { border: 0; background: #075e54; color: #fff; border-radius: 50%; width: 38px; height: 38px; }
.simbar { display: flex; gap: 10px; justify-content: center; align-items: center; padding: 16px 16px 0; flex-wrap: wrap; }
.simbar .info { font-size: 12px; color: var(--muted); }
.phone-label { text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 8px; }

/* —— 支付页 —— */
.paypage { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.paypage .card { max-width: 380px; width: 100%; text-align: center; }
.paypage .amt { font-size: 30px; font-weight: 700; }
.paypage label { display: block; text-align: left; margin: 14px 0; }
.paypage select { width: 100%; margin-top: 6px; }
.paypage .btn { width: 100%; padding: 12px; }
.paypage .badge { display: inline-block; background: var(--amber-2); color: var(--amber); font-size: 11px; padding: 3px 8px; border-radius: 99px; }
.paypage .ok { color: var(--green); font-weight: 600; }

/* —— 打位看板 —— */
.board { overflow-x: auto; padding-right: 14px; }
.brow { display: flex; align-items: stretch; min-width: 760px; }
.blabel { width: 64px; flex: none; font-size: 12px; color: var(--muted); display: flex; align-items: center; }
.btrack { position: relative; flex: 1; height: 46px; border-bottom: 1px solid var(--line); }
.bhead .btrack { height: 20px; border: 0; }
.bhead .btrack span { position: absolute; transform: translateX(-50%); font-size: 11px; color: var(--muted); }
.btrack i { position: absolute; top: 0; bottom: 0; border-left: 1px dashed #eceee9; }
.bnow { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--red); z-index: 2; }
.bblock { position: absolute; top: 5px; bottom: 5px; border-radius: 6px; padding: 3px 6px; font-size: 11px; overflow: hidden; white-space: nowrap; background: var(--blue-2); color: var(--blue); border-left: 3px solid var(--blue); line-height: 1.3; }
.bblock b, .bblock span { display: block; overflow: hidden; text-overflow: ellipsis; }
.bblock span { opacity: .8; }
.bblock.completed { background: var(--green-2); color: var(--green); border-left-color: var(--green); }
.bblock.no_show { background: var(--red-2); color: var(--red); border-left-color: var(--red); }
.bblock.pending_payment { background: var(--amber-2); color: var(--amber); border-left-color: var(--amber); }

/* —— 表单 —— */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 14px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
.form input, .form select { color: var(--ink); }

/* —— 手机端顶部导航 —— */
.mnav { display: none; gap: 6px; overflow-x: auto; margin: -6px 0 14px; padding-bottom: 4px; }
.mnav a { white-space: nowrap; padding: 6px 10px; border-radius: 99px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; }
.mnav a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
@media (max-width: 1000px) { .mnav { display: flex; } .main { padding: 16px; } }

/* —— 推广海报 —— */
.poster { width: 380px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 28px; text-align: center; margin-top: 10px; }
.poster .pname { font-size: 20px; font-weight: 800; }
.poster .ptag { color: var(--green); margin-top: 6px; font-size: 13px; }
.poster .pqr { width: 240px; margin: 18px auto; }
.poster .pqr svg { width: 100%; height: auto; display: block; }
.poster ol { text-align: left; margin: 0 auto; width: 250px; padding-left: 20px; line-height: 1.9; }
.poster .pnum { font-size: 18px; font-weight: 700; margin-top: 12px; letter-spacing: 1px; }
.poster .plangs { color: var(--muted); font-size: 12px; margin-top: 4px; }
@media print { .side, .mnav, .top .btn, .lang-toggle, .main > div > p { display: none !important; } .app { display: block; } .poster { border: 0; margin: 0 auto; } }

/* —— 模拟器补充 —— */
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 8px 0; background: #f0f0f0; }
.chips button { border: 1px solid #d5d8d3; background: #fff; border-radius: 99px; padding: 4px 9px; font-size: 11.5px; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips .lbl { font-size: 11px; color: var(--muted); width: 100%; }
