/* =====================================================================
   BetterTimetable — 主界面样式（界面1 + 界面2 + 界面4）
   ===================================================================== */

/* ================= 顶部导航栏 ================= */
.top-nav {
  height: var(--nav-height);
  background: var(--color-primary-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.top-nav .nav-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 16px;
  transition: background .15s;
}
.top-nav .nav-btn:active { background: rgba(255,255,255,0.15); }

/* 离线状态徽标（顶栏右侧小红色提示） */
.offline-badge {
  position: absolute;
  right: 104px; /* 避开设置齿轮(48px)与下一周按钮(~92px)区域 */
  top: 50%;
  transform: translateY(-50%);
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 10px;
  letter-spacing: 1px;
  display: none;
  align-items: center;
  gap: 3px;
  box-shadow: 0 1px 4px rgba(239,68,68,0.4);
  animation: offline-pulse 2s ease-in-out infinite;
}
.offline-badge.show { display: inline-flex; }
.offline-badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.9;
}
@keyframes offline-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.week-selector {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 500;
}
.week-selector .week-num {
  padding: 6px 14px;
  border-radius: 18px;
  background: rgba(255,255,255,0.18);
  position: relative;
}
.week-selector .week-num::after {
  content: '▾';
  margin-left: 4px;
  font-size: 12px;
  opacity: 0.7;
}

