/* XTP Tennis · 教练工作台 — 深色独立品牌 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; color: #0B1F2A; }
body { background: #F4F6F9; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
small { color: #6B7C8F; }

/* ========== 登录页 ========== */
.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
}
.login-left {
  position: relative;
  background: linear-gradient(135deg, #0B1F2A 0%, #16303F 100%);
  color: #fff;
  padding: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.brand-mark img { height: 48px; width: auto; }
.login-left small { color: rgba(255,255,255,0.6); font-size: 13px; letter-spacing: 2px; }
.slogan h1 { font-size: 42px; font-weight: 900; line-height: 1.35; color: #C6FF00; margin-bottom: 24px; }
.slogan p { font-size: 15px; line-height: 2; color: rgba(255,255,255,0.7); }
.court-deco {
  position: absolute;
  right: -40px;
  bottom: -40px;
  font-size: 420px;
  opacity: 0.08;
}
.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
.login-card {
  width: 100%;
  max-width: 420px;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.login-card h2 { font-size: 30px; font-weight: 900; color: #0B1F2A; margin-bottom: 8px; }
.login-hint { color: #6B7C8F; font-size: 14px; line-height: 1.7; }
.qr-wrap {
  margin: 18px auto 4px;
  width: 220px; height: 220px;
  padding: 16px;
  border: 2px dashed #E5E8EE;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #FAFBFC;
  position: relative;
}
.qr-wrap canvas { width: 100% !important; height: 100% !important; }
.qr-status {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: #6B7C8F;
  font-size: 13px;
}
.qr-refresh {
  align-self: center;
  background: none;
  border: none;
  color: #6B7C8F;
  font-size: 13px;
}
.qr-refresh:hover { color: #0B1F2A; }
.login-tips {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tip { color: #6B7C8F; font-size: 13px; display: flex; gap: 10px; align-items: center; }
.tip span {
  width: 20px; height: 20px;
  background: #C6FF00; color: #0B1F2A;
  border-radius: 50%;
  font-size: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
}
.poll-msg {
  text-align: center;
  font-size: 13px;
  color: #0B1F2A;
  margin-top: 12px;
  min-height: 20px;
}

/* ========== 工作台布局 ========== */
#appView { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
#appView[hidden] { display: none; }
aside {
  background: #0B1F2A;
  color: #fff;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.brand-row { padding: 0 20px; }
.brand img { height: 36px; width: auto; }
.brand small { color: rgba(255,255,255,0.5); font-size: 11px; margin-left: 6px; letter-spacing: 1px; }
.coach-identity {
  display: flex; align-items: center; gap: 12px;
  margin: 4px 20px 12px; padding: 14px;
  background: rgba(255,255,255,0.06);
  border-radius: 14px;
}
.cv-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: #2C4654;
  object-fit: cover;
}
.cv-name { font-weight: 800; font-size: 14px; }
.cv-tag { font-size: 11px; color: #C6FF00; margin-top: 2px; }
nav { display: flex; flex-direction: column; }
nav a {
  padding: 12px 20px;
  color: rgba(255,255,255,0.65);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all .15s;
}
nav a:hover { color: #fff; background: rgba(255,255,255,0.04); }
nav a.active { color: #C6FF00; background: rgba(198,255,0,0.08); border-left-color: #C6FF00; }

main { display: flex; flex-direction: column; min-width: 0; }
header {
  padding: 20px 32px;
  border-bottom: 1px solid rgba(11,31,42,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
}
header h1 { font-size: 22px; font-weight: 900; color: #0B1F2A; margin-top: 4px; }
#crumb { color: #9AA7B2; font-size: 12px; letter-spacing: 0.5px; }
#logoutBtn, #logoutBtn2 {
  padding: 8px 20px;
  background: #fff;
  border: 1px solid rgba(11,31,42,0.15);
  border-radius: 999px;
  font-size: 13px;
  color: #0B1F2A;
}
#logoutBtn:hover { background: rgba(255,90,78,0.08); border-color: #FF5A4E; color: #C62828; }
#logoutBtn2.ghost { border-color: rgba(214, 220, 230, 0.9); }
.danger { color: #C62828; border-color: #F9C8C4; }

/* ========== 工作台首页 ========== */
section { padding: 24px 32px; }
.welcome { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.welcome-left, .welcome-greeting {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(11,31,42,0.06);
  padding: 24px;
}
.welcome-hello { font-size: 15px; color: #6B7C8F; }
.welcome-hello b { color: #0B1F2A; font-size: 22px; font-weight: 900; }
.greeting-banner {
  padding: 28px;
  background: linear-gradient(135deg, #C6FF00 0%, #A9E200 100%);
  border-radius: 14px;
  color: #0B1F2A;
}
.greeting-banner text { font-size: 18px; font-weight: 900; display: block; margin-bottom: 4px; }
.greeting-banner small { color: #5F7300; font-size: 13px; }

.metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 16px; }
.metric-card {
  background: #fff; border-radius: 16px; padding: 24px;
  border: 1px solid rgba(11,31,42,0.06);
}
.metric-num { font-size: 34px; font-weight: 900; color: #0B1F2A; }
.metric-label { color: #6B7C8F; font-size: 13px; margin-top: 4px; }

.panel {
  background: #fff;
  border-radius: 16px;
  border: 1px solid rgba(11,31,42,0.06);
  padding: 24px;
}
.panel-head { margin-bottom: 16px; }
.panel-head h2 { font-size: 18px; font-weight: 900; color: #0B1F2A; margin-top: 2px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; color: #6B7C8F; font-weight: 700; font-size: 13px; border-bottom: 1px solid #F0F2F5; }
td { padding: 12px; color: #0B1F2A; border-bottom: 1px solid #F5F7FA; }
tr:last-child td { border-bottom: none; }
.empty-hint { text-align: center; color: #9AA7B2; padding: 36px 0; }

.toolbar {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}
.toolbar-tip { color: #9AA7B2; font-size: 13px; flex: 1; }
.toolbar button.primary {
  background: #0B1F2A; color: #fff; border: none;
  padding: 9px 22px; border-radius: 999px; font-size: 13px; font-weight: 800;
}
.primary {
  background: #0B1F2A; color: #fff; border: none;
  padding: 10px 22px; border-radius: 10px; font-size: 13px; font-weight: 800;
}
.primary:hover { background: #16303F; }
td .ops { display: flex; gap: 8px; }
td button {
  background: none; border: none; padding: 6px 10px;
  color: #0B1F2A; font-size: 13px;
  border-radius: 6px;
}
td button:hover { background: rgba(11,31,42,0.06); }
td button.danger { color: #C62828; }
td button.danger:hover { background: rgba(255,90,78,0.1); }
td .chk { width: 40px; }
td .chk input { width: 16px; height: 16px; }
td select, td input {
  padding: 4px 8px;
  border: 1px solid rgba(11,31,42,0.12);
  border-radius: 6px;
  font-size: 13px;
}

/* ========== 可约时间（二态：可约/不可约，教练课与陪练课共用） ========== */
.avail-banner {
  margin: 0 0 14px; padding: 10px 14px;
  background: #F2FBE0; border: 1px solid #D9F2A8; border-radius: 10px;
  color: #4D6200; font-size: 13px; font-weight: 600;
}
.avail-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}
.avail-day {
  border: 1px solid rgba(11,31,42,0.08);
  border-radius: 12px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.avail-day .day-title {
  text-align: center; font-weight: 800; font-size: 14px;
  padding-bottom: 8px; border-bottom: 1px dashed rgba(11,31,42,0.08);
}
.avail-slot {
  padding: 8px 4px;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  background: #F4F6F9;
  border: 1px solid rgba(11,31,42,0.08);
  border-radius: 8px;
  cursor: pointer;
  color: #8A97A3;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.avail-slot small { font-size: 11px; font-weight: 700; }
.avail-slot.coach {
  background: #0B1F2A; border-color: #0B1F2A; color: #fff;
}
.avail-slot.coach small { color: #C6FF00; }
.avail-slot:hover { box-shadow: 0 0 0 2px rgba(198,255,0,0.55); }
.avail-legend {
  display: flex; gap: 24px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px;
  border-top: 1px dashed rgba(11,31,42,0.1);
  font-size: 13px; color: #5A6B78; font-weight: 600;
}
.avail-legend span { display: inline-flex; align-items: center; gap: 8px; }
.avail-legend .lg { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }
.lg-off { background: #F4F6F9; border: 1px solid rgba(11,31,42,0.12); }
.lg-coach { background: #0B1F2A; }
.avail-hint { margin-top: 12px; font-size: 13px; color: #9AA7B2; }

/* ========== 个人资料 ========== */
.profile-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.p-field { display: flex; flex-direction: column; gap: 6px; }
.p-field.full { grid-column: 1 / -1; }
.p-field label { font-size: 13px; font-weight: 700; color: #0B1F2A; }
.p-field input, .p-field select, .p-field textarea {
  padding: 10px 14px;
  background: #F7F9FC;
  border: 1px solid rgba(11,31,42,0.1);
  border-radius: 10px;
  font-size: 14px;
  color: #0B1F2A;
}
.p-field textarea { resize: vertical; }
#pfSaveBtn { grid-column: 1 / -1; margin-top: 6px; justify-self: start; }

/* ========== 学员评价 ========== */
.review-head {
  display: grid; grid-template-columns: 1fr 2fr; gap: 24px;
  padding: 24px;
  background: linear-gradient(135deg, #C6FF00 0%, #A9E200 100%);
  border-radius: 14px;
  color: #0B1F2A;
  margin-bottom: 20px;
}
.review-num { font-size: 54px; font-weight: 900; }
.review-stars { font-size: 18px; letter-spacing: 2px; }
.review-total { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.review-dist { display: flex; flex-direction: column; gap: 6px; }
.rv-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.rv-row .bar {
  flex: 1; height: 8px;
  background: rgba(11,31,42,0.1);
  border-radius: 999px; overflow: hidden;
}
.rv-row .bar i { display: block; height: 100%; background: #0B1F2A; }
.rv-row .cnt { width: 36px; text-align: right; color: #0B1F2A; font-weight: 700; }
.rv-row .label { width: 36px; text-align: right; }

/* ========== 设置 ========== */
.setting-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 0;
  border-bottom: 1px solid #F0F2F5;
}
.setting-item:last-child { border-bottom: none; }
.setting-title { font-weight: 800; font-size: 14px; margin-bottom: 4px; }
.setting-item small { font-size: 13px; }

/* ========== Modal / Toast ========== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(11,31,42,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal {
  width: 520px; max-width: 92vw;
  background: #fff;
  border-radius: 18px;
  padding: 24px;
}
.modal .head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
}
.modal h2 { font-size: 18px; font-weight: 900; }
.modal #modalClose {
  border: none; background: none;
  font-size: 24px; color: #9AA7B2; cursor: pointer;
}
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-body label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.modal-body input, .modal-body select, .modal-body textarea {
  padding: 9px 12px;
  background: #F7F9FC;
  border: 1px solid rgba(11,31,42,0.1);
  border-radius: 8px;
  font-size: 14px;
}
.modal-actions {
  margin-top: 12px;
  display: flex; gap: 10px; justify-content: flex-end;
}
.modal-actions button {
  padding: 8px 22px;
  border-radius: 8px;
  font-size: 13px; font-weight: 800;
  border: none; cursor: pointer;
}
.modal-actions button[type="button"] { background: #F4F6F9; color: #0B1F2A; }
.modal-actions button.primary { background: #0B1F2A; color: #fff; }

/* ========== 主场多选 ========== */
.court-pick-field {
  display: flex; align-items: center; gap: 12px;
  background: #F7F9FC;
  border: 1px solid rgba(11,31,42,0.1);
  border-radius: 8px; padding: 8px 8px 8px 14px;
  cursor: pointer;
}
.court-pick-text {
  flex: 1; min-width: 0;
  font-size: 14px; color: #9AA7B2;
  line-height: 1.4;
}
.court-pick-text.set { color: #0B1F2A; font-weight: 600; }
.court-pick-btn {
  flex-shrink: 0;
  background: #F2FBE0; color: #4D6200;
  border: 1px solid #D9F2A8;
  border-radius: 999px; padding: 7px 18px;
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.court-pick-btn:hover { background: #C6FF00; border-color: #C6FF00; }
.court-modal { width: 600px; max-height: 84vh; display: flex; flex-direction: column; }
.court-modal .modal-body { flex: 1; min-height: 0; overflow: hidden; }
.court-kw {
  padding: 10px 14px;
  background: #F1F4F6; border: none;
  border-radius: 999px; font-size: 14px; flex-shrink: 0;
}
.court-pick-list { flex: 1; min-height: 240px; overflow-y: auto; margin: 0 -6px; padding: 0 6px; }
.court-empty { padding: 48px 0; text-align: center; color: #9AA7B2; font-size: 14px; }
.court-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 10px;
  border-bottom: 1px solid rgba(11,31,42,0.05);
  cursor: pointer; border-radius: 8px;
}
.court-opt:hover { background: #FAFBFC; }
.court-opt-check {
  width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 50%; border: 2px solid #C7CFD6;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: #0B1F2A;
}
.court-opt.on .court-opt-check { background: #C6FF00; border-color: #C6FF00; font-weight: 900; }
.court-opt-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.court-opt-info b { font-size: 14px; color: #0B1F2A; }
.court-opt-info small { font-size: 12px; color: #9AA7B2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.court-pick-tip { flex-shrink: 0; font-size: 13px; color: #5F7300; font-weight: 700; min-height: 18px; }
.court-pick-actions { flex-shrink: 0; margin-top: 4px; }
.court-pick-actions button { padding: 9px 26px; }

.toast {
  position: fixed; top: 40px; left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  background: #0B1F2A; color: #fff;
  border-radius: 999px;
  font-size: 13px; font-weight: 700;
  z-index: 2000;
}
.toast.err { background: #C62828; }

.hidden { display: none !important; }
/* 覆盖浏览器默认 hidden 属性，确保任何带 hidden 的元素都不拦截事件 */
[hidden] { display: none !important; }

/* ========== 约课管理 ========== */
.bk-chips { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.bk-chip {
  padding: 7px 18px; border-radius: 999px;
  border: 1px solid rgba(11,31,42,0.12);
  background: #fff; color: #5A6B78;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.bk-chip.on { background: #C6FF00; border-color: #C6FF00; color: #0B1F2A; }
.bk-student { display: flex; align-items: center; gap: 8px; min-width: 0; }
.bk-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: #EDF1F5; flex-shrink: 0; object-fit: cover;
}
.badge {
  display: inline-block; padding: 3px 12px;
  border-radius: 999px; font-size: 12px; font-weight: 800; line-height: 1.5;
}
.badge.st-pending { background: #FFF1DC; color: #B25E00; }
.badge.st-approved { background: #E4FA9E; color: #3D5200; }
.badge.st-done { background: #6B7C8F; color: #fff; }
.badge.st-rejected { background: #FFE4EC; color: #C62828; }
.badge.st-cancelled { background: #F1F4F8; color: #8A97A3; }

/* ========== 教练风采上传 ========== */
.up-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.up-btn {
  padding: 8px 18px; border-radius: 999px;
  border: 1px dashed rgba(11,31,42,0.3);
  background: #fff; color: #0B1F2A;
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.up-btn:hover { border-color: #5F7300; color: #5F7300; }
.up-tip { color: #9AA7B2; font-size: 12px; }
.up-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.up-thumb {
  position: relative;
  width: 96px; height: 72px;
  border-radius: 10px; overflow: hidden;
  background: #EDF1F5;
}
.up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.up-thumb .up-del {
  position: absolute; top: 2px; right: 2px;
  width: 20px; height: 20px; padding: 0;
  border: none; border-radius: 50%;
  background: rgba(11,31,42,0.72); color: #fff;
  font-size: 14px; line-height: 20px; text-align: center; cursor: pointer;
}
.up-thumb .up-del:hover { background: #C62828; }
.up-thumb .up-mark {
  position: absolute; left: 0; bottom: 0;
  padding: 1px 8px;
  background: rgba(198,255,0,0.92); color: #0B1F2A;
  font-size: 11px; font-weight: 800;
}
@media (max-width: 900px) {
  .login-wrap { grid-template-columns: 1fr; }
  .login-left { display: none; }
  #appView { grid-template-columns: 72px 1fr; }
  aside nav a span { display: none; }
  nav a { font-size: 0; padding: 12px 0; justify-content: center; text-align: center; }
}
