:root {
  --bg: #f3f7ff;
  --card: #ffffff;
  --line: #dfe8fb;
  --text: #193255;
  --muted: #5e7599;
  --primary: #2a6df4;
  --ok: #14a36f;
  --danger: #d74a5a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
  min-height: 100vh;
  padding: 0 12px 18px;
}
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  isolation: isolate;
  margin: 0 -12px 4px;
  background: linear-gradient(180deg, #0f7a2c 0%, #0f6f2b 100%);
  border-bottom: 2px solid rgba(255, 255, 255, 0.25);
  padding: 8px 10px;
}
.top-row {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr) max-content;
  gap: 10px;
  align-items: center;
}
.top-title {
  text-align: center;
  font-size: clamp(18px, 3.4vw, 30px);
  color: #fff;
  font-weight: 700;
  letter-spacing: 1px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  user-select: none;
}
.top-btn {
  border: 0;
  border-radius: 10px;
  padding: 4px 7px;
  min-height: 0;
  line-height: 1.2;
  font-size: clamp(13px, 2.3vw, 16px);
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  background: rgba(151, 209, 166, 0.35);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
  width: auto;
  justify-self: start;
}
#btnTopCreate {
  margin-left: -6px;
  width: 65px;
  min-width: 65px;
  box-sizing: border-box;
}
#btnTopJoin { justify-self: end; margin-right: -6px; }
.top-btn:active {
  transform: translateY(1px);
}
.wrap {
  max-width: 960px;
  margin: 0 auto;
  display: grid;
  gap: 6px;
}
/* 左栏 | 新闻条、黑板、主区（座位等）— 新闻/黑板为教室页直接子元素，便于手机端与侧栏行对齐 */
.classroom-page {
  display: grid;
  grid-template-columns: minmax(65px, 65px) 1fr;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}
.classroom-page .left-tools {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
}
.classroom-page .news-strip {
  grid-column: 2;
  grid-row: 1;
}
.classroom-page .blackboard {
  grid-column: 2;
  grid-row: 2;
}
.classroom-page .class-main {
  grid-column: 2;
  grid-row: 3;
  min-height: 0;
}
.left-tools {
  display: grid;
  grid-template-rows: 26px 56px 60px 58px;
  gap: 6px;
  width: 65px;
  min-width: 65px;
  max-width: 65px;
  position: relative;
  z-index: 2;
  box-sizing: border-box;
  overflow: hidden;
}
.tool-time,
.tool-card,
.coin-wrap {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.tool-time {
  height: 26px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e9f7ea;
  border: 1px solid #b9d8bd;
  border-radius: 10px;
  color: #1d5f35;
  font-weight: 700;
  text-align: center;
  padding: 0 4px;
}
.tool-card {
  background: #f1f4f8;
  border: 1px solid #cbd5e4;
  border-radius: 12px;
  min-height: 0;
  color: #20314e;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
}
.left-tools .tool-card,
.left-tools .coin-wrap {
  min-height: 0;
  overflow: visible;
}
.left-tools .tool-card:first-of-type {
  margin-top: -4px;
}
.tool-icon { display: block; width: 28px; height: 28px; margin: 0 auto; background-size: contain; background-repeat: no-repeat; background-position: center; }
.tool-icon-msg { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2320314e'%3E%3Cpath d='M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z'/%3E%3C/svg%3E"); }
.tool-icon-bag { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2320314e'%3E%3Cpath d='M18 6h-2c0-2.21-1.79-4-4-4S8 3.79 8 6H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-6-2c1.1 0 2 .9 2 2h-4c0-1.1.9-2 2-2zm6 16H6V8h2v2c0 .55.45 1 1 1s1-.45 1-1V8h4v2c0 .55.45 1 1 1s1-.45 1-1V8h2v12z'/%3E%3C/svg%3E"); }
/* 黑板右侧「玩法介绍」：书本双页 + 蓝色星标（与主题色一致） */
.tool-icon-intro-logo {
  display: block;
  width: 28px;
  height: 28px;
  margin: 0 auto;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='3.5' y='5' width='7.5' height='13' rx='1.2' fill='%2320314e'/%3E%3Crect x='13' y='5' width='7.5' height='13' rx='1.2' fill='%2320314e' opacity='.88'/%3E%3Cpath fill='%232a6df4' d='M12 2.2l1.35 2.75 3.02.44-2.19 2.13.52 3.01L12 9.77 8.3 11.5l.52-3.01-2.19-2.13 3.02-.44L12 2.2z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.tool-text { font-size: 18px; font-weight: 600; }
.left-tools .tool-card-bag .tool-text { font-size: 13px; }
/* 侧边栏「消息」按钮：有未读时整钮高亮闪烁（未点已读/未删除的本地消息，或未标已读的验证消息） */
#btnMsg.tool-card-msg-unread {
  position: relative;
  z-index: 2;
  animation: tool-msg-unread-pulse 1.2s ease-in-out infinite;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.55), 0 0 12px rgba(59, 130, 246, 0.28);
}
@keyframes tool-msg-unread-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.48), 0 0 10px rgba(59, 130, 246, 0.2);
    border-color: #60a5fa;
  }
  50% {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.88), 0 0 18px rgba(37, 99, 235, 0.42);
    border-color: #2563eb;
  }
}
@media (prefers-reduced-motion: reduce) {
  #btnMsg.tool-card-msg-unread {
    animation: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.72), 0 0 8px rgba(59, 130, 246, 0.22);
    border-color: #3b82f6;
  }
}
/* 左侧「我记得」按钮：橙色闪烁提醒 */
#btnMemory.tool-card-memory-unread {
  position: relative;
  z-index: 2;
  animation: tool-memory-unread-pulse 1.15s ease-in-out infinite;
  border-color: #ff922b;
  box-shadow: 0 0 0 2px rgba(255, 146, 43, 0.55), 0 0 12px rgba(255, 146, 43, 0.35);
}
@keyframes tool-memory-unread-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px rgba(255, 146, 43, 0.48), 0 0 10px rgba(255, 146, 43, 0.24);
    border-color: #ffa94d;
  }
  50% {
    box-shadow: 0 0 0 3px rgba(245, 124, 0, 0.85), 0 0 18px rgba(245, 124, 0, 0.45);
    border-color: #f57c00;
  }
}
@media (prefers-reduced-motion: reduce) {
  #btnMemory.tool-card-memory-unread {
    animation: none;
    box-shadow: 0 0 0 2px rgba(245, 124, 0, 0.7), 0 0 8px rgba(255, 146, 43, 0.24);
    border-color: #f57c00;
  }
}
.coin-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  gap: 4px;
  background: transparent;
  border: none;
  min-height: 0;
}
.coin-num {
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1.4 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f0a020, #e67c00);
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(230, 124, 0, 0.35);
}
.coin-label {
  display: block;
  color: #d72b2b;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
}
.class-main {
  display: grid;
  gap: 6px;
}
.news-strip {
  height: 26px;
  margin-left: -6px;
  width: calc(100% + 6px);
  box-sizing: border-box;
  border-radius: 10px;
  border: 1px solid #c6d8f7;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
}
.news-track {
  color: #d72b2b;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
  animation: classNewsScroll var(--news-scroll-duration, 24s) linear infinite;
  padding-left: 100%;
  will-change: transform;
}
.news-blue {
  color: #2563eb;
}
@keyframes classNewsScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}
.blackboard {
  margin-top: -6px;
  margin-left: -6px;
  width: calc(100% + 6px);
  box-sizing: border-box;
  background: linear-gradient(135deg, #324451, #0f1e2a);
  border: 2px solid #c08949;
  border-radius: 12px;
  height: 224px;
  min-height: 224px;
  text-align: left;
  padding: 10px 10px;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.blackboard h2 {
  margin: 0;
  padding: 0;
}
/* 上课/课间：第一行「科目 第N课时 …」，小号字，把版面留给正文 */
.blackboard-lesson-title {
  margin: 0 0 1px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.32;
  flex-shrink: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.blackboard-lesson-title--welcome {
  text-align: center;
  color: #ff3b30;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.35;
}
.blackboard p {
  margin: 6px 0;
  font-size: 16px;
  font-weight: 600;
}
.blackboard-meta {
  display: block;
  margin: 0 0 1px;
  font-size: 12px;
  color: #ffffff;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}
.blackboard-section {
  text-align: left;
  max-width: 100%;
  margin: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font-size: 6px;
}
.blackboard-section-text {
  margin: 0;
  /* 电脑版：与科目行同字体，恢复正常可读大小 */
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.08;
  color: #ffffff;
  white-space: pre-wrap;
  word-break: break-word;
}
/* 电脑端强制覆盖（不受窗口宽度影响） */
@media (hover: hover) and (pointer: fine) {
  .blackboard-section-text {
    font-family: "Microsoft YaHei", "SimHei", sans-serif !important;
    font-size: 13px !important;
    font-weight: 500 !important;
  }
}
.blackboard-welcome-line {
  text-align: center;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.32;
  margin: 4px 0;
}
.blackboard-break-hint {
  margin: 6px 0 0;
  text-align: center;
  color: #ff3b30;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  animation: blackboardHintPulse 1.8s ease-in-out infinite;
}
@keyframes blackboardHintPulse {
  0% { opacity: 1; }
  50% { opacity: 0.72; }
  100% { opacity: 1; }
}
/* 讲台行：左空 | 讲台居中 | 玩法介绍贴右（与黑板列右缘对齐） */
.class-controls-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  justify-items: stretch;
  min-height: 70px;
  position: relative;
  z-index: 5;
  margin-top: -6px;
  margin-bottom: 8px;
}
.class-controls-spacer {
  min-width: 0;
  pointer-events: none;
}
.class-controls-bar .teacher-podium {
  grid-column: 2;
  position: relative;
  left: auto;
  transform: none;
  justify-self: center;
}
.teacher-area {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.teacher-avatar-wrap {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  cursor: pointer;
}
.teacher-avatar-wrap.show {
  display: flex;
}
.teacher-avatar-wrap img {
  width: 100%;
  height: 100%;
  max-width: 58px;
  max-height: 58px;
  object-fit: cover;
  border-radius: 4px;
}
.teacher-avatar-wrap span {
  display: none;
}
.class-controls-intro-slot {
  grid-column: 3;
  justify-self: end;
  align-self: start;
}
/* 与左侧「我的书包」同规格：65×58 */
.tool-card-intro-corner {
  width: 65px;
  min-width: 65px;
  max-width: 65px;
  height: 58px;
  min-height: 58px;
  max-height: 58px;
  box-sizing: border-box;
  padding: 0;
  margin: 0;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(37, 99, 235, 0.15);
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  background: #f1f4f8;
  border: 1px solid #cbd5e4;
  border-radius: 12px;
  color: #20314e;
  font: inherit;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: none;
}
.tool-card-intro-corner:active {
  opacity: 0.92;
}
.tool-card-intro-corner .tool-text {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.15;
}
.btn-mid {
  position: relative;
  background: #f2f4f7;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  width: 70px;
  height: 70px;
  min-width: 70px;
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2153db;
  font-weight: 700;
  font-size: 12px;
}
/* 讲台：与学生座位相反——上为黄区（凳子色）、下为灰桌面；黄区通宽；文案为下课时间 */
.btn-mid.teacher-podium {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 1px solid #d4d9de;
  border-radius: 0;
  color: #333;
  box-sizing: border-box;
  /* 讲台比通用 btn-mid 加宽：在当前基础上再加宽 20%（高度不变） */
  width: calc(70px * 1.2 * 1.15 * 1.2 * 1.2);
  min-width: calc(70px * 1.2 * 1.15 * 1.2 * 1.2);
  /* 电脑版讲台：略加高，刚好容纳老师图像 */
  height: 84px;
  min-height: 84px;
}
.btn-mid.teacher-podium .podium-top {
  flex: 0 0 23%;
  min-height: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 3px;
  box-sizing: border-box;
  background: #f0e6c8;
  border-bottom: 1px solid #d4d9de;
  font-weight: 700;
  line-height: 1.1;
}
.btn-mid.teacher-podium .podium-time {
  font-size: 11px;
  color: #1a1a1a;
  letter-spacing: -0.02em;
  text-align: center;
}
.btn-mid.teacher-podium .podium-body {
  flex: 1 1 0;
  min-height: 0;
  background: #eff1f4;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.modal-input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.teacher-modal-panel #teacherModalTitle {
  display: block;
  margin: 0 0 10px;
  padding: 8px 12px;
  background: #2f8f3a;
  color: #ffffff;
  border-radius: 8px;
  text-align: center;
}
.seat-grid {
  display: grid;
  /* 电脑端：与顶部栏同宽 960px，第1列与创建班级左对齐、第8列与进入教室右对齐 */
  width: 960px;
  margin-left: calc(-1 * (65px + 8px));
  /* 与讲台留一条缝 */
  margin-top: 0;
  box-sizing: border-box;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0;
  row-gap: 2px;
}

/* 仅电脑版：讲台与座位留一点缝（手机端不动） */
@media (min-width: 1025px) {
  /* 电脑版：减少区域间 grid gap，座位更贴近讲台 */
  .class-main {
    gap: 0 !important;
  }
  .classroom-page .class-controls-bar {
    margin-bottom: 0 !important;
  }
  .classroom-page .seat-grid {
    margin-top: 2px !important;
  }
}
.seat {
  aspect-ratio: 1 / 1.32;
  border: 1px solid #d4d9de;
  border-radius: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.seat-desk {
  position: relative;
  flex: 0 0 75%;
  min-height: 0;
  background: #eff1f4;
  border-bottom: 1px solid #d4d9de;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  padding-bottom: 2px;
}
.seat-desk img {
  max-width: 72%;
  max-height: 72%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.seat-desk .seat-avatar-fail {
  font-size: 10px;
  color: #999;
}
.seat-stool {
  flex: 0 0 25%;
  min-height: 0;
  background: #f0e6c8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: #333;
  text-align: center;
  overflow: hidden;
  padding: 0 2px;
}
.seat.my-seat {
  cursor: pointer;
}
.seat.my-seat:hover {
  border-color: #2f8f3a;
  box-shadow: 0 0 0 1px rgba(47, 143, 58, 0.4);
}
/* 每行8个座位，映射到带3条过道的11列网格 */
.seat-grid .seat:nth-child(8n + 1) { grid-column: 1; }
.seat-grid .seat:nth-child(8n + 2) { grid-column: 2; }
.seat-grid .seat:nth-child(8n + 3) { grid-column: 4; }
.seat-grid .seat:nth-child(8n + 4) { grid-column: 5; }
.seat-grid .seat:nth-child(8n + 5) { grid-column: 7; }
.seat-grid .seat:nth-child(8n + 6) { grid-column: 8; }
.seat-grid .seat:nth-child(8n + 7) { grid-column: 10; }
.seat-grid .seat:nth-child(8n + 8) { grid-column: 11; }
/* 同桌并排：中间保留一条分隔线，避免双线 */
.seat-grid .seat:nth-child(8n + 1),
.seat-grid .seat:nth-child(8n + 3),
.seat-grid .seat:nth-child(8n + 5),
.seat-grid .seat:nth-child(8n + 7) {
  border-right: 0;
}
.action-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
  /* 与座位区同宽、左右对齐 */
  width: 960px;
  margin-left: calc(-1 * (65px + 8px));
  box-sizing: border-box;
  /* 桌子与活动区之间分隔线 */
  margin-top: -4px;
  padding-top: 2px;
  border-top: 1px solid #d4d9de;
}
.action-btn {
  min-height: 46px;
  border: 1px solid #9ec5a4;
  border-radius: 8px;
  background: #e3f0e3;
  color: #18642b;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 4px;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.action-icon {
  display: block;
  font-size: 16px;
  line-height: 1;
}
.action-label {
  display: block;
  white-space: nowrap;
}

/* 14个活动 logo 的主色调（与截图风格接近） */
.action-pass-note .action-icon { color: #e17f20; }
.action-pass-note.action-pass-note--flash {
  animation: action-pass-note-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(225, 127, 32, 0.45);
}
@keyframes action-pass-note-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.03); }
}
.action-near-attack .action-icon { color: #c92a2a; }
.action-near-attack.action-near-attack--flash {
  animation: action-near-attack-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(201, 42, 42, 0.45);
}
@keyframes action-near-attack-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.03); }
}
.action-remote-attack .action-icon { color: #c92a2a; }
.action-remote-attack.action-remote-attack--flash {
  animation: action-remote-attack-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(201, 42, 42, 0.45);
}
@keyframes action-remote-attack-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.03); }
}
/* 递纸条弹窗：橙色顶栏 + 模板选择器（非系统下拉） */
.pass-note-panel .pass-note-header {
  background: linear-gradient(180deg, #ffb347 0%, #fd7e14 50%, #f76707 100%);
  box-shadow: 0 2px 10px rgba(214, 104, 0, 0.35);
}
.pass-note-panel .pass-note-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.pass-note-panel .pass-note-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #e8590c;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 各玩法/记录弹窗：顶栏高度与右上角退出与递纸条一致（仅尺寸与位置；各面板渐变色仍由 *-header / love-letter-header 等决定） */
.classlog-panel .classlog-header {
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  box-sizing: border-box;
}
/* 须高于 .xxx-panel .xxx-exit（同权重时后者会覆盖）；与递纸条退出钮同规格 */
.classlog-panel .classlog-header .classlog-exit {
  top: 8px;
  right: 10px;
  transform: none;
  padding: 8px 36px !important;
  font-size: 18px !important;
  line-height: 1.25;
  border-radius: 10px;
}
.pass-note-template-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  text-align: left;
  min-height: 46px;
  padding: 10px 12px;
  margin: 0;
  border: 1px solid #c5d4f0;
  border-radius: 10px;
  background: #fff;
  font-size: 15px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pass-note-template-trigger:active {
  background: #f1f5fb;
}
.pass-note-template-trigger-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
  color: #495057;
}
.pass-note-template-trigger-chev {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 300;
  color: #868e96;
  line-height: 1;
}
.pass-note-picker-mask {
  z-index: 220;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
/* 高于 .modal-mask(8000)（消息/书包等顶层遮罩），否则从消息里点「选同学」时面板落在下层无法点击 */
.shared-classmate-picker-mask.pass-note-picker-mask {
  z-index: 12050;
}
@media (min-width: 480px) {
  .pass-note-picker-mask {
    align-items: center;
    padding: 16px;
  }
}
.pass-note-picker-panel {
  width: 100%;
  max-width: 520px;
  max-height: min(78vh, 560px);
  background: #fff;
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
}
@media (min-width: 480px) {
  .pass-note-picker-panel {
    border-radius: 14px;
    max-height: min(82vh, 620px);
  }
}
.pass-note-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(180deg, #fff8f0, #ffecd9);
  border-bottom: 1px solid #ffd8a8;
  flex-shrink: 0;
}
.pass-note-picker-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #c2410c;
}
.pass-note-picker-close {
  border: 0;
  border-radius: 10px;
  padding: 7px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #ff922b, #fd7e14);
  cursor: pointer;
  flex-shrink: 0;
}
.pass-note-picker-close:active {
  opacity: 0.92;
}
.pass-note-picker-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 100px;
}
.pass-note-template-row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 14px;
  border: 0;
  border-bottom: 1px solid #e9eef5;
  background: #fff;
  font-size: 15px;
  line-height: 1.45;
  color: #1d2d44;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pass-note-template-row:nth-child(even) {
  background: #f8fafc;
}
/* 关系类型选择面板：行内图标 + 文案（与递纸条列表同宽） */
.relation-type-picker-row .relation-type-picker-row-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.relation-type-picker-row .relation-type-logo {
  flex-shrink: 0;
}
/* 解散关系列表面板：行内图标 + 关系说明 */
.relation-dissolve-picker-row .relation-dissolve-picker-row-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
}
.relation-dissolve-picker-row .relation-type-logo {
  flex-shrink: 0;
}
.relation-dissolve-picker-row .relation-dissolve-picker-label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}
.pass-note-template-row:active {
  background: #e8f1ff;
}
.pass-note-form .pass-note-label-blue {
  color: #2563eb;
  font-weight: 600;
}
.pass-note-form .modal-label {
  margin-top: 10px;
}
.pass-note-form .modal-label:first-of-type {
  margin-top: 0;
}
.pass-note-form #passNoteContent {
  min-height: 88px;
  resize: vertical;
}