.week-nav {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  color: rgba(255,255,255,0.8);
}
.week-nav:active { background: rgba(255,255,255,0.15); color: #fff; }

/* ================= 周次下拉选择 ================= */
.week-dropdown {
  position: fixed;
  top: var(--nav-height);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  width: 220px;
  max-height: 280px;
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  overflow-y: auto;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: all .2s var(--ease-out);
}
.week-dropdown.show {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.week-dropdown-item {
  padding: 12px 16px;
  font-size: 14px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
}
.week-dropdown-item:last-child { border-bottom: none; }
.week-dropdown-item:active { background: var(--bg-page); }
.week-dropdown-item.active {
  color: var(--color-primary);
  font-weight: 600;
  background: rgba(13,148,136,0.08);
}

/* ================= 白色通知栏（点击进入界面2） ================= */
.notice-bar {
  background: #fff;
  margin: 10px 12px;
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s;
}
.notice-bar:active { transform: scale(0.99); box-shadow: var(--shadow-md); }

.notice-block {
  flex: 1;
  min-width: 0;
}
.notice-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.notice-label .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.notice-label.next .dot { background: var(--color-accent); }

.notice-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-loc {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.notice-arrow {
  align-self: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ================= 课表网格 ================= */
.timetable-wrap {
  padding: 4px 8px 20px;
}

.tt-header-row {
  display: grid;
  grid-template-columns: 38px repeat(7, 1fr);
  gap: 2px;
  margin-bottom: 4px;
}
.tt-header-cell {
  height: 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--text-muted);
}
.tt-header-cell .day-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.tt-header-cell.today .day-name { color: var(--color-primary); }
.today-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  vertical-align: middle;
}

.tt-grid {
  display: grid;
  grid-template-columns: 38px repeat(7, 1fr);
  grid-template-rows: repeat(15, 40px);
  grid-auto-rows: 0;
  grid-auto-columns: 0;
  gap: 2px;
  background: var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}
.tt-cell {
  background: #fff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: var(--text-muted);
  min-height: 40px;
  overflow: hidden;
}
.tt-cell.time-cell {
  background: transparent;
  font-size: 10px;
  flex-direction: column;
  line-height: 1.2;
  padding: 2px 0;
}
.tt-cell.time-cell .sec-name { font-weight: 600; color: var(--text-secondary); }
.tt-cell.time-cell .sec-time { font-size: 9px; color: var(--text-muted); }

/* 课程卡片 —— 普通单元格即占1格，合并时用 row-span */
.tt-course {
  position: relative;
  z-index: 5;
  background: var(--color-primary);
  color: #fff;
  border-radius: 6px;
  padding: 4px 5px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  cursor: pointer;
  transition: transform .12s, box-shadow .15s;
  min-height: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
}
.tt-course:active { transform: scale(0.96); box-shadow: 0 2px 6px rgba(0,0,0,0.2); }
.tt-course .c-name { font-weight: 600; font-size: 11px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; word-break: break-all; line-height: 1.3; max-height: 2.6em; }
.tt-course .c-loc  { font-size: 10px; opacity: 0.85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tt-course .c-teach { font-size: 9px; opacity: 0.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 当天课程高亮 */
.tt-cell.today-col .tt-course { box-shadow: 0 0 0 1.5px var(--color-primary); }

/* 当天无课程时的占位 */
.tt-empty-tip {
  grid-column: 2 / span 7;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  background: #fff;
}

/* ========= ***时间光标（非本期目标，留接口）*** ========= */
.tt-time-cursor {
  /* TODO: 实现时间光标，根据当前时间在对应 section 位置绘制一条横线 */
  /* 前置课程变灰 */
}
.tt-course.past { opacity: 0.45; filter: grayscale(0.5); }

/* ================= 课程详情弹窗 ================= */
.course-modal {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 500;
  animation: fadeIn .2s var(--ease-out);
}
.course-modal.show { display: flex; }
.course-modal .modal-card {
  width: 100%;
  background: #fff;
  border-radius: 20px 20px 0 0;
  padding: 24px 20px 30px;
  animation: slideUp .28s var(--ease-out);
}
.course-modal .modal-close {
  position: absolute;
  top: 12px; right: 16px;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: 20px;
}
.course-modal .c-modal-name {
  font-size: 20px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px;
  padding-right: 40px;
}
.course-modal .c-info-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
}
.course-modal .c-info-row:last-child { border-bottom: none; }
.course-modal .c-info-label {
  width: 70px; color: var(--text-muted); flex-shrink: 0;
}
.course-modal .c-info-value { flex: 1; color: var(--text-primary); word-break: break-all; }

/* 颜色选择器 */
.c-color-picker {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.c-color-picker input[type="color"] {
  width: 40px; height: 36px;
  border: none; border-radius: 8px;
  cursor: pointer;
  background: none;
  padding: 0;
}
.c-color-picker input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 8px; }
.c-color-picker input[type="color"]::-webkit-color-swatch { border: 1px solid var(--border-color); border-radius: 8px; }
.c-color-picker .color-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  background: var(--bg-page);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.c-color-picker .color-btn:active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.c-color-picker .color-btn.danger { color: #ef4444; border-color: rgba(239,68,68,0.3); }
.c-color-picker .color-btn.danger:active { background: #ef4444; color: #fff; border-color: #ef4444; }

@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

/* =====================================================================
   界面2 —— 通知页（全屏覆盖）
   ===================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  height: 100vh;
  background: #fff;
  z-index: 100;
  display: none;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s var(--ease-out);
  overflow: hidden;
}
.overlay.show {
  display: flex;
  transform: translateX(0);
}
.overlay.hiding-left  { transform: translateX(-100%); }
.overlay.hiding-right { transform: translateX(100%); }

/* 界面2 顶部区域 —— 固定高度，不随内容撑高 */
.notify-header {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 40px 20px 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
}
.notify-header .slide-hint {
  position: absolute;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: rgba(255,255,255,0.55);
}
.notify-header .cur-label {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
}
.notify-header .cur-name {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
}
.notify-header .cur-empty {
  font-size: 26px;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
}
.notify-header .cur-loc {
  font-size: 16px;
  margin-top: 10px;
  color: rgba(255,255,255,0.85);
}

/* 界面2 下方区域 */
.notify-body {
  flex: 1;
  padding: 20px 20px 12px;
  background: var(--bg-page);
  overflow-y: auto;
}
.next-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
/* 界面2 顶部时间卡片：当前时间 + 倒计时（内容居中） */
.now-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 20px 16px 16px;
  text-align: center;
  margin-bottom: 18px;
}
.now-card .nc-time {
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-primary-dark);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.now-card .nc-line {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-primary);
  min-height: 22px;
  line-height: 22px;
  margin-top: 8px;
}
.now-card .nc-line + .nc-line { margin-top: 0; }
.now-card .nc-line:empty { visibility: hidden; }

/* =====================================================================
   版本更新通知弹窗（每版本只自动弹一次）
   ===================================================================== */
.release-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 9999;
}
.release-card {
  background: #fff;
  border-radius: 16px;
  max-width: 420px;
  width: 100%;
  padding: 22px 22px 18px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
}
.release-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.release-badge {
  flex-shrink: 0;
  background: var(--color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}
.release-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-primary-dark);
}
.release-list {
  margin: 14px 0 18px;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.9;
  color: #475569;
}
.release-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.release-btn:active { opacity: 0.85; }

/* ================= 热修复 / 强制更新特殊弹窗（备用，HOTFIX_CONFIG 控制） =================
   - z-index 高于 .release-modal(9999)，避免双层遮罩重叠时被压在下方
   - 「立即重载」红色 / 「稍后手动重载」灰色，均需点 3 次确认
   ===================================================================== */
.hotfix-modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 10000;
}
.hotfix-modal.show { display: flex; }
.hotfix-card {
  background: #fff;
  border-radius: 18px;
  max-width: 360px;
  width: 100%;
  padding: 26px 22px 18px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.28);
  text-align: center;
  animation: slideUp .28s var(--ease-out);
}
.hotfix-icon {
  font-size: 42px;
  line-height: 1;
  margin-bottom: 12px;
}
.hotfix-title {
  font-size: 17px;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 12px;
}
.hotfix-body {
  font-size: 14px;
  line-height: 1.65;
  color: #475569;
  margin-bottom: 20px;
}
.hotfix-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hotfix-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s, background .15s;
}
.hotfix-btn:active { transform: scale(0.98); }
.hotfix-btn-reload {
  background: #dc2626;
  color: #fff;
}
.hotfix-btn-reload.counting {
  background: #991b1b;
  animation: hotfix-pulse 0.8s ease-in-out infinite;
}
.hotfix-btn-later {
  background: #e2e8f0;
  color: #64748b;
}
.hotfix-btn-later.counting {
  background: #cbd5e1;
  color: #475569;
  animation: hotfix-pulse 0.8s ease-in-out infinite;
}
@keyframes hotfix-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, 0); }
}
.hotfix-hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
}
.next-card {
  background: var(--color-primary-dark);
  color: #fff;
  border-radius: 18px;
  padding: 30px 26px;
}
.next-card .n-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 20px;
  word-break: break-all;
}
.next-card .n-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}
.next-card .n-tag {
  background: rgba(255,255,255,0.2);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 14px;
}
.next-card .n-loc {
  font-size: 40px;
  font-weight: 700;
  margin-top: 24px;
  letter-spacing: 1px;
  word-break: break-all;
}

