/* ============ 筝爱学 · 设计系统 ============ */
/* 米白宣纸底 / 墨黑文字 / 朱砂红点缀 / 衬线标题 */

:root {
  --bg: #f8f5ee;            /* 米白宣纸 */
  --ink: #26221c;           /* 墨黑 */
  --ink-soft: #4a443b;
  --muted: #857e70;         /* 淡墨 */
  --accent: #b03a2e;        /* 朱砂红 */
  --accent-dark: #8f2e24;
  --accent-soft: #f7e9e6;
  --card: #ffffff;
  --border: #e8e2d5;
  --border-strong: #d8d0bd;
  --green: #4a7c59;
  --shadow: 0 2px 12px rgba(38, 34, 28, 0.06);
  --radius: 12px;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  padding-bottom: 150px;
  min-height: 100vh;
}

.hidden { display: none !important; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ============ 页头 ============ */
.site-header { padding: 48px 0 6px; text-align: center; }

.brand h1 {
  font-family: var(--serif);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: 10px;
  text-indent: 10px;
  color: var(--ink);
}

.brand-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 4px;
  text-indent: 4px;
}

/* ============ 顶部切换Tab ============ */
.top-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 30px auto 10px;
  max-width: 720px;
}
.top-tab {
  flex: 1;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--muted);
  font-size: 15px;
  font-weight: 600;
  font-family: var(--serif);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
}
.top-tab:hover { border-color: var(--accent); color: var(--accent); }
.top-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ============ 搜索 ============ */
.search-section { padding: 28px 0 8px; }

.search-bar {
  display: flex;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
}

.search-bar input {
  flex: 1;
  min-height: 56px;          /* 触控设备保持充足高度余量 */
  padding: 10px 22px;
  border: 1px solid var(--border-strong);
  border-radius: 28px;
  background: var(--card);
  font-size: 16px;           /* >=16px 防止 iOS 聚焦缩放 */
  font-family: var(--sans);
  color: var(--ink);
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.search-bar input:focus { border-color: var(--accent); }
.search-bar input::placeholder { color: #b3ab9c; }

.search-bar button {
  min-height: 56px;
  padding: 0 34px;
  border: none;
  border-radius: 28px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  letter-spacing: 4px;
  cursor: pointer;
  font-family: var(--serif);
  transition: background 0.2s;
}
.search-bar button:hover { background: var(--accent-dark); }
.search-bar button:disabled { background: #c9b6b2; cursor: not-allowed; }

/* 触控设备（手机 / pad）：搜索框与按钮更高的触控余量 */
@media (pointer: coarse) {
  .search-bar input,
  .search-bar button { min-height: 60px; }
  .search-bar input { font-size: 17px; }
}

.search-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin-top: 14px;
}

/* ============ 最近搜索记录 ============ */
.recent-searches {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 14px auto 0;
}
.recent-label {
  flex: none;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--serif);
  letter-spacing: 2px;
}
.recent-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; min-width: 0; }
.recent-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 220px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  background: var(--card);
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.15s;
  min-height: 34px;   /* 触控友好 */
}
.recent-chip span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-chip:hover { border-color: var(--accent); color: var(--accent); }
.recent-chip .recent-x {
  flex: none;
  font-style: normal;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  padding: 2px;
}
.recent-chip .recent-x:hover { color: var(--accent); }
.recent-clear {
  flex: none;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  min-height: 34px;
}
.recent-clear:hover { color: var(--accent); }

/* ============ 区块标题 ============ */
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.section-title-note { font-family: var(--sans); font-size: 13px; font-weight: 400; color: var(--muted); }

