/* 摔跤智研 手机网页版。配色与小程序一致。 */
:root {
  --bg: #eef3f9;
  --surface: #ffffff;
  --line: #dbe3ee;
  --ink: #16253a;
  --muted: #5d6b7e;
  --faint: #8c98a8;
  --accent: #1f4a7c;
  --accent-soft: #e3ebf6;
  --focus: #fff4cf;
  --coach: #1f4a7c;
  --athlete: #2c7a8c;
  --medic: #3d7a5a;
  --danger: #b23a2c;
  --bar-h: 48px;
  --tab-h: 56px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.m-root {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding-top: var(--bar-h);
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom));
  position: relative;
}

.m-root.with-compose { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

/* 顶栏与底部标签 */
.m-bar {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  height: var(--bar-h);
  z-index: 20;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(10px);
}

.m-title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.m-back, .m-back-space {
  width: 48px;
  flex: none;
  text-align: center;
  font-size: 30px;
  line-height: var(--bar-h);
  color: var(--ink);
}

.m-tabs {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  z-index: 20;
  display: flex;
  background: #fff;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.m-tabs a {
  flex: 1;
  height: var(--tab-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 12px;
  color: var(--faint);
}

.m-tabs a.on { color: var(--accent); }
.m-tabs img { width: 24px; height: 24px; }

/* 通用 */
.m-wrap {
  padding: 14px 16px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.m-muted { color: var(--muted); font-size: 13px; margin: 0; }
.m-faint { color: var(--faint); font-size: 12px; margin: 0; }
.m-faint.center, .center { text-align: center; }
.m-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 36px 0; margin: 0; }
p { margin: 0; }

.m-notice { margin: 0; border-radius: 10px; padding: 9px 12px; font-size: 13px; }
.m-notice.error { background: #fdecea; color: #8a2c22; }
.m-notice.ok { background: #e3f2ea; color: #2f6b4b; }
.m-notice.info { background: var(--accent-soft); color: var(--accent); }

.m-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.m-card.row { flex-direction: row; align-items: flex-start; gap: 10px; }
.m-card-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }

.m-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.m-tag { background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 1px 9px; font-size: 12px; }
.m-tag.more { background: transparent; color: var(--muted); }

.m-badge { display: inline-block; border-radius: 4px; padding: 0 5px; font-size: 11px; line-height: 1.7; color: #fff; background: var(--faint); vertical-align: middle; }
.m-badge.coach { background: var(--coach); }
.m-badge.athlete { background: var(--athlete); }
.m-badge.medic { background: var(--medic); }
.m-badge.admin { background: #b8862b; margin-left: 4px; }
.m-badge.state { color: var(--accent); background: var(--accent-soft); }
.m-badge.state.published { color: #2f6b4b; background: #e3f2ea; }
.m-badge.state.unpublished { color: var(--muted); background: #f1f1f1; }
.m-badge.state.media-failed, .m-badge.state.mobile-failed { color: #8a2c22; background: #fdecea; }
.m-badge.state.mobile-processing { color: #7a5a12; background: #fff4cf; }

.m-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  background: var(--faint);
}

.m-avatar.coach { background: var(--coach); }
.m-avatar.athlete { background: var(--athlete); }
.m-avatar.medic { background: var(--medic); }
.m-avatar.small { width: 28px; height: 28px; font-size: 12px; }
.m-avatar.big { width: 58px; height: 58px; font-size: 24px; }

.m-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 18px;
  font-size: 15px;
  text-align: center;
  background: transparent;
}

.m-btn.block { display: block; width: 100%; }
.m-btn.small { padding: 5px 14px; font-size: 13px; }
.m-btn.primary { background: var(--accent); color: #fff; }
.m-btn.danger { background: var(--danger); color: #fff; }
.m-btn.ghost { border-color: var(--line); background: var(--surface); }
.m-btn.danger-text, .danger-text { color: var(--danger); }
.m-btn:disabled { opacity: 0.55; }

.m-link { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; }
.m-link.faint { color: var(--faint); }

.m-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 11px;
  font-size: 15px;
  outline: none;
}

.m-input:focus { border-color: var(--accent); }
textarea.m-input { resize: vertical; }

/* 登录页 */
.m-root.login-mode { padding-top: 0; padding-bottom: 0; }
.m-root.login-mode .m-bar { display: none; }

.m-login {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-top: calc(48px + env(safe-area-inset-top));
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #f6f9fd 0%, #e9eff7 42%, #d5e0ee 58%, #3a5d8a 74%, #1f3b62 86%, #1a3355 100%);
  overflow: hidden;
}

.m-pillars {
  position: absolute;
  top: calc(18px + env(safe-area-inset-top));
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 10px;
  border-left: 1px solid #b9c6d6;
  color: #6c7b8f;
  font-size: 11px;
  letter-spacing: 2px;
}

.m-brand { display: flex; flex-direction: column; align-items: center; }
.m-logo { width: 140px; }
.m-brand h1 {
  margin: 6px 0 0;
  font-family: "STZhongsong", "Songti SC", "Noto Serif CJK SC", "SimSun", serif;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 5px;
  color: #1b3b64;
  line-height: 1.2;
}

.m-brand p {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  color: #26446b;
  font-size: 14px;
  letter-spacing: 2px;
}

.m-brand p i { display: inline-block; width: 22px; height: 1px; background: #4c6a91; }

.m-login-form { margin: 32px 30px 0; display: flex; flex-direction: column; gap: 13px; }

.m-pill {
  display: flex;
  align-items: center;
  height: 50px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid #d2dce9;
  padding: 0 20px;
}

.m-pill img { width: 20px; height: 20px; }
.m-pill input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; margin-left: 13px; font-size: 16px; }

.m-login-button {
  height: 50px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #2d5d96 0%, #1b3f6d 100%);
  color: #fff;
  font-size: 18px;
  letter-spacing: 8px;
  box-shadow: 0 5px 12px rgba(27, 63, 109, 0.28);
}

.m-login-button:disabled { background: #6f8bb0; letter-spacing: 2px; }
.m-login-help { text-align: center; font-size: 12px; color: #5d6b7e; }

.m-scene { position: relative; margin-top: 22px; }
.m-scene img { width: 100%; }
.m-scene span {
  position: absolute;
  transform: translateX(-50%);
  color: #f1f6fd;
  font-size: 11px;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.m-slogan { padding-left: 24px; color: rgba(255, 255, 255, 0.82); font-size: 15px; letter-spacing: 2px; display: flex; flex-direction: column; gap: 4px; }

/* 视频列表 */
.m-video-card { display: block; background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.m-cover { position: relative; aspect-ratio: 16 / 9; background: #1b2a40; }
.m-cover img { width: 100%; height: 100%; object-fit: cover; }
.m-cover-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.35); letter-spacing: 4px; }
.m-play { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px; border-radius: 50%; background: rgba(0, 0, 0, 0.45); color: #fff; display: flex; align-items: center; justify-content: center; padding-left: 3px; font-size: 18px; }
.m-duration { position: absolute; right: 8px; bottom: 8px; background: rgba(0, 0, 0, 0.6); color: #fff; border-radius: 4px; padding: 0 6px; font-size: 11px; }
.m-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; }
.m-card-body strong { font-size: 16px; line-height: 1.4; }

/* 详情 */
.m-player-box { background: #000; }
.m-player { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; }
.m-player.off { display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.7); font-size: 13px; padding: 0 24px; text-align: center; }
.m-info { display: flex; flex-direction: column; gap: 6px; }
.m-info h2 { margin: 0; font-size: 20px; line-height: 1.35; }
.m-tag-group { display: flex; flex-direction: column; gap: 3px; }

.m-section-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 6px; }
.m-thread-list { display: flex; flex-direction: column; gap: 10px; }
.m-thread { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.m-replies { background: #f6f9fc; border-top: 1px solid var(--line); }
.m-message { display: flex; gap: 10px; padding: 12px; }
.m-message.reply { padding-left: 20px; }
.m-message.focus { background: var(--focus); box-shadow: inset 3px 0 0 var(--accent); }
.m-message-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.m-who { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.m-who strong { font-size: 14px; }
.m-who strong.off { color: var(--faint); text-decoration: line-through; }
.m-text { white-space: pre-wrap; word-break: break-word; }
.m-mentions { color: var(--athlete); font-size: 13px; }
.m-meta { display: flex; justify-content: space-between; align-items: center; }
.m-ops { display: inline-flex; gap: 16px; }
.m-ops.end { justify-content: flex-end; display: flex; }

.m-compose-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  z-index: 15;
  border: 0;
  border-top: 1px solid var(--line);
  background: #fff;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  text-align: left;
  color: var(--muted);
}

.m-compose-bar::before { content: ""; }
.m-composer { width: 100%; border: 0; background: var(--bg); border-radius: 10px; padding: 10px; font-size: 15px; resize: vertical; outline: none; }
.m-row-end { display: flex; justify-content: flex-end; margin-top: -6px; }
.m-at { align-self: flex-start; border: 0; background: #e1f0f3; color: var(--athlete); border-radius: 999px; padding: 4px 12px; font-size: 13px; }
.m-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.m-chip { border: 0; background: #e1f0f3; color: var(--athlete); border-radius: 999px; padding: 3px 10px; font-size: 13px; }
.m-person-list { display: flex; flex-direction: column; max-height: 45vh; overflow-y: auto; }
.m-person { display: flex; align-items: center; gap: 10px; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 9px 0; text-align: left; }
.m-person-main { flex: 1; min-width: 0; }
.m-check { width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; }
.m-check.on { background: var(--accent); border-color: var(--accent); }

/* 我的 */
.m-profile { display: flex; align-items: center; gap: 14px; padding: 8px 4px 2px; }
.m-profile h2 { margin: 0 0 4px; font-size: 20px; }
.m-list { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.m-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 14px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.m-row:last-child { border-bottom: 0; }
.m-row.link:active { background: var(--accent-soft); }
.m-row.danger .m-row-text > span:first-child { color: var(--danger); }
.m-row-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-row-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.m-arrow { color: var(--faint); font-size: 22px; line-height: 1; }
.m-section-label { color: var(--muted); font-size: 13px; padding: 0 4px; margin-bottom: -4px; }
.m-head-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-head-row .m-btn { flex: none; white-space: nowrap; }

/* 管理 */
.m-thumb { flex: none; width: 112px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #1b2a40; }
.m-thumb img { width: 100%; height: 100%; object-fit: cover; }
.m-states { display: flex; flex-wrap: wrap; gap: 5px; }
.m-progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; }
.m-progress i { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.m-row-buttons { display: flex; gap: 10px; }
.m-row-buttons .m-btn { flex: 1; }
.m-group { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 9px; }
.m-group h3 { margin: 0; font-size: 15px; }
.m-field { display: flex; flex-direction: column; gap: 4px; }
.m-field > span { font-size: 13px; color: var(--muted); }
.m-field b { color: var(--danger); }
.m-choice-row { display: flex; flex-wrap: wrap; gap: 7px; }
.m-choice { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 4px 13px; font-size: 13px; }
.m-choice.small { padding: 3px 10px; font-size: 12px; }
.m-choice.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.m-subject { border-top: 1px dashed var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 5px; }
.m-side { display: flex; align-items: center; gap: 7px; }
.m-side > span { flex: none; width: 34px; font-size: 13px; font-weight: 600; }
.m-side.red > span { color: #b23a2c; }
.m-side.blue > span { color: #2f5d9a; }
.m-side .m-input:last-child { flex: none; width: 34%; }
.m-actions-col { display: flex; flex-direction: column; gap: 9px; }
.m-inline { display: flex; align-items: center; gap: 10px; }
.m-secret { background: var(--bg); border-radius: 8px; padding: 8px 10px; font-family: ui-monospace, Menlo, monospace; word-break: break-all; }
.m-reason { font-size: 12px; color: #8a5a12; }

/* 弹层 */
.m-overlay { display: none; }
.m-overlay.open { display: block; }
.m-mask { position: fixed; inset: 0; background: rgba(22, 37, 58, 0.45); z-index: 40; }

.m-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  max-height: 86vh;
  overflow-y: auto;
  z-index: 41;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 14px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-sheet-head { display: flex; justify-content: space-between; align-items: center; }
.m-sheet-head strong { font-size: 16px; }

.m-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: calc(100% - 48px);
  max-width: 400px;
  z-index: 41;
  background: #fff;
  border-radius: 14px;
  padding: 20px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.m-dialog > strong { font-size: 17px; text-align: center; }
.m-dialog > p { color: var(--muted); font-size: 14px; }
.m-dialog-actions { display: flex; gap: 10px; margin-top: 4px; }
.m-dialog-actions .m-btn { flex: 1; }

.m-actions {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  z-index: 41;
  background: #f2f4f7;
  border-radius: 14px 14px 0 0;
  overflow: hidden;
  padding-bottom: env(safe-area-inset-bottom);
  display: flex;
  flex-direction: column;
}

.m-actions button { border: 0; border-bottom: 1px solid var(--line); background: #fff; padding: 15px; font-size: 16px; }
.m-actions button.danger { color: var(--danger); }
.m-actions button.cancel { margin-top: 7px; border-bottom: 0; }

.m-toast {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%);
  z-index: 60;
  background: rgba(22, 37, 58, 0.88);
  color: #fff;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.m-toast.show { opacity: 1; }