/* 邻桌物理攻击弹窗（参考 images/near-attack-ui-reference.png） */
.near-attack-panel {
  max-width: 420px;
}
/* 邻桌物理攻击：玫红顶栏（与递纸条橙、远程蓝区分） */
.near-attack-panel .near-attack-header {
  background: linear-gradient(180deg, #fb7185 0%, #f43f5e 50%, #e11d48 100%);
  box-shadow: 0 2px 10px rgba(225, 29, 72, 0.38);
}
.near-attack-panel .near-attack-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.near-attack-panel .near-attack-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #be123c;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.near-attack-form {
  padding-bottom: 6px;
}
.near-attack-label {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
}
.near-attack-label--target {
  margin-top: 16px;
}
.near-attack-kind-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: stretch;
}
.near-attack-kind-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 4px 12px;
  margin: 0;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.near-attack-kind-card:hover {
  border-color: #ced4da;
  background: #f8f9fa;
}
.near-attack-kind-card.selected {
  border-color: #f43f5e;
  background: linear-gradient(180deg, #fff1f2 0%, #ffe4e6 100%);
  box-shadow: 0 0 0 1px rgba(244, 63, 94, 0.35);
}
.near-attack-kind-card:focus-visible {
  outline: 2px solid #339af0;
  outline-offset: 2px;
}
.near-attack-kind-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
}
.near-attack-svg {
  width: 52px;
  height: 52px;
  display: block;
}
.near-attack-kind-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: #343a40;
  padding: 0 2px;
}
@media (min-width: 380px) {
  .near-attack-kind-text {
    font-size: 12px;
  }
}
.near-attack-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ced4da;
  min-height: 46px;
}
.near-attack-actions {
  margin-top: 18px;
  padding-top: 4px;
}
.near-attack-btn-confirm {
  background: #1b5e20 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35);
}
.near-attack-btn-confirm:active {
  filter: brightness(0.95);
}

/* 远程物理攻击：海蓝顶栏（与邻桌玫红区分） */
.remote-attack-panel {
  max-width: 420px;
}
.remote-attack-panel .remote-attack-header {
  background: linear-gradient(180deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.38);
}
.remote-attack-panel .remote-attack-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.remote-attack-panel .remote-attack-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.remote-attack-form {
  padding-bottom: 6px;
}
.remote-attack-label {
  display: block;
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
}
.remote-attack-label--target {
  margin-top: 16px;
}
.remote-attack-kind-row {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  align-items: stretch;
}
.remote-attack-kind-card {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 10px 4px 12px;
  margin: 0;
  border: 2px solid #dee2e6;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.remote-attack-kind-card:hover {
  border-color: #ced4da;
  background: #f8f9fa;
}
.remote-attack-kind-card.selected {
  border-color: #3b82f6;
  background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.35);
}
.remote-attack-kind-card:focus-visible {
  outline: 2px solid #339af0;
  outline-offset: 2px;
}
.remote-attack-kind-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  font-size: 40px;
  line-height: 1;
}
.remote-attack-kind-text {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  color: #343a40;
  padding: 0 2px;
}
@media (min-width: 380px) {
  .remote-attack-kind-text {
    font-size: 12px;
  }
}
.remote-attack-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ced4da;
  min-height: 46px;
}
.remote-attack-actions {
  margin-top: 18px;
  padding-top: 4px;
}
.remote-attack-btn-confirm {
  background: #1b5e20 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35);
}
.remote-attack-btn-confirm:active {
  filter: brightness(0.95);
}

/* 取外号弹窗（蓝标签 + 绿确认，与参考图一致） */
.nickname-panel {
  max-width: 420px;
}
.nickname-panel .nickname-header {
  background: linear-gradient(180deg, #a3e635 0%, #84cc16 45%, #65a30d 100%);
  box-shadow: 0 2px 10px rgba(101, 163, 13, 0.38);
}
.nickname-panel .nickname-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.nickname-panel .nickname-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #3f6212;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.nickname-form {
  padding-bottom: 8px;
}
.nickname-label {
  display: block;
  margin: 14px 0 8px;
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}
.nickname-label:first-of-type {
  margin-top: 4px;
}
.nickname-hint {
  margin: -4px 0 8px;
  font-size: 12px;
  color: #868e96;
  line-height: 1.4;
}
.nickname-input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ced4da;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 15px;
}
.nickname-select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid #ced4da;
  min-height: 46px;
}
.nickname-row-2 {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.nickname-row-2 .nickname-select {
  flex: 1 1 0;
  min-width: 0;
}
.nickname-row-2--triggers .nickname-classmate-trigger {
  flex: 1 1 0;
  min-width: 0;
}
.nickname-row-2--triggers .pass-note-template-trigger-text {
  font-size: 13px;
}
.nickname-actions {
  margin-top: 20px;
  padding-top: 4px;
}
.nickname-btn-confirm {
  background: #1b5e20 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35);
}
.nickname-btn-confirm:active {
  filter: brightness(0.95);
}
.action-nickname.action-nickname--flash {
  animation: action-nickname-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(43, 138, 62, 0.45);
}
@keyframes action-nickname-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.03); }
}

/* 吃零食弹窗：蓝顶栏、橙选中卡片、绿确认 */
.snack-panel {
  max-width: 440px;
}
.snack-panel .snack-header {
  background: linear-gradient(180deg, #34d399 0%, #10b981 50%, #059669 100%);
  box-shadow: 0 2px 10px rgba(5, 150, 105, 0.38);
}
.snack-panel .snack-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.snack-panel .snack-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #047857;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.snack-form {
  padding-bottom: 8px;
}
.snack-label {
  display: block;
  margin: 14px 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}
.snack-kind-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.snack-kind-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid #dee2e6;
  background: #f8f9fa;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.snack-kind-card:hover {
  border-color: #adb5bd;
  background: #fff;
}
.snack-kind-card.selected,
.snack-kind-card:focus-visible {
  border-color: #fd7e14;
  background: #fff4e6;
  box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.25);
}
.snack-kind-icon {
  font-size: 1.5rem;
  line-height: 1;
}
.snack-kind-name {
  font-size: 16px;
  font-weight: 700;
  color: #212529;
}
.snack-kind-desc {
  font-size: 13px;
  color: #495057;
  line-height: 1.45;
}
.snack-actions {
  margin-top: 18px;
  padding-top: 4px;
}
.snack-btn-confirm {
  background: #1b5e20 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35);
}
.snack-btn-confirm:active {
  filter: brightness(0.95);
}
.action-snack.action-snack--flash {
  animation: action-snack-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(253, 126, 20, 0.45);
}
@keyframes action-snack-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.1); transform: scale(1.03); }
}

