/* ===========================================================
   私教工作台样式
   =========================================================== */
:root {
  --paper: #f4f7f8;
  --card: #ffffff;
  --ink: #16232b;
  --ink2: #33424c;
  --muted: #5f6f79;
  --faint: #8c9aa3;
  --line: #e3e9ec;
  --line2: #cbd5da;
  --accent: #16afd0;
  --accent-deep: #0b7f97;
  --teal: #0b7f97;
  --teal2: #0b7f97;
  --teal-soft: #e4f6fb;
  --gold: #a87a1e;
  --gold-soft: #f8f0de;
  --rose: #b4575f;
  --rose-soft: #f8eaeb;
  --green: #2f7d5b;
  --green-soft: #e7f3ed;
  --r: 12px;
  --shadow: 0 1px 2px rgba(22,35,43,.04), 0 10px 30px -18px rgba(22,35,43,.35);
  --sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Songti SC", "Noto Serif CJK SC", Georgia, serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 14px; line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--teal2); text-decoration: none; }
h1,h2,h3,h4 { margin: 0; font-weight: 650; }
p { margin: 0; }
ul, ol { margin: 0; padding-left: 1.1em; }
small { font-size: 11.5px; color: var(--faint); }

/* ---------- 顶栏 ---------- */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(244,247,248,.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.appbar-in {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  height: 62px; display: flex; align-items: center; gap: 26px;
}
.logo { display: flex; align-items: center; gap: 10px; color: inherit; }
.logo-mark {
  width: 32px; height: 32px; border-radius: 9px; background: var(--teal);
  display: grid; place-items: center;
}
.logo-mark svg { width: 19px; height: 19px; }
.logo-txt b { display: block; font-family: var(--serif); font-size: 15.5px; letter-spacing: .04em; line-height: 1.2; }
.logo-txt i { display: block; font-style: normal; font-size: 9px; letter-spacing: .18em; color: var(--faint); }

.tabs { display: flex; gap: 2px; }
.tab {
  border: 0; background: transparent; padding: 9px 15px; border-radius: 8px;
  cursor: pointer; color: var(--ink2); font-size: 15.5px; font-weight: 600; white-space: nowrap;
  display: flex; align-items: center; gap: 6px;
}
.tab:hover { background: rgba(11,127,151,.08); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--accent); color: #ffffff; font-weight: 600; }
.tab-num { font-size: 11.5px; opacity: .7; font-family: var(--mono); }
.appbar-right { margin-left: auto; display: flex; gap: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 14px; border-radius: 9px; cursor: pointer;
  border: 1px solid var(--line2); background: var(--card); color: var(--ink2);
  font-size: 13px; line-height: 1; transition: all .16s ease; white-space: nowrap;
}
.btn:hover { border-color: var(--teal2); color: var(--teal); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: #ffffff; }
.btn.primary:hover { background: var(--teal2); border-color: var(--teal2); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: rgba(11,127,151,.07); color: var(--teal); }
.btn.sm { padding: 7px 11px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.danger:hover { border-color: var(--rose); color: var(--rose); }

/* ---------- 布局 ---------- */
.app { max-width: 1440px; margin: 0 auto; padding: 22px 24px 80px; }
.panel[hidden] { display: none; }
.two-col { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 22px; align-items: start; }
.plan-grid { display: grid; grid-template-columns: 300px minmax(0,1fr); gap: 22px; align-items: start; }
.report-grid { display: grid; grid-template-columns: 320px minmax(0,1fr); gap: 22px; align-items: start; }

.col-list, .planner-form, .report-form {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px; position: sticky; top: 84px;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.col-head h2 { font-family: var(--serif); font-size: 20px; }
.hint { font-size: 11.5px; color: var(--faint); line-height: 1.6; margin-top: 12px; }
.backup-row { display: flex; gap: 14px; margin-top: 12px; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--teal2); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkbtn:hover { color: var(--teal); }

/* ---------- 会员列表 ---------- */
.client-list { display: grid; gap: 8px; }
.client-card {
  text-align: left; width: 100%; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper);
  padding: 11px 12px; display: grid; gap: 3px;
  transition: all .15s ease;
}
.client-card:hover { border-color: var(--line2); background: var(--card); }
.client-card.on { border-color: var(--teal2); background: var(--teal-soft); }
.client-card .c-top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.client-card .c-name { font-weight: 650; font-size: 14px; }
.client-card .c-goal { font-size: 10.5px; color: var(--teal); background: var(--teal-soft); border-radius: 4px; padding: 1px 6px; }
.client-card.on .c-goal { background: #fff; }
.client-card .c-sub { font-size: 11.5px; color: var(--faint); }

/* ---------- 会员详情 ---------- */
.empty-state {
  border: 1px dashed var(--line2); border-radius: var(--r);
  padding: 60px 20px; text-align: center; color: var(--muted);
  background: rgba(255,255,255,.55);
}
.empty-state .es-icon { font-size: 26px; color: var(--gold); margin-bottom: 8px; }
.empty-state h3 { font-family: var(--serif); font-size: 19px; margin-bottom: 6px; color: var(--ink); }
.empty-state p { font-size: 13px; margin-bottom: 16px; }

.card-block { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 14px; }
.card-block h3 { font-size: 15px; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.card-block h3 .badge { font-size: 10px; letter-spacing: .1em; color: var(--gold); font-weight: 600; }

.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 18px; font-size: 13px; }
.profile-grid .k { font-size: 11px; color: var(--faint); letter-spacing: .06em; }
.profile-grid .v { color: var(--ink2); }

.tag-list { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: var(--teal-soft); color: var(--teal); }
.tag.warn { background: var(--rose-soft); color: var(--rose); }
.tag.gray { background: #edf2f4; color: var(--muted); }
.tag.gold { background: var(--gold-soft); color: #8a6416; }

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 12px; }
.field .lbl { display: block; font-size: 11px; letter-spacing: .1em; color: var(--faint); text-transform: uppercase; margin-bottom: 5px; }
.field select, .field input, .field textarea, .search-box input, .modal-head input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; padding: 8px 10px; font-size: 13px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field select:focus, .field input:focus, .field textarea:focus {
  border-color: var(--teal2); box-shadow: 0 0 0 3px rgba(22,175,208,.14);
}
.field textarea { resize: vertical; line-height: 1.6; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--ink2);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; cursor: pointer;
  transition: all .14s ease;
}
.chip:hover { border-color: var(--line2); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip.warn.on { background: var(--rose); border-color: var(--rose); }
.chip.gold.on { background: var(--gold); border-color: var(--gold); color: #fff; }

/* ---------- 排课 ---------- */
.plan-body { display: grid; gap: 14px; }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.eyebrow { font-size: 10px; letter-spacing: .2em; color: var(--gold); font-weight: 600; }
.plan-head h2 { font-family: var(--serif); font-size: 24px; margin: 4px 0 4px; }
.plan-meta { font-size: 12.5px; color: var(--muted); }
.plan-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.block {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.block-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f7fafb, #ffffff);
}
.block-head .b-zh { font-weight: 650; font-size: 14px; }
.block-head .b-en { font-size: 9.5px; letter-spacing: .16em; color: var(--faint); text-transform: uppercase; }
.block-head .b-time { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--teal); }
.block-head .b-tip { font-size: 11px; color: var(--faint); }
.block-rows { display: grid; }

.ex-row {
  display: grid; grid-template-columns: 26px minmax(0,1fr) 236px 92px;
  gap: 10px; align-items: center;
  padding: 10px 16px; border-bottom: 1px dashed var(--line);
}
.ex-row:last-child { border-bottom: none; }
.ex-row:hover { background: rgba(11,127,151,.035); }
.ex-idx { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.ex-main { min-width: 0; }
.ex-name { font-weight: 650; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ex-name .src { font-size: 9px; letter-spacing: .08em; padding: 1px 5px; border-radius: 3px; }
.src.pilates { background: var(--teal-soft); color: var(--teal); }
.src.strength { background: var(--gold-soft); color: #8a6416; }
.ex-sub { font-size: 11px; color: var(--faint); margin-top: 1px; }
.ex-why { font-size: 11px; color: var(--teal); margin-top: 3px; }
.ex-dose { display: flex; gap: 4px; }
.ex-dose input {
  flex: 1 1 0; width: auto; min-width: 0; border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 4px; font-size: 11.5px; text-align: center; background: #fff;
}
.ex-dose input[data-f="load"] { flex: 2.2 1 0; text-align: left; }
.ex-dose input:focus { outline: none; border-color: var(--teal2); }
.ex-tools { display: flex; gap: 2px; justify-content: flex-end; }
.ex-row .icon-btn { width: 21px; height: 21px; font-size: 11px; }
.icon-btn {
  width: 24px; height: 24px; border-radius: 6px; border: 1px solid transparent;
  background: transparent; color: var(--faint); cursor: pointer; line-height: 1;
  display: grid; place-items: center; font-size: 12px;
}
.icon-btn:hover { background: #fff; border-color: var(--line); color: var(--ink); }

.plan-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: 12px; color: var(--muted); }

/* ---------- 动作库 ---------- */
.lib-bar {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px; display: grid; gap: 10px; margin-bottom: 12px;
}
.search-box { position: relative; }
.search-box input { padding-left: 32px; }
.s-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; fill: none; stroke: var(--faint); stroke-width: 2; }
.lib-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font-size: 12px; color: var(--faint); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(265px, 1fr)); gap: 10px; }
.lib-card {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; cursor: pointer; display: grid; gap: 5px;
  transition: all .16s ease; text-align: left; width: 100%;
}
.lib-card:hover { border-color: var(--line2); transform: translateY(-1px); box-shadow: var(--shadow); }
.lib-card .l-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.lib-card .l-name { font-weight: 650; font-size: 14px; }
.lib-card .l-en { font-size: 9.5px; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; display: block; }
.lib-card .l-desc { font-size: 11.5px; color: var(--muted); line-height: 1.55; }
.lib-card .l-foot { display: flex; gap: 4px; flex-wrap: wrap; }
.lvl { font-size: 10px; padding: 1px 6px; border-radius: 4px; background: #e4f6fb; color: #0b7f97; white-space: nowrap; }
.lvl.初级, .lvl.基础 { background: #e4f6fb; color: #0b7f97; }
.lvl.中级 { background: #c9edf7; color: #0b7f97; }
.lvl.高级, .lvl.进阶 { background: var(--accent); color: #fff; }

/* ---------- 抽屉 / 弹窗 ---------- */
.drawer-wrap, .modal-wrap { position: fixed; inset: 0; z-index: 80; }
.drawer-mask, .modal-mask { position: absolute; inset: 0; background: rgba(22,35,43,.38); }
.drawer {
  position: absolute; top: 0; right: 0; height: 100%; width: min(480px, 92vw);
  background: var(--card); box-shadow: -20px 0 60px -30px rgba(0,0,0,.4);
  overflow-y: auto; padding: 22px 24px 40px;
  animation: slide .24s ease;
}
@keyframes slide { from { transform: translateX(26px); opacity: .4 } to { transform: none; opacity: 1 } }
.drawer-close { position: absolute; top: 14px; right: 16px; border: 1px solid var(--line); background: var(--paper); width: 30px; height: 30px; border-radius: 8px; cursor: pointer; color: var(--muted); }
.drawer h2 { font-family: var(--serif); font-size: 21px; margin-right: 40px; }
.drawer .en { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 14px; }
.drawer h4 { font-size: 11px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; margin: 16px 0 5px; }
.drawer p, .drawer li { font-size: 12.5px; color: var(--ink2); }
.drawer ul { margin-bottom: 3px; }
.drawer .meta { display: grid; grid-template-columns: 68px 1fr; gap: 4px 10px; font-size: 12.5px; }
.drawer .meta dt { color: var(--faint); font-size: 11.5px; }
.drawer .meta dd { margin: 0; }

.modal {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(680px, 94vw); max-height: 82vh; background: var(--card);
  border-radius: 14px; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 30px 80px -30px rgba(0,0,0,.45);
}
.modal-head { display: flex; gap: 10px; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 15px; white-space: nowrap; }
.modal-head input { flex: 1; }
.modal-body { overflow-y: auto; padding: 8px; }
.pick-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.pick-item:hover { background: var(--teal-soft); }
.pick-item .p-name { font-size: 13px; font-weight: 600; }
.pick-item .p-sub { font-size: 11px; color: var(--faint); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 12.5px; z-index: 120; box-shadow: var(--shadow);
}

/* ---------- 周报 ---------- */
.report-preview { min-height: 300px; }
.report-sheet {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 30px 34px; max-width: 780px; margin: 0 auto;
  box-shadow: var(--shadow);
}
.rs-top { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--ink); padding-bottom: 10px; margin-bottom: 18px; }
.rs-brand { font-size: 10px; letter-spacing: .2em; color: var(--faint); }
.rs-title { font-family: var(--serif); font-size: 26px; letter-spacing: .04em; }
.rs-sub { font-size: 10px; letter-spacing: .22em; color: var(--faint); text-align: right; }
.rs-client { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.rs-client .n { font-size: 20px; font-weight: 650; }
.rs-client .w { font-size: 11.5px; color: var(--faint); font-family: var(--mono); }
.rs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.rs-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: #f7fafb; }
.rs-kpi .k { font-size: 10.5px; letter-spacing: .1em; color: var(--faint); }
.rs-kpi .v { font-family: var(--serif); font-size: 26px; color: var(--teal); line-height: 1.25; }
.rs-kpi .v small { font-family: var(--sans); font-size: 11px; color: var(--faint); }
.rs-kpi .d { font-size: 11px; color: var(--muted); }
.rs-sec { margin-bottom: 14px; }
.rs-sec h4 { font-size: 11px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; margin-bottom: 6px; }
.rs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.rs-table th { text-align: left; font-size: 10px; letter-spacing: .08em; color: var(--faint); font-weight: 600; padding: 5px 8px; border-bottom: 1px solid var(--line); }
.rs-table td { padding: 6px 8px; border-bottom: 1px dashed var(--line); color: var(--ink2); }
.rs-bar { display: flex; gap: 3px; margin-top: 4px; }
.rs-bar i { height: 6px; border-radius: 3px; background: var(--teal); opacity: .75; min-width: 3px; }
.inp-sm { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; background: #fff; }
.rs-keyword { display: flex; gap: 16px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #f7fafb; }
.rs-keyword .kw-en { font-family: var(--serif); font-size: 20px; color: var(--gold); line-height: 1.2; }
.rs-keyword .kw-zh { font-size: 15px; font-weight: 650; }
.rs-quote { font-size: 12.5px; color: var(--ink2); line-height: 1.8; white-space: pre-wrap; }
.rs-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 10px; letter-spacing: .16em; color: var(--faint); }

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .two-col, .plan-grid, .report-grid { grid-template-columns: 1fr; }
  .col-list, .planner-form, .report-form { position: static; max-height: none; }
  .plan-grid .planner-form { order: 2; }
  .appbar-in { gap: 12px; padding: 0 14px; height: auto; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .appbar-right { margin-left: auto; }
}
@media (max-width: 720px) {
  .app { padding: 14px 12px 60px; }
  .ex-row { grid-template-columns: 22px minmax(0,1fr); grid-template-areas: "i m" ". d" ". t"; }
  .ex-row .ex-idx { grid-area: i; }
  .ex-row .ex-main { grid-area: m; }
  .ex-row .ex-dose { grid-area: d; margin-top: 6px; }
  .ex-row .ex-tools { grid-area: t; justify-content: flex-end; }
  .rs-grid { grid-template-columns: 1fr; }
  .report-sheet { padding: 20px 18px; }
  .logo-txt i { display: none; }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .appbar, .planner-form, .report-form, .col-list, .plan-actions, .lib-bar, .drawer-wrap, .modal-wrap, .toast,
  .ex-tools, .icon-btn, .backup-row { display: none !important; }
  .app { padding: 0; max-width: none; }
  .report-grid, .plan-grid { display: block; }
  .report-sheet { border: none; box-shadow: none; max-width: 190mm; width: 190mm; margin: 0 auto; padding: 0; }
  .plan-output { max-width: 190mm; margin: 0 auto; }
  .panel[hidden] { display: none !important; }
  .block { break-inside: avoid; }
  .ex-row { grid-template-columns: 26px minmax(0,1fr) 240px !important; grid-template-areas: none !important; gap: 12px; }
  .ex-row .ex-idx, .ex-row .ex-main, .ex-row .ex-dose, .ex-row .ex-tools { grid-area: auto !important; margin: 0 !important; }
  .ex-dose { gap: 5px; }
  .ex-dose input { border-color: #cbd5da; padding: 4px 6px; }
  @page { size: A4; margin: 12mm; }
}

/* ===========================================================
   学员主页（递给会员看，深色）
   =========================================================== */
.member-app {
  position: fixed; inset: 0; z-index: 100; margin: 0 auto;
  max-width: 460px; display: flex; flex-direction: column;
  background: #0e1318; color: #e3e9ec;
  box-shadow: 0 0 120px rgba(0,0,0,.7);
}
.member-app[hidden] { display: none; }
body.member-open::before {
  content: ""; position: fixed; inset: 0; z-index: 99;
  background: rgba(8, 12, 16, .62); backdrop-filter: blur(2px);
}
.mA-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.mA-icon { width: 34px; height: 34px; border-radius: 10px; border: 1px solid #16232b; background: #16232b; color: #cbd5da; cursor: pointer; font-size: 13px; }
.mA-title b { display: block; font-size: 16px; letter-spacing: .02em; }
.mA-title span { font-size: 11px; color: #8c9aa3; }
.mA-ghost { margin-left: auto; border: 1px solid #16232b; background: #16232b; color: #8c9aa3; border-radius: 10px; width: 34px; height: 34px; cursor: pointer; }
.mA-scroll { flex: 1; overflow-y: auto; padding: 6px 16px 26px; }
.mA-nav {
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: #0a0e12; border-top: 1px solid #16232b;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom));
}
.mA-nav button { background: none; border: 0; color: #7e8c96; display: grid; gap: 2px; justify-items: center; font-size: 10px; padding: 6px 0; cursor: pointer; }
.mA-nav button.on { color: #f2a03d; }
.mA-nav i { font-style: normal; font-size: 15px; line-height: 1; }

.ma-h1row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ma-pill { font-size: 11px; padding: 3px 9px; border-radius: 999px; background: #16232b; color: #a3b1b9; white-space: nowrap; }
.ma-pill.on { background: #2a2114; color: #f7c169; }
.ma-eyebrow { font-size: 10px; letter-spacing: .2em; color: #8c9aa3; }
.ma-h1 { font-family: var(--serif); font-size: 23px; font-weight: 600; margin: 4px 0 6px; letter-spacing: .02em; }
.ma-sub { font-size: 12.5px; color: #8c9aa3; line-height: 1.7; }
.ma-cta {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  margin: 14px 0 10px; padding: 16px 18px; border-radius: 12px; border: 0;
  background: linear-gradient(135deg, #f7c169, #f2a03d); color: #20160a;
  font-size: 16px; font-weight: 650; cursor: pointer;
}
.ma-cta:hover { filter: brightness(1.04); }
.ma-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ma-btn { padding: 20px 10px; border-radius: 12px; background: #16232b; border: 1px solid #16232b; color: #e3e9ec; font-size: 13.5px; cursor: pointer; }
.ma-btn:hover { border-color: #33424c; }
.ma-card { background: #16232b; border: 1px solid #16232b; border-radius: 12px; padding: 14px 16px; }
.ma-h2 { font-size: 14px; margin: 20px 0 9px; display: flex; justify-content: space-between; align-items: baseline; }
.ma-h2 span { font-size: 11px; color: #8c9aa3; font-weight: 400; }
.ma-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ma-photo { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #16232b; }
.ma-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ma-photo .d { position: absolute; left: 6px; bottom: 5px; font-size: 9px; color: #fff; text-shadow: 0 1px 3px #000; }
.ma-photo .x { position: absolute; right: 4px; top: 4px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 9px; cursor: pointer; }
.ma-add { aspect-ratio: 1; border: 1px dashed #33424c; border-radius: 8px; background: transparent; color: #7e8c96; font-size: 20px; cursor: pointer; }
.ma-add:hover { border-color: #f2a03d; color: #f2a03d; }
.ma-row { display: flex; justify-content: space-between; align-items: center; padding: 11px 0; border-bottom: 1px solid #16232b; font-size: 13px; }
.ma-row:last-child { border-bottom: 0; }
.ma-row .m { color: #8c9aa3; font-size: 11.5px; }
.ma-kpi { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ma-kpi .ma-card { padding: 12px 14px; }
.ma-kpi .v { font-family: var(--serif); font-size: 23px; color: #f2a03d; line-height: 1.3; }
.ma-kpi .k { font-size: 10.5px; color: #8c9aa3; }
.ma-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.ma-tag { font-size: 11px; padding: 2px 8px; border-radius: 5px; background: #16232b; color: #a3b1b9; }
.ma-tag.warn { background: #3a2226; color: #d98e95; }
.ma-label { display: block; font-size: 11px; color: #8c9aa3; margin: 10px 0 4px; }
.ma-input { width: 100%; background: #0f151a; border: 1px solid #16232b; color: #e3e9ec; border-radius: 8px; padding: 9px 10px; font-size: 13px; }
.ma-save { width: 100%; margin-top: 12px; padding: 12px; border-radius: 10px; border: 0; background: #f2a03d; color: #1c1305; font-weight: 650; cursor: pointer; }
.ma-foot { text-align: center; font-size: 9.5px; letter-spacing: .18em; color: #5f6f79; margin-top: 24px; }

/* ===========================================================
   P0：首页 Hub / 动作库 2.0 / 全局搜索 / 相册
   =========================================================== */
.gsearch { position: relative; width: 210px; }
.gsearch input {
  width: 100%; padding: 8px 10px 8px 30px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); font-size: 12.5px; outline: none;
}
.gsearch input:focus { border-color: var(--teal2); box-shadow: 0 0 0 3px rgba(22,175,208,.14); }
.gs-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; fill: none; stroke: var(--faint); stroke-width: 2; }
.gs-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 320px; max-height: 60vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 60;
}
.gs-results[hidden] { display: none; }
.gs-hit { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 12.5px; }
.gs-hit:hover { background: var(--teal-soft); }
.gs-hit .t { font-size: 9px; color: var(--faint); letter-spacing: .08em; }

/* 首页 */
.hub { max-width: 1120px; margin: 0 auto; }
.hub-hero { padding: 8px 0 20px; }
.hub-hero h1 { font-family: var(--serif); font-size: 30px; margin: 6px 0 10px; letter-spacing: .02em; }
.hub-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.hub-stats .chip { background: var(--card); }
.hub-grid { display: grid; grid-template-columns: 1.65fr 1fr; gap: 14px; align-items: start; }
.hub-col { display: grid; gap: 14px; align-content: start; }
.hub-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; min-width: 0; }
.hub-card.span2 { grid-column: span 2; }
.hub-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.hub-head h3 { font-size: 15px; }
.hub-more { font-size: 11px; color: var(--faint); }
.hub-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hub-act {
  display: grid; gap: 4px; justify-items: center; padding: 14px 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; font-size: 12px; color: var(--ink2);
}
.hub-act:hover { border-color: var(--teal2); color: var(--teal); background: var(--teal-soft); }
.hub-act i { font-style: normal; font-size: 17px; color: var(--teal); }
.sys-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.sys-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px 10px; background: var(--paper); cursor: pointer; text-align: left; }
.sys-card:hover { border-color: var(--teal2); background: var(--teal-soft); }
.sys-card b { display: block; font-size: 13px; }
.sys-card span { font-size: 10.5px; color: var(--faint); }
.sys-card .n { font-family: var(--mono); font-size: 15px; color: var(--teal); display: block; margin-top: 4px; }
.hub-clients { display: grid; gap: 6px; }
.hub-clients .hc { display: flex; justify-content: space-between; gap: 8px; padding: 7px 8px; border-radius: 8px; cursor: pointer; font-size: 12.5px; }
.hub-clients .hc:hover { background: var(--teal-soft); }
.hub-clients .hc .d { color: var(--faint); font-size: 11px; }
.hub-empty { font-size: 12.5px; color: var(--faint); padding: 10px 2px; }
.today-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.today-row:last-child { border-bottom: 0; }
.today-row .who { font-weight: 650; font-size: 13.5px; }
.today-row .what { font-size: 11.5px; color: var(--faint); }
.today-row .go { font-size: 12px; }

/* 动作库 2.0 */
.lib-layout { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: 18px; align-items: start; }
.lib-side { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; }
.lib-side-title { font-size: 11px; letter-spacing: .18em; color: var(--faint); margin: 16px 0 7px; }
.sys-list { display: grid; gap: 4px; }
.sys-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 9px 11px; border-radius: 8px; cursor: pointer; font-size: 15px; font-weight: 600; border: 1px solid transparent; background: transparent; color: var(--ink); text-align: left; }
.sys-item:hover { background: var(--paper); }
.sys-item.on { background: var(--accent); color: #fff; }
.sys-item.on .n { color: rgba(255,255,255,.8); }
.sys-item .n { font-family: var(--mono); font-size: 12.5px; font-weight: 400; opacity: .7; }
.cat-list { display: grid; gap: 2px; }
.cat-item { display: flex; justify-content: space-between; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 14.5px; font-weight: 500; color: var(--ink2); background: transparent; border: 0; text-align: left; }
.cat-item:hover { background: var(--paper); color: var(--ink); }
.cat-item.on { background: #e4f6fb; color: #0b7f97; font-weight: 700; }
.cat-item .n { font-family: var(--mono); font-size: 11.5px; font-weight: 400; opacity: .6; }
.lib-top {
  display: grid; gap: 10px; align-items: center; margin-bottom: 10px;
  grid-template-columns: 210px minmax(0, 1fr) auto;
  grid-template-areas: "search equip tools" "level level level";
}
.lib-top .search-box { grid-area: search; width: 210px; }
.lib-top #libEquip { grid-area: equip; }
.lib-top #libLevel { grid-area: level; margin-top: 0; }
.lib-top .lib-tools { grid-area: tools; }
.lib-main { padding-bottom: 96px; }
.lib-grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 10px; }
.ex-card2 {
  position: relative; text-align: left; border: 1px solid var(--line); border-radius: 12px;
  background: var(--card); padding: 0; overflow: hidden; cursor: pointer; font-family: inherit; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.ex-card2:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line2); }
.ex-card2.sel { border-color: var(--teal2); box-shadow: 0 0 0 2px rgba(22,175,208,.2); }
.ex-card2 .pic { background: #f7fafb; border-bottom: 1px solid var(--line); padding: 6px 8px 0; }
.ex-card2 .pic svg { width: 100%; height: auto; display: block; }
.ex-card2 .body { padding: 9px 11px 11px; }
.ex-card2 .nm { font-weight: 650; font-size: 13.5px; line-height: 1.35; }
.ex-card2 .en { font-size: 9px; letter-spacing: .08em; color: var(--faint); text-transform: uppercase; display: block; margin-top: 1px; }
.ex-card2 .tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.ex-card2 .chk {
  position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--line2); background: #fff; display: grid; place-items: center; font-size: 11px; color: transparent;
}
.ex-card2.sel .chk { background: var(--teal); border-color: var(--teal); color: #fff; }
.sel-bar {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 70;
  display: flex; align-items: center; gap: 10px;
  background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 999px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,.5); font-size: 13px;
}
.sel-bar[hidden] { display: none; }
.sel-bar .btn { border-color: rgba(255,255,255,.2); background: transparent; color: #fff; }
.sel-bar .btn.primary { background: var(--gold); border-color: var(--gold); color: #241a08; }
.sel-bar .btn.ghost { color: #cbd5da; }

/* 相册 */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.album-item { position: relative; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #f7fafb; }
.album-item img { width: 100%; height: 100%; object-fit: cover; }
.album-item .x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; cursor: pointer; }
.album-add { aspect-ratio: 1; border: 1px dashed var(--line2); border-radius: 8px; background: transparent; color: var(--faint); font-size: 20px; cursor: pointer; }
.album-add:hover { border-color: var(--teal2); color: var(--teal); }

@media (max-width: 1080px) {
  .hub-grid { grid-template-columns: 1fr; }
  .lib-layout { grid-template-columns: 1fr; }
  .lib-side { position: static; max-height: none; }
  .sys-cards { grid-template-columns: repeat(2, 1fr); }
  .gsearch { display: none; }
}
@media (max-width: 720px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-hero h1 { font-size: 24px; }
  .sys-cards { grid-template-columns: 1fr 1fr; }
  .lib-top { grid-template-columns: 1fr; grid-template-areas: "search" "equip" "level" "tools"; }
  .lib-top .search-box { width: 100%; }
  .sel-bar { left: 12px; right: 12px; transform: none; border-radius: 14px; flex-wrap: wrap; justify-content: center; }
}

.ss-badge {
  font-size: 9px; letter-spacing: .04em; padding: 1px 6px; border-radius: 999px;
  background: var(--gold-soft); color: #8a6416; border: 1px solid #eadfc4;
}

@media (max-width: 1080px) {
  .lib-side { padding: 12px; }
  .lib-side .col-head { margin-bottom: 8px; }
  .sys-list { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
  .sys-item { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
  .sys-item .n { display: none; }
  .lib-side-title { display: none; }
  .cat-list { display: flex; overflow-x: auto; gap: 6px; margin-top: 8px; padding-bottom: 2px; }
  .cat-item { white-space: nowrap; border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; }
  .cat-item .n { display: none; }
}
@media (max-width: 720px) {
  .ex-card2 .pic { padding: 4px 28px 0; }
}
.ex-card2 .pic svg { height: 128px; width: 100%; }
@media (max-width: 720px) { .ex-card2 .pic svg { height: 108px; } }


/* ---------- 动作图片 ---------- */
.lib-tools { display: flex; gap: 14px; margin-top: 6px; }
.ex-card2 .pic-img { width: 100%; height: 128px; object-fit: cover; display: block; border-radius: 8px 8px 0 0; }
.ex-card2 .pic { position: relative; }
.pic-badge {
  position: absolute; left: 8px; bottom: 8px; font-size: 9px; padding: 1px 6px;
  border-radius: 4px; background: rgba(22,35,43,.62); color: #fff; letter-spacing: .04em;
}
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0 4px; }
.gallery .g-item { position: relative; border-radius: 8px; overflow: hidden; background: #f7fafb; aspect-ratio: 4/3; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .g-x { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 9px; cursor: pointer; }
.gallery .g-add { border: 1px dashed var(--line2); border-radius: 8px; aspect-ratio: 4/3; background: transparent; color: var(--faint); font-size: 20px; cursor: pointer; }
.gallery .g-add:hover { border-color: var(--teal2); color: var(--teal); }
.gallery .g-cap { position: absolute; left: 4px; bottom: 3px; font-size: 9px; color: #fff; text-shadow: 0 1px 2px #000; }


/* ---------- 手册字段 ---------- */
.code-badge {
  display: inline-block; font-family: var(--mono); font-size: 9px; line-height: 1.6;
  padding: 0 4px; border-radius: 3px; background: #edf2f4; color: #5f6f79;
  margin-left: 5px; vertical-align: 2px; letter-spacing: .04em;
}
.code-badge.lg { font-size: 11px; padding: 1px 6px; vertical-align: 5px; background: var(--teal-soft); color: var(--teal); }
.analysis { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.analysis .an { font-size: 10.5px; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 3px 7px; color: var(--muted); }
.analysis .an b { color: var(--faint); font-weight: 500; margin-right: 4px; }
.man {
  font-size: 12.5px; color: var(--ink2); line-height: 1.78;
  background: #f7fafb; border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 11px; margin-bottom: 2px;
}
.man.rose { color: var(--rose); background: #fbf3f4; border-color: #eed6d8; }
.drawer h4 { margin-top: 16px; }

.posture-hint b { display: inline-block; margin-right: 6px; font-weight: 600; }
.posture-hint { font-size: 11px; color: var(--teal); line-height: 1.65; padding: 8px 10px; background: var(--teal-soft); border-radius: 8px; margin-top: 10px; }
.posture-hint[hidden] { display: none; }

/* ---------- 体态评测 ---------- */
.screen-wrap { max-width: 880px; margin: 0 auto; }
.screen-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.screen-head h1 { font-family: var(--serif); font-size: 26px; margin: 6px 0 4px; letter-spacing: .01em; }
.screen-sub { font-size: 12.5px; color: var(--muted); }
.screen-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.screen-select { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 13px; }
.screen-note {
  background: var(--gold-soft); border: 1px solid #eadfc4; color: #8a6416;
  padding: 10px 13px; border-radius: 10px; font-size: 12.5px; line-height: 1.75; margin-bottom: 12px;
}
.screen-progress { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--faint); margin-bottom: 10px; flex-wrap: wrap; }
.scr-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.scr-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #f7fafb; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.scr-name { font-weight: 650; font-size: 15px; }
.scr-en { font-size: 10px; color: var(--faint); letter-spacing: .08em; }
.scr-link { font-size: 11.5px; color: var(--teal2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.scr-scores { margin-left: auto; display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.scr-scores label { display: flex; align-items: center; gap: 5px; cursor: pointer; }
.scr-scores input { accent-color: var(--teal); }
.scr-items { display: grid; gap: 1px; padding: 10px 14px 12px; }
.scr-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink2); padding: 4px 0; cursor: pointer; }
.scr-item.off { opacity: .38; }
.scr-item.off input { pointer-events: none; }
.scr-tip { font-size: 11.5px; color: var(--faint); padding: 2px 0 0; }
.screen-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.hist-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 8px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.hist-item .h-date { font-weight: 650; font-size: 13.5px; }
.hist-item .h-sum { font-size: 11.5px; color: var(--faint); }
.hist-item .h-acts { display: flex; gap: 6px; }

.scr-note-wrap { display: block; margin-top: 18px; }
.scr-note-wrap > span { display: block; font-size: 11px; letter-spacing: .1em; color: var(--faint); margin-bottom: 6px; }
.scr-note-wrap textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--card);
  padding: 10px 12px; font-family: inherit; font-size: 13px; line-height: 1.7; resize: vertical; outline: none;
}
.scr-note-wrap textarea:focus { border-color: var(--teal2); box-shadow: 0 0 0 3px rgba(22,175,208,.14); }
.hist-item .h-note { font-size: 11.5px; color: var(--muted); margin-top: 3px; max-width: 42ch; }

/* ---------- 身体数据与体态照片 ---------- */
.scr-sec { margin-top: 18px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px 16px; }
.scr-sec-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.scr-sec-head h3 { font-size: 15px; }
.scr-bmi { font-size: 12px; color: var(--teal); font-weight: 600; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 22px; }
.metric { display: grid; grid-template-columns: 64px minmax(0,1fr) 34px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.metric .m-k { font-size: 12.5px; color: var(--ink2); }
.metric .m-v { border: 0; background: transparent; font-size: 13px; color: var(--ink); outline: none; padding: 2px 0; border-bottom: 1px dashed transparent; }
.metric .m-v:focus { border-bottom-color: var(--teal2); }
.metric .m-u { font-size: 11px; color: var(--faint); text-align: right; }
.photo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ph-slot { position: relative; border: 1px dashed var(--line2); border-radius: 10px; background: var(--paper); aspect-ratio: 3/4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; overflow: hidden; }
.ph-slot:hover { border-color: var(--teal2); }
.ph-slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph-slot .ph-label { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
.ph-slot .ph-ico { width: 22px; height: 22px; opacity: .45; }
.ph-slot .ph-del { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.5); color: #fff; font-size: 10px; cursor: pointer; }
.ph-slot.empty .ph-label { color: var(--faint); text-shadow: none; position: static; }
@media (max-width: 720px) {
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
}

/* ---------- 自建动作库 ---------- */
.modal-wide { width: min(760px, 96vw); }
.custom-form { padding: 14px 18px 20px; display: grid; gap: 10px; }
.cf-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cf-row:has(select:nth-of-type(4)) { grid-template-columns: repeat(4, 1fr); }
.cf-field { display: grid; gap: 4px; }
.cf-field > span { font-size: 11px; letter-spacing: .06em; color: var(--faint); }
.cf-field input, .cf-field select, .cf-field textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; background: #fff;
  padding: 8px 10px; font-family: inherit; font-size: 13px; outline: none; resize: vertical;
}
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus {
  border-color: var(--teal2); box-shadow: 0 0 0 3px rgba(22,175,208,.14);
}
.cf-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; }
@media (max-width: 640px) {
  .cf-row, .cf-row:has(select:nth-of-type(4)) { grid-template-columns: 1fr 1fr; }
}

.scr-cat { font-size: 10.5px; padding: 2px 9px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); line-height: 1.6; max-width: 58ch; }
.scr-cat span { display: block; }
.scr-body { padding: 10px 14px 14px; display: grid; gap: 8px; }
.scr-line { display: grid; grid-template-columns: 68px 1fr; gap: 10px; font-size: 12.5px; line-height: 1.7; color: var(--ink2); }
.scr-line > b, .scr-check > b { font-weight: 600; color: var(--faint); font-size: 11.5px; letter-spacing: .04em; }
.scr-check { display: grid; grid-template-columns: 68px 1fr; gap: 10px; }
.scr-check .scr-items { padding: 0; }
.scr-grades { display: grid; gap: 4px; border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 2px; }
.scr-grades span { font-size: 11.5px; color: var(--muted); display: grid; grid-template-columns: 40px 1fr; gap: 8px; line-height: 1.6; }
.scr-grades i { font-style: normal; color: var(--gold); font-weight: 600; }
@media (max-width: 640px) {
  .scr-line, .scr-check { grid-template-columns: 1fr; gap: 2px; }
  .scr-grades span { grid-template-columns: 36px 1fr; }
}

/* ---------- 评估动作：动作/评估演示 ---------- */
.media-sec { margin-top: 20px; }
.media-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.media-head h4 { margin: 0; }
.media-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.m-tile { position: relative; border-radius: 9px; overflow: hidden; background: var(--paper); aspect-ratio: 4/3; }
.m-tile img, .m-tile video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.m-tile .m-x { position: absolute; top: 5px; right: 5px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 10px; cursor: pointer; }
.m-add { border: 1px dashed var(--line2); border-radius: 9px; background: var(--paper); aspect-ratio: 4/3; font-size: 22px; color: var(--faint); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.m-add:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- 评估 → 针对性动作 ---------- */
.scr-remedy { margin-top: 10px; background: var(--teal-soft); border-radius: 10px; padding: 9px 12px; }
.rm-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--accent-deep); margin-bottom: 7px; flex-wrap: wrap; }
.rm-head b { font-weight: 600; }
.rm-tag { font-size: 10px; background: #fff; border-radius: 999px; padding: 1px 8px; color: var(--accent-deep); }
.rm-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.rm-chip { border: 1px solid rgba(11,127,151,.18); background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink2); }
.rm-chip i { font-style: normal; font-size: 9px; opacity: .5; margin-left: 4px; }
.rm-chip:hover { border-color: var(--accent); color: var(--accent-deep); }
.remedial-note { margin-top: 14px; font-size: 12px; color: var(--muted); background: var(--gold-soft); border-radius: 10px; padding: 9px 12px; line-height: 1.7; }
.remedial-note:empty { display: none; }

.rm-line { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: start; }
.rm-line > b { font-size: 11px; color: var(--accent-deep); font-weight: 600; padding-top: 5px; }

.prompt-acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- 统一媒体瓦片：完整显示 + 悬停删除 ---------- */
.m-tile, .gallery .g-item, .album-item, .ma-photo, .ph-slot { background: #fff; }
.m-tile img, .m-tile video, .gallery img, .album-item img, .ma-photo img, .ph-slot img {
  object-fit: contain; background: #f7fafb;
}
.m-x, .gallery .g-x, .album-item .x, .ma-photo .x, .ph-slot .ph-del {
  position: absolute; top: 5px; right: 5px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(22,35,43,.55); color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transition: opacity .15s ease; z-index: 3;
}
.m-tile:hover .m-x, .gallery .g-item:hover .g-x, .album-item:hover .x,
.ma-photo:hover .x, .ph-slot:hover .ph-del,
.m-x:focus-visible, .gallery .g-x:focus-visible, .album-item .x:focus-visible { opacity: 1; }

.media-grid, .gallery, .album-grid, .ma-photos { background: transparent; }

/* ---------- 大图预览 ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 300; background: rgba(12,18,22,.86);
  display: flex; align-items: center; justify-content: center; padding: 40px;
}
.lightbox[hidden] { display: none; }
.lightbox img, .lightbox video { max-width: 92vw; max-height: 86vh; border-radius: 10px; background: #fff; }
.lightbox video { background: #000; }
.lb-close {
  position: absolute; top: 18px; right: 20px; width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 15px; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.24); }

/* ---------- 媒体缩略图：按原图比例自适应（不裁切、不留黑边） ---------- */
.media-grid, .gallery, .album-grid { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.media-grid, .gallery { margin-top: 8px; }

.m-tile, .gallery .g-item, .album-item {
  position: relative; height: 150px; width: auto; aspect-ratio: auto;
  border-radius: 9px; overflow: hidden; background: #f7fafb; flex: 0 0 auto;
}
.m-tile img, .m-tile video,
.gallery .g-item img, .album-item img {
  height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; background: #f7fafb;
}
.m-add, .gallery .g-add, .album-add {
  flex: 0 0 auto; width: 110px; height: 150px; aspect-ratio: auto;
  border: 1px dashed var(--line2); border-radius: 9px; background: var(--paper);
  color: var(--faint); font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.m-add:hover, .gallery .g-add:hover, .album-add:hover { border-color: var(--accent); color: var(--accent); }

/* 学员主页的精彩瞬间同样自适应 */
.ma-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.ma-photo { position: relative; height: 130px; width: auto; aspect-ratio: auto; border-radius: 9px; overflow: hidden; background: #1a1a1a; }
.ma-photo img { height: 100%; width: auto; max-width: 100%; object-fit: contain; display: block; }

/* ---------- 媒体项 + 图下说明 ---------- */
.m-item { display: flex; flex-direction: column; gap: 6px; width: max-content; max-width: 100%; }
.m-cap { font-size: 12px; line-height: 1.5; color: var(--muted); max-width: 180px; white-space: normal; }
.m-cap-btn {
  position: absolute; top: 5px; right: 32px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: rgba(22,35,43,.55); color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  opacity: 0; transition: opacity .15s ease; z-index: 3;
}
.m-tile:hover .m-cap-btn { opacity: 1; }


.m-fail { display:flex; align-items:center; justify-content:center; text-align:center; height:100%; padding:8px; font-size:11px; color:var(--faint); background:var(--paper); }

/* ---------- 手机 / 平板可用性优化 ---------- */
@media (max-width: 1024px) {
  .app { padding: 16px 16px 80px; }
  .appbar-in { gap: 10px; }
  .tabs { scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .tabs::-webkit-scrollbar { display: none; }
}
@media (max-width: 720px) {
  .app { padding: 12px 10px 84px; }
  .appbar-in { padding: 8px 10px; gap: 8px; }
  .logo-txt b { font-size: 14px; }
  .logo-txt i { display: none; }
  .logo-mark { width: 28px; height: 28px; border-radius: 8px; }
  .tab { font-size: 14px; padding: 8px 10px; }
  .tab-num { display: none; }
  .appbar-right .icon-btn { display: none; }
  .drawer { width: 100vw; padding: 18px 16px 36px; }
  .modal { width: 94vw; }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
  .screen-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .screen-head h1 { font-size: 22px; }
  .screen-sub { font-size: 12px; }
  .screen-actions { width: 100%; }
  .screen-select { flex: 1 1 100%; }
  .screen-actions .btn { flex: 1 1 auto; }
  .screen-note { font-size: 12px; padding: 8px 10px; }
  .scr-head { padding: 10px 12px; gap: 6px; }
  .scr-name { font-size: 14px; }
  .scr-scores { width: 100%; margin-left: 0; justify-content: flex-start; gap: 14px; }
  .scr-body { padding: 8px 12px 12px; }
  .scr-line, .scr-check { grid-template-columns: 1fr; gap: 2px; }
  .scr-grades span { grid-template-columns: 34px 1fr; }
  .lib-grid2 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ex-card2 .pic svg { height: 96px; }
  .ex-card2 .body { padding: 8px 9px 10px; }
  .ex-card2 .nm { font-size: 13px; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .metric { grid-template-columns: 52px minmax(0,1fr) 28px; }
  .photo-grid { grid-template-columns: 1fr 1fr; }
  .m-tile, .gallery .g-item, .album-item { height: 110px; }
  .m-add, .gallery .g-add, .album-add { width: 88px; height: 110px; }
  .m-cap { max-width: 140px; font-size: 11px; }
  .ma-photo { height: 100px; }
  .report-sheet { padding: 16px 12px; }
  .plan-table-wrap, .report-sheet table { overflow-x: auto; display: block; }
  .hub-hero h1 { font-size: 22px; }
  .hub-stats { gap: 6px; }
  .btn { padding: 8px 12px; }
  .btn.sm { padding: 6px 10px; }
  .toast { left: 12px; right: 12px; transform: none; text-align: center; }
}

/* ---------- 云端登录 ---------- */
.cloud-status { border: 1px solid var(--line); background: var(--card); color: var(--muted); font-size: 11px; padding: 6px 10px; border-radius: 999px; cursor: pointer; }
.cloud-status:hover { border-color: var(--accent); color: var(--accent-deep); }
.cloud-gate { position: fixed; inset: 0; z-index: 500; background: rgba(16,24,30,.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cloud-gate[hidden] { display: none; }
.cg-card { width: min(380px, 94vw); background: #fff; border-radius: 16px; padding: 26px 24px 22px; box-shadow: 0 30px 80px -30px rgba(0,0,0,.5); }
.cg-logo { width: 40px; height: 40px; border-radius: 11px; background: var(--teal); color: #fff; display: grid; place-items: center; font-family: var(--serif); font-size: 20px; margin-bottom: 12px; }
.cg-card h2 { font-family: var(--serif); font-size: 21px; margin-bottom: 4px; }
.cg-sub { font-size: 12px; color: var(--muted); margin-bottom: 16px; line-height: 1.6; }
.cg-field { display: grid; gap: 4px; margin-bottom: 10px; }
.cg-field span { font-size: 11px; color: var(--faint); }
.cg-field input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font-size: 14px; outline: none; }
.cg-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22,175,208,.14); }
.cg-err { min-height: 16px; font-size: 12px; color: var(--rose); margin: 2px 0 8px; }
.cg-actions { display: flex; gap: 8px; }
.cg-actions .btn { flex: 1; }
.cg-status { margin-top: 10px; font-size: 11px; color: var(--faint); text-align: center; }

/* 云同步菜单 */
.cloud-wrap { position: relative; }
.cloud-menu { position: absolute; right: 0; top: 38px; width: 220px; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; z-index: 120; }
.cloud-menu[hidden] { display: none; }
.cloud-menu .cm-email { font-size: 11px; color: var(--faint); padding: 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; word-break: break-all; }
.cloud-menu .cm-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 8px; border-radius: 7px; font-size: 12.5px; color: var(--ink2); cursor: pointer; }
.cloud-menu .cm-item:hover { background: var(--paper); }
.cloud-menu .cm-item.danger { color: var(--rose); }

/* 大图预览里的操作条（手机用） */
.lb-actions { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); display: flex; gap: 10px; }
.lb-actions[hidden] { display: none; }
.lb-actions .btn { background: rgba(255,255,255,.14); color: #fff; border: 1px solid rgba(255,255,255,.25); }
.lb-actions .btn:hover { background: rgba(255,255,255,.24); }
.lb-actions .btn.danger { color: #ffb4ba; border-color: rgba(255,150,160,.4); }

.backup-banner { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--gold-soft); border: 1px solid #eadfc4; color: #8a6416; font-size: 11.5px; padding: 7px 10px; border-radius: 8px; margin-bottom: 8px; }
.backup-banner[hidden] { display: none; }
.backup-banner .linkbtn { color: #8a6416; white-space: nowrap; }