/* 楼层地图区域 */
.floor-map {
  margin-top: 16px;
  padding: 12px;
  background: #fff;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border-color);
  position: relative;
}
.floor-map img {
  max-width: 100%;
  border-radius: 8px;
}
.floor-map .map-placeholder {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

/* ========= ***楼层地图插件（非本期目标，留接口）*** ========= */
.floor-map-room {}

/* 界面2底部关闭按钮 */
.ov2-close-btn {
  flex-shrink: 0;
  margin: 16px 20px 24px;
  height: 46px;
  background: #fff;
  border: 1.5px solid var(--color-primary);
  color: var(--color-primary);
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 2px;
  transition: background .15s, transform .1s;
}
.ov2-close-btn:active {
  background: var(--color-primary);
  color: #fff;
  transform: scale(0.98);
}

/* =====================================================================
   界面4 —— 个人空间（覆盖式，最高优先级 z-index:200）
   ===================================================================== */
.profile-overlay { z-index: 200; }

.profile-header {
  background: var(--color-primary-dark);
  color: #fff;
  padding: 16px 20px 28px;
  position: relative;
  flex-shrink: 0;
}
.profile-header .back-btn {
  position: absolute;
  top: 12px; left: 12px;
  width: 36px; height: 36px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 18px;
}
.profile-header .back-btn:active { background: rgba(255,255,255,0.15); }
.profile-header .avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
}
.profile-header .p-name { font-size: 18px; font-weight: 600; }
.profile-header .p-email { font-size: 12px; color: rgba(255,255,255,0.75); margin-top: 2px; }

.profile-body {
  flex: 1;
  overflow-y: auto;
  background: var(--bg-page);
  padding: 16px 12px 40px;
}
.profile-group {
  background: #fff;
  border-radius: 14px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.profile-version {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 0 10px;
  letter-spacing: 0.5px;
}
/* ================= 留言系统 ================= */
/* iOS 风格开关 */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch .slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 999px;
  transition: background .25s var(--ease-out);
  cursor: pointer;
}
.switch .slider::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform .25s var(--ease-out);
}
.switch input:checked + .slider { background: var(--color-primary); }
.switch input:checked + .slider::before { transform: translateX(18px); }

/* 底部滑出留言面板 */
.msg-sheet {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 600;
  animation: fadeIn .2s var(--ease-out);
}
.msg-sheet.show { display: flex; }
.msg-sheet-card {
  width: 100%;
  max-height: 82vh;
  background: var(--bg-page);
  border-radius: 20px 20px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  animation: slideUp .28s var(--ease-out);
}
.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border-color);
  margin: 6px auto 10px;
}
.msg-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}
.msg-sheet-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.msg-sheet-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.msg-sheet-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #fff;
  color: var(--text-muted);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
}
.msg-sheet-close:active { background: var(--bg-page); }