/* 送礼物弹窗（参考 UI：蓝标签、橙选中、售价橙色、绿确认） */
.gift-panel {
  max-width: 420px;
  width: calc(100% - 24px);
}
.gift-panel .gift-header {
  background: linear-gradient(180deg, #f472b6 0%, #ec4899 50%, #db2777 100%);
  box-shadow: 0 2px 10px rgba(219, 39, 119, 0.38);
}
.gift-panel .gift-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.gift-panel .gift-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #be185d;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.gift-form {
  padding-bottom: 8px;
}
.gift-form-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}
.gift-form-label:first-of-type {
  margin-top: 4px;
}
.gift-form .gift-classmate-trigger {
  margin-top: 0;
}
/* 礼物卡片：手机上一行 3 个，整体缩小以适配窄屏 */
.gift-kind-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 4px;
}
.gift-kind-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 2px;
  padding: 6px 3px 5px;
  border-radius: 10px;
  border: 2px solid #dee2e6;
  background: #f8f9fa;
  cursor: pointer;
  text-align: center;
  font: inherit;
  min-height: 0;
  min-width: 0;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.gift-kind-card:hover {
  border-color: #adb5bd;
  background: #fff;
}
.gift-kind-card.selected,
.gift-kind-card:focus-visible {
  border-color: #ff922b;
  background: #fff4e6;
  box-shadow: 0 0 0 2px rgba(255, 146, 43, 0.35);
}
.gift-kind-icon {
  font-size: 1.2rem;
  line-height: 1;
}
.gift-kind-name {
  font-size: 11px;
  font-weight: 700;
  color: #212529;
  line-height: 1.2;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gift-kind-desc {
  font-size: 9px;
  color: #2563eb;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  width: 100%;
}
.gift-kind-price {
  font-size: 9px;
  font-weight: 700;
  color: #e8590c;
  margin-top: auto;
  line-height: 1.2;
  white-space: nowrap;
}
@media (min-width: 400px) {
  .gift-kind-grid {
    gap: 8px;
  }
  .gift-kind-card {
    padding: 8px 5px 6px;
  }
  .gift-kind-icon {
    font-size: 1.35rem;
  }
  .gift-kind-name {
    font-size: 12px;
  }
  .gift-kind-desc {
    font-size: 10px;
  }
  .gift-kind-price {
    font-size: 10px;
    white-space: normal;
  }
}
.gift-classmate-picker-empty {
  margin: 0;
  padding: 20px 14px;
  text-align: center;
  font-size: 14px;
  color: #868e96;
  line-height: 1.45;
}
.gift-actions {
  margin-top: 16px;
  padding-top: 4px;
}
.gift-btn-confirm {
  background: #1b5e20 !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.35);
}
.gift-btn-confirm:active {
  filter: brightness(0.95);
}
.action-gift.action-gift--flash {
  animation: action-gift-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(194, 37, 92, 0.45);
}
@keyframes action-gift-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}
.action-love-letter.action-love-letter--flash {
  animation: action-love-letter-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(166, 30, 77, 0.45);
}
@keyframes action-love-letter-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}
.action-relation-bureau.action-relation-bureau--flash {
  animation: action-relation-bureau-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(232, 89, 12, 0.45);
}
@keyframes action-relation-bureau-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}
.action-heart-talk.action-heart-talk--flash {
  animation: action-heart-talk-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(194, 37, 92, 0.45);
}
@keyframes action-heart-talk-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}
.action-coin-exchange.action-coin-exchange--flash {
  animation: action-coin-exchange-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(245, 159, 0, 0.45);
}
@keyframes action-coin-exchange-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}
.relation-bureau-panel { max-width: 700px; }
.heart-talk-panel { max-width: 680px; }
.heart-talk-section-title-wrap {
  display: flex;
  justify-content: center;
  margin: 2px 0 8px;
}
.heart-talk-mode-btn {
  min-width: 132px;
  border: none !important;
  background: #e8590c !important;
  color: #fff !important;
}
.heart-talk-now-line {
  margin: 2px 0 8px;
  padding: 7px 10px;
  border-radius: 6px;
  background: #c3e6cb;
  color: #1b5e20;
  font-size: 14px;
  text-align: center;
}
.msg-coin-up { color: #0ca678; font-weight: 700; }
.msg-coin-down { color: #e03131; font-weight: 700; }
.relation-bureau-panel .memory-form {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.relation-bureau-panel .relation-section-title {
  margin: 0 0 6px;
}
.relation-bureau-panel .love-letter-label {
  margin: 8px 0 4px;
}
.relation-bureau-panel #relationVowInput {
  min-height: 56px;
  max-height: 88px;
}
.relation-type-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
.relation-type-btn {
  border: 1px solid #d0bfff;
  border-radius: 10px;
  background: #fff;
  color: #5f3dc4;
  padding: 6px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 72px;
}
.relation-type-logo { display: block; font-size: 24px; line-height: 1; margin-bottom: 4px; }
.relation-type-name { display: block; color: #495057; font-size: 12px; line-height: 1.2; text-align: center; }
.relation-type-btn.is-selected { background: #f3f0ff; border-color: #845ef7; }
.relation-pick-row { display: flex; gap: 8px; align-items: center; }
.relation-add-btn { flex: 0 0 auto; min-width: 74px; }
.relation-picked-list { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 8px; min-height: 34px; }
.relation-picked-item {
  border: 1px solid #e9d8fd;
  border-radius: 999px;
  padding: 5px 10px;
  background: #fdf4ff;
  color: #862e9c;
  cursor: pointer;
}
.relation-section-title { margin: 2px 0 8px; color: #1864ab; text-align: center; }
.relation-divider { border: 0; border-top: 1px solid #dee2e6; margin: 14px 0; }
.relation-confirm-btn { background: #2b8a3e !important; color: #fff !important; border: none !important; }
/* 时光币交易所 · 确认赠与：橙色，与下方微信购买绿按钮区分 */
#coinGiftSubmit.relation-confirm-btn { background: #f76707 !important; }
#coinGiftSubmit.relation-confirm-btn:hover { filter: brightness(0.95); }
.relation-dissolve-btn { background: #f08c00 !important; color: #fff !important; border: none !important; }
.relation-bureau-panel .relation-confirm-btn,
.relation-bureau-panel .relation-dissolve-btn {
  display: block;
  width: min(240px, 100%);
  margin: 0 auto;
}
.relation-bureau-panel .modal-actions {
  display: flex;
  justify-content: center;
  align-items: center;
}
@media (max-width: 768px) {
  .relation-bureau-panel .memory-form {
    margin: 0 5px 4px;
    padding-bottom: 2px;
  }
  .relation-bureau-panel .relation-section-title {
    font-size: 15px;
    margin: 0 0 2px;
  }
  .relation-bureau-panel .love-letter-label {
    margin: 4px 0 2px;
    font-size: 12px;
  }
  .relation-bureau-panel .relation-divider {
    margin: 6px 0;
  }
  .relation-bureau-panel #relationVowInput {
    min-height: 42px;
    max-height: 62px;
  }
  .relation-bureau-panel .modal-actions {
    margin-top: 4px;
    margin-bottom: 0;
    justify-content: center;
  }
  .relation-type-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .relation-type-btn { min-height: 58px; padding: 3px 1px; border-radius: 8px; }
  .relation-type-logo { font-size: 17px; margin-bottom: 2px; }
  .relation-type-name { font-size: 10px; line-height: 1.1; }
  .relation-picked-list { margin-top: 4px; gap: 5px; min-height: 28px; }
  .relation-picked-item { padding: 3px 8px; font-size: 12px; }
  .relation-bureau-panel .relation-confirm-btn,
  .relation-bureau-panel .relation-dissolve-btn {
    width: min(200px, 100%);
  }
  .relation-bureau-panel .coin-change-log-table {
    font-size: 13px;
  }
  .relation-bureau-panel .coin-change-log-table thead th {
    font-size: 12px;
    padding: 6px 4px 4px;
  }
  .relation-bureau-panel .coin-change-log-table tbody td {
    padding: 6px 4px;
  }
  .relation-bureau-panel .coin-change-log-time {
    font-size: 12px;
  }
  .relation-bureau-panel .coin-change-log-reason,
  .relation-bureau-panel .coin-change-log-range {
    font-size: 13px;
  }
}

.love-letter-panel,
.love-letter-write-panel {
  max-width: 640px;
}
/* 写情书 / 情书信纸：顶栏保持原粉紫渐变（不改） */
.love-letter-panel .love-letter-header,
.love-letter-write-panel .love-letter-header {
  background: linear-gradient(180deg, #f72585, #b5179e);
  box-shadow: 0 2px 10px rgba(181, 23, 158, 0.35);
}
.love-letter-panel .love-letter-exit,
.love-letter-write-panel .love-letter-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #ad1457;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 查看情书：与写情书顶栏同色 */
.love-letter-read-panel .love-letter-header {
  background: linear-gradient(180deg, #f72585, #b5179e);
  box-shadow: 0 2px 10px rgba(181, 23, 158, 0.35);
}
.love-letter-read-panel .love-letter-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.love-letter-read-panel .love-letter-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #ad1457;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 关系管理局（原共用 love-letter-header，改为靛紫） */
.relation-bureau-panel:not(.coin-exchange-panel) .love-letter-header {
  background: linear-gradient(180deg, #6366f1 0%, #4f46e5 50%, #4338ca 100%);
  box-shadow: 0 2px 10px rgba(67, 56, 202, 0.38);
}
.relation-bureau-panel:not(.coin-exchange-panel) .love-letter-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.relation-bureau-panel:not(.coin-exchange-panel) .love-letter-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #4338ca;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 时光币交易所：琥珀金 */
.coin-exchange-panel .love-letter-header {
  background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}
.coin-exchange-panel .love-letter-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.coin-exchange-panel .love-letter-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #b45309;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 心里话与心中歌：天蓝 */
.heart-talk-panel .love-letter-header {
  background: linear-gradient(180deg, #38bdf8 0%, #0ea5e9 50%, #0284c7 100%);
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.38);
}
.heart-talk-panel .love-letter-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.heart-talk-panel .love-letter-exit {
  background: rgba(255, 255, 255, 0.95);
  color: #0369a1;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.love-letter-label {
  display: block;
  margin: 12px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #7b2cbf;
}
.love-letter-label:first-of-type {
  margin-top: 4px;
}
.love-paper-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.love-paper-card {
  height: 56px;
  border-radius: 10px;
  border: 1px solid #b197fc;
  cursor: pointer;
  background: linear-gradient(180deg, #fff0f6, #ffe3ec);
  position: relative;
  overflow: hidden;
}
.love-paper-card.selected {
  box-shadow: 0 0 0 2px rgba(247, 37, 133, 0.32);
  border-color: #f72585;
}
.love-paper-card[data-paper-style="0"] {
  background:
    radial-gradient(circle at 22% 30%, rgba(255, 255, 255, 0.85) 0 9px, rgba(255, 255, 255, 0) 10px),
    radial-gradient(circle at 78% 72%, rgba(255, 255, 255, 0.78) 0 10px, rgba(255, 255, 255, 0) 11px),
    linear-gradient(180deg, #fff0f6, #ffd6e8);
}
.love-paper-card[data-paper-style="1"] {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.45) 0 6px,
      rgba(255, 255, 255, 0) 6px 13px
    ),
    linear-gradient(180deg, #fff9db, #ffec99);
}
.love-paper-card[data-paper-style="2"] {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.35) 0 2px, transparent 3px),
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.45) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 78%, rgba(255, 255, 255, 0.45) 0 2px, transparent 3px),
    linear-gradient(180deg, #e3fafc, #c5f6fa);
  background-size: 18px 18px, 18px 18px, 18px 18px, auto;
}
.love-paper-card[data-paper-style="3"] {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.35) 0 7px,
      rgba(255, 255, 255, 0) 7px 14px
    ),
    linear-gradient(180deg, #f3f0ff, #e5dbff);
}
.love-paper-card[data-paper-style="4"] {
  background:
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)),
    repeating-linear-gradient(
      0deg,
      rgba(84, 110, 122, 0.18) 0 1px,
      rgba(84, 110, 122, 0) 1px 10px
    ),
    linear-gradient(180deg, #f1f3f5, #dee2e6);
}
.love-paper-card[data-paper-style="5"] {
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.38) 0 8px, transparent 9px),
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.34) 0 8px, transparent 9px),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.2) 0 3px,
      rgba(255, 255, 255, 0) 3px 9px
    ),
    linear-gradient(180deg, #d3f9d8, #b2f2bb);
}
.love-paper-card[data-paper-style="6"] {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.45) 0 1px,
      rgba(255, 255, 255, 0) 1px 10px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.4) 0 1px,
      rgba(255, 255, 255, 0) 1px 10px
    ),
    linear-gradient(180deg, #ffe8cc, #ffd8a8);
}
.love-paper-card[data-paper-style="7"] {
  background:
    radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.72) 0 4px, transparent 5px),
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.6) 0 3px, transparent 4px),
    radial-gradient(circle at 52% 76%, rgba(255, 255, 255, 0.65) 0 4px, transparent 5px),
    linear-gradient(180deg, #dbe4ff, #bac8ff);
}
.love-paper-card[data-paper-style="8"] {
  background:
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.3) 0 4px,
      rgba(255, 255, 255, 0) 4px 8px
    ),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.2) 0 4px,
      rgba(255, 255, 255, 0) 4px 8px
    ),
    linear-gradient(180deg, #ffc9c9, #ffa8a8);
}
.love-paper-card[data-paper-style="9"] {
  background:
    radial-gradient(circle at 50% 15%, rgba(255, 255, 255, 0.55) 0 7px, transparent 8px),
    radial-gradient(circle at 16% 84%, rgba(255, 255, 255, 0.48) 0 6px, transparent 7px),
    radial-gradient(circle at 84% 84%, rgba(255, 255, 255, 0.48) 0 6px, transparent 7px),
    linear-gradient(180deg, #f8f0fc, #eebefa);
}
.love-paper-card[data-paper-style="10"] {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.3) 0 14px,
      rgba(255, 255, 255, 0) 14px 24px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(0, 0, 0, 0.04) 0 1px,
      rgba(0, 0, 0, 0) 1px 12px
    ),
    linear-gradient(180deg, #e6fcf5, #c3fae8);
}
.love-paper-card[data-paper-style="11"] {
  background:
    radial-gradient(circle at 25% 28%, rgba(255, 255, 255, 0.5) 0 6px, transparent 7px),
    radial-gradient(circle at 75% 66%, rgba(255, 255, 255, 0.48) 0 6px, transparent 7px),
    linear-gradient(180deg, #fff3bf, #ffe066);
}
.love-paper-card[data-paper-style="12"] {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.45) 0 3px,
      rgba(255, 255, 255, 0) 3px 7px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(255, 255, 255, 0.22) 0 6px,
      rgba(255, 255, 255, 0) 6px 12px
    ),
    linear-gradient(180deg, #fae8ff, #e599f7);
}
.love-paper-card[data-paper-style="13"] {
  background:
    repeating-linear-gradient(
      0deg,
      rgba(255, 255, 255, 0.35) 0 2px,
      rgba(255, 255, 255, 0) 2px 8px
    ),
    radial-gradient(circle at 82% 20%, rgba(255, 255, 255, 0.46) 0 8px, transparent 9px),
    linear-gradient(180deg, #e7f5ff, #a5d8ff);
}
.love-paper-card[data-paper-style="14"] {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.28) 0 8px,
      rgba(255, 255, 255, 0) 8px 16px
    ),
    radial-gradient(circle at 18% 72%, rgba(255, 255, 255, 0.44) 0 7px, transparent 8px),
    linear-gradient(180deg, #fff5f5, #ffc9c9);
}
/* paper_16–paper_30：与 0–14 不重复的额外信纸样式 */
.love-paper-card[data-paper-style="15"] {
  background:
    radial-gradient(ellipse 120% 45% at 50% 0%, rgba(255, 255, 255, 0.28) 0%, transparent 52%),
    radial-gradient(ellipse 110% 40% at 50% 100%, rgba(255, 255, 255, 0.22) 0%, transparent 48%),
    linear-gradient(180deg, #a5e9f5, #3bc9db);
}
.love-paper-card[data-paper-style="16"] {
  background:
    radial-gradient(circle at 17% 28%, rgba(255, 255, 255, 0.55) 0 1px, transparent 2px),
    radial-gradient(circle at 73% 62%, rgba(255, 255, 255, 0.5) 0 1px, transparent 2px),
    radial-gradient(circle at 48% 48%, rgba(255, 255, 255, 0.42) 0 1px, transparent 2px),
    linear-gradient(180deg, #e9d8fd, #c4b5fd);
  background-size: 22px 26px, 24px 22px, 20px 24px, auto;
}
.love-paper-card[data-paper-style="17"] {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0 7px, transparent 7px 20px),
    repeating-linear-gradient(180deg, #ffd8c2 0 11px, #ffb4a2 11px 23px);
}
.love-paper-card[data-paper-style="18"] {
  background:
    repeating-linear-gradient(108deg, rgba(255, 255, 255, 0.14) 0 1px, transparent 1px 9px),
    linear-gradient(180deg, #c0eb75, #82c91e);
}
.love-paper-card[data-paper-style="19"] {
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 250, 200, 0.95) 0 1px, transparent 2px),
    radial-gradient(circle at 86% 38%, rgba(255, 255, 255, 0.88) 0 1px, transparent 2px),
    radial-gradient(circle at 44% 82%, rgba(255, 248, 220, 0.85) 0 1px, transparent 2px),
    linear-gradient(180deg, #748ffc, #4263eb);
}
.love-paper-card[data-paper-style="20"] {
  background:
    radial-gradient(ellipse at 0% 45%, rgba(255, 255, 255, 0.38) 0%, transparent 58%),
    radial-gradient(ellipse at 100% 25%, rgba(255, 255, 255, 0.28) 0%, transparent 52%),
    linear-gradient(128deg, #fcc2d7, #e64980);
}
.love-paper-card[data-paper-style="21"] {
  background:
    radial-gradient(circle at 32% 38%, rgba(188, 150, 110, 0.24) 0 17px, transparent 19px),
    radial-gradient(circle at 68% 58%, rgba(160, 130, 95, 0.2) 0 21px, transparent 23px),
    linear-gradient(180deg, #fff9f0, #ffe8cc);
}
.love-paper-card[data-paper-style="22"] {
  background:
    repeating-linear-gradient(118deg, rgba(255, 255, 255, 0.16) 0 4px, transparent 4px 9px),
    repeating-linear-gradient(238deg, rgba(255, 255, 255, 0.12) 0 4px, transparent 4px 9px),
    linear-gradient(180deg, #b2f2bb, #40c057);
}
.love-paper-card[data-paper-style="23"] {
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.28) 0 2px, transparent 2px 10px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 2px, transparent 2px 13px),
    linear-gradient(180deg, #eebefa, #da77f2);
}
.love-paper-card[data-paper-style="24"] {
  background:
    radial-gradient(ellipse at 0% 0%, rgba(121, 85, 55, 0.14) 0%, transparent 48%),
    radial-gradient(ellipse at 100% 100%, rgba(121, 85, 55, 0.11) 0%, transparent 46%),
    linear-gradient(180deg, #fdf6e3, #e9e2d0);
}
.love-paper-card[data-paper-style="25"] {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.1) 0 6px,
      rgba(255, 255, 255, 0) 6px 12px
    ),
    linear-gradient(158deg, #da77f2, #5f3dc4);
}
.love-paper-card[data-paper-style="26"] {
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.58) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 54%, rgba(255, 255, 255, 0.48) 0 5px, transparent 6px),
    radial-gradient(circle at 48% 78%, rgba(255, 255, 255, 0.42) 0 4px, transparent 5px),
    linear-gradient(180deg, #d3f9fa, #99e9f2);
}
.love-paper-card[data-paper-style="27"] {
  background:
    repeating-linear-gradient(
      45deg,
      rgba(120, 80, 50, 0.16) 0 2px,
      transparent 2px 11px
    ),
    repeating-linear-gradient(
      -45deg,
      rgba(120, 80, 50, 0.13) 0 2px,
      transparent 2px 11px
    ),
    linear-gradient(180deg, #ffe8cc, #ffc078);
}
.love-paper-card[data-paper-style="28"] {
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.1) 0 1px,
      transparent 1px 5px
    ),
    linear-gradient(180deg, #ced4da, #868e96);
}
.love-paper-card[data-paper-style="29"] {
  background:
    radial-gradient(circle at 50% 118%, rgba(255, 255, 255, 0.42) 0 34%, transparent 35%),
    radial-gradient(circle at 50% 128%, rgba(255, 255, 255, 0.22) 0 46%, transparent 47%),
    linear-gradient(180deg, #ffe066, #fab005);
}
.love-letter-actions {
  margin-top: 16px;
}
.love-letter-select {
  min-height: 46px;
}

.action-seat.action-seat--flash {
  animation: action-seat-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(25, 135, 84, 0.45);
}
@keyframes action-seat-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.04); }
}

/* 换座位弹窗（规则仅在玩法介绍中展示；布局与教室一致：每行 8 座 + 过道） */
.change-seat-panel {
  width: min(920px, calc(100vw - 20px));
  max-width: 100%;
  background: #fff;
  border: 1px solid #dee2e6;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.14);
}
.change-seat-header {
  background: linear-gradient(180deg, #22d3ee 0%, #06b6d4 50%, #0e7490 100%);
  box-shadow: 0 2px 10px rgba(14, 116, 144, 0.35);
}
.change-seat-panel .change-seat-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.change-seat-panel .classlog-header .classlog-exit {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #0e7490 !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.change-seat-mode-row {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  flex-wrap: wrap;
  background: #fff;
  border-bottom: 1px solid #e9ecef;
}
.change-seat-mode-btn {
  flex: 1;
  min-width: min(140px, 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 12px 10px;
  font-size: 14px;
  font-weight: 600;
  background: #f1f3f5;
  color: #495057;
  cursor: pointer;
  line-height: 1.25;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.change-seat-mode-btn.is-selected {
  background: #e8f9ee;
  color: #1b5e20;
  border: 2px solid #2f8f3a;
  padding: 11px 9px;
}
.change-seat-grid-wrap {
  flex: 1;
  min-height: clamp(160px, 42vh, 440px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px 12px;
  background: #fff;
}
/* 换座示意图：8×5 均匀网格（与示意图一致，不含过道） */
.change-seat-select-grid--plain {
  display: grid;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  box-sizing: border-box;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px 6px;
}
.change-seat-swap-block {
  padding: 0 16px 14px;
  background: #fff;
  border-top: 1px solid #f1f3f5;
}
.change-seat-swap-block[hidden] {
  display: none !important;
}
.change-seat-swap-hint {
  display: block;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #1971c2;
  line-height: 1.35;
  cursor: pointer;
}
.change-seat-swap-select {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  display: block;
  box-sizing: border-box;
  padding: 12px 14px;
  font-size: 15px;
  font-weight: 600;
  color: #343a40;
  border: 1px solid #ced4da;
  border-radius: 10px;
  background: #fff;
  font-family: inherit;
  cursor: pointer;
  appearance: auto;
}
.change-seat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 0;
  min-width: 0;
  aspect-ratio: 1 / 1.2;
  padding: 5px 4px;
  border-radius: 10px;
  border: 1px solid #dee2e6;
  background: #e9ecef;
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  box-sizing: border-box;
  position: relative;
}
/* 示意图：不显示「第几行第几列」，保留给读屏（aria-label） */
.change-seat-cell-pos {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.change-seat-cell-main {
  font-weight: 700;
  color: #495057;
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.change-seat-cell--empty .change-seat-cell-main {
  color: #868e96;
  font-weight: 600;
}
.change-seat-cell--mine {
  background: #ffe3e3;
  border-color: #ffc9c9;
}
.change-seat-cell--mine .change-seat-cell-main {
  color: #c92a2a;
}
.change-seat-cell--classmate {
  background: #ffe3e3;
  border-color: #ffc9c9;
}
.change-seat-cell--classmate .change-seat-cell-main {
  color: #c92a2a;
  font-weight: 700;
}
.change-seat-cell--occupied {
  background: #e9ecef;
  border-color: #dee2e6;
}
.change-seat-cell--occupied .change-seat-cell-main {
  color: #495057;
  font-weight: 700;
}
.change-seat-cell.is-selected {
  background: #ffe3e3;
  border: 2px solid #e03131;
  box-shadow: 0 0 0 1px rgba(224, 49, 49, 0.18);
  padding: 4px 3px;
}
.change-seat-cell.is-selected .change-seat-cell-main {
  color: #c92a2a;
}
.change-seat-cell.is-disabled {
  cursor: not-allowed;
}
.change-seat-cell.is-disabled.change-seat-cell--mine,
.change-seat-cell.is-disabled.change-seat-cell--occupied {
  opacity: 1;
}
.change-seat-cell.is-disabled:not(.change-seat-cell--mine):not(.change-seat-cell--occupied) {
  opacity: 0.6;
}
.change-seat-panel[data-change-seat-mode="swap"]
  .change-seat-cell.is-disabled:not(.change-seat-cell--mine):not(.change-seat-cell--occupied) {
  opacity: 1;
}
.change-seat-actions {
  padding: 12px 14px 16px;
  background: #fff;
  border-top: 1px solid #e9ecef;
  gap: 12px;
  margin-top: 0;
}
.change-seat-actions .modal-btn.cancel {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  background: #e9ecef;
  border: 1px solid #ced4da;
  color: #1971c2;
  font-weight: 700;
}
.change-seat-actions .modal-btn.cancel:hover {
  background: #dee2e6;
}
.change-seat-actions .change-seat-confirm {
  flex: 1;
  min-height: 46px;
  border-radius: 12px;
  background: #2b6a3e;
  border: none;
  color: #fff;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(43, 106, 62, 0.38);
}
.change-seat-actions .change-seat-confirm:hover {
  filter: brightness(1.05);
}
.change-seat-loading {
  text-align: center;
  color: #868e96;
  padding: 24px;
  margin: 0;
  grid-column: 1 / -1;
}
.msg-seat-ex-cancel {
  background: #6c757d !important;
  color: #fff !important;
  border: none !important;
}

/* 传八卦新动态后 15 秒内：闪烁「消息」按钮（与未读样式可叠加） */
#btnMsg.tool-card-gossip-hint {
  position: relative;
  z-index: 2;
  animation: tool-gossip-hint-pulse 1.1s ease-in-out infinite;
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.5), 0 0 12px rgba(124, 58, 237, 0.28);
}
@keyframes tool-gossip-hint-pulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.45), 0 0 10px rgba(124, 58, 237, 0.2);
    border-color: #8b5cf6;
  }
  50% {
    box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.75), 0 0 16px rgba(109, 40, 217, 0.38);
    border-color: #6d28d9;
  }
}
@media (prefers-reduced-motion: reduce) {
  #btnMsg.tool-card-gossip-hint {
    animation: none;
    box-shadow: 0 0 0 2px rgba(109, 40, 217, 0.65), 0 0 8px rgba(124, 58, 237, 0.22);
    border-color: #7c3aed;
  }
}
.gossip-panel {
  width: min(520px, calc(100vw - 24px));
  max-height: min(92vh, calc(100vh - 20px));
  display: flex;
  flex-direction: column;
}
.gossip-header {
  background: linear-gradient(180deg, #c4b5fd 0%, #8b5cf6 45%, #6d28d9 100%);
  box-shadow: 0 2px 10px rgba(109, 40, 217, 0.38);
}
.gossip-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.gossip-exit {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #5b21b6 !important;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.gossip-body {
  padding: 14px 16px 18px;
  background: #fff;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.gossip-field-label {
  display: block;
  font-weight: 700;
  margin: 10px 0 6px;
  color: #343a40;
  font-size: 15px;
}
.gossip-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 120px;
  padding: 10px 12px;
  border: 1px solid #ced4da;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
}
.gossip-select {
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border: 1px solid #ced4da;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  background: #fff;
  margin-top: 2px;
}
.gossip-cost-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: #868e96;
  line-height: 1.4;
}
.gossip-actions {
  margin-top: 16px;
}
.gossip-send-btn {
  background: #2b6a3e !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700;
}
.gossip-respond-lead {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1971c2;
  line-height: 1.4;
}
.gossip-respond-choice-hint {
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.5;
  color: #495057;
  background: #f1f3f5;
  border-radius: 10px;
  border: 1px solid #dee2e6;
}
.gossip-respond-choice-hint strong {
  color: #212529;
}
.gossip-content-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  font-size: 15px;
  line-height: 1.5;
  color: #212529;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
}
.gossip-forward-block {
  margin-top: 14px;
}
.gossip-respond-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
  justify-content: flex-end;
}
.gossip-respond-btns .modal-btn {
  min-height: 44px;
  flex: 1 1 118px;
}
.msg-gossip-pending-body {
  line-height: 1.45;
}
.msg-gossip-pending-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-top: 12px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 10px;
  border: 1px solid #e9ecef;
}
.msg-gossip-sel-label {
  font-weight: 700;
  font-size: 14px;
  color: #343a40;
  flex-shrink: 0;
}
.msg-gossip-forward-trigger {
  flex: 1 1 220px;
  min-width: 170px;
  width: 100%;
  margin: 0;
  min-height: 48px;
  padding: 10px 12px;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.msg-gossip-forward-trigger .pass-note-template-trigger-text {
  font-size: 15px;
  font-weight: 600;
}
.msg-gossip-pending-actions {
  margin-top: 12px;
}
.msg-gossip-pending-actions .msg-item-actions-inline {
  width: 100%;
  justify-content: stretch;
  gap: 10px 12px;
}
#msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-believe,
#msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-doubt,
#msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-dead-believe {
  min-height: 48px;
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  border-radius: 12px;
  flex: 1 1 calc(50% - 6px);
  min-width: 0;
  white-space: normal;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-dead-believe {
  flex: 1 1 100%;
  margin-top: 2px;
}

.seat-nickname {
  position: absolute;
  top: 2px;
  left: 2px;
  right: 2px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.15;
  color: #e03131;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  z-index: 1;
  pointer-events: none;
  letter-spacing: -0.02em;
  padding: 0 1px;
  box-sizing: border-box;
}

/* 荣誉勋章区（标题与 ✓打卡区 共用 .bag-section-label 居中） */
.bag-medal-strip-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  /* 外边距由 .bag-section-label 统一 */
  font-size: 15px;
  font-weight: 700;
  color: #2563eb;
}
.bag-medal-strip-title-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.bag-medal-strip-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 6px 4px;
  padding: 8px 6px 8px;
  border-radius: 12px;
  border: 2px solid #e6c35c;
  background: linear-gradient(180deg, #fffbeb 0%, #fff8e1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}
.bag-medal-item {
  flex: 1 1 56px;
  min-width: 56px;
  max-width: 72px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.bag-medal-icon-wrap {
  width: 48px;
  height: 48px;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.bag-medal-icon-svg {
  width: 48px;
  height: 48px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}
.bag-medal-meta {
  width: 100%;
}
.bag-medal-name {
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  word-break: keep-all;
}
.bag-medal-name--note { color: #e03131; }
.bag-medal-name--martial { color: #862e2e; }
.bag-medal-name--sniper { color: #5c3ecf; }
.bag-medal-name--naming { color: #1b6e2f; }
.bag-medal-name--food { color: #c2410c; }
.bag-medal-level {
  font-weight: 800;
  font-size: 10px;
  opacity: 0.95;
}
.bag-medal-freq {
  margin-top: 2px;
  font-size: 10px;
  font-weight: 500;
  color: #868e96;
  line-height: 1.2;
}
/* 手机：书包弹窗压缩纵向；五枚勋章单行收紧 */
@media (max-width: 640px) {
  .modal-mask.bag-panel-mask {
    padding: 8px 10px;
  }
  .bag-panel-mask .msg-panel.bag-panel {
    padding: 6px 8px 8px;
    max-height: min(88dvh, calc(100vh - 20px));
  }
  .bag-panel-mask .bag-panel-header {
    margin-bottom: 2px;
  }
  .bag-panel-mask .bag-checkin-card {
    padding: 6px 8px;
    border-radius: 9px;
  }
  .bag-panel-mask .bag-checkin-row {
    gap: 6px;
    align-items: center;
  }
  .bag-panel-mask .bag-checkin-rule {
    margin-bottom: 2px;
    font-size: 11px;
    line-height: 1.35;
  }
  .bag-panel-mask .bag-checkin-btn {
    width: 66px;
    height: 66px;
    font-size: 15px;
  }
  .bag-panel-mask .bag-checkin-msg {
    margin-top: 4px;
  }
  .bag-panel-mask .bag-section-label {
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.2;
  }
  .bag-panel-mask .bag-medal-strip {
    margin-top: 4px;
  }
  .bag-panel-mask .bag-medal-strip-title {
    margin-bottom: 3px;
    font-size: 13px;
    gap: 4px;
  }
  .bag-panel-mask .bag-medal-strip-title-icon svg {
    width: 16px;
    height: 16px;
  }
  .bag-panel-mask .bag-medal-strip-inner {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0 1px;
    padding: 4px 1px 6px;
  }
  .bag-panel-mask .bag-medal-item {
    flex: 1 1 0;
    min-width: 0;
    max-width: none;
  }
  .bag-panel-mask .bag-medal-icon-wrap {
    width: 34px;
    height: 34px;
    margin-bottom: 3px;
  }
  .bag-panel-mask .bag-medal-icon-svg {
    width: 34px;
    height: 34px;
  }
  .bag-panel-mask .bag-medal-name {
    font-size: 9px;
    line-height: 1.15;
  }
  .bag-panel-mask .bag-medal-level {
    font-size: 8px;
  }
  .bag-panel-mask .bag-medal-freq {
    font-size: 8px;
    margin-top: 1px;
  }
}
.action-nickname .action-icon { color: #2b8a3e; }
.action-snack .action-icon { color: #f08c00; }
.action-heart-talk .action-icon { color: #d6336c; }
.action-gift .action-icon { color: #c2255c; }
.action-seat .action-icon { color: #4263eb; }
.action-gossip .action-icon { color: #7048e8; }
.action-gossip.action-gossip--flash {
  animation: action-gossip-flash 1.1s ease-in-out infinite;
  box-shadow: 0 0 0 2px rgba(112, 72, 232, 0.45);
}
@keyframes action-gossip-flash {
  0%, 100% { filter: brightness(1); transform: scale(1); }
  50% { filter: brightness(1.12); transform: scale(1.03); }
}
.action-love-letter .action-icon { color: #a61e4d; }
.action-coin-exchange .action-icon { color: #e67700; }
/* 时光币交易所：用矢量图标替代 🪙（旧系统/部分字体不显示） */
.action-coin-exchange .action-icon svg {
  display: block;
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}
.action-relation-bureau .action-icon { color: #e8590c; }
.action-memory .action-icon { color: #f76707; }
.action-class-log .action-icon { color: #0b7285; }
.dev-hidden {
  display: none;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(25, 50, 85, 0.08);
}
h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
}
.sub { margin-top: 8px; color: var(--muted); }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
label {
  display: block;
  margin: 8px 0 6px;
  font-size: 14px;
  color: var(--muted);
}
input {
  width: 100%;
  border: 1px solid #c9d8fa;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
}
input:focus { border-color: #7ea4fb; }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 15px;
  cursor: pointer;
  color: #fff;
  background: var(--primary);
  margin-top: 10px;
  margin-right: 8px;
}
.btn.ok { background: var(--ok); }
.btn.gray { background: #6b7f9f; }
.badge {
  display: inline-block;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #e9f0ff;
  color: #2a5cc8;
  margin-left: 8px;
}
.tips {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}
#msg {
  min-height: 24px;
  margin-top: 8px;
  font-size: 14px;
}
.err { color: var(--danger); }
.okText { color: var(--ok); }
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 14px;
}
th, td {
  border-bottom: 1px solid #e6eefc;
  text-align: left;
  padding: 9px 8px;
}
th { color: var(--muted); font-weight: 600; }
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 28, 48, 0.45);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 8000;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.modal-mask.show { display: flex; }

/* 手机端离开确认：居中、叠在最上 */
.leave-confirm-mask {
  align-items: center;
  justify-content: center;
  z-index: 9000;
  padding: 16px;
}
.modal-leave-confirm {
  width: min(320px, calc(100% - 24px));
  max-height: none;
  padding: 18px 16px 16px;
}
.modal-leave-confirm h3 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
}
.modal-leave-confirm .modal-actions {
  margin-top: 4px;
}

/* 消息面板：标题+橙色退出、说明文、圆角白底卡片列表 */
.msg-panel-mask {
  align-items: flex-start;
  padding-top: 20px;
}
/* 我的书包弹窗：整块面板在屏幕中居中 */
.modal-mask.bag-panel-mask {
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  padding-top: 10px;
}
.msg-panel {
  width: min(720px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  background: var(--bg);
  border-radius: 14px;
  padding: 14px 16px;
}
.msg-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.msg-panel-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  text-align: left;
  flex: 1;
}
.msg-panel-exit {
  border: 0;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(180deg, #4f8ff7, #2563eb);
  cursor: pointer;
}
.msg-panel-exit:active { opacity: 0.9; }

/* 玩法介绍弹窗 */
.intro-guide-mask {
  align-items: center;
  justify-content: center;
  padding: 16px;
  padding-top: 16px;
}
.intro-guide-panel {
  width: min(640px, 100%);
  /* 须给定确定高度，否则 flex:1 的 .intro-guide-detail 在仅 max-height 时会被算成 0 高，正文不显示 */
  height: min(86vh, 720px);
  max-height: min(86vh, 720px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.intro-guide-hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: #5c6570;
  line-height: 1.45;
}
.intro-guide-types {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8ecf1;
  max-height: 40vh;
  overflow-y: auto;
  flex-shrink: 0;
}
.intro-guide-group {
  margin-bottom: 14px;
}
.intro-guide-group:last-child {
  margin-bottom: 0;
}
.intro-guide-group-title {
  font-size: 13px;
  font-weight: 700;
  color: #2a6df4;
  margin: 0 0 8px;
  letter-spacing: 0.03em;
}
.intro-guide-group:first-child .intro-guide-group-title {
  margin-top: 0;
}
.intro-guide-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.intro-guide-chip {
  border: 1px solid #c9d4e3;
  background: #f4f7fb;
  color: #1a2a3d;
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.intro-guide-chip:hover {
  background: #e8f0fc;
  border-color: #8eb4e8;
}
.intro-guide-chip.is-active {
  background: linear-gradient(180deg, #fff4e8, #ffe8d4);
  border-color: #ff9f4a;
  color: #8b4513;
  box-shadow: 0 1px 0 rgba(255, 140, 60, 0.2);
}
.intro-guide-detail {
  flex: 1 1 auto;
  min-height: 8rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 4px;
}
.intro-guide-detail-title {
  margin: 0 0 12px;
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}
.intro-guide-detail-body p {
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.65;
  color: #3d4a5c;
}
.intro-guide-detail-body p:last-child {
  margin-bottom: 0;
}
/* 玩法介绍「消息」条：与原先消息弹窗说明同款字号/色 */
.intro-guide-detail-body .intro-guide-msg-blurb {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: #6d7f99;
}
.intro-guide-empty {
  color: #888;
  font-size: 14px;
}

/* 班级记录弹窗 */
.classlog-mask {
  align-items: center;
  justify-content: center;
  padding: 10px;
  z-index: 180;
}
.classlog-panel {
  width: min(720px, 100%);
  max-height: min(92vh, calc(100vh - 20px));
  background: #f6f8fc;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid #d6e1f5;
  display: flex;
  flex-direction: column;
}
.classlog-header {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: linear-gradient(180deg, #34c46a, #1f9f4b);
}
.classlog-title {
  margin: 0;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
}
.classlog-exit {
  position: absolute;
  border: 0;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(180deg, #4f8ff7, #2563eb);
  cursor: pointer;
  box-sizing: border-box;
  line-height: 1.2;
}
/* 班级记录：灰蓝顶栏（仅默认绿顶栏的纯 classlog 弹窗） */
#classLogMask .classlog-header {
  background: linear-gradient(180deg, #94a3b8 0%, #64748b 50%, #475569 100%);
  box-shadow: 0 2px 10px rgba(71, 85, 105, 0.35);
}
#classLogMask .classlog-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
#classLogMask .classlog-header .classlog-exit {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #1e293b !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
/* 我记得：琥珀棕顶栏 */
#memoryMask .classlog-header {
  background: linear-gradient(180deg, #f59e0b 0%, #d97706 50%, #b45309 100%);
  box-shadow: 0 2px 10px rgba(180, 83, 9, 0.38);
}
#memoryMask .classlog-header .classlog-title {
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
#memoryMask .classlog-header .classlog-exit {
  background: rgba(255, 255, 255, 0.95) !important;
  color: #92400e !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
}
.classlog-tip {
  margin: 10px 10px 8px;
  color: #5f6f86;
  font-size: 14px;
  line-height: 1.45;
}
.classlog-list-wrap {
  margin: 0 10px 10px;
  border-top: 1px solid #d5dce8;
  background: #f6f8fc;
  min-height: 120px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.classlog-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.classlog-item {
  padding: 7px 2px;
  border-bottom: 1px dashed #d6dce8;
}
.classlog-time {
  color: #6a778f;
  font-size: 16px;
  margin-bottom: 2px;
}
.classlog-text {
  color: #152840;
  font-size: 17px;
  line-height: 1.28;
}
.classlog-empty {
  padding: 24px 8px;
  text-align: center;
  color: #6d7f99;
  font-size: 16px;
}
/* 时光币交易所 · 本人变动：三列表格 */
.coin-change-log-wrap {
  padding: 0;
}
.coin-change-log-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 15px;
}
.coin-change-log-table thead th {
  text-align: left;
  padding: 8px 6px 6px;
  color: #5f6f86;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid #c8d4e8;
  background: #eef2f9;
  vertical-align: bottom;
}
.coin-change-log-table thead th:nth-child(1) {
  width: 26%;
}
.coin-change-log-table thead th:nth-child(2) {
  width: 44%;
}
.coin-change-log-table thead th:nth-child(3) {
  width: 30%;
}
.coin-change-log-table tbody td {
  padding: 8px 6px;
  border-bottom: 1px dashed #d6dce8;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.coin-change-log-time {
  color: #6a778f;
  font-size: 14px;
  line-height: 1.35;
}
.coin-change-log-reason {
  color: #152840;
  font-size: 13px;
  line-height: 1.3;
}
.coin-change-log-range {
  color: #152840;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}
.coin-change-log-empty {
  padding: 22px 10px;
  text-align: center;
  color: #6d7f99;
  font-size: 16px;
  border-bottom: none;
}
.memory-panel .memory-form {
  margin: 0 10px 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #d5dce8;
}
.memory-panel .memory-form .modal-label {
  margin: 6px 0 4px;
}
.memory-panel .memory-form .modal-actions {
  margin-top: 8px;
}
.memory-records-title {
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  color: #1d2d44;
  margin: 2px 10px 6px;
}
.memory-records-head {
  margin: 0 10px;
  display: grid;
  grid-template-columns: 130px 110px 1fr 110px;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px 10px 0 0;
  background: #efe7d7;
  color: #9a3a00;
  font-size: 20px;
  font-weight: 700;
}
.memory-records-list {
  margin: 0;
  padding: 0;
}
.memory-row {
  display: grid;
  grid-template-columns: 130px 110px 1fr 110px;
  gap: 8px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid #ebeef3;
  color: #334155;
  font-size: 17px;
  line-height: 1.35;
}
.memory-col-content {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.memory-col-name,
.memory-col-time {
  white-space: nowrap;
}
.memory-empty {
  list-style: none;
  padding: 20px 8px;
  text-align: center;
  color: #7c8aa1;
  font-size: 16px;
}

/* 我的书包：橙色徽章居左；✓打卡区 / 荣誉勋章栏 共用居中标题对齐 */
.msg-panel.bag-panel {
  padding: 10px 12px 11px;
}
.bag-panel .bag-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}
.bag-panel-heading {
  margin: 0;
  flex: 0 1 auto;
  text-align: left;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1.25;
}
.bag-section-label {
  margin: 0 0 5px;
  padding: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: #2563eb;
  line-height: 1.25;
}
h3.bag-section-label.bag-medal-strip-title {
  font-weight: 700;
}
.bag-medal-strip {
  margin-top: 6px;
}
.bag-gift-cabinet {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #ced4da;
}
.bag-love-letter-cabinet {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #ced4da;
}
.bag-love-letter-list {
  max-height: 240px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* 关系档案室：多列网格，图标与关系管理局类型一致 */
.relation-archive-grid {
  max-height: 280px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  align-items: stretch;
}
.relation-archive-grid .bag-love-letter-empty {
  grid-column: 1 / -1;
}
.relation-archive-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 10px 6px 8px;
  border: 1px solid #e9d8fd;
  border-radius: 12px;
  background: #fff;
  box-sizing: border-box;
  min-width: 0;
}
.relation-archive-item--dissolved {
  opacity: 0.72;
  background: #f8f9fa;
}
.relation-archive-icon {
  font-size: 1.85rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.06));
}
.relation-archive-type {
  font-size: 12px;
  font-weight: 700;
  color: #862e9c;
  line-height: 1.25;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.relation-archive-status {
  font-size: 10px;
  font-weight: 600;
  color: #5f3dc4;
  line-height: 1.2;
}
.relation-archive-names {
  font-size: 11px;
  color: #495057;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.relation-archive-vow {
  font-size: 10px;
  color: #868e96;
  line-height: 1.35;
  max-width: 100%;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-align: center;
}
@media (min-width: 520px) {
  .relation-archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }
}
/* 手机：关系卡片更紧凑，一行多列 */
@media (max-width: 519px) {
  .relation-archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 4px;
    max-height: 240px;
  }
  .relation-archive-item {
    padding: 5px 2px 4px;
    gap: 2px;
    border-radius: 8px;
  }
  .relation-archive-icon {
    font-size: 1.28rem;
  }
  .relation-archive-type {
    font-size: 9px;
    line-height: 1.2;
  }
  .relation-archive-status {
    font-size: 8px;
  }
  .relation-archive-names {
    font-size: 8px;
    line-height: 1.25;
  }
  .relation-archive-vow {
    font-size: 8px;
    line-height: 1.3;
    -webkit-line-clamp: 2;
  }
}
.bag-love-letter-item {
  border: 1px solid #e9d8fd;
  border-radius: 10px;
  background: #fff;
  padding: 8px 10px;
}
.bag-love-letter-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.bag-love-letter-role {
  color: #862e9c;
  font-weight: 700;
  font-size: 13px;
}
.bag-love-letter-status {
  color: #5f3dc4;
  font-size: 12px;
}
.bag-love-letter-line {
  color: #495057;
  font-size: 12px;
  line-height: 1.4;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.bag-love-letter-empty {
  text-align: center;
  color: #868e96;
  font-size: 13px;
  padding: 10px 8px;
}
/* 情书收藏夹：列表仅标识，点击查看全文 */
.bag-love-letter-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border: 1px solid #e9d8fd;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.bag-love-letter-card:hover,
.bag-love-letter-card:focus-visible {
  background: #fdf4ff;
  outline: none;
  box-shadow: 0 0 0 2px rgba(181, 23, 158, 0.2);
}
.bag-love-letter-card-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.bag-love-letter-card-title {
  font-size: 14px;
  font-weight: 700;
  color: #5f3dc4;
}
.bag-love-letter-card-who {
  font-size: 13px;
  color: #862e9c;
}
.bag-love-letter-card-sub {
  font-size: 11px;
  color: #868e96;
}
span.love-paper-card.bag-love-letter-thumb {
  display: block;
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 10px;
  pointer-events: none;
}
/* 情书全文阅读（叠在书包之上） */
.love-letter-read-mask {
  z-index: 12100;
  align-items: center;
  justify-content: center;
  padding: 12px;
}
.love-letter-read-panel {
  max-width: 420px;
  width: calc(100% - 24px);
  max-height: min(88vh, 640px);
  overflow: auto;
}
.love-letter-read-body {
  margin: 0 10px 14px;
}
.love-letter-read-meta {
  font-size: 14px;
  font-weight: 600;
  color: #862e9c;
  margin: 0 0 10px;
  text-align: center;
  line-height: 1.4;
}
.love-letter-read-sheet.love-paper-card {
  height: auto;
  min-height: 200px;
  width: 100%;
  box-sizing: border-box;
  padding: 16px 18px;
  text-align: left;
  cursor: default;
  margin-top: 2px;
}
.love-letter-read-block {
  margin-bottom: 14px;
}
.love-letter-read-block:last-child {
  margin-bottom: 0;
}
.love-letter-read-k {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #862e9c;
  margin-bottom: 4px;
}
.love-letter-read-v {
  font-size: 15px;
  color: #212529;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.love-letter-read-body-text {
  min-height: 72px;
}
.bag-gift-cabinet-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 0 0 3px;
}
.bag-gift-cabinet-head-icon {
  font-size: 1.1rem;
  line-height: 1;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.08));
}
.bag-gift-cabinet-title-text {
  margin: 0;
  padding: 0;
  font-size: 14px;
  font-weight: 700;
  color: #2563eb;
  line-height: 1.15;
}
.bag-gift-cabinet-tip {
  margin: 0 0 5px;
  font-size: 11px;
  color: #868e96;
  line-height: 1.3;
  text-align: center;
}
.coin-wechat-rate-highlight {
  font-weight: 700;
  color: #2b8a3e;
}
.coin-wechat-tip-trust {
  margin-top: 2px;
  margin-bottom: 4px;
}
.coin-wechat-tip-mobile-only {
  display: none;
  margin-top: 0;
  margin-bottom: 6px;
}
@media (max-width: 768px) {
  .coin-wechat-tip-mobile-only {
    display: block;
  }
}
/* 浅绿底容器 + 白卡片：手机起即一行 7 个，整体压低高度 */
.bag-gift-cabinet-board {
  background: linear-gradient(180deg, #ecfdf3 0%, #e6fcf5 100%);
  border: 1px solid #8ce99a;
  border-radius: 8px;
  padding: 4px 3px 5px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}
.bag-gift-cabinet-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 3px;
}
@media (min-width: 720px) {
  .bag-gift-cabinet-grid {
    gap: 7px;
  }
  .bag-gift-cabinet-board {
    padding: 7px 8px 9px;
    border-radius: 10px;
  }
}
.bag-gift-slot-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 1px;
  min-width: 0;
  padding: 3px 1px 4px;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.bag-gift-slot-icon {
  font-size: 0.92rem;
  line-height: 1;
}
.bag-gift-slot-name {
  font-size: 8px;
  font-weight: 700;
  color: #212529;
  line-height: 1.1;
  word-break: break-all;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.bag-gift-slot-blessing {
  font-size: 6px;
  font-weight: 500;
  color: #2563eb;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  max-height: 1.2em;
}
.bag-gift-slot-qty {
  margin-top: 1px;
  font-size: 12px;
  font-weight: 800;
  color: #2b8a3e;
  line-height: 1;
  letter-spacing: -0.03em;
}
@media (min-width: 400px) {
  .bag-gift-slot-icon {
    font-size: 1.05rem;
  }
  .bag-gift-slot-name {
    font-size: 9px;
  }
  .bag-gift-slot-blessing {
    font-size: 7px;
  }
  .bag-gift-slot-qty {
    font-size: 14px;
  }
}
@media (min-width: 720px) {
  .bag-gift-slot-card {
    gap: 2px;
    padding: 5px 4px 6px;
    border-radius: 8px;
  }
  .bag-gift-slot-icon {
    font-size: 1.28rem;
  }
  .bag-gift-slot-name {
    font-size: 11px;
    line-height: 1.15;
  }
  .bag-gift-slot-blessing {
    font-size: 9px;
    line-height: 1.2;
    -webkit-line-clamp: 2;
    max-height: 2.5em;
  }
  .bag-gift-slot-qty {
    margin-top: 2px;
    font-size: 18px;
  }
}
.bag-checkin-card {
  background: #e8f7ea;
  border: 1px solid #9dc7a4;
  border-radius: 10px;
  padding: 8px 10px;
  margin-top: 0;
}
.bag-checkin-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.bag-checkin-btn {
  flex-shrink: 0;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 0;
  cursor: pointer;
  background: linear-gradient(180deg, #3cb371, #2f8f3a);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(47, 143, 58, 0.35);
}
.bag-checkin-btn:active:not(:disabled) {
  opacity: 0.92;
  transform: scale(0.98);
}
.bag-checkin-btn.is-disabled,
.bag-checkin-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}
.bag-checkin-text {
  flex: 1;
  min-width: 0;
}
.bag-checkin-rule {
  margin: 0 0 4px;
  font-size: 12px;
  color: #5a6b7d;
  line-height: 1.38;
}
.bag-checkin-count-line {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  color: #2563eb;
}
.bag-checkin-num {
  font-weight: 700;
}
.bag-checkin-wait-hint {
  font-size: 12px;
  font-weight: 500;
  color: #c53030;
}
.bag-checkin-msg {
  margin: 5px 0 0;
  font-size: 12px;
  line-height: 1.35;
  color: #c53030;
  min-height: 1.15em;
}
.bag-checkin-msg:empty {
  display: none;
}
.bag-checkin-msg.is-ok {
  color: #2f7a34;
}

.msg-panel-hint-red {
  font-weight: 700;
  color: #c00;
}
.msg-panel-toolbar {
  margin: 0 0 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.msg-panel-clear-btn {
  border: 1px solid #e2e8f0;
  background: #f7fafc;
  color: #64748b;
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.msg-panel-clear-btn:active {
  opacity: 0.88;
}
.msg-panel-card {
  background: #fff;
  border: 1px solid #e0e6ed;
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 120px;
}
.msg-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.msg-item {
  padding: 10px 0;
  border-bottom: 1px solid #f0f2f5;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-bottom: 4px;
}
.msg-item-title {
  font-size: 15px;
  font-weight: 700;
  color: #2d3748;
  flex: 1 1 140px;
  min-width: 0;
  line-height: 1.35;
}
.msg-item-badge {
  font-size: 12px;
  font-weight: 600;
  color: #718096;
  white-space: nowrap;
}
.msg-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px 8px;
  flex: 0 1 auto;
  margin-left: auto;
  max-width: 100%;
}
.msg-item-time {
  font-size: 12px;
  color: #8a9bb5;
  flex-shrink: 0;
  font-weight: 500;
  white-space: nowrap;
}
/* 时间在「已读」与「删除」之间，与两侧按钮拉开距离 */
.msg-item-time--mid {
  margin: 0 4px;
  padding: 0 4px;
  min-width: 2.75em;
  text-align: center;
  color: #64748b;
  font-weight: 600;
}
.msg-item-actions-inline {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  max-width: 100%;
}
.msg-item-actions-inline .msg-btn-sm {
  border: 0;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
}
.msg-item-actions-inline .msg-btn-approve {
  background: linear-gradient(180deg, #2f8f3a, #227a2d);
  color: #fff;
}
.msg-item-actions-inline .msg-btn-reject {
  background: #eef2f8;
  color: #4a5568;
  border: 1px solid #d3dbe8;
}
/* 未读时「已读」为绿色，点后变灰（.msg-btn-read-done） */
.msg-item-actions-inline .msg-btn-read:not(.msg-btn-read-done):not(:disabled) {
  background: linear-gradient(180deg, #34d399, #22c55e);
  color: #fff;
  border: 1px solid #16a34a;
  box-shadow: 0 1px 4px rgba(34, 197, 94, 0.35);
}
.msg-item-actions-inline .msg-btn-read.msg-btn-read-done,
.msg-item-actions-inline .msg-btn-read:disabled {
  background: #e8eaed !important;
  color: #94a3b8 !important;
  border: 1px solid #d1d5db !important;
  cursor: default;
  opacity: 1;
  box-shadow: none;
}
.msg-item-actions-inline .msg-btn-delete {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ffcdd2;
}
.msg-local-read .msg-item-title,
.msg-local-read .msg-item-body {
  opacity: 0.7;
}
.msg-item-body {
  font-size: 13px;
  color: #718096;
  line-height: 1.5;
  white-space: pre-line;
}
.msg-item.msg-empty .msg-item-body {
  color: #8a9bb5;
}

.modal {
  width: min(720px, 100%);
  max-height: min(92vh, calc(100vh - 24px));
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #d9e5fb;
  padding: 14px;
}
#createModalMask .modal {
  padding: 10px 12px;
}
#createModalMask .modal h3 {
  margin: 0 0 8px;
}
#createModalMask .modal-label {
  margin: 4px 0 2px;
  font-size: 13px;
}
#createModalMask .modal-input,
#createModalMask .modal-select {
  padding: 6px 10px;
  font-size: 14px;
}
#createModalMask .modal-tip {
  margin-top: 2px;
}
#createModalMask .modal-actions {
  gap: 8px;
  margin-top: 8px;
}
#createModalMask .modal-btn {
  min-height: 36px;
  font-size: 15px;
}
.modal h3 {
  margin: 2px 0 12px;
  text-align: center;
}
.modal-title-badge {
  display: inline-block;
  background: linear-gradient(180deg, #ff9f3d, #ff7f2a);
  color: #fff;
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 20px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(255, 132, 41, 0.3);
}
.modal-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: #2a6df4;
}
.modal-input, .modal-select {
  width: 100%;
  border: 1px solid #bdcadf;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: #f9fbff;
}
.modal-tip {
  margin-top: 4px;
  color: #6d7f99;
  font-size: 14px;
}
.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}
.modal-btn {
  border: 0;
  border-radius: 10px;
  min-height: 40px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.modal-btn.cancel {
  color: #233a5f;
  background: #eef2f8;
  border: 1px solid #d3dbe8;
}
.modal-btn.submit {
  color: #fff;
  background: linear-gradient(180deg, #2f8f3a, #227a2d);
}
.modal-desc {
  margin: 0 0 12px;
  font-size: 13px;
  color: #5e7599;
  line-height: 1.5;
}
.modal-hint {
  margin: 0 0 4px;
  font-size: 12px;
  color: #5e7599;
}
/* 加入班级弹窗：标题区与创建班级同款橙色徽章；h3 在 .join-modal-body 内 */
.modal-join .join-modal-body > h3 {
  margin-top: 0;
  margin-bottom: 8px;
}
.modal-join .modal-label {
  margin: 4px 0 2px;
}
.modal-join .label-hint {
  font-size: 12px;
  color: #000;
  font-weight: normal;
}
.modal-join .modal-hint {
  margin: 0 0 2px;
}
.modal-join .modal-input,
.modal-join .modal-select {
  padding: 6px 10px;
  font-size: 14px;
}
.modal-join .join-search-row {
  margin-bottom: 4px;
}
.modal-join .join-results {
  max-height: 200px;
  margin-bottom: 6px;
}
.modal-join .join-results-item {
  padding: 6px 10px;
  font-size: 13px;
}
/* 加入班级搜索：同学昵称红字、紧跟班级名同一行（避免块级标题独占一行；提高优先级兼容微信内核） */
.modal-join .join-results .join-results-item .join-results-item-main {
  display: -webkit-flex;
  display: flex;
  -webkit-flex-flow: row nowrap;
  flex-flow: row nowrap;
  -webkit-align-items: center;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  flex: 1 1 auto;
}
.modal-join .join-results .join-results-item .join-results-item-main .join-class-title {
  display: block;
  -webkit-flex: 1 1 0%;
  flex: 1 1 0%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.modal-join .join-results .join-results-item .join-results-item-main .join-member-search-proof {
  -webkit-flex: 0 0 auto;
  flex: 0 0 auto;
  margin-left: 6px;
  color: #c62828 !important;
  -webkit-text-fill-color: #c62828 !important;
  font-weight: 700 !important;
  font-size: 14px !important;
  white-space: nowrap !important;
}
.modal-join .join-results .join-results-item.selected .join-results-item-main .join-member-search-proof {
  color: #ffcdd2 !important;
  -webkit-text-fill-color: #ffcdd2 !important;
}
/* 进入教室弹窗：中部可滚动，底部固定「取消 / 确定」始终可见 */
.join-modal-layout {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 640px);
  padding-bottom: 0;
  overflow: hidden;
}
.join-modal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-right: 2px;
}
.join-modal-footer-actions {
  flex-shrink: 0;
  margin-top: 0;
  padding: 12px 0 4px;
  border-top: 1px solid #e6eefc;
}
.modal-join .join-form {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e6eefc;
}
.join-members-line {
  margin: 0 0 8px;
  font-size: 13px;
  color: #c00;
  line-height: 1.4;
}
.modal-join .join-form .modal-label {
  margin: 3px 0 2px;
}
.modal-join .join-form .modal-hint {
  margin: 0 0 2px;
}
.modal-join .join-form .modal-textarea {
  min-height: 48px;
  padding: 6px 10px;
}
.join-form-actions {
  margin-top: 8px;
  margin-bottom: 0;
}
.modal-join .modal-actions {
  margin-top: 8px;
}
.join-search-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
  align-items: center;
}
.join-search-row .modal-input {
  flex: 1;
  min-width: 0;
}
.search-btn {
  flex-shrink: 0;
  background: #eef2f8;
  color: #233a5f;
  border: 1px solid #d3dbe8;
  padding: 6px 12px;
}
.join-results {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid #d4d9de;
  border-radius: 10px;
  margin-bottom: 10px;
  background: #f9fbff;
}
.join-results-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid #e6eefc;
  cursor: pointer;
  font-size: 14px;
}
.join-results-item-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0 8px;
}
.join-results-item-main .join-class-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.join-member-search-proof {
  flex-shrink: 0;
  font-size: 14px;
  font-weight: 700;
  color: #c62828 !important;
  white-space: nowrap;
  -webkit-text-fill-color: #c62828 !important;
}
.join-results-item.selected .join-member-search-proof {
  color: #ffcdd2 !important;
  -webkit-text-fill-color: #ffcdd2 !important;
}
.join-results-item:last-child { border-bottom: 0; }
.join-results-item:hover {
  background: #e8f0fe;
}
.join-results-item.selected {
  background: #1a56b0;
}
.join-results-item.selected .join-class-title {
  color: #fff;
}
.join-results-item .join-selected-tag {
  display: none;
  flex-shrink: 0;
  font-size: 12px;
  color: #fff;
  font-weight: 500;
}
.join-results-item.selected .join-selected-tag {
  display: inline;
}
.join-results-item .join-class-title {
  font-weight: 600;
  color: #193255;
  min-width: 0;
}
.join-results-item .join-class-code {
  font-size: 12px;
  color: #5e7599;
  margin-top: 2px;
}
.join-form {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #e6eefc;
}
.join-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 2px;
  font-size: 14px;
  color: #5e7599;
  cursor: pointer;
}
.join-remember input { width: auto; }
.modal-textarea {
  min-height: 60px;
  resize: vertical;
}
.modal-seat .modal-actions {
  grid-template-columns: 1fr;
}
.modal-actions-two {
  grid-template-columns: 1fr 1fr !important;
  gap: 10px;
}
.modal-actions-two .modal-btn {
  width: 100%;
  box-sizing: border-box;
}
.seat-modal-mask .modal {
  max-height: 90vh;
}
.seat-select-grid {
  display: grid;
  grid-template-columns:
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr) 10px
    minmax(0, 1fr) minmax(0, 1fr);
  column-gap: 0;
  row-gap: 2px;
  margin-bottom: 8px;
}
.seat-select-grid .seat {
  cursor: pointer;
  aspect-ratio: 1 / 1.32;
}
.seat-select-grid .seat.selected {
  border-color: #2f8f3a;
  box-shadow: 0 0 0 2px #2f8f3a;
}
.seat-select-grid .seat.taken {
  cursor: not-allowed;
  opacity: 0.85;
}
.seat-select-grid .seat:nth-child(8n + 1) { grid-column: 1; }
.seat-select-grid .seat:nth-child(8n + 2) { grid-column: 2; }
.seat-select-grid .seat:nth-child(8n + 3) { grid-column: 4; }
.seat-select-grid .seat:nth-child(8n + 4) { grid-column: 5; }
.seat-select-grid .seat:nth-child(8n + 5) { grid-column: 7; }
.seat-select-grid .seat:nth-child(8n + 6) { grid-column: 8; }
.seat-select-grid .seat:nth-child(8n + 7) { grid-column: 10; }
.seat-select-grid .seat:nth-child(8n + 8) { grid-column: 11; }
.image-select-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  margin-bottom: 12px;
  contain: layout;
}
.image-select-item {
  aspect-ratio: 1;
  border: 2px solid #d4d9de;
  border-radius: 12px;
  background: #f5f6f8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  font-size: 13px;
  color: #5e7599;
}
.image-select-item.selected {
  border-color: #2f8f3a;
  box-shadow: 0 0 0 2px #2f8f3a;
}
.image-select-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}
#imageModalMask .modal {
  transform: translateZ(0);
  backface-visibility: hidden;
}
/* 仅电脑版：左侧与创建班级加宽 25%，黑板与流动广告屏对应减小 */
@media (min-width: 1025px) {
  :root {
    --desk-left-col: 82px;
    --desk-main-col: 525px;
    --desk-gap: 6px;
    /* 与 .seat-grid / .action-grid 外沿一致（主列 + 左栏 + 列间距，同 100% + 88px 伸出） */
    --desk-seat-outer-w: calc(var(--desk-left-col) + var(--desk-gap) + var(--desk-main-col));
    /*
     * 弹窗顶缘与教室内黑板上沿平齐：顶栏 + 顶栏下边距 + 教室第 1 行（新闻/时钟行，与 .left-tools 首行 26px 一致）+ row-gap。
     * 顶栏实高随字号略变，可按观感微调 --desk-topbar-approx。
     */
    --desk-topbar-approx: 52px;
    --desk-modal-top: calc(
      env(safe-area-inset-top, 0px) + var(--desk-topbar-approx) + 4px + 26px + 4px
    );
    --desk-modal-max-h: calc(100vh - var(--desk-modal-top) - 16px);
    --desk-modal-max-h-d: calc(100dvh - var(--desk-modal-top) - 16px);
  }
  .top-row,
  .wrap {
    max-width: calc(var(--desk-left-col) + var(--desk-gap) + var(--desk-main-col));
  }
  #btnTopCreate {
    width: 82px;
    min-width: 82px;
  }
  #btnTopJoin {
    margin-right: 0;
  }
  .classroom-page {
    grid-template-columns: var(--desk-left-col) var(--desk-main-col);
    column-gap: var(--desk-gap);
    row-gap: 4px;
  }
  .left-tools {
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    gap: 2px;
    /* 消息 / 时光币 / 我的书包在当前基础上再压缩 10%（66 -> 59） */
    grid-template-rows: 26px 59px 59px 59px;
    /*
     * 侧栏 z-index 高于主区时，action-grid 负 margin 向左伸出的一列会与侧栏矩形重叠，
     * 导致「递纸条」「换座位」等首列按钮点不到。容器不接收命中，子项仍可点。
     */
    pointer-events: none;
  }
  .classroom-page .left-tools > * {
    pointer-events: auto;
  }
  /* 去掉默认 -4px 顶部偏移；消息上沿与黑板上沿对齐 */
  .left-tools .tool-card:first-of-type {
    margin-top: 0;
  }
  .classroom-page .news-strip {
    margin-left: 0;
    width: 100%;
  }
  .classroom-page .blackboard {
    margin-left: 0;
    width: 100%;
    justify-self: start;
  }
  .news-strip {
    height: 24px;
  }
  .news-track {
    font-size: 14px;
  }
  .classroom-page .class-main {
    width: 100%;
    justify-self: start;
    gap: 8px;
  }
  .class-controls-bar {
    /* 讲台与黑板、座位都保留可见缝隙 */
    margin-top: 4px;
    margin-bottom: 2px;
  }
  .seat-grid {
    width: calc(100% + 88px);
    margin-left: -88px;
    /* 与讲台留一条缝 */
    margin-top: 6px;
    /* 座位横向拉宽、过道缩小；高度保持当前观感 */
    --desk-aisle-base: 4px;
    --desk-seat-base: calc((100% - (3 * var(--desk-aisle-base))) / 8);
    --desk-seat-small: calc(var(--desk-seat-base) * 0.95);
    --desk-aisle-grow: calc((var(--desk-seat-base) - var(--desk-seat-small)) * 8 / 3);
    --desk-aisle-wide: calc(var(--desk-aisle-base) + var(--desk-aisle-grow));
    grid-template-columns:
      var(--desk-seat-small) var(--desk-seat-small) var(--desk-aisle-wide)
      var(--desk-seat-small) var(--desk-seat-small) var(--desk-aisle-wide)
      var(--desk-seat-small) var(--desk-seat-small) var(--desk-aisle-wide)
      var(--desk-seat-small) var(--desk-seat-small);
  }
  .seat-grid .seat {
    /* 配合宽度放大，保持高度基本不变 */
    aspect-ratio: 1 / 1.14;
  }
  /* 活动区与座位同宽对齐；列间距留缝；行距再收紧 */
  .action-grid {
    width: calc(100% + 88px);
    margin-left: -88px;
    box-sizing: border-box;
    /* 电脑版：分隔线与14个图标整体下移 5px */
    margin-top: 1px;
    /* 仅图标再上移 2px（分隔线不动） */
    padding-top: 3px;
    column-gap: 10px;
    row-gap: 2px;
  }
  .classroom-page .action-btn {
    min-height: 62px;
    height: 62px;
    max-height: 62px;
    padding: 8px 4px;
    gap: 4px;
    overflow: hidden;
    box-sizing: border-box;
  }
  .classroom-page .action-btn .action-icon {
    font-size: 20px;
    flex-shrink: 0;
  }
  /* 窄格内长文案：略小字号 + 最多两行，避免顶破边框（仅桌面） */
  .classroom-page .action-btn .action-label {
    font-size: 9.8px;
    letter-spacing: -0.04em;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
    line-height: 1.12;
    max-width: 100%;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 0;
  }
  .blackboard {
    /* 黑板在当前基础上再压缩 10%（202 -> 182） */
    height: 182px;
    min-height: 182px;
    margin-top: 0;
  }
  .class-controls-bar {
    margin-top: 0;
  }
  /* 座位区向左伸出 (左栏+列间距)，宽度中线比主列中线偏左一半；仅平移讲台与座位区对齐 */
  .classroom-page .class-controls-bar .teacher-podium {
    transform: translateX(calc(-1 * (var(--desk-left-col) + var(--desk-gap)) / 2));
  }

  /* 电脑版弹窗：宽度与座位区外沿一致；顶缘与黑板上沿平齐；横向居中 */
  .modal-mask {
    align-items: flex-start !important;
    justify-content: center !important;
    padding-top: var(--desk-modal-top) !important;
    padding-left: max(12px, env(safe-area-inset-left, 0px));
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-bottom: max(16px, env(safe-area-inset-bottom, 0px));
  }
  .modal-mask > .modal,
  .modal-mask > .classlog-panel,
  .modal-mask > .intro-guide-panel,
  .modal-mask > .msg-panel,
  .modal-mask > .pass-note-picker-panel {
    width: min(var(--desk-seat-outer-w), calc(100vw - 24px));
    max-width: min(var(--desk-seat-outer-w), calc(100vw - 24px));
    max-height: var(--desk-modal-max-h);
    max-height: min(var(--desk-modal-max-h-d), var(--desk-modal-max-h));
    box-sizing: border-box;
  }
  .modal-mask > .intro-guide-panel {
    height: auto;
    min-height: 0;
  }
}
/* 手机端通用：安全区 + 比例变量（vmin/vw/clamp），适配更多机型与长宽比 */
@media (max-width: 1024px) {
  :root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    /* 页边：随屏宽略变，避免大屏手机留白过小、小屏挤爆 */
    --body-pad-x: clamp(4px, 1.8vmin, 12px);
    --body-pad-b: clamp(4px, 1.5vmin, 10px);
    /* 左侧工具列宽度：约 17.5% 短边，夹在 54～82px */
    --rail-w: clamp(54px, 17.5vmin, 82px);
    /* 主区内行/块间距（侧栏与主区之间不再留缝，见 .classroom-page column-gap） */
    --cell-gap: clamp(4px, 1.2vmin, 8px);
    /* 页面左内边距（与 body 一致，用于 100vw 区块对齐视口） */
    --page-pad-x: max(var(--body-pad-x), var(--safe-left));
    /* 侧栏宽度（下课钮水平偏移用；列间距为 0 时不再加 gap） */
    --rail-span: var(--rail-w);
    --topbar-slot: clamp(44px, 11.5vmin, 56px);
    /* 流动新闻条行高：与左侧时钟行对齐 */
    --news-strip-h: clamp(22px, 6vmin, 30px);
    /* 消息 / 我的书包 左侧行高一致 */
    --tool-row-msg-h: clamp(48px, 11vmin, 64px);
    /* 黑板高度由栅格与「消息～书包」三行对齐，不再用固定 --mobile-blackboard-h */
    --mobile-controls-h: clamp(64px, 13vmin, 92px);
    /* 两行×7 活动按钮：再拉高一块 */
    --mobile-action-h: clamp(112px, 26vmin, 172px);
    /* 座位略高：配合 aspect-ratio 拉长灰色座位区 */
    --mobile-seat-min: clamp(30px, 7.1vmin, 52px);
  }
  body {
    height: 100dvh;
    overflow: hidden;
    padding: 0 max(var(--body-pad-x), var(--safe-right)) max(var(--body-pad-b), var(--safe-bottom))
      max(var(--body-pad-x), var(--safe-left));
    padding-top: max(0px, var(--safe-top));
  }
  .top-bar {
    margin: 0 calc(-1 * var(--body-pad-x)) 2px;
    padding: clamp(5px, 1.4vmin, 8px) var(--body-pad-x);
    padding-left: max(var(--body-pad-x), var(--safe-left));
    padding-right: max(var(--body-pad-x), var(--safe-right));
  }
  .wrap {
    min-height: calc(100dvh - var(--topbar-slot) - var(--safe-top) - var(--safe-bottom));
    height: calc(100dvh - var(--topbar-slot) - var(--safe-top) - var(--safe-bottom));
    max-height: calc(100dvh - var(--topbar-slot) - var(--safe-top) - var(--safe-bottom));
    gap: var(--cell-gap);
    overflow-x: visible;
  }
  .top-row {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    gap: 5px;
  }
  #btnTopCreate {
    margin-left: calc(-1 * min(4px, var(--body-pad-x)));
    width: var(--rail-w);
    min-width: var(--rail-w);
  }
  .top-title {
    min-width: 0;
  }
  #btnTopJoin {
    margin-right: calc(-1 * min(4px, var(--body-pad-x)));
  }
  .top-btn {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 13px;
  }
  .top-title {
    font-size: 16px;
  }
  .card {
    padding: 13px;
  }
  .classroom-page {
    grid-template-columns: var(--rail-w) minmax(0, 1fr);
    /* 行：时钟+新闻 | 消息 | 时光币 | 书包 | 主区；黑板跨第 2～4 行 */
    grid-template-rows: var(--news-strip-h) auto auto auto minmax(0, 1fr);
    column-gap: 0;
    row-gap: var(--cell-gap);
    height: 100%;
    min-width: 0;
    overflow-x: visible;
    align-items: stretch;
  }
  .classroom-page .left-tools {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--cell-gap);
    grid-column: 1;
    grid-row: 1 / 5;
    align-self: stretch;
    /* 主区 seat-grid / action-grid 用 100vw+负 margin 向左伸出时，会盖住侧栏命中区域；抬高叠层保证可点 */
    position: relative;
    z-index: 60;
    isolation: isolate;
    width: var(--rail-w);
    min-width: var(--rail-w);
    max-width: var(--rail-w);
    box-sizing: border-box;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: max(2px, env(safe-area-inset-bottom, 0px));
  }
  .classroom-page .left-tools > * {
    flex-shrink: 0;
  }
  .classroom-page .news-strip {
    grid-column: 2;
    grid-row: 1;
  }
  /* 与顶栏 #btnTopJoin 同款右移，右缘与「进入教室」对齐 */
  .classroom-page .news-strip,
  .classroom-page .blackboard {
    width: calc(100% + min(4px, var(--body-pad-x)));
    max-width: none;
    margin-right: calc(-1 * min(4px, var(--body-pad-x)));
    box-sizing: border-box;
  }
  .classroom-page .left-tools .coin-wrap {
    min-height: clamp(52px, 12vmin, 68px);
    align-items: stretch;
  }
  .classroom-page .coin-label {
    align-self: center;
  }
  /* 高度与原先 min(52px,85% 父宽) + aspect-ratio 1.4/1 一致；左右与消息边框盒对齐 */
  .classroom-page .coin-num {
    width: 100%;
    max-width: none;
    aspect-ratio: unset;
    height: calc(min(52px, 0.85 * var(--rail-w)) / 1.4);
    border-radius: 999px;
    flex-shrink: 0;
  }
  .classroom-page .blackboard {
    grid-column: 2;
    grid-row: 2 / 5;
    align-self: stretch;
    /* 抵消第 1 行与第 2 行之间的 row-gap，与流动广告条下缘贴齐 */
    margin-top: calc(-1 * var(--cell-gap));
  }
  .classroom-page .class-main {
    grid-column: 2;
    grid-row: 5;
  }
  .left-tools .tool-card:first-of-type {
    margin-top: -4px;
  }
  .tool-time {
    height: var(--news-strip-h);
    font-size: clamp(10px, 2.8vmin, 13px);
    padding: 0 clamp(1px, 0.6vmin, 4px);
  }
  .tool-card {
    min-height: 0;
    border-radius: 10px;
  }
  .left-tools .tool-card,
  .left-tools .coin-wrap {
    min-height: 0;
    overflow: visible;
  }
  /* 消息、书包同高 */
  .classroom-page .left-tools #btnMsg,
  .classroom-page .left-tools .tool-card.tool-card-bag {
    min-height: var(--tool-row-msg-h);
    height: var(--tool-row-msg-h);
    max-height: var(--tool-row-msg-h);
    box-sizing: border-box;
  }
  .classroom-page .left-tools .tool-card-bag .tool-text {
    white-space: nowrap;
    line-height: 1.15;
  }
  .tool-icon {
    width: clamp(20px, 5.5vmin, 26px);
    height: clamp(20px, 5.5vmin, 26px);
  }
  .tool-text { font-size: clamp(11px, 3vmin, 14px); }
  .left-tools .tool-card-bag .tool-text {
    font-size: clamp(9px, 2.6vmin, 12px);
  }
  .coin-num {
    font-size: clamp(15px, 4.2vmin, 20px);
    max-width: min(52px, 85%);
  }
  .coin-label {
    font-size: clamp(9px, 2.5vmin, 12px);
  }
  .class-main {
    gap: 0;
    align-content: start;
    /* 中间行用 auto：避免 1fr 把座位区撑满、底下空一大块（像离分隔线很远） */
    grid-template-rows:
      var(--mobile-controls-h)
      auto
      var(--mobile-action-h);
    min-height: 0;
    overflow-x: visible;
    overflow-y: visible;
  }
  .news-strip {
    height: var(--news-strip-h);
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: clamp(8px, 2vmin, 12px);
    position: relative;
    z-index: 2;
    /* 减轻与时钟列交界处的一条竖线感 */
    border-left: none;
  }
  .news-track { font-size: clamp(12px, 3.4vmin, 15px); }
  .blackboard {
    margin-left: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    height: 100%;
    min-height: 0;
    align-self: stretch;
    overflow: hidden;
    border-radius: 12px;
    padding: clamp(6px, 1.8vmin, 12px) clamp(8px, 2vmin, 12px);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
  }
  .blackboard h2 {
    margin: 0;
    padding: 0;
  }
  .blackboard-lesson-title {
    font-size: clamp(11px, 2.8vmin, 13px);
    margin-bottom: 1px;
    line-height: 1.28;
  }
  .blackboard-lesson-title--welcome {
    color: #ff3b30;
    font-size: clamp(14px, 3.6vmin, 18px);
    font-weight: 800;
    line-height: 1.35;
    text-align: center;
  }
  .blackboard p {
    font-size: clamp(12px, 3.2vmin, 15px);
    margin: clamp(4px, 1vmin, 8px) 0;
    line-height: 1.35;
  }
  .blackboard-meta {
    display: block;
    font-size: clamp(10px, 2.6vmin, 12px);
    margin-bottom: 1px;
    line-height: 1.15;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .blackboard-section {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    font-size: clamp(5px, 1.2vmin, 7px);
  }
  .blackboard-section-text {
    font-size: clamp(4.25px, 1.02vmin, 5.95px);
    line-height: 1.05;
  }
  .blackboard-break-hint {
    margin-top: 4px;
    font-size: clamp(9px, 2.2vmin, 11px);
  }
  .blackboard-welcome-line {
    color: #ffffff;
    font-size: clamp(12px, 3vmin, 15px);
    font-weight: 700;
    line-height: 1.32;
    margin: clamp(3px, 0.8vmin, 6px) 0;
    text-align: center;
  }
  .class-controls-bar {
    margin-top: -8px;
    min-height: 0;
    z-index: 5;
  }
  /* 与原先绝对居中相比，向左偏移半格侧栏宽度，视觉仍对准教室中线 */
  .class-controls-bar .teacher-podium {
    transform: none;
    justify-self: center;
  }
  .teacher-area {
    transform: translateX(calc(-1 * var(--rail-w) / 2));
  }
  .teacher-avatar-wrap {
    padding: 2px;
  }
  .teacher-avatar-wrap img {
    max-width: clamp(42px, 11vmin, 58px);
    max-height: clamp(42px, 11vmin, 58px);
  }
  .teacher-avatar-wrap span {
    font-size: clamp(8px, 2.1vmin, 10px);
  }
  .tool-card-intro-corner {
    width: var(--rail-w);
    min-width: var(--rail-w);
    max-width: var(--rail-w);
    height: var(--tool-row-msg-h);
    min-height: var(--tool-row-msg-h);
    max-height: var(--tool-row-msg-h);
  }
  .tool-card-intro-corner .tool-text {
    font-size: clamp(9px, 2.6vmin, 12px);
  }
  .tool-icon-intro-logo {
    width: clamp(20px, 5.5vmin, 26px);
    height: clamp(20px, 5.5vmin, 26px);
  }
  .btn-mid {
    width: clamp(58px, 15vmin, 78px);
    height: clamp(58px, 15vmin, 78px);
    min-width: clamp(58px, 15vmin, 78px);
    min-height: clamp(58px, 15vmin, 78px);
    font-size: clamp(10px, 2.7vmin, 13px);
  }
  /* 手机讲台宽度：在当前基础上再加宽 20% */
  .btn-mid.teacher-podium {
    width: clamp(calc(58px * 1.2 * 1.15 * 1.2 * 1.2), calc(15vmin * 1.2 * 1.15 * 1.2 * 1.2), calc(78px * 1.2 * 1.15 * 1.2 * 1.2));
    min-width: clamp(calc(58px * 1.2 * 1.15 * 1.2 * 1.2), calc(15vmin * 1.2 * 1.15 * 1.2 * 1.2), calc(78px * 1.2 * 1.15 * 1.2 * 1.2));
    /* 手机版讲台：缩低一点，避免多余空白，但仍能显示完整头像 */
    height: clamp(74px, 19vmin, 92px);
    min-height: clamp(74px, 19vmin, 92px);
  }
  .btn-mid.teacher-podium .podium-top {
    min-height: clamp(16px, 3.8vmin, 22px);
    padding: clamp(1px, 0.35vmin, 3px) clamp(2px, 0.5vmin, 4px);
  }
  .btn-mid.teacher-podium .podium-time {
    font-size: clamp(9px, 2.4vmin, 12px);
  }
  .seat-grid {
    position: relative;
    z-index: 0;
    /* 手机端：贴绿色条左右边；过长时可滚动，避免矮屏被裁切 */
    width: 100vw;
    margin-left: calc(-1 * (var(--rail-w) + var(--page-pad-x)));
    /* 手机版：座位与下方内容整体下移 5px，避免与讲台重叠 */
    margin-top: 7px;
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1fr) clamp(5px, 1.6vmin, 9px)
      minmax(0, 1fr) minmax(0, 1fr) clamp(5px, 1.6vmin, 9px)
      minmax(0, 1fr) minmax(0, 1fr) clamp(5px, 1.6vmin, 9px)
      minmax(0, 1fr) minmax(0, 1fr);
    /* 上下行之间留极细缝，避免完全贴死 */
    row-gap: clamp(2px, 0.45vmin, 4px);
    align-content: start;
    justify-content: stretch;
    min-height: 0;
    max-height: min(50dvh, 420px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* 教室座位区：勿用全局 .seat，避免选座弹窗被误伤 */
  .seat-grid .seat {
    display: grid;
    /* 座位略微再扁一点，整体高度更紧凑 */
    grid-template-rows: minmax(0, 20fr) minmax(0, 4fr);
    aspect-ratio: 1 / 1.24;
    align-self: start;
    justify-self: stretch;
    width: 100%;
    min-width: 0;
    min-height: var(--mobile-seat-min);
    border-radius: 0;
    border: 1px solid #d4d9de;
    box-sizing: border-box;
  }
  .seat-grid .seat-desk {
    grid-row: 1;
    min-height: 0;
    background: #eff1f4;
    border-bottom: 1px solid #d4d9de;
  }
  /* 手机教室：座位格窄，外号再缩小、略减字重，避免裁切 */
  .seat-grid .seat-nickname {
    top: 1px;
    left: 0;
    right: 0;
    font-size: clamp(7px, 1.85vmin, 9px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.04em;
    padding: 0 2px;
  }
  .seat-select-grid .seat-nickname {
    top: 1px;
    left: 0;
    right: 0;
    font-size: clamp(7px, 1.85vmin, 9px);
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: -0.04em;
    padding: 0 2px;
  }
  .seat-grid .seat-stool {
    grid-row: 2;
    min-height: clamp(9px, 2.8vmin, 16px);
    background: #f0e6c8;
    font-size: clamp(9px, 2.6vmin, 12px);
  }
  /* 换座位：与教室座位区相同的 8×5 + 过道；窄屏可横向滑动看清整排 */
  .change-seat-panel .change-seat-grid-wrap {
    flex: 1;
    min-height: 0;
    max-height: min(52dvh, 480px);
    overflow: auto;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: clamp(6px, 1.5vmin, 12px) clamp(4px, 1vmin, 10px);
  }
  .change-seat-select-grid--plain {
    max-width: none;
    width: 100%;
    gap: clamp(5px, 1.2vmin, 8px) clamp(4px, 1vmin, 6px);
  }
  .change-seat-swap-block {
    padding: 0 clamp(10px, 2.5vmin, 16px) clamp(10px, 2.5vmin, 14px);
  }
  .change-seat-swap-hint {
    font-size: clamp(12px, 3.2vmin, 14px);
    margin-bottom: clamp(6px, 1.5vmin, 10px);
  }
  .change-seat-swap-select {
    padding: clamp(10px, 2.5vmin, 12px) clamp(10px, 2.5vmin, 14px);
    font-size: clamp(14px, 3.6vmin, 16px);
    border-radius: clamp(8px, 2vmin, 10px);
  }
  .change-seat-cell {
    aspect-ratio: 1 / 1.15;
    min-height: max(var(--mobile-seat-min), 34px);
    border-radius: clamp(8px, 2vmin, 10px);
    font-size: clamp(10px, 2.65vmin, 13px);
    padding: clamp(3px, 0.8vmin, 5px) clamp(2px, 0.5vmin, 4px);
  }
  .change-seat-cell.is-selected {
    padding: clamp(2px, 0.55vmin, 4px) clamp(1px, 0.4vmin, 3px);
  }
  .change-seat-mode-row {
    padding: clamp(8px, 2vmin, 12px) clamp(8px, 2vmin, 12px);
    gap: clamp(6px, 1.5vmin, 10px);
  }
  .change-seat-mode-btn {
    font-size: clamp(12px, 3.2vmin, 14px);
    padding: clamp(9px, 2.2vmin, 12px) clamp(6px, 1.5vmin, 10px);
  }
  .change-seat-mode-btn.is-selected {
    padding: clamp(8px, 2vmin, 11px) clamp(5px, 1.4vmin, 9px);
  }
  .change-seat-actions .modal-btn.cancel,
  .change-seat-actions .change-seat-confirm {
    min-height: clamp(42px, 10vmin, 50px);
    font-size: clamp(13px, 3.4vmin, 16px);
  }
  .action-grid {
    width: 100vw;
    margin-left: calc(-1 * (var(--rail-w) + var(--page-pad-x)));
    grid-template-columns: repeat(7, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: clamp(3px, 0.7vmin, 5px);
    align-content: stretch;
    /* 保持图标位置不动：不要用 margin-top 推动整体 */
    margin-top: 3px;
    /* 仅将 14 个图标整体下移 3px（分隔线不动） */
    padding-top: calc(clamp(0px, 0.1vmin, 1px) + 3px);
    position: relative;
  }
  /* 仅移动分隔线（不移动 14 个图标） */
  .action-grid::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -1px;
    height: 1px;
    background: #d4d9de;
    pointer-events: none;
  }
  .action-btn {
    min-height: clamp(36px, 9vmin, 50px);
    height: 100%;
    font-size: clamp(10px, 2.8vmin, 12px);
    border-radius: 8px;
    line-height: 1.15;
    padding: clamp(4px, 1vmin, 8px) clamp(2px, 0.6vmin, 4px);
    gap: clamp(1px, 0.3vmin, 3px);
    justify-content: center;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
  }
  .action-btn .action-icon {
    font-size: clamp(12px, 3.5vmin, 16px);
    line-height: 1;
    flex: 0 0 auto;
  }
  .action-btn .action-label {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
    line-height: 1.08;
    font-size: clamp(8px, 2.15vmin, 11px);
    max-width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 0;
    margin: 0;
  }
  .modal-mask {
    align-items: center;
    padding: 0;
  }
  .modal {
    width: 100%;
    min-height: 100%;
    max-height: 100vh;
    border-radius: 0;
    border: 0;
    padding: 8px 8px 10px;
  }
  .modal h3 {
    margin-bottom: 6px;
  }
  .modal-title-badge {
    font-size: 18px;
    padding: 5px 14px;
  }
  .classlog-mask {
    padding: 0;
  }
  .intro-guide-mask {
    padding: 0;
    align-items: stretch;
  }
  .intro-guide-mask .intro-guide-panel {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    padding: 8px 10px 6px;
  }
  .intro-guide-mask .msg-panel-header {
    margin-bottom: 4px;
  }
  .intro-guide-mask .intro-guide-hint {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.35;
  }
  /* 标签区不再限高，避免出现内部滚动条；整体由面板滚动 */
  .intro-guide-mask .intro-guide-types {
    max-height: none;
    overflow: visible;
    margin-bottom: 8px;
    padding-bottom: 6px;
  }
  .intro-guide-mask .intro-guide-group {
    margin-bottom: 8px;
  }
  .intro-guide-mask .intro-guide-group-title {
    margin-bottom: 5px;
    font-size: 12px;
  }
  .intro-guide-mask .intro-guide-chips-row {
    gap: 6px;
  }
  .intro-guide-mask .intro-guide-chip {
    font-size: 12px;
    padding: 5px 10px;
  }
  .intro-guide-mask .intro-guide-detail-title {
    margin-bottom: 8px;
    font-size: 15px;
  }
  .intro-guide-mask .intro-guide-detail-body p {
    margin-bottom: 8px;
    font-size: 13px;
    line-height: 1.55;
  }
  .classlog-panel {
    width: 100%;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
    border: 0;
  }
  /* 顶栏与「递纸条」桌面规格对齐：手机端原先 42px + 小退出钮易显扁小 */
  .classlog-panel .classlog-header {
    height: 48px;
    min-height: 48px;
    max-height: 48px;
  }
  .classlog-title {
    font-size: 18px;
  }
  .classlog-panel .classlog-header .classlog-exit {
    right: 8px;
    top: 50%;
    transform: translateY(-50%) !important;
    font-size: 18px !important;
    padding: 8px 32px !important;
    border-radius: 10px;
    line-height: 1.2 !important;
    min-height: 36px;
    box-sizing: border-box;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .classlog-tip {
    margin: 8px 8px 6px;
    font-size: 13px;
  }
  .memory-panel .memory-form {
    margin: 0 8px 6px;
    padding-bottom: 6px;
  }
  .memory-records-title {
    font-size: 24px;
    margin: 2px 8px 6px;
  }
  .memory-records-head {
    margin: 0 8px;
    grid-template-columns: 90px 70px 1fr 70px;
    gap: 6px;
    padding: 6px 8px;
    font-size: 14px;
  }
  .memory-row {
    grid-template-columns: 90px 70px 1fr 70px;
    gap: 6px;
    padding: 6px 8px;
    font-size: 13px;
    line-height: 1.3;
  }
  .memory-empty {
    font-size: 14px;
    padding: 14px 6px;
  }
  .classlog-list-wrap {
    margin: 0 8px 8px;
    min-height: 0;
    flex: 1;
  }
  .classlog-time {
    font-size: 14px;
  }
  .classlog-text {
    font-size: 15px;
    line-height: 1.24;
  }
  .modal-label {
    font-size: 13px;
    margin: 6px 0 3px;
  }
  .modal-input, .modal-select {
    font-size: 15px;
    padding: 7px 9px;
  }
  .modal-tip {
    font-size: 12px;
    margin-top: 2px;
    line-height: 1.2;
  }
  .modal-actions {
    gap: 8px;
    margin-top: 10px;
  }
  .modal-btn {
    font-size: 15px;
    min-height: 36px;
  }
  /* 进入教室：全屏弹窗内仍保留底栏「取消/确定」固定可见 */
  .modal.join-modal-layout {
    min-height: 0;
    height: 100%;
    max-height: 100vh;
    display: flex;
    flex-direction: column;
  }
  .bag-checkin-btn {
    width: 82px;
    height: 82px;
    font-size: 17px;
  }
  /* 书包弹窗不在 .modal 内，移动端与创建班级徽章同尺寸 */
  .bag-panel .modal-title-badge {
    font-size: 18px;
    padding: 5px 14px;
  }
  /* 消息面板（手机）：压缩高度与字号，一屏多显示几条 */
  #msgPanelMask.msg-panel-mask {
    align-items: stretch;
    padding: 8px;
    padding-top: 8px;
  }
  #msgPanelMask .msg-panel {
    width: 100%;
    max-width: none;
    max-height: min(92dvh, calc(100vh - 16px));
    padding: 8px 10px 10px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  #msgPanelMask .msg-panel-header {
    margin-bottom: 4px;
    flex-shrink: 0;
  }
  #msgPanelMask .msg-panel-title {
    font-size: 16px;
  }
  #msgPanelMask .msg-panel-exit {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 8px;
  }
  #msgPanelMask .msg-panel-toolbar {
    margin: 0 0 4px;
    justify-content: center;
    flex-shrink: 0;
  }
  #msgPanelMask .msg-panel-clear-btn {
    padding: 3px 8px;
    font-size: 11px;
    border-radius: 6px;
  }
  #msgPanelMask .msg-panel-card {
    padding: 6px 8px;
    flex: 1;
    min-height: 80px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  #msgPanelMask .msg-item {
    padding: 5px 0;
  }
  #msgPanelMask .msg-item-time--mid {
    font-size: 10px;
    min-width: 2.4em;
    margin: 0 3px;
    padding: 0 3px;
  }
  #msgPanelMask .msg-item-head {
    gap: 3px 6px;
    margin-bottom: 2px;
  }
  #msgPanelMask .msg-item-title {
    font-size: 13px;
    line-height: 1.2;
  }
  #msgPanelMask .msg-item-badge {
    font-size: 10px;
  }
  #msgPanelMask .msg-item-time {
    font-size: 10px;
  }
  #msgPanelMask .msg-item-body {
    font-size: 11px;
    line-height: 1.3;
  }
  #msgPanelMask .msg-item-actions-inline {
    gap: 10px 12px;
  }
  #msgPanelMask .msg-item-actions-inline .msg-btn-sm {
    padding: 4px 8px;
    font-size: 10px;
    border-radius: 5px;
    min-height: 0;
  }
  #msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-believe,
  #msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-doubt,
  #msgPanelMask .msg-gossip-pending-actions .msg-item-actions-inline .msg-gossip-dead-believe {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
  }
  #msgPanelMask .msg-gossip-forward-trigger {
    min-height: 50px;
    padding: 12px 14px;
  }
  #msgPanelMask .msg-gossip-forward-trigger .pass-note-template-trigger-text {
    font-size: 15px;
  }
  #msgPanelMask .msg-item.msg-empty .msg-item-title {
    font-size: 13px;
  }
  #msgPanelMask .msg-item.msg-empty .msg-item-body {
    font-size: 11px;
  }
}

/* 横屏或矮屏：压缩底栏与新闻行高，黑板高度仍随侧栏三格联动 */
@media (max-width: 1024px) and (max-height: 560px) {
  :root {
    --mobile-controls-h: clamp(48px, 10vmin, 68px);
    --mobile-action-h: clamp(96px, 22vmin, 148px);
    --news-strip-h: clamp(20px, 5.5vmin, 28px);
  }
}

/* 极窄屏（如折叠外屏）：侧栏略窄 */
@media (max-width: 380px) {
  :root {
    --rail-w: clamp(50px, 16vmin, 68px);
    --mobile-seat-min: clamp(28px, 6.8vmin, 50px);
  }
}