/* ============ 状态 ============ */
.loading-state, .empty-state, .error-state {
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.error-state { color: var(--accent); }
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: -3px;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ 歌曲列表（搜索结果） ============ */
.song-list { list-style: none; }
.song-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  transition: border-color 0.15s, box-shadow 0.15s;
  flex-wrap: wrap;
}
.song-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.song-item.selected { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.song-item.disabled { opacity: 0.55; }

.song-play {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.song-play svg { width: 20px; height: 20px; fill: var(--ink); margin-left: 2px; }
.song-play:hover { border-color: var(--accent); }
.song-play:hover svg { fill: var(--accent); }
.song-play.playing { background: var(--accent); border-color: var(--accent); }
.song-play.playing svg { fill: #fff; margin-left: 0; }
.song-play:disabled { opacity: 0.4; cursor: not-allowed; }

.song-info { flex: 1; min-width: 180px; }
.song-name {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.saved-flag {
  display: inline-block;
  margin-left: 10px;
  font-size: 11px;
  font-family: var(--sans);
  font-weight: 400;
  color: var(--green);
  background: #eef3ec;
  padding: 2px 10px;
  border-radius: 10px;
  vertical-align: 2px;
  white-space: nowrap;
}
.song-meta { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.song-tag { flex: none; font-size: 12px; padding: 3px 10px; border-radius: 10px; background: #eef3ec; color: var(--green); }
.song-tag.vip { background: #f5efe4; color: #a08240; }
.song-tag.blocked { background: #f5e8e6; color: var(--accent); }

.song-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.song-download, .song-save-btn {
  flex: none;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--serif);
  letter-spacing: 1px;
  white-space: nowrap;
  min-height: 38px;   /* 触控友好 */
}
.song-download { border: 1px solid #2a5580; background: transparent; color: #2a5580; }
.song-download:hover { background: #e6eff7; }
.song-download:disabled { border-color: var(--border-strong); color: var(--muted); cursor: not-allowed; }

.song-save-btn { border: 1px solid var(--green); background: transparent; color: var(--green); }
.song-save-btn:hover { background: #eef3ec; }
.song-save-btn.saving { opacity: 0.7; background: #eef3ec; }
.song-save-btn.saved { background: var(--green); color: #fff; border-color: var(--green); }

/* ============ 通用按钮 ============ */
.btn {
  padding: 10px 22px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  font-family: var(--serif);
  letter-spacing: 1px;
  transition: all 0.15s;
  min-height: 42px;   /* 触控友好 */
}
.btn-primary { border: none; background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-primary:disabled { background: #c9b6b2; cursor: not-allowed; }
.btn-outline { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent-soft); }
.btn-outline:disabled { border-color: var(--border-strong); color: var(--muted); cursor: not-allowed; }
.btn-small { padding: 6px 14px; font-size: 12px; border-radius: 16px; min-height: 34px; }

/* ============ 网上找谱 ============ */
.sheets-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.sheets-header .section-title { margin-bottom: 0; }

.sheet-tabs {
  display: flex;
  gap: 10px;
  margin: 18px 0 6px;
  flex-wrap: wrap;
}
.sheet-tab {
  padding: 9px 20px;
  border-radius: 20px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 14px;
  font-family: var(--serif);
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 1px;
  min-height: 40px;   /* 触控友好 */
}
.sheet-tab:hover { border-color: var(--accent); color: var(--accent); }
.sheet-tab.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.sheet-tab em {
  font-style: normal;
  font-size: 12px;
  margin-left: 4px;
  opacity: 0.75;
}
.sheet-tab-note { color: var(--muted); font-size: 12px; margin-bottom: 14px; }

.sheet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sheet-card {
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }

.sheet-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 190px;
  border: none;
  padding: 0;
  background:
    linear-gradient(45deg, #f4f0e6 25%, transparent 25%),
    linear-gradient(-45deg, #f4f0e6 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #f4f0e6 75%),
    linear-gradient(-45deg, transparent 75%, #f4f0e6 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  cursor: zoom-in;
  overflow: hidden;
}
.sheet-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}
.sheet-thumb.broken {
  background: #f5ede8;
  color: var(--accent);
  font-size: 13px;
  cursor: default;
  line-height: 1.8;
}
.sheet-page-badge {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 2;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  padding: 3px 9px;
  border-radius: 10px;
  pointer-events: none;
}

.sheet-info { padding: 10px 14px 14px; display: flex; flex-direction: column; gap: 8px; }
.sheet-title-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 24px; }
.sheet-best {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: #a08240;
  background: #f5efe4;
  padding: 2px 8px;
  border-radius: 8px;
}
.sheet-source {
  font-size: 12px;
  color: #2a5580;
  text-decoration: none;
  border-bottom: 1px dashed #c5d4e2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.sheet-source:hover { color: var(--accent); border-bottom-color: var(--accent); }

.sheet-verify-row { display: flex; flex-direction: column; gap: 4px; min-height: 40px; }
.sheet-v-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 10px;
}
.sheet-v-tag.none { background: #f0ede4; color: var(--muted); }
.sheet-v-tag.loading { background: #f0ede4; color: var(--ink-soft); }
.sheet-v-tag.pass { background: #eef3ec; color: var(--green); }
.sheet-v-tag.fail { background: var(--accent-soft); color: var(--accent-dark); }
.sheet-v-summary { font-size: 12px; color: var(--muted); line-height: 1.5; }

.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 18px;
  font-size: 12px;
  cursor: pointer;
  font-family: var(--serif);
  letter-spacing: 1px;
  transition: all 0.15s;
  min-height: 36px;   /* 触控友好 */
  white-space: nowrap;
}
.sheet-btn.verify { border: 1px solid var(--accent); background: transparent; color: var(--accent); }
.sheet-btn.verify:hover { background: var(--accent-soft); }
.sheet-btn.verify:disabled { border-color: var(--border-strong); color: var(--muted); cursor: not-allowed; }
.sheet-btn.save { border: 1px solid var(--green); background: transparent; color: var(--green); }
.sheet-btn.save:hover { background: #eef3ec; }
.sheet-btn.save:disabled { border-color: var(--green); background: var(--green); color: #fff; cursor: default; }

/* ============ 云端曲库 ============ */
.library-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.library-hint { color: var(--muted); font-size: 13px; }

.library-list { list-style: none; }
.library-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  transition: all 0.15s;
}
.library-item:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.lib-left { flex: 1; min-width: 220px; }
.lib-name { font-family: var(--serif); font-weight: 700; font-size: 16px; }
.lib-artist { color: var(--muted); font-size: 13px; }
.lib-meta-line { color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
.lib-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.lib-badge { background: #eef3ec; color: var(--green); font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.lib-badge.score { background: var(--accent-soft); color: var(--accent-dark); }
.lib-badge.cloud { background: #e6eff7; color: #2a5580; }
.lib-badge.src { background: #f0ede4; color: var(--ink-soft); }

.lib-sheets { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.lib-sheet-thumb {
  position: relative;
  width: 96px;
  height: 72px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #f4f0e6;
  cursor: zoom-in;
  overflow: hidden;
  padding: 0;
  transition: border-color 0.15s, transform 0.15s;
}
.lib-sheet-thumb:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.lib-sheet-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lib-sheet-thumb i {
  position: absolute;
  left: 0; bottom: 0;
  right: 0;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
  padding: 3px 6px;
  background: rgba(38, 34, 28, 0.62);
  color: #fff;
  text-align: center;
  letter-spacing: 2px;
}

.lib-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.lib-action {
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--ink-soft);
  transition: all 0.15s;
  font-family: var(--serif);
  letter-spacing: 1px;
  min-height: 36px;   /* 触控友好 */
}
.lib-action:hover { border-color: var(--accent); color: var(--accent); }
.lib-action.play:hover { border-color: var(--green); color: var(--green); background: #eef3ec; }
.lib-action.play-src:hover { border-color: #2a5580; color: #2a5580; background: #e6eff7; }
.lib-action.delete:hover { border-color: var(--accent); color: #fff; background: var(--accent); }
.lib-action:disabled { opacity: 0.4; cursor: not-allowed; }

/* ============ 播放器 ============ */
.player-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: #2b2620;
  color: #f2ede2;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 28px;
  z-index: 100;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.25);
  flex-wrap: wrap;
}
/* 播放音频时：播放条固定贴最底部，底部菜单栏整体抬到播放条正上方（高度由 JS 动态测量） */
body.playing .bottom-tabs { bottom: var(--player-h, 64px); }
body.logged-in.playing { padding-bottom: calc(96px + var(--player-h, 64px)); }
.player-toggle {
  flex: none;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.player-toggle svg { width: 20px; height: 20px; fill: #fff; }
.player-toggle .icon-play { margin-left: 2px; }

.player-info { flex: 1; min-width: 0; }
.player-name {
  font-family: var(--serif);
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.player-progress {
  height: 3px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  cursor: pointer;
}
.player-progress-fill { height: 100%; background: var(--accent); border-radius: 2px; width: 0; transition: width 0.2s linear; }
.player-time { flex: none; font-size: 12px; color: #b8b0a0; font-variant-numeric: tabular-nums; }
.player-source {
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #d4c9b5;
}
.player-source.cloud { background: rgba(74,124,89,0.5); color: #fff; }
.player-source.original { background: rgba(176,58,46,0.35); color: #fff; }

/* ============ 谱子大图弹窗 ============ */
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;}
/* 时间点标记备注弹窗：需要盖在所有业务弹窗（含匿名点评/视频点评）之上 */
#markerNoteModal { z-index: 400; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(30, 22, 12, 0.65);
  backdrop-filter: blur(2px);
}
.modal-panel {
  position: relative;
  background: var(--bg);
  border-radius: 16px;
  width: min(1160px, 94vw);
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0,0,0,0.35);
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
}
.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  z-index: 5;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.06);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--accent); color: #fff; }
.modal-body {
  overflow-y: auto;
  padding: 28px 28px 30px;
}
.modal-loading {
  padding: 80px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}

.sheet-modal-panel { width: min(1000px, 96vw); }
.sheet-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding-right: 44px;
}
.sheet-modal-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
}
.sheet-modal-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.sheet-modal-sub a { color: #2a5580; }
.sheet-modal-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.sheet-modal-verify {
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 10px;
  margin-bottom: 12px;
}
.sheet-modal-verify.pass { background: #eef3ec; color: var(--green); }
.sheet-modal-verify.fail { background: var(--accent-soft); color: var(--accent-dark); }
.sheet-modal-img-wrap {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  min-height: 220px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: auto;
  max-height: 72vh;
}
.sheet-modal-img-wrap img {
  display: block;
  max-width: 100%;
  opacity: 0;
  transition: opacity 0.25s;
}
.sheet-modal-img-wrap.loaded img { opacity: 1; }
.sheet-modal-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}
.sheet-pager-btn {
  font-size: 13px;
  padding: 7px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.sheet-pager-btn:hover:not(:disabled) { border-color: var(--accent); box-shadow: var(--shadow); }
.sheet-pager-btn:disabled { opacity: 0.45; cursor: default; }
.sheet-pager-info {
  font-size: 13px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 10px 26px;
  border-radius: 22px;
  font-size: 14px;
  z-index: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  animation: toastIn 0.25s ease;
  max-width: 90vw;
}
.toast.error { background: var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } }

/* ============ 响应式 ============ */
@media (max-width: 760px) {
  .brand h1 { font-size: 32px; letter-spacing: 6px; }
  .search-bar { flex-direction: column; }
  .search-bar button { width: 100%; }
  .top-tabs { flex-direction: column; }
  .song-item { padding: 12px; }
  .song-btns { width: 100%; }
  .song-download, .song-save-btn { flex: 1; }
  .song-tag { display: none; }
  .player-time, .player-source { display: none; }
  .sheet-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .sheet-thumb { height: 160px; }
  .modal-body { padding: 18px 12px 24px; }
  .sheet-modal-head { padding-right: 0; }
  .lib-actions { width: 100%; }
  .lib-action { flex: 1; }
  .recent-searches { max-width: 100%; }
  .recent-chip { max-width: 100%; }
}

/* 触控设备：可点击元素保持最小触控目标（44px 方便手指点按） */
@media (pointer: coarse) {
  .song-play { width: 46px; height: 46px; }
  .sheet-tab { padding: 11px 20px; }
  .lib-action { padding: 10px 14px; }
  .sheet-btn { padding: 10px 10px; }
  .recent-chip { padding: 8px 14px; }
}

/* ================================================================
 * ============ 用户系统 / 视频 / 任务 / 奖励 / 工作台 ============
 * ================================================================ */

/* ---- 页头用户区（身份在退出按钮正上方） ---- */
.site-header { position: relative; padding-top: 36px; }
.header-user {
  position: absolute; top: 24px; right: 24px;
  display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
}
.user-chip {
  background: var(--card); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 20px; font-size: 13px;
  color: var(--ink-soft); box-shadow: var(--shadow);
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; line-height: 1;   /* 与退出按钮同高 */
}

/* ---- 登录/注册 ---- */
.auth-section { display: flex; justify-content: center; padding: 30px 0 60px; }
.auth-card {
  width: 100%; max-width: 460px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 28px 26px 26px; box-shadow: var(--shadow);
}
.auth-tabs { display: flex; gap: 8px; margin-bottom: 22px; }
.auth-tab {
  flex: 1; padding: 11px; border: 1px solid var(--border-strong);
  background: transparent; border-radius: 22px;
  font-size: 15px; font-weight: 600; font-family: var(--serif);
  color: var(--muted); cursor: pointer; letter-spacing: 2px;
}
.auth-tab.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.role-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.role-card {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 14px 6px 12px; border: 1.5px solid var(--border-strong); border-radius: 14px;
  background: transparent; cursor: pointer; transition: all 0.15s;
}
.role-card.active { border-color: var(--accent); background: var(--accent-soft); }
.role-emoji { font-size: 26px; }
.role-name { font-size: 15px; font-weight: 700; font-family: var(--serif); }
.role-desc { font-size: 11px; color: var(--muted); }
.auth-error {
  margin-top: 14px; padding: 10px 14px; border-radius: 10px;
  background: #fdeeee; color: var(--accent-dark); font-size: 13px;
}
.auth-tip { margin-top: 12px; font-size: 12px; color: var(--muted); text-align: center; }

/* ---- 表单 ---- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 600; }
.field input, .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: 10px; font-size: 15px; font-family: var(--sans);
  background: #fff; color: var(--ink); outline: none;
}
.field select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 14px;
}
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field textarea { resize: vertical; }
.field-note { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn-block { width: 100%; margin-top: 6px; }
.hidden-input { display: none; }
.sub-title {
  font-family: var(--serif); font-size: 17px; font-weight: 700;
  margin: 26px 0 12px; color: var(--ink);
}

/* ---- 底部Tab（触屏优先） ---- */
.bottom-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  display: flex; justify-content: space-around;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  max-width: 640px; margin: 0 auto;
}
.bottom-tab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; cursor: pointer;
  padding: 5px 2px; border-radius: 10px; min-width: 0;
}
.bt-icon { font-size: 21px; line-height: 1.15; filter: grayscale(0.85); transition: filter 0.15s; }
.bt-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bottom-tab.active .bt-icon { filter: none; transform: scale(1.12); }
.bottom-tab.active .bt-label { color: var(--accent); font-weight: 700; }
body.logged-in { padding-bottom: 96px; }

/* ---- 首页（古风水墨背景） ---- */
.home-hero {
  position: relative;
  background: linear-gradient(135deg, rgba(43, 38, 32, 0.72) 0%, rgba(61, 54, 48, 0.55) 100%),
              url('../img/gufeng-bg.jpg') center / cover no-repeat;
  border-radius: 18px; padding: 26px 22px; color: #fff;
  box-shadow: 0 6px 24px rgba(38, 34, 28, 0.28);
  overflow: hidden;
}
.home-hero::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0) 40%, rgba(38,34,28,0.12) 100%);
}
.home-hero > * { position: relative; z-index: 1; }
.home-greet { font-family: var(--serif); font-size: 22px; font-weight: 700; letter-spacing: 2px; text-shadow: 0 1px 6px rgba(0,0,0,0.4); }
.home-stats { display: flex; gap: 10px; margin-top: 16px; }
.stat-chip {
  flex: 1; background: rgba(255, 255, 255, 0.14); backdrop-filter: blur(3px); border-radius: 12px;
  padding: 10px 6px; text-align: center;
}
.stat-chip em { display: block; font-style: normal; font-size: 24px; font-weight: 800; font-family: var(--serif); }
.stat-chip span { font-size: 11px; opacity: 0.85; }
.home-lesson-tip {
  margin-top: 14px; padding: 12px 16px; border-radius: 12px;
  background: var(--accent-soft); border: 1px solid #ecc5bd;
  color: var(--accent-dark); font-size: 14px; font-weight: 600;
}

/* ---- 首页公告（最新动态） ---- */
.home-announcements {
  margin-top: 16px; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(135deg, #f7f2e8 0%, #f2ead9 100%);
  border: 1px solid #e3d5b8;
}
.announce-list { list-style: none; margin: 8px 0 0; padding: 0; }
.announce-item {
  font-size: 13px; color: var(--ink-soft); padding: 6px 0;
  border-bottom: 1px dashed #e0d3b6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.announce-item:last-child { border-bottom: none; }

/* ---- 首页老师工作台入口 ---- */
.home-workbench-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  margin-top: 14px; padding: 16px 18px; border-radius: 16px;
  background: linear-gradient(135deg, #4a3f35 0%, #6b5d4e 100%);
  border: 1px solid #3a3129; color: #fff; cursor: pointer;
  box-shadow: 0 4px 16px rgba(58, 49, 41, 0.3); transition: transform 0.15s;
}
.home-workbench-btn:hover:not(:disabled) { transform: translateY(-2px); }
.hwb-icon { font-size: 30px; }
.hwb-info { flex: 1; display: flex; flex-direction: column; gap: 3px; text-align: left; }
.hwb-title { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 1px; }
.hwb-desc { font-size: 12px; opacity: 0.8; }
.hwb-arrow { font-size: 26px; opacity: 0.5; }
.home-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.home-action-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px 8px 14px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.12s; font-family: var(--serif);
}
.home-action-btn:active { transform: scale(0.96); }
.ha-icon { font-size: 28px; }
.ha-desc { font-size: 11px; color: var(--muted); font-family: var(--sans); }
.home-task-list { background: var(--card); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.home-task-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px;
}
.home-task-item:last-child { border-bottom: none; }
.ht-points { color: var(--accent); font-weight: 700; }
.student-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.student-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 16px 10px; cursor: pointer; box-shadow: var(--shadow);
}
.sc-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; font-family: var(--serif);
}
.sc-name { font-weight: 700; font-size: 14px; }
.sc-meta { font-size: 11px; color: var(--muted); }

/* ---- 视频上传 ---- */
.upload-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.upload-drop {
  border: 2px dashed var(--border-strong); border-radius: 14px;
  padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.15s;
}
.upload-drop.drag, .upload-drop:hover { border-color: var(--accent); background: var(--accent-soft); }
.upload-drop.compact { padding: 14px; }
.upload-drop p { font-size: 15px; font-weight: 600; }
.upload-sub { font-size: 12px !important; color: var(--muted); font-weight: 400 !important; margin-top: 4px; }
.upload-icon { font-size: 34px; display: block; margin-bottom: 8px; }
.upload-drop.inline {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  min-width: 180px; flex: 1 1 180px; border-radius: 10px; text-align: left;
}
.upload-drop.inline .upload-icon { font-size: 20px; display: inline; margin: 0; }
.upload-txt { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.upload-input {
  flex: 1 1 160px; min-width: 140px; padding: 10px 12px;
  border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px; color: var(--ink);
}
.upload-input.notes { flex: 0 1 180px; }
.upload-file-info { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.upload-progress { display: flex; align-items: center; gap: 10px; margin: 10px 0 4px; }
.upload-progress-bar { flex: 1; height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.upload-progress-fill { height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.2s; }
.upload-progress-text { font-size: 13px; font-weight: 700; color: var(--accent); min-width: 38px; }

/* ---- 任务上传弹窗（独立，不混入作品广场） ---- */
.task-upload-panel { width: min(560px, 94vw); }
.tu-title { font-family: var(--serif); font-size: 20px; margin: 0 0 8px; padding-right: 32px; }
.tu-task {
  background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 14px; font-size: 14px; color: var(--ink-soft);
}
.tu-task .tu-points { margin-left: 8px; font-weight: 700; color: var(--accent); }

/* ---- 任务「可手动完成」标记 ---- */
.task-opt { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--accent-dark); background: var(--accent-soft); border: 1px solid var(--border-strong); border-radius: 999px; padding: 1px 8px; }

/* ---- 勾选框字段 ---- */
.checkbox-field { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; }
.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---- 学生选择条 ---- */
.student-select-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 16px;
  font-size: 14px; color: var(--ink-soft);
}
/* 作品页筛选栏位于「发布作品」按钮下方，需与按钮保持间距 */
#videoStudentBar { margin-top: 16px; }
.student-select-bar select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 8px 34px 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  font-size: 14px; background-color: #fff; color: var(--ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 14px;
}

/* ---- 视频卡片 ---- */
.video-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.video-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow);
}
.video-card.clickable { cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s; }
.video-card.clickable:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,0.08); border-color: var(--border-strong); }
.vc-hint { font-size: 12px; color: var(--muted); margin-right: auto; }
.vc-actions .vc-review-badge { margin-left: auto; }
.video-card.pending-review { border-left: 4px solid #d9a441; }
.video-card.reviewed { border-left: 4px solid var(--green); }
.video-card.pinned { border-color: #c9a44a; background: linear-gradient(135deg, #fffdf6 0%, #faf4e4 100%); }
.vc-pin {
  display: inline-block; margin-bottom: 6px; font-size: 11px; font-weight: 700;
  color: #9a7b2d; background: #f6ecd4; border: 1px solid #e3d1a4; border-radius: 999px; padding: 2px 10px;
}
.video-pin-note { font-size: 12px; color: #9a7b2d; margin: 0 0 10px; }
.vc-replies { margin-top: 10px; padding-top: 8px; border-top: 1px dashed #d9e5d9; }
.vc-replies.shown { margin-top: 12px; }
.vc-reply { font-size: 13px; color: var(--ink-soft); padding: 3px 0; }
.vr-by { font-weight: 700; color: var(--ink); }
.reply-form { margin-top: 12px; }
.vc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.vc-song { font-weight: 700; font-family: var(--serif); font-size: 16px; }
.vc-date { font-size: 12px; color: var(--muted); white-space: nowrap; }
.vc-notes { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.vc-meta { font-size: 12px; color: var(--muted); margin-top: 4px; }
.vc-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.vc-review-badge { font-size: 12px; color: var(--green); margin-left: auto; }
.vc-review-badge.wait { color: #d9a441; }
.vc-review {
  margin-top: 12px; padding: 12px 14px; border-radius: 12px;
  background: #f4f7f4; border: 1px solid #d9e5d9;
}
.vc-review-teacher { font-size: 13px; font-weight: 700; color: var(--green); }
.vc-review-text { font-size: 14px; margin-top: 4px; white-space: pre-wrap; }
.vc-markers { font-size: 12px; color: var(--ink-soft); margin-top: 8px; }

/* ---- 视频弹窗 ---- */
.video-modal-panel { max-width: 680px; }
.vm-title { font-family: var(--serif); font-size: 18px; margin-bottom: 4px; }
.vm-notes { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.vm-video { width: 100%; border-radius: 12px; background: #000; max-height: 52vh; }
.review-form { margin-top: 16px; border-top: 1px solid var(--border); padding-top: 14px; }
.rating-picker { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; }
.star-btn {
  background: none; border: none; font-size: 30px; color: var(--border-strong);
  cursor: pointer; padding: 2px 6px; line-height: 1;
}
.star-btn.on { color: #e8a33d; }
.rating-label { font-size: 13px; color: var(--muted); margin-left: 6px; }

/* ---- 任务条：老师点评状态徽章 ---- */
.task-review-chip { font-size: 11px; font-weight: 600; border-radius: 999px; padding: 1px 8px; margin-left: 4px; }
.task-review-chip.ok { color: var(--green); background: #e8f3e8; border: 1px solid #cfe3cf; }
.task-review-chip.wait { color: #d9a441; background: #faf3e0; border: 1px solid #ecd9a8; }

/* ---- 表演活动封面 ---- */
.perf-cover { width: 100%; max-height: 200px; object-fit: cover; border-radius: 12px; margin-bottom: 10px; display: block; }

/* ---- 发布作品弹窗内表单 ---- */
.upload-col .upload-drop { margin-bottom: 10px; }
.marker-hint { font-size: 12px; color: var(--muted); margin: 8px 0 6px; line-height: 1.5; }
.marker-list { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.marker-item { font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 6px; }
.marker-del { background: none; border: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 0 4px; }
.vm-marker {
  background: var(--accent-soft); color: var(--accent-dark); border: none;
  border-radius: 8px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.vm-delete { margin-top: 14px; text-align: center; }
.btn-danger { color: var(--accent-dark); border-color: #ecc5bd; }

/* ---- 任务 ---- */
.task-form {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; margin: 14px 0; box-shadow: var(--shadow);
}
.task-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.task-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow);
}
.task-card.status-done { opacity: 0.75; }
.task-card.status-cancelled { opacity: 0.55; }
/* 标题独占一行完整显示；徽章组换到下一行可换行排列，避免把标题挤成竖条 */
.task-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.task-title { font-weight: 700; font-family: var(--serif); font-size: 16px; overflow-wrap: anywhere; word-break: break-word; }
.task-points { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px; color: var(--accent); font-weight: 800; font-size: 14px; }
.task-desc { font-size: 13px; color: var(--ink-soft); margin-top: 6px; overflow-wrap: anywhere; }
.task-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.task-meta .overdue { color: var(--accent-dark); font-weight: 700; }
.task-attachments { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.task-attach-img { width: 110px; height: 110px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); cursor: zoom-in; }
.task-attach-video { width: 220px; border-radius: 10px; background: #000; }
.task-feedback {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  background: #f4f7f4; font-size: 13px;
}
.tf-by { color: var(--muted); font-size: 12px; margin-left: 6px; }
.task-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.attach-drop {
  border: 1.5px dashed var(--border-strong); border-radius: 12px;
  padding: 16px; text-align: center; cursor: pointer; font-size: 13px; color: var(--ink-soft);
}
.attach-drop:hover { border-color: var(--accent); }
.attach-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.attach-item { font-size: 12px; color: var(--ink-soft); }

/* ---- 奖励 ---- */
.reward-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.reward-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.reward-card.status-offered { border-left: 4px solid #e8a33d; }
.reward-card.status-claimed { border-left: 4px solid var(--accent); }
.reward-card.status-granted { border-left: 4px solid var(--green); opacity: 0.85; }
.reward-card.status-wished { border-left: 4px solid #8e7cc3; background: linear-gradient(135deg, #faf8ff 0%, var(--card) 60%); }
.reward-card.status-rejected { border-left: 4px solid #c0c0c0; opacity: 0.8; }
.reward-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.reward-title { font-weight: 700; font-family: var(--serif); font-size: 16px; }
.reward-points { color: var(--accent); font-weight: 800; white-space: nowrap; }
.reward-desc { font-size: 13px; color: var(--ink-soft); margin-top: 6px; }
.reward-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 8px; }
.reward-status.s-offered { color: #b8860b; }
.reward-status.s-claimed { color: var(--accent-dark); font-weight: 700; }
.reward-status.s-granted { color: var(--green); }
.reward-status.s-wished { color: #7a5fc9; font-weight: 700; }
.reward-status.s-rejected { color: #a0a0a0; }
.reward-actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ---- 老师工作台 ---- */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.teacher-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow);
}
.teacher-card h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 10px; }
.teacher-card-num em { font-style: normal; font-size: 30px; font-weight: 800; color: var(--accent); font-family: var(--serif); }
.teacher-card-desc { font-size: 12px; color: var(--muted); margin-top: 8px; }
.weekday-picker { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.weekday-btn {
  width: 40px; height: 40px; border-radius: 50%;
  border: 1.5px solid var(--border-strong); background: none;
  font-size: 13px; color: var(--muted); cursor: pointer;
}
.weekday-btn.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.time-range { display: flex; align-items: center; gap: 8px; }
.time-range select { flex: 1; }
.time-range-sep { color: var(--muted); font-size: 13px; flex: 0 0 auto; }
.lesson-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.lesson-item {
  padding: 10px 12px; border-radius: 10px; background: var(--bg);
  font-size: 13px;
}
.lesson-head { display: flex; justify-content: space-between; font-weight: 600; }
.lesson-date { color: var(--muted); font-weight: 400; font-size: 12px; }
.empty-hint { font-size: 13px; color: var(--muted); }

/* ---- 我的 ---- */
.me-section { display: flex; flex-direction: column; gap: 16px; }
.me-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow);
}
.me-card h3 { font-family: var(--serif); margin-bottom: 12px; }
.me-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: var(--serif);
  margin-bottom: 12px;
}
.me-name { font-size: 20px; font-weight: 700; font-family: var(--serif); }
.me-role { color: var(--muted); font-size: 13px; margin-top: 2px; }
.me-bindcode { margin-top: 14px; font-size: 14px; }
.me-bindcode b {
  font-family: var(--serif); font-size: 22px; color: var(--accent);
  letter-spacing: 3px; margin: 0 8px;
}
.rel-item { font-size: 14px; padding: 6px 0; border-bottom: 1px dashed var(--border); }
.me-points { font-size: 14px; }
.point-log { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); color: var(--ink-soft); }
.point-log.plus { color: var(--green); }
.point-log.minus { color: var(--accent-dark); }

/* ---- 管理 ---- */
.admin-filter { display: flex; gap: 10px; margin: 14px 0; }
.admin-filter select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 9px 36px 9px 14px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 14px;
  background-color: #fff; color: var(--ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 14px;
}
.admin-user-list { display: flex; flex-direction: column; gap: 10px; }
.admin-user-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 14px 16px; flex-wrap: wrap;
}
.au-info { display: flex; flex-direction: column; gap: 2px; }
.au-info b { font-size: 15px; }
.au-role { font-size: 11px; padding: 2px 8px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-dark); display: inline-block; width: fit-content; }
.au-role.r-admin { background: var(--ink); color: #fff; }
.au-role.r-teacher { background: #eaf0f7; color: #2c5f8a; }
.au-role.r-parent { background: #f7f0ea; color: #7a5c3e; }
.au-sub { font-size: 12px; color: var(--muted); }
.au-actions { display: flex; gap: 8px; align-items: center; }
.au-role-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none;
  padding: 8px 32px 8px 10px; border: 1px solid var(--border-strong); border-radius: 10px; font-size: 13px;
  background-color: #fff; color: var(--ink);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 14px;
}

/* ---- 确认弹窗 ---- */
.confirm-modal-panel { max-width: 380px; margin-top: 20vh; }

/* ---- 新增响应式 ---- */
@media (max-width: 760px) {
  .home-actions { grid-template-columns: 1fr; }
  .home-action-btn { flex-direction: row; justify-content: flex-start; padding: 14px 16px; gap: 12px; }
  .home-action-btn .ha-icon { font-size: 24px; }
  .home-action-btn span:nth-child(2) { font-size: 16px; }
  .role-picker { grid-template-columns: 1fr; }
  .role-card { flex-direction: row; justify-content: center; gap: 10px; padding: 12px; }
  .field-row { grid-template-columns: 1fr; }
  .header-user { top: 24px; right: 14px; }
  .user-chip { font-size: 11px; padding: 5px 10px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-height: 30px; }
  .header-user .btn-small { min-height: 30px; }
  .task-attach-video { width: 100%; }
  .au-role-select { max-width: 100px; }
  .bottom-tabs { max-width: 100%; }
}
@media (pointer: coarse) {
  .bottom-tab { padding: 7px 2px; min-height: 44px; justify-content: center; }
  .star-btn { font-size: 38px; padding: 6px 10px; }
  .weekday-btn { width: 46px; height: 46px; }
  .home-action-btn { min-height: 64px; }
  .upload-drop { min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
  .upload-drop.inline { min-height: auto; flex-direction: row; justify-content: flex-start; }
  .auth-tab { padding: 13px; }
  .btn { min-height: 44px; }
}

/* ---- 测试账号一键登录 ---- */
.quick-test-login { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--border-strong); }
.qt-title { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin-bottom: 10px; }
.qt-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qt-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px; border: 1px solid var(--border-strong); border-radius: 12px;
  background: var(--card); cursor: pointer; transition: all 0.15s; min-width: 0;
}
.qt-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-1px); }
.qt-btn:disabled { opacity: 0.55; cursor: wait; }
.qt-emoji { font-size: 22px; line-height: 1.1; }
.qt-name { font-size: 12px; color: var(--ink); font-weight: 600; white-space: nowrap; }
.qt-note { font-size: 11px; color: var(--muted); margin-top: 8px; }

/* ---- 老师工作台：概览 + 待点评 ---- */
.teacher-summary { margin-bottom: 18px; }
.ts-row { display: flex; gap: 10px; }
.ts-chip {
  flex: 1; background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 6px; text-align: center; box-shadow: var(--shadow);
}
.ts-chip em { display: block; font-style: normal; font-size: 22px; font-weight: 800; font-family: var(--serif); color: var(--accent-dark); }
.ts-chip span { font-size: 11px; color: var(--muted); }
.ts-students { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.ts-student {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px;
  font: inherit; text-align: left; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.ts-student:hover { border-color: var(--accent, #b98d4f); }
.ts-go { flex: none; color: var(--muted); font-size: 18px; line-height: 1; }
.ts-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex: none;
  background: var(--accent-soft); color: var(--accent-dark);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px;
}
.ts-name { font-weight: 700; font-size: 14px; }
.ts-meta { margin-left: auto; font-size: 12px; color: var(--muted); }
.teacher-block { margin-bottom: 18px; }
.sub-count {
  display: inline-block; min-width: 22px; text-align: center; margin-left: 6px;
  background: #c05b5b; color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 1px 8px;
}
.teacher-review-list { display: flex; flex-direction: column; gap: 8px; }
.tr-item {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 14px; transition: all 0.15s;
}
.tr-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.tr-song { font-weight: 700; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-owner { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.tr-date { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* ---- 视频点评弹窗内的任务信息区块（点任务查看详情复用同一弹窗） ---- */
.vm-task {
  background: linear-gradient(135deg, #f7f2e8 0%, #f2ead9 100%);
  border: 1px solid #e3d5b8; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 14px;
}
.vm-task-title { font-family: var(--serif); font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.td-title { font-family: var(--serif); font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.td-chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.td-points { color: var(--accent); font-weight: 800; font-size: 13px; }
.td-tag { font-size: 11px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 999px; padding: 2px 8px; }
.td-desc { font-size: 14px; color: var(--ink-soft); margin: 8px 0; }
.td-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12.5px; color: var(--muted); margin: 8px 0 4px; }
.td-video-title { font-family: var(--serif); font-size: 16px; font-weight: 700; margin: 16px 0 8px; }
.td-video-song { font-size: 13px; color: var(--ink-soft); margin-bottom: 8px; }
.task-card.clickable { cursor: pointer; }
.task-card.clickable:hover { border-color: var(--accent); }

/* ---- 学生数据弹窗（老师/家长点学生卡片进入） ---- */
.student-detail-panel { width: min(560px, 94vw); }
.sd-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.sd-head .sc-avatar { width: 52px; height: 52px; font-size: 22px; }
.sd-name { font-family: var(--serif); font-size: 19px; font-weight: 700; }
.sd-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sd-chips { display: flex; gap: 10px; margin-bottom: 12px; }
.sd-stats {
  display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: var(--ink-soft);
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
}
.sd-stats b { color: var(--accent-dark); }
.sd-entries { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.sd-title { font-family: var(--serif); font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.sd-tasks { display: flex; flex-direction: column; gap: 8px; }
.sd-task {
  display: flex; flex-direction: column; gap: 2px; cursor: pointer;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px;
  transition: all 0.15s;
}
.sd-task:hover { border-color: var(--accent); background: var(--accent-soft); }
.sdt-title { font-weight: 700; font-size: 14px; }
.sdt-meta { font-size: 12px; color: var(--muted); }

/* ---- 绑定关系行（可解除绑定） ---- */
.rel-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 14px;
}
.rel-row:last-child { border-bottom: none; }
.rel-icon { flex: none; }
.rel-text { flex: 1; min-width: 0; }
.rel-text b { display: block; font-size: 14px; }
.rel-text i { display: block; font-style: normal; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---- 首页：最新动态标题贴容器顶端 / 日历加载框 ---- */
.home-announcements .sub-title { margin-top: 0; }
#calGrid .loading-state, #calGrid .error-state, #calGrid .empty-state {
  grid-column: 1 / -1;
  width: 78%;
  max-width: 440px;
  margin: 10px auto;
}

/* ---- 底栏过多 Tab 时的紧凑模式 ---- */
.bottom-tabs.crowded .bt-icon { font-size: 18px; }
.bottom-tabs.crowded .bt-label { font-size: 9.5px; }

/* ---- 曲库页内部切换（找谱 / 我的曲库） ---- */
.lib-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  background: #f3efe8; border-radius: 12px; padding: 4px;
}
.lib-tab {
  flex: 1; padding: 10px 8px; border: none; border-radius: 9px;
  background: none; font-size: 14px; color: var(--ink-soft); cursor: pointer;
  transition: all 0.15s;
}
.lib-tab.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 1px 4px rgba(38, 34, 28, 0.1); }

/* ---- 任务状态徽章 ---- */
.task-status {
  display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 700;
  border-radius: 999px; padding: 2px 8px; vertical-align: middle;
}
.task-status.s-pending { color: #b8860b; background: #fdf3dd; border: 1px solid #ecd9a8; }
.task-status.s-done { color: var(--green, #3e7d3e); background: #e8f3e8; border: 1px solid #c9e2c9; }
.task-status.s-cancelled { color: var(--muted, #999); background: #f0f0f0; border: 1px solid #ddd; }
.task-status.s-missed { color: #c0392b; background: #fdeceb; border: 1px solid #f2c4c0; }
.task-status.s-late { color: #8a6d1a; background: #f7eed2; border: 1px solid #e2cf96; }
.late-hint { color: #b8860b; }
.task-repeat {
  display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 600;
  color: #6b5ca5; background: #efecf9; border: 1px solid #d8d2ef; border-radius: 999px; padding: 2px 8px;
}
.task-repeat.tp { color: #c07a1f; background: #fdf3e3; border-color: #efdcbb; }
.modal-sub { color: var(--muted, #888); font-size: 13px; margin: 0 0 14px; }

/* ---- 表演卡片 ---- */
.perf-list { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
.perf-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 16px; box-shadow: var(--shadow); border-left: 4px solid #c58f4a;
}
.perf-card.past { opacity: 0.6; border-left-color: var(--border-strong); }
.perf-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.perf-title { font-weight: 700; font-family: var(--serif); font-size: 16px; }
.perf-date { font-size: 13px; color: var(--accent-dark); font-weight: 600; white-space: nowrap; }
.perf-desc { font-size: 13px; color: var(--ink-soft); margin-top: 6px; overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.perf-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 6px; overflow-wrap: anywhere; }
.perf-signup-names { margin-top: 8px; font-size: 13px; color: var(--ink-soft); background: #f7f4ee; border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; }
.perf-card { min-width: 0; }
/* 密码输入框 + 小眼睛切换明文 */
.pw-input { position: relative; display: flex; align-items: center; }
.pw-input input { width: 100%; padding-right: 42px; }
.pw-eye { position: absolute; right: 6px; border: none; background: none; font-size: 16px; cursor: pointer; padding: 4px 6px; opacity: .7; }
.pw-eye:hover { opacity: 1; }
/* 任务详情：一键发送老师点评 */
.share-review-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; padding: 10px; background: #f2f7f2; border: 1px dashed #bcd9bc; border-radius: 10px; }
.share-review-note { font-size: 12px; color: var(--muted); }
/* 匿名点评完成页 */
.anon-done { text-align: center; padding: 18px 6px; }
.anon-done-icon { font-size: 44px; }
.anon-done h3 { font-family: var(--serif); margin: 10px 0 8px; }
.anon-done p { font-size: 14px; color: var(--ink-soft); margin: 6px 0; line-height: 1.7; }
.anon-done-tip { background: #fdf6e8; border-radius: 10px; padding: 10px 12px; text-align: left; }
.anon-done-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
/* 匿名点评：身份横幅（绑定老师转实名/已登录提示匿名） */
.anon-banner { font-size: 13px; padding: 9px 12px; border-radius: 10px; background: #eef3fb; border: 1px solid #cad8ef; color: #33507a; margin-bottom: 12px; line-height: 1.6; }
.anon-banner.warn { background: #fdf6e8; border-color: #efdcbb; color: #8a6420; }
/* 匿名点评：已有点评展示 */
.anon-review-show { background: #f7f4ee; border-radius: 12px; padding: 12px; text-align: left; margin: 10px 0; }
.anon-review-show .anon-review-by { font-weight: 700; font-size: 14px; margin-bottom: 6px; color: var(--accent-dark, #8a6420); }
.anon-review-show p { font-size: 14px; color: var(--ink-soft); margin: 4px 0; line-height: 1.7; }
/* 老师待点评队列：任务标题+期日期标注 */
.tr-task { font-size: 12px; color: var(--accent-dark, #8a6420); background: #fdf6e8; border-radius: 999px; padding: 2px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
/* 通用防溢出：长链接/无空格长文本在卡片内换行，不撑破容器 */
.td-meta, .td-desc, .vm-task, .vm-notes, .task-meta, .task-feedback, .marker-item, .perf-head, .perf-title, .lesson-item, .announce-item, .review-form textarea { overflow-wrap: anywhere; word-break: break-word; min-width: 0; }
.task-head, .task-card, .vm-task-title, .field input, .field textarea { min-width: 0; }
.perf-actions { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.perf-mine { color: var(--green, #3e7d3e); font-weight: 700; font-size: 13px; }
.perf-past { color: var(--muted); font-size: 12px; }

/* ---- 日历 ---- */
.cal-header { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 12px; }
.cal-month { font-family: var(--serif); font-size: 18px; font-weight: 700; min-width: 110px; text-align: center; }
.cal-week-row {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px;
  font-size: 12px; color: var(--muted); text-align: center; font-weight: 600;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1 / 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  cursor: pointer; padding: 2px; min-width: 0;
}
.cal-cell.empty { border: none; background: none; }
.cal-cell.today { border-color: var(--accent); background: var(--accent-soft, #f7efe2); }
.cal-cell.sel { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft, #f7efe2); }
.cal-num { font-size: 14px; font-weight: 600; }
.cal-cell.today .cal-num { color: var(--accent); font-weight: 800; }
.cal-dots { display: flex; gap: 3px; height: 6px; }
.cal-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.cal-dot.d-lessonDay { background: #4a7fb5; }
.cal-dot.d-task { background: #c58f4a; }
.cal-dot.d-taskRange { background: transparent; border: 1.5px solid #d9b98c; box-sizing: border-box; }
.cal-dot.d-perf { background: #b0576b; }
.cal-dot.d-perfDeadline { background: #7a6bb0; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin: 12px 0 4px; }
.cal-legend .cal-dot { width: 8px; height: 8px; margin-right: 4px; vertical-align: middle; }
.cal-day-events { margin-top: 14px; }
.cal-event {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px;
  padding: 10px 12px; margin-top: 8px; font-size: 14px;
}
.cal-event.d-lessonDay { border-left: 4px solid #4a7fb5; }
.cal-event.d-task { border-left: 4px solid #c58f4a; }
.cal-event.d-taskRange { border-left: 4px solid #d9b98c; opacity: .72; }
.cal-event.d-perf { border-left: 4px solid #b0576b; }
.cal-event.d-perfDeadline { border-left: 4px solid #7a6bb0; }
.cal-event.clickable { cursor: pointer; transition: background .12s; }
.cal-event.clickable:hover { background: #f6efe2; }
.ce-title { font-weight: 600; }
.ce-sub { font-size: 12px; color: var(--muted); }
.ce-sub.muted { opacity: .8; }