.msg-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
}
.msg-card {
  display: flex;
  gap: 10px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  animation: fadeIn .25s var(--ease-out);
}
.msg-avatar {
  width: 38px; height: 38px;
  border-radius: 50%;
  flex-shrink: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
}
.msg-body { flex: 1; min-width: 0; }
.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.msg-nick { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-bubble {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.55;
  word-break: break-word;
}

.msg-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.msg-empty-icon { font-size: 44px; display: block; margin-bottom: 10px; opacity: .55; }
.msg-empty-text { font-size: 14px; }
.msg-empty-tip { font-size: 12px; margin-top: 6px; opacity: .8; }

.msg-write-btn {
  margin-top: 4px;
  width: 100%;
  padding: 13px;
  border-radius: 12px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(13,148,136,0.28);
  transition: opacity .15s;
}
.msg-write-btn:active { opacity: .85; }

/* 发布留言弹窗字数统计 */
.msg-counter {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}
.msg-counter.over { color: #ef4444; }

/* ---- 发布留言底部半屏面板 ---- */
.compose-card {
  min-height: 62vh;
}
.compose-textarea {
  width: 100%;
  min-height: 150px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-primary);
  background: var(--bg-card);
  resize: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color .2s;
}
.compose-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}
.compose-input {
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border: 1.5px solid var(--border-color);
  border-radius: 12px;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-card);
  box-sizing: border-box;
}
.compose-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.compose-visibility {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 12px;
  cursor: pointer;
}
.cv-title { display: block; font-size: 14px; font-weight: 600; color: var(--text-primary); }
.cv-sub { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; line-height: 1.4; }
.compose-foot {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.compose-foot .msg-counter { flex: 1; margin-top: 0; }
.compose-foot .msg-write-btn { margin-top: 0; max-width: 140px; }

/* ---- 留言卡片：私密标识 / 联系方式 ---- */
.msg-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: 999px;
  vertical-align: 1px;
}
.msg-badge.private {
  background: #fef3c7;
  color: #b45309;
}
.msg-contact {
  margin-top: 6px;
  font-size: 12px;
  color: var(--color-primary);
  word-break: break-all;
}
.msg-contact::before { content: '📎 '; }

/* ================= 上传课表教程卡片 ================= */
.guide-card { text-align: center; }
.guide-img {
  display: block;
  width: 100%;
  max-height: 52vh;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin: 12px 0 6px;
  cursor: zoom-in;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  background: var(--bg-page);
}
.guide-tip {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* 图片放大查看层（高于一切弹窗，点击任意处关闭） */
.img-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1600;
  animation: fadeIn .18s var(--ease-out);
}
.img-viewer.show { display: flex; }
.img-viewer img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
}
.profile-item {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
}
.profile-item:last-child { border-bottom: none; }
.profile-item:active { background: var(--bg-page); }
.profile-item .pi-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  background: rgba(13,148,136,0.1);
  color: var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.profile-item .pi-label { flex: 1; font-size: 14px; }
.profile-item .pi-arrow { color: var(--text-muted); font-size: 14px; }
.profile-item.danger { color: #dc2626; }
.profile-item.danger .pi-icon { background: rgba(220,38,38,0.1); color: #dc2626; }

/* 上传文件区 */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  background: #fff;
  transition: border-color .2s;
}
.upload-area:active { border-color: var(--color-primary); color: var(--color-primary); }

/* ================= 弹窗（用于修改昵称/密码） ================= */
.modal-dialog {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1500;
}
.modal-dialog.show { display: flex; }
.modal-dialog .dialog-card {
  width: 86%;
  max-width: 360px;
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px;
  animation: fadeIn .2s var(--ease-out);
}
.modal-dialog .dialog-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}
.modal-dialog .dialog-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.modal-dialog .dialog-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
}
.modal-dialog .dialog-btn.cancel { background: var(--bg-page); color: var(--text-secondary); }
.modal-dialog .dialog-btn.ok { background: var(--color-primary); color: #fff; }
.modal-dialog .dialog-btn:disabled { background: var(--text-muted); cursor: not-allowed; }

/* =====================================================================
   添加课程（beta）/ 编辑课程信息 弹窗
   ===================================================================== */
.ac-body {
  max-height: 56vh;
  overflow-y: auto;
  text-align: left;
}
.ac-field { margin-bottom: 12px; }
.ac-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.ac-label i { color: #ef4444; font-style: normal; }
.ac-quick {
  font-size: 11px;
  color: var(--color-primary);
  cursor: pointer;
  user-select: none;
}
.ac-quick:active { opacity: .7; }
.ac-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  box-sizing: border-box;
  background: var(--bg-page);
  color: var(--text-primary);
}
.ac-input:focus { outline: none; border-color: var(--color-primary); }
.ac-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ac-pill {
  min-width: 34px;
  height: 30px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-page);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  box-sizing: border-box;
}
.ac-pill.on {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.ac-preview {
  margin-top: 4px;
  padding: 10px;
  background: var(--bg-page);
  border-radius: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}
.ac-scope {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0 0;
  cursor: pointer;
}
.ac-scope input { accent-color: var(--color-primary); }
.ac-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
}
