@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg-main: #0c1a2c;
  --bg-container: #112238;
  --card-bg: rgba(28, 48, 78, 0.82);
  --card-border: rgba(255, 255, 255, 0.14);
  --card-border-hl: #10b981;
  --accent-green: #10b981;
  --accent-lime: #a3e635;
  --accent-gold: #fbbf24;
  --accent-cyan: #38bdf8;
  --text-main: #ffffff;
  --text-muted: #cbd5e1;
}

body {
  background: radial-gradient(circle at 50% 0%, #1e3a5f 0%, var(--bg-main) 80%);
  color: var(--text-main);
  font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

/* 垂直移动端视口 */
.portrait-container {
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  background-color: var(--bg-container);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
}

/* 顶栏 */
.top-bar {
  padding: 12px 14px;
  background: rgba(18, 38, 63, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.app-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.title-hl {
  color: var(--accent-lime);
  text-shadow: 0 0 12px rgba(163, 230, 53, 0.5);
}

.svg-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
}

/* 跑马灯 */
.marquee-strip {
  background: linear-gradient(90deg, #1e3a8a 0%, #0369a1 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  white-space: nowrap;
  padding: 5px 0;
}

.marquee-content {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  color: #e0f2fe;
  animation: marquee 18s linear infinite;
}

@keyframes marquee {
  0% { transform: translateX(0%); }
  100% { transform: translateX(-50%); }
}

/* 核心指标展示条 (高亮明快卡片) */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
  background: rgba(23, 42, 69, 0.85);
  border-bottom: 1px solid var(--card-border);
}

/* 期次功能沿用原顶部指标条与配置表单，仅增加一行紧凑切换控件。 */
.period-switch {
  margin: 0 0 10px;
  padding: 7px 9px;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  background: rgba(163, 230, 53, 0.06);
  border: 1px solid rgba(163, 230, 53, 0.25);
  border-radius: 7px;
  color: #cbd5e1;
  font-size: 11px;
}

.period-switch select {
  padding: 4px 7px;
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  font-size: 11px;
}

.period-switch #periodState { color: #a3e635; }

.form-help {
  padding: 0 12px 10px;
  color: #94a3b8;
  font-size: 11px;
  line-height: 1.55;
}

.slot-card.hour-slot { border-top-color: #38bdf8; }
.stat-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.stat-item:hover {
  border-color: var(--accent-lime);
}

.s-lbl {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.s-val {
  font-size: 13px;
  font-weight: 800;
  margin-top: 3px;
  color: #fff;
}

.c-green { color: var(--accent-lime); }
.c-gold { color: var(--accent-gold); }
.c-cyan { color: var(--accent-cyan); }

/* 主区域 */
.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  position: relative;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-pane.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 二级小页签 */
.sub-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  background: rgba(15, 30, 52, 0.8);
  padding: 5px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
}

.sub-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px 0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.sub-tab.active {
  background: #1e3a5f;
  color: var(--accent-lime);
  border: 1px solid rgba(163, 230, 53, 0.3);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.sub-pane {
  display: none;
}

.sub-pane.active {
  display: block;
}

/* 周导航条 (精细扁平化，大幅节约高度) */
.pane-toolbar {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  padding: 5px 8px;
  border-radius: 8px;
}

.week-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.btn-s {
  background: #2563eb;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-s:hover {
  background: #1d4ed8;
  border-color: var(--accent-lime);
}

/* 排期列表 (按天分组 + 双栏并列紧凑布局) */
.schedule-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 天分组容器 */
.day-group {
  margin-bottom: 2px;
}

.day-group-header {
  font-size: 12px;
  font-weight: 800;
  color: #cbd5e1;
  padding: 4px 8px;
  background: rgba(30, 58, 95, 0.7);
  border-radius: 8px 8px 0 0;
  border: 1px solid var(--card-border);
  border-bottom: 2px solid rgba(163, 230, 53, 0.2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.day-group-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(17, 34, 56, 0.5);
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
}

/* 单个班次卡片 */
.slot-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 4px 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: all 0.2s ease;
}

.slot-card:hover {
  border-color: rgba(255, 255, 255, 0.3);
}

.slot-card.m-border { border-top: 3px solid #fb923c; }
.slot-card.a-border { border-top: 3px solid #3b82f6; }
.slot-card.dimmed { opacity: 0.6; filter: grayscale(0.5); }

/* 卡片第一行：类型+时间+状态 */
.slot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-type {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.slot-type.morning { color: #fb923c; }
.slot-type.afternoon { color: #60a5fa; }

.slot-time {
  font-size: 10px;
  color: var(--accent-cyan);
  font-weight: 700;
  margin-left: 2px;
}

/* 状态徽章 */
.st-ok { color: #fff; background: #059669; border: 1px solid #10b981; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; }
.st-full { color: #fff; background: #dc2626; border: 1px solid #ef4444; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; }
.st-lock { color: #e2e8f0; background: #475569; border: 1px solid #64748b; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; }

/* 卡片第二行：球友标签 */
.slot-players {
  background: rgba(15, 23, 42, 0.5);
  padding: 3px 5px;
  border-radius: 5px;
  min-height: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
}

.p-tag {
  background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.p-del {
  color: #fca5a5;
  cursor: pointer;
  font-weight: 800;
  font-size: 11px;
  padding: 0 2px;
  border-radius: 50%;
  transition: color 0.15s;
}

.p-del:hover {
  color: #ef4444;
}

/* 卡片第三行：费用+按钮 */
.slot-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slot-btns {
  display: flex;
  gap: 3px;
}

.est-txt {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
}

/* 紧凑按钮样式 */
.btn-book-mini {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-book-mini:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5);
}

.btn-book-mini:disabled {
  background: #475569;
  color: #94a3b8;
  border-color: #64748b;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-close-mini {
  background: #475569;
  border: 1px solid #f87171;
  color: #fecaca;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-close-mini:hover {
  background: #64748b;
}

.btn-unlock-mini {
  background: #475569;
  border: 1px solid #64748b;
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-unlock-mini:hover {
  background: #1e3a5f;
  border-color: var(--accent-lime);
}

.btn-book-past {
  background: #475569;
  border: 1px solid #64748b;
  color: #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-book-past:hover {
  background: #1e3a5f;
  border-color: var(--accent-lime);
}

/* 财务台面板 */
.pane-box {
  background: linear-gradient(135deg, #1e3a5f 0%, #152e4d 100%);
  border: 1px solid var(--accent-gold);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  font-size: 12px;
  line-height: 1.8;
  box-shadow: 0 4px 20px rgba(251, 191, 36, 0.15);
}

.box-head {
  font-weight: 800;
  color: var(--accent-gold);
  font-size: 14px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.hl-row {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  font-weight: 800;
  color: var(--accent-lime);
  font-size: 13px;
}

.transfer-summary-row,
.ov-transfer-totals {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 5px;
  font-weight: 800;
}

.transfer-due { color: var(--accent-cyan); }
.transfer-pending { color: var(--accent-gold); }

.ledger-transfer-cell div + div { margin-top: 3px; }

.table-wrap {
  overflow-x: auto;
}

.lofi-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow: hidden;
}

.lofi-table th, .lofi-table td {
  padding: 9px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
}

.lofi-table th {
  color: #fff;
  font-weight: 800;
  background: #1e3a5f;
}

/* 足迹日历卡片 */
.overview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ov-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 12px;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ov-title {
  font-weight: 800;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
}

.cal-timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cal-badge {
  background: #0f172a;
  border: 1px solid var(--accent-cyan);
  color: #bae6fd;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.cal-badge span:first-child {
  font-weight: 800;
  color: #fff;
}

.cal-badge span:last-child {
  font-weight: 700;
}

.transfer-total {
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.65);
}

.cal-badge.is-due {
  border-color: var(--accent-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.cal-badge.is-due span:last-child { color: var(--accent-cyan); }

.cal-badge.is-pending {
  border-color: var(--accent-gold);
  background: rgba(251, 191, 36, 0.08);
}

.cal-badge.is-pending span:last-child { color: var(--accent-gold); }

/* 配置与删改 */
.config-form {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12px;
}

.form-title {
  font-weight: 800;
  color: var(--accent-lime);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
}

.form-row input,
.form-row select {
  width: 140px;
  padding: 6px 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  font-family: inherit;
  font-weight: 700;
}

.config-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-secondary {
  background: #334155;
  box-shadow: none;
}

.btn-full {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.5);
}

.roster-del-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
}

.del-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-del {
  background: #dc2626;
  color: #fff;
  border: none;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

/* 底部发光网球导航栏 (支持全面屏安全区) */
.bottom-nav {
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #0c1a2c;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 10;
}

.nav-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-item.active {
  color: var(--accent-lime);
  font-weight: 800;
  transform: translateY(-2px);
}

/* 弹窗 */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99;
}

.modal.active { display: flex; }

.modal-box {
  background: #1e3a5f;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 16px;
  border-radius: 14px;
  width: 310px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
}

.m-title {
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}

.roster-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.roster-grid button {
  background: #0f172a;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.roster-grid button:hover {
  background: #10b981;
  border-color: var(--accent-lime);
}

.add-inline {
  display: flex;
  gap: 6px;
}

.add-inline input {
  flex: 1;
  padding: 6px 8px;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.m-actions {
  display: flex;
  justify-content: flex-end;
}

.m-actions button {
  padding: 6px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.2);
  background: #334155;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #059669;
  color: #fff;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.5);
  display: none;
  z-index: 100;
  border: 1px solid rgba(255,255,255,0.3);
}

/* =============================================
   学习笔记 (Learning Notes) — Notes Tab
   ============================================= */

/* --- Notes Course Section --- */
.notes-course-section {
  background: var(--card-bg);
  border-radius: 14px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  animation: fadeIn 0.35s ease;
}

/* --- Notes Course Header --- */
.notes-course-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 13px;
  font-weight: 700;
  color: #e2e8f0;
}

.notes-course-meta {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  max-width: 60%;
  text-align: right;
  line-height: 1.4;
}

/* --- Notes List --- */
.notes-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* --- Individual Note Card --- */
.note-item {
  background: rgba(15, 23, 42, 0.55);
  border-radius: 12px;
  padding: 12px 14px;
  border-left: 3px solid #10b981;
  position: relative;
  animation: fadeIn 0.3s ease;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.note-item:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}

.note-author {
  font-size: 13px;
  font-weight: 700;
  color: #a3e635;
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-author::before {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10b981, #a3e635);
  flex-shrink: 0;
}

.note-time {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
  margin-bottom: 6px;
}

.note-text {
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

/* --- Note Delete Button --- */
.note-delete-btn {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease, background 0.2s ease;
  flex-shrink: 0;
}

.note-item:hover .note-delete-btn {
  opacity: 1;
}

.note-delete-btn:hover {
  background: rgba(239, 68, 68, 0.35);
}

/* =============================================
   Media Gallery — Note Media Grid
   ============================================= */

.note-media-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.note-media-thumb {
  width: 80px;
  height: 80px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.note-media-thumb:hover {
  transform: scale(1.08);
  box-shadow: 0 4px 18px rgba(16, 185, 129, 0.25);
}

.note-media-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.note-media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- Video Play Icon Overlay --- */
.note-video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.note-video-overlay::after {
  content: '▶';
  color: #fff;
  font-size: 22px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

/* =============================================
   Note Form — Add Note Input Area
   ============================================= */

.note-form {
  background: rgba(15, 23, 42, 0.6);
  border: 1px dashed rgba(163, 230, 53, 0.2);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}

.note-form-header {
  font-size: 12px;
  font-weight: 700;
  color: #a3e635;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.note-form-header::before {
  content: '✏️';
  font-size: 14px;
}

.note-form select {
  width: 100%;
  padding: 8px 10px;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 8px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.note-form select:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.note-form textarea {
  width: 100%;
  min-height: 70px;
  padding: 10px;
  background: #1e293b;
  color: #e2e8f0;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  resize: vertical;
  margin-bottom: 8px;
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}

.note-form textarea:focus {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.note-form textarea::placeholder {
  color: #64748b;
}

.personal-note-file-status {
  color: #94a3b8;
  font-size: 11px;
}

/* --- Upload Area --- */
.note-upload-area {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.note-upload-area.drag-over {
  background: rgba(16, 185, 129, 0.08);
  border-radius: 8px;
  outline: 2px dashed #10b981;
  outline-offset: -2px;
}

.note-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  background: rgba(6, 182, 212, 0.12);
  color: #06b6d4;
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.note-upload-btn:hover {
  background: rgba(6, 182, 212, 0.22);
  transform: scale(1.03);
}

/* --- Media Preview before Upload --- */
.note-media-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.note-preview-item {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

.note-preview-item img,
.note-preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.note-preview-remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(239, 68, 68, 0.85);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* --- Submit Button --- */
.note-submit-btn {
  width: 100%;
  padding: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.note-submit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
}

.note-submit-btn:active {
  transform: scale(0.97);
}

/* =============================================
   Player Notes View — 按球友查看
   ============================================= */

.player-notes-card {
  background: var(--card-bg);
  border-radius: 14px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255,255,255,0.06);
  animation: fadeIn 0.35s ease;
}

.player-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  font-size: 14px;
  font-weight: 700;
  color: #a3e635;
}

.player-notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.player-note-entry {
  background: rgba(15, 23, 42, 0.5);
  border-radius: 10px;
  padding: 10px 12px;
  border-left: 3px solid #06b6d4;
}

.player-note-date {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  color: #0f172a;
  background: linear-gradient(135deg, #06b6d4, #22d3ee);
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 6px;
}

.player-note-summary {
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* =============================================
   Lightbox — Full Screen Media Viewer
   ============================================= */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: fadeIn 0.25s ease;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  max-width: 92vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 10000;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.lightbox-media {
  max-width: 92vw;
  max-height: 85vh;
  border-radius: 10px;
  object-fit: contain;
}

/* =============================================
   Empty & Loading States
   ============================================= */

.notes-empty {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}

.notes-loading {
  position: relative;
  min-height: 120px;
}

.notes-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  margin: -14px 0 0 -14px;
  border: 3px solid rgba(163, 230, 53, 0.15);
  border-top-color: #a3e635;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* --- fadeIn animation (if not already defined) --- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* =============================================
   方案 AB：A 的单行计分板布局 + B 的日场球场配色
   仅覆盖视觉与排版，业务状态和交互保持原实现。
   ============================================= */
.theme-court-light {
  --bg-main: #dfeadf;
  --bg-container: #f8f6ef;
  --card-bg: #fffdf8;
  --card-border: #d4dfd2;
  --card-border-hl: #2f7d45;
  --accent-green: #237846;
  --accent-lime: #4f7f24;
  --accent-gold: #b97708;
  --accent-cyan: #147a83;
  --text-main: #173523;
  --text-muted: #607467;
  background: linear-gradient(145deg, #d8eadc 0%, #f3ead8 100%);
  color: var(--text-main);
}

.theme-court-light .portrait-container {
  background: var(--bg-container);
  border-color: rgba(42, 91, 57, 0.18);
  box-shadow: 0 0 34px rgba(42, 91, 57, 0.18);
}

.theme-court-light .top-bar {
  padding: 10px 14px;
  background: rgba(255, 253, 248, 0.96);
  border-bottom-color: #cadacb;
}

.theme-court-light .app-title { color: #173523; }
.theme-court-light .svg-icon { stroke: #2f7d45; }

.theme-court-light .marquee-strip {
  background: linear-gradient(90deg, #2f7d45 0%, #4b9560 100%);
  border-bottom-color: rgba(31, 91, 50, 0.28);
}

.theme-court-light .marquee-content { color: #fffdf3; }

.theme-court-light .stats-strip {
  gap: 6px;
  padding: 7px 9px;
  background: #edf3ea;
  border-bottom-color: #cfddcf;
}

.theme-court-light .stat-item {
  padding: 6px 4px;
  background: #fffdf8;
  border-color: #cbdacb;
  box-shadow: 0 2px 7px rgba(42, 91, 57, 0.08);
}

.theme-court-light .s-lbl { color: #586c5e; }
.theme-court-light .s-val { color: #173523; }
.theme-court-light .s-val small { color: #607467 !important; }
.theme-court-light .c-green { color: #4f7f24; }
.theme-court-light .c-gold,
.theme-court-light .transfer-pending { color: #785000; }
.theme-court-light .c-cyan,
.theme-court-light .transfer-due { color: #08727a; }

.theme-court-light .main-content { padding: 8px; }

.theme-court-light .period-switch {
  margin-bottom: 7px;
  padding: 6px 8px;
  background: #eef6e8;
  border-color: #b8cfab;
  color: #4d6654;
}

.theme-court-light .period-switch select,
.theme-court-light .form-row input,
.theme-court-light .form-row select,
.theme-court-light .note-form select,
.theme-court-light .note-form textarea,
.theme-court-light .add-inline input,
.theme-court-light #cfgNoticeText {
  background: #fffdf8 !important;
  border-color: #bdcdbf !important;
  color: #173523 !important;
}

.theme-court-light .period-switch #periodState { color: #39752e; }

.theme-court-light .pane-toolbar {
  margin-bottom: 5px;
  padding: 4px 6px;
  background: #fffdf8;
  border-color: #c9d8ca;
  box-shadow: 0 1px 5px rgba(42, 91, 57, 0.06);
}

.theme-court-light .week-nav { color: #244c31; }
.theme-court-light .btn-s {
  background: #e3efe2;
  border-color: #9fbea4;
  color: #27653c;
}
.theme-court-light .btn-s:hover { background: #d3e7d4; }

/* A 方案核心：每天仍分组，但每节课只占一行。 */
.theme-court-light .schedule-list { gap: 5px; }
.theme-court-light .day-group { margin-bottom: 0; }
.theme-court-light .day-group-header {
  padding: 4px 8px;
  background: #e3efe2;
  border-color: #c2d4c4;
  border-bottom-color: #78a482;
  color: #244c31;
}

.theme-court-light .day-group-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 3px;
  background: #f3f5ed;
  border-color: #c9d8ca;
}

.theme-court-light .slot-card {
  display: grid;
  grid-template-columns: 94px minmax(68px, 1fr) auto auto;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 4px 5px;
  background: #fffdf8;
  border-color: #d1ddd1;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(42, 91, 57, 0.06);
}

.theme-court-light .slot-card.m-border {
  border-top-width: 1px;
  border-left: 3px solid #d19a45;
}
.theme-court-light .slot-card.a-border,
.theme-court-light .slot-card.hour-slot {
  border-top-width: 1px;
  border-left: 3px solid #3c8b59;
}
.theme-court-light .slot-card.dimmed {
  opacity: 0.62;
  filter: grayscale(0.3);
}

.theme-court-light .slot-identity {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.theme-court-light .slot-time {
  margin: 0;
  color: #1d4f31;
  font-size: 11px;
  line-height: 1.15;
}
.theme-court-light .slot-type {
  font-size: 10px;
  line-height: 1.15;
}
.theme-court-light .slot-type.morning { color: #9b6517; }
.theme-court-light .slot-type.afternoon { color: #2f7d45; }

.theme-court-light .slot-players {
  min-width: 0;
  min-height: 28px;
  padding: 2px 4px;
  background: #f1f5ec;
  border: 1px solid #e0e8dc;
  color: #607467;
}
.theme-court-light .slot-players > span:not(.p-tag) { color: #52645a !important; }
.theme-court-light .p-tag {
  background: #e2f0df;
  border-color: #a9c7aa;
  color: #235e38;
  box-shadow: none;
}
.theme-court-light .p-del { color: #b74435; }

.theme-court-light .slot-summary {
  min-width: 53px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.theme-court-light .est-txt {
  color: #7c5a24;
  white-space: nowrap;
  font-size: 9px;
}
.theme-court-light .st-ok { background: #e3f2e5; border-color: #74a87f; color: #23633a; }
.theme-court-light .st-full { background: #fae4df; border-color: #d98878; color: #9e3023; }
.theme-court-light .st-lock { background: #eceee9; border-color: #c6ccc4; color: #566159; }

.theme-court-light .slot-btns {
  justify-content: flex-end;
  flex-wrap: wrap;
  max-width: 82px;
}
.theme-court-light .btn-book-mini,
.theme-court-light .btn-full {
  background: linear-gradient(135deg, #3a8a52 0%, #26713f 100%);
  box-shadow: none;
}
.theme-court-light .btn-close-mini {
  background: #fff7f3;
  border-color: #d58b7f;
  color: #a44335;
}
.theme-court-light .btn-unlock-mini,
.theme-court-light .btn-book-past,
.theme-court-light .btn-book-mini:disabled,
.theme-court-light .btn-secondary {
  background: #e7ece5;
  border-color: #bcc9bc;
  color: #566159;
}

/* 其他功能页沿用原结构，仅同步 B 方案配色。 */
.theme-court-light .sub-tabs {
  margin-bottom: 7px;
  background: #edf3ea;
  border-color: #c9d8ca;
}
.theme-court-light .sub-tab { color: #56695b; }
.theme-court-light .sub-tab.active {
  background: #fffdf8;
  color: #2f7d45;
  border-color: #9fc3a6;
  box-shadow: 0 2px 7px rgba(42, 91, 57, 0.08);
}

.theme-court-light .pane-box,
.theme-court-light .config-form,
.theme-court-light .ov-card,
.theme-court-light .notes-course-section,
.theme-court-light .player-notes-card {
  background: #fffdf8;
  border-color: #c9d8ca;
  color: #173523;
  box-shadow: 0 2px 8px rgba(42, 91, 57, 0.07);
}
.theme-court-light .pane-box { border-color: #d4ad60; }
.theme-court-light .box-head { color: #996208; }
.theme-court-light .hl-row { border-top-color: #d8dfd3; color: #39752e; }
.theme-court-light .form-title { border-bottom-color: #d6e0d5; color: #2f7d45; }
.theme-court-light .form-help { color: #56695b; }
.theme-court-light .del-row,
.theme-court-light .note-item,
.theme-court-light .player-note-entry,
.theme-court-light .note-form {
  background: #f1f5ec;
  border-color: #d7e1d5;
  color: #173523;
}

.theme-court-light .lofi-table { background: #fffdf8; border-color: #c9d8ca; }
.theme-court-light .lofi-table th {
  background: #dfece0;
  color: #244c31;
}
.theme-court-light .lofi-table th,
.theme-court-light .lofi-table td { border-bottom-color: #dce5da; }
.theme-court-light .lofi-table td strong { color: #173523 !important; }

.theme-court-light .ov-title,
.theme-court-light .notes-course-header,
.theme-court-light .player-notes-header { border-bottom-color: #d6e0d5; color: #2f7d45; }
.theme-court-light .notes-course-header span[style*="color:#fff"] { color: #173523 !important; }
.theme-court-light .notes-course-meta,
.theme-court-light .personal-note-file-status,
.theme-court-light .note-time,
.theme-court-light .player-note-summary { color: #56695b; }
.theme-court-light .note-author,
.theme-court-light .note-form-header { color: #2f7d45; }
.theme-court-light .note-text { color: #354f3d; }

.theme-court-light .cal-badge {
  background: #f2f7f0;
  color: #31563b;
  box-shadow: none;
}
.theme-court-light .cal-badge span:first-child { color: #173523; }
.theme-court-light .cal-badge.is-pending span:last-child { color: #765000; }
.theme-court-light .transfer-total { background: #edf3ea; }

.theme-court-light .bottom-nav {
  height: calc(52px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 248, 0.98);
  border-top-color: #c6d6c6;
  box-shadow: 0 -3px 12px rgba(42, 91, 57, 0.08);
}
.theme-court-light .nav-item { color: #596b5e; }
.theme-court-light .nav-item.active { color: #2f7d45; }

.theme-court-light .modal { background: rgba(35, 60, 42, 0.52); }
.theme-court-light .modal-box {
  background: #fffdf8;
  border-color: #bdcdbf;
  box-shadow: 0 10px 35px rgba(25, 55, 33, 0.24);
}
.theme-court-light .m-title { color: #173523; }
.theme-court-light .roster-grid button,
.theme-court-light .m-actions button {
  background: #edf3ea;
  border-color: #b8c9ba;
  color: #244c31;
}

/* 浅色主题可读性与组件配色统一。 */
.theme-court-light .box-body #sponCount,
.theme-court-light .del-row strong,
.theme-court-light .ov-title > span:first-child,
.theme-court-light .player-notes-header > span:first-child,
.theme-court-light .notes-course-header > div:first-child span {
  color: #173523 !important;
}

.theme-court-light .lofi-table td span[style*="background:#1e3a8a"] {
  background: #e2f0df !important;
  border-color: #9dbda1 !important;
  color: #2f6d3f !important;
}

.theme-court-light .ov-title span[style*="color:#a3e635"],
.theme-court-light .del-row span[style*="color:#a3e635"] {
  color: #39752e !important;
}

.theme-court-light .del-row span[style*="color:#64748b"],
.theme-court-light .notes-course-section span[style*="color:#64748b"],
.theme-court-light .notes-course-section span[style*="color:#94a3b8"],
.theme-court-light .player-notes-card span[style*="color:#64748b"] {
  color: #52645a !important;
}

.theme-court-light .ov-card span[style*="color:#94a3b8"] {
  color: #59695e !important;
}

.theme-court-light .player-note-date {
  color: #245f39;
  background: #e2f0df;
  border: 1px solid #a9c7aa;
}

.theme-court-light .note-upload-btn {
  color: #286b3e;
  background: #e8f2e5;
  border-color: #adc9b0;
}

.theme-court-light .note-upload-btn:hover {
  color: #1f5933;
  background: #dbead9;
}

.theme-court-light .player-note-entry { border-left-color: #3a8a52; }

.theme-court-light .note-delete-btn {
  color: #9f352c;
  background: #fde9e5;
  border-color: #c9786d;
}

.theme-court-light .notes-course-section [style*="background:rgba(15,23,42,0.4)"] {
  background: #f1f5ec !important;
  border-color: #cbdacb !important;
}

.theme-court-light .note-date-input {
  background: #fffdf8 !important;
  border-color: #bdcdbf !important;
  color: #173523 !important;
}

.theme-court-light .form-title svg { stroke: currentColor; }

.theme-court-light #saveNoticeBtn {
  background: linear-gradient(135deg, #3a8a52 0%, #26713f 100%);
  color: #fff;
}

.theme-court-light .roster-grid button:hover {
  background: #2f7d45;
  border-color: #2f7d45;
  color: #fff;
}

@media (max-width: 360px) {
  .theme-court-light .slot-card {
    grid-template-columns: 82px minmax(62px, 1fr) auto;
  }
  .theme-court-light .slot-btns {
    grid-column: 2 / -1;
    max-width: none;
  }
}
