/* =========================================
   0. 全局变量与背景 (碧蓝档案·蔚蓝配色版)
   ========================================= */
:root {
  --scroll-bg: #F0F8FF;
  --scroll-ink: #37474F;
  --scroll-red: #4FC3F7;
  --scroll-gold: #B3E5FC;
  --scroll-accent: #039BE5;
  --scroll-border: 2px solid #B3E5FC;
  --scroll-shadow: 4px 4px 0px 0px rgba(79, 195, 247, 0.3);
  --paper-texture: url('data:image/svg+xml;utf8,<svg width="200" height="200" xmlns="http://www.w3.org/2000/svg"><filter id="noise"><feTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="3" stitchTiles="stitch"/></filter><rect width="100%" height="100%" filter="url(%23noise)" opacity="0.05"/></svg>');
  --font-serif: "Segoe UI", "Microsoft YaHei", "Noto Serif SC", "Source Han Serif SC", sans-serif;
  --font-kaiti: "LXGW WenKai", "Noto Serif SC", serif;
}
/* =========================================
   1. 核心气泡容器
   ========================================= */
div.group.relative > div.relative.inline-block.bg-gray-100\/90 {
  display: block !important;
  isolation: isolate;
  transform-style: preserve-3d;
  background-color: #F0F8FF !important;
  background-image: linear-gradient(180deg, #FFFFFF 0%, #F0F8FF 100%) !important;
  border: 1px solid #B3E5FC;
  border-top: 4px solid #4FC3F7;
  border-bottom: 1px solid #B3E5FC;
  border-radius: 20px;
  box-shadow: 0 4px 15px rgba(79, 195, 247, 0.15);
  padding: 20px 28px;
  width: 95%;
  max-width: 48em;
  margin: 10px auto;
  box-sizing: border-box;
  font-family: var(--font-serif);
  color: var(--scroll-ink) !important;
  font-size: 1.05rem;
  line-height: 1.9;
  letter-spacing: 0.05em;
  position: relative;
  z-index: 1;
  -webkit-font-smoothing: antialiased;
}
@media screen and (max-width: 600px) {
  div.group.relative > div.relative.inline-block.bg-gray-100\/90 {
    padding: 15px 12px;
    width: 98%;
    font-size: 1rem;
  }
}
div.group.relative > div.relative.inline-block.bg-gray-100\/90::before {
  content: "";
  position: absolute;
  top: 6px; bottom: 6px; left: 6px; right: 6px;
  border: 1px dashed rgba(79, 195, 247, 0.3);
  border-radius: 14px;
  pointer-events: none;
  z-index: -1;
  transform: translateZ(-1px);
  background: transparent !important;
}
div.group.relative > div.relative.inline-block.bg-gray-100\/90 p[data-character="天照院夜夜"] {
  position: relative;
  display: inline-block;
  color: var(--scroll-accent);
  font-weight: 900;
  border-bottom: 2px solid rgba(3, 155, 229, 0.3);
  padding-bottom: 2px;
  padding-right: 14px;
  margin-bottom: 5px;
  font-family: var(--font-kaiti);
}
div.group.relative > div.relative.inline-block.bg-gray-100\/90 p[data-character="天照院夜夜"]::after {
  content: "❤";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-55%);
  color: #4FC3F7;
  font-size: 0.9em;
  opacity: 0.8;
  animation: heartbeat 1.5s infinite;
}
@keyframes heartbeat {
  0%   { transform: translateY(-55%) scale(1); }
  25%  { transform: translateY(-55%) scale(1.15); }
  50%  { transform: translateY(-55%) scale(1); }
  75%  { transform: translateY(-55%) scale(1.25); }
  100% { transform: translateY(-55%) scale(1); }
}
/* =========================================
   2. ClassUI 面板
   ========================================= */
.classUI-details-panel,
.classUI-panel {
  margin-bottom: 20px;
  background-color: #FAFDFF;
  background-image: var(--paper-texture);
  border: 1px solid #B3E5FC;
  border-radius: 16px;
  box-shadow: 3px 3px 0 rgba(79, 195, 247, 0.2);
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}
.classUI-details-panel:hover,
.classUI-panel:hover {
  transform: translateY(-2px);
  box-shadow: 4px 4px 0 rgba(79, 195, 247, 0.3);
  transition: all 0.3s ease;
}
.styled-prose-container {
  background: transparent;
  --classUI-panel-bg: #F5FCFF;
  --classUI-panel-border: #B3E5FC;
  --classUI-header-bg: #E1F5FE;
  --classUI-text-secondary: #546E7A;
  --classUI-accent: #039BE5;
  --classUI-code-bg: #E0F7FA;
  --classUI-code-text: #0277BD;
  --classUI-summary-hover-bg: #B3E5FC;
  --novel-text-underline: rgba(3, 155, 229, 0.15);
  --novel-text-color: #263238;
  padding: 0;
  box-shadow: none;
}
.classUI-panel-header,
.classUI-summary-header {
  background-color: #E1F5FE;
  padding: 10px 15px;
  font-weight: 700;
  color: #0277BD;
  border-bottom: 1px solid #B3E5FC;
  font-family: var(--font-serif);
  display: flex;
  align-items: center;
}
.classUI-summary-header::before {
  content: "❤";
  color: #4FC3F7;
  margin-right: 10px;
  font-size: 0.8em;
}
.classUI-panel-content {
  padding: 1.2em;
  color: #37474F;
  font-family: var(--font-serif);
}
.classUI-master-system .classUI-system-line {
  display: block;
  margin-bottom: 0.8em;
  line-height: 1.6;
  border-bottom: 1px dotted #B3E5FC;
  padding-bottom: 6px;
}
.classUI-master-system .classUI-label {
  color: #0277BD;
  background: rgba(79, 195, 247, 0.1);
  padding: 0 6px;
  margin-right: 0.6em;
  font-weight: bold;
  border-radius: 4px;
  font-family: var(--font-serif);
  display: inline-block;
  margin-bottom: 4px;
}
.classUI-master-system .classUI-value {
  color: #37474F;
  font-family: var(--font-serif);
  display: block;
  width: 100%;
}
.classUI-master-system .classUI-task-active,
.classUI-master-system .classUI-task-completed,
.classUI-master-system .classUI-task-failed {
  font-size: 0.85em;
  padding: 0.2em 0.6em;
  border-radius: 12px;
  margin-left: 0.5em;
  font-weight: bold;
}
.classUI-master-system .classUI-task-active {
  background-color: #E1F5FE;
  color: #0288D1;
  border: 1px solid #B3E5FC;
}
.classUI-master-system .classUI-task-completed {
  background-color: #E8F5E9;
  color: #388E3C;
  border: 1px solid #C8E6C9;
}
.classUI-master-system .classUI-task-failed {
  background-color: #FFEBEE;
  color: #D32F2F;
  border: 1px solid #FFCDD2;
}
.classUI-compass-options {
  gap: 12px;
}
.classUI-compass-option {
  border: 2px solid #B3E5FC;
  background-color: #FFFFFF;
  color: #546E7A;
  border-radius: 16px;
  position: relative;
  box-shadow: 2px 2px 0 rgba(79, 195, 247, 0.2);
  padding: 14px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  overflow: hidden;
  user-select: none;
  font-weight: 600;
}
.classUI-compass-option:hover,
.classUI-compass-option:focus-visible {
  background-color: #E1F5FE;
  border-color: #039BE5;
  transform: translateY(-1px);
  box-shadow: 3px 3px 0 rgba(3, 155, 229, 0.2);
  outline: none;
}
.classUI-compass-option .classUI-option-label,
.classUI-compass-option .classUI-copy-feedback {
  display: inline-block;
  transition: opacity 0.3s ease;
  backface-visibility: hidden;
}
.classUI-compass-option .classUI-copy-feedback {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  opacity: 0;
  pointer-events: none;
  font-weight: bold;
  color: var(--classUI-accent);
}
.classUI-compass-option.classUI-copied .classUI-option-label {
  opacity: 0;
}
.classUI-compass-option.classUI-copied .classUI-copy-feedback {
  opacity: 1;
}
.classUI-option-label {
  color: #039BE5;
  font-weight: 900;
  border-right: 1px solid rgba(179, 229, 252, 0.4);
  padding-right: 10px;
  font-family: var(--font-kaiti);
}
.classUI-compass-disabled {
  color: var(--classUI-text-secondary);
  text-align: center;
  padding: 1em 0;
  font-style: italic;
  user-select: none;
}
@media (min-width: 768px) {
  .classUI-compass-options {
    display: flex;
    flex-direction: row;
  }
  .classUI-compass-option {
    flex: 1;
  }
}
.classUI-status-grid {
  font-family: var(--font-kaiti);
  display: flex;
  flex-direction: column;
  gap: 1em;
}
.classUI-status-grid .classUI-status-item {
  display: flex;
  flex-wrap: nowrap;
  margin-bottom: 0.8em;
  align-items: flex-start;
  line-height: 1.7;
}
.classUI-status-grid .classUI-status-item:last-child {
  margin-bottom: 0;
}
.classUI-status-grid .classUI-label {
  font-weight: 600;
  color: var(--classUI-text-secondary);
  flex-shrink: 0;
  width: 6.5em;
}
.classUI-status-grid .classUI-value {
  word-break: break-word;
  flex-grow: 1;
  padding-left: 0.5em;
  border-left: 2px solid var(--classUI-panel-border);
}
.classUI-memory-section {
  display: flex;
  flex-direction: column;
  width: 100%;
}
.classUI-memory-header {
  font-weight: 700;
  color: var(--classUI-accent);
  padding-bottom: 0.4em;
  border-bottom: 2px dashed var(--classUI-panel-border);
  margin-bottom: 0.6em;
  font-size: 0.95em;
  letter-spacing: 0.5px;
}
.classUI-memory-content {
  line-height: 1.8;
  white-space: pre-wrap;
  word-wrap: break-word;
  padding-left: 0.5em;
}
.classUI-master-system .classUI-indent-1 {
  padding-left: 1.8em;
  position: relative;
}
.classUI-master-system .classUI-indent-1::before {
  content: "•";
  position: absolute;
  left: 1em;
  color: var(--classUI-accent);
}
.classUI-master-system .classUI-indent-2 {
  padding-left: 3.2em;
  position: relative;
}
.classUI-master-system .classUI-indent-2::before {
  content: "◦";
  position: absolute;
  left: 2.4em;
  color: var(--classUI-accent);
}
.styled-prose-container > p:not([class]),
.styled-prose-container > div > p:not([class]),
.story-content p {
  text-indent: 2em;
  margin-bottom: 0.8em;
}
@media (max-width: 768px) {
  .classUI-panel,
  .classUI-details-panel {
    margin: 0.5em 0;
    border-radius: 12px;
  }
  .classUI-master-system .classUI-system-line {
    font-size: 13.5px;
  }
  .classUI-status-grid .classUI-status-item {
    font-size: 13.5px;
  }
  .classUI-panel-header,
  .classUI-summary-header {
    padding: 0.6em 1em;
    font-size: 14px;
  }
  .classUI-panel-content {
    padding: 0.8em;
  }
  .classUI-status-grid {
    gap: 0.7em;
  }
  .classUI-memory-header {
    font-size: 13.5px;
    padding-bottom: 0.2em;
  }
  .classUI-memory-content {
    font-size: 13.5px;
    line-height: 1.55;
  }
  .classUI-details-panel {
    margin-bottom: 10px;
  }
}
/* =========================================
   3. MomoTalk (桃信) 蔚蓝档案风格
   ========================================= */
.momo-talk-wrapper {
  font-family: 'Segoe UI', 'Helvetica Neue', Helvetica, 'Microsoft YaHei', sans-serif !important;
  background-color: #7297C8 !important;
  border: none !important;
  border-radius: 12px;
  overflow: hidden;
  max-width: 100%;
  margin: 20px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #000 !important;
  text-indent: 0 !important;
  clear: both;
}
.momo-talk-wrapper details > summary {
  list-style: none;
  cursor: pointer;
  outline: none;
}
.momo-talk-wrapper details > summary::-webkit-details-marker {
  display: none;
}
.momo-talk-wrapper * {
  text-indent: 0 !important;
  box-sizing: border-box;
}
.momo-header {
  background-color: #263342 !important;
  color: #FFFFFF !important;
  padding: 12px 18px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(0,0,0,0.1) !important;
  font-size: 1em;
  letter-spacing: 0.5px;
}
.momo-header:hover {
  filter: brightness(1.05);
}
.momo-body {
  background-color: #7297C8 !important;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow-y: auto;
  background-image: none;
}
.momo-msg {
  display: flex;
  align-items: flex-start;
  animation: momoFadeIn 0.3s ease-out;
  margin-bottom: 5px;
  width: 100%;
}
.momo-msg.student-side {
  justify-content: flex-start;
}
.momo-msg.student-side .momo-avatar-box {
  margin-right: 8px;
  margin-top: 2px;
}
.momo-msg.sensei-side {
  justify-content: flex-end;
}
.momo-msg.sensei-side .momo-avatar-box {
  display: none;
}
.momo-msg.sensei-side .momo-content {
  align-items: flex-end;
}
.momo-msg.sensei-side .momo-bubble {
  background-color: #85E249 !important;
  color: #000000 !important;
  border: none !important;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  position: relative;
}
.momo-msg.sensei-side .momo-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 8px;
  border-color: transparent transparent transparent #85E249;
}
.momo-avatar-box {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #E0E0E0;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  border: none;
  box-shadow: none;
  overflow: hidden;
}
.momo-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
}
.momo-avatar-text {
  font-size: 10px;
  display: none;
}
.momo-content {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}
.momo-name {
  font-size: 0.75em;
  color: #FFFFFF !important;
  text-shadow: 0 1px 1px rgba(0,0,0,0.2);
  margin-bottom: 4px;
  margin-left: 2px;
  line-height: 1.2;
}
.momo-msg.sensei-side .momo-name {
  display: none;
}
.momo-bubble {
  background-color: #FFFFFF !important;
  border: none !important;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.95em;
  line-height: 1.5;
  color: #000000 !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  text-align: left;
  white-space: pre-line !important;
  word-wrap: break-word;
  min-width: 2em;
  position: relative;
}
.momo-msg.student-side .momo-bubble::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 12px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 8px 6px 0;
  border-color: transparent #FFFFFF transparent transparent;
}
.momo-bubble p {
  text-indent: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}
.momo-sticker {
  max-width: 140px;
  border-radius: 12px;
  margin-top: 4px;
  display: block;
}
@keyframes momoFadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
/* =========================================
   4. 角色信息面板 - 气泡进度条样式
   ========================================= */
.classUI-bubble-bar {
  position: relative;
  background-color: #E6F3F7;
  border: 1px solid #B3E5FC;
  border-radius: 8px;
  box-shadow: inset 0 1px 3px rgba(79,195,247,0.1);
  min-height: 24px;
  height: auto;
  width: 100%;
  overflow: hidden;
  margin-top: 2px;
  display: flex;
  align-items: center;
}
.classUI-bar-fill {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  z-index: 1;
  opacity: 0.85;
  transition: width 0.5s ease-in-out;
  background-color: #4FC3F7;
  border-radius: inherit;
}
.classUI-bar-text {
  position: relative;
  z-index: 2;
  color: #37474F;
  font-weight: 900;
  font-family: var(--font-serif);
  font-size: 0.85em;
  line-height: 1.5;
  padding: 4px 8px;
  white-space: normal;
  word-wrap: break-word;
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
  width: 100%;
  text-indent: 0 !important;
}
.classUI-bar-fill.pink { background-color: #F48FB1 !important; }
.classUI-bar-fill.purple { background-color: #C77DFF !important; }
.classUI-bar-fill.teal, .classUI-bar-fill.cyan { background-color: #4CC9F0 !important; }
.classUI-bar-fill.green { background-color: #70E000 !important; }
.classUI-bar-fill.dark, .classUI-bar-fill.black { background-color: #7E57C2 !important; }
.classUI-bar-fill.yellow, .classUI-bar-fill.gold { background-color: #FFB703 !important; }
.classUI-bar-fill.blue { background-color: #29B6F6 !important; }
/* =========================================
   5. 角色面板 (Dashboard)
   ========================================= */
.classUI-top-dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
  padding: 10px;
  border: 2px solid #B3E5FC;
  background-color: #F0F8FF;
  box-shadow: 0 4px 8px rgba(79,195,247,0.2);
  border-radius: 12px;
  box-sizing: border-box;
}
.classUI-top-dashboard .classUI-system-line {
  margin-bottom: 0 !important;
  box-sizing: border-box;
}
.classUI-top-dashboard .classUI-system-line:nth-child(1) {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  background: transparent;
  border: none;
  border-bottom: 2px dashed #B3E5FC;
  box-shadow: none;
  padding-bottom: 8px;
  margin-bottom: 5px;
  font-size: 1.6em;
  font-weight: 800;
  color: #0288D1;
  font-family: var(--font-kaiti);
}
.classUI-top-dashboard .classUI-system-line:nth-child(1) .classUI-label {
  font-size: 0.8em;
  margin-right: 8px;
  opacity: 0.8;
}
.classUI-top-dashboard .classUI-system-line:not(:nth-child(1)) {
  background-color: #FFFFFF;
  border: 1px solid #E1F5FE;
  border-radius: 8px;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  box-shadow: 0 1px 3px rgba(179,229,252,0.2);
  transition: all 0.2s ease;
  min-width: 0;
}
.classUI-top-dashboard .classUI-system-line:not(:nth-child(1)):hover {
  transform: translateY(-1px);
  border-color: #4FC3F7;
  box-shadow: 0 3px 6px rgba(79,195,247,0.2);
}
.classUI-top-dashboard .classUI-system-line:not(:nth-child(1)) .classUI-label {
  margin-right: 8px;
  font-size: 1.1em;
  flex-shrink: 0;
}
.classUI-top-dashboard .classUI-system-line:not(:nth-child(1)) .classUI-value {
  font-weight: 600;
  color: #546E7A;
  font-family: var(--font-serif);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* =========================================
   6. 开发度标签
   ========================================= */
.classUI-dev-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #0277BD;
  background-image: linear-gradient(135deg, #039BE5 0%, #0277BD 100%);
  color: #FFFFFF;
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 6px;
  margin-left: 8px;
  line-height: 1.4;
  vertical-align: middle;
  box-shadow: 0 2px 5px rgba(2, 119, 189, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  cursor: help;
  transition: all 0.2s ease;
  transform: rotate(-3deg);
}
.classUI-dev-tag:hover {
  transform: rotate(-3deg) translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 4px 8px rgba(2, 119, 189, 0.4);
}
/* =========================================
   暗黑模式 — 集中写在末尾
   ========================================= */
@media (prefers-color-scheme: dark) {
  div.group.relative > div.relative.inline-block.bg-gray-100\/90 {
    background-color: #263238 !important;
    background-image: linear-gradient(180deg, #263238 0%, #1c252a 100%) !important;
    color: #ECEFF1 !important;
    border-color: #455A64;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .classUI-details-panel,
  .classUI-panel {
    background-color: #263238 !important;
    background-image: none !important;
    color: #ECEFF1 !important;
    border-color: #455A64;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  }
  .styled-prose-container {
    --classUI-panel-bg: #263238;
    --classUI-panel-border: #455A64;
    --classUI-header-bg: #37474F;
    --classUI-text-secondary: #B0BEC5;
    --classUI-accent: #4FC3F7;
    --classUI-code-bg: #263238;
    --classUI-code-text: #81D4FA;
    --classUI-summary-hover-bg: #455A64;
    --novel-text-underline: rgba(79, 195, 247, 0.2);
    --novel-text-color: #ECEFF1;
  }
  .classUI-panel-header {
    background-color: #37474F !important;
    color: #E1F5FE !important;
    border-bottom-color: #455A64 !important;
  }
  .classUI-summary-header {
    background-color: #37474F !important;
    background-image: linear-gradient(to right, #37474F, #455A64) !important;
    color: #E1F5FE !important;
  }
  .classUI-summary-header:hover,
  .classUI-summary-header:focus {
    background-color: #455A64 !important;
    background-image: linear-gradient(to right, #455A64, #546E7A) !important;
  }
  .classUI-panel-content {
    color: #ECEFF1 !important;
  }
  .classUI-master-system .classUI-label {
    color: #81D4FA !important;
    background: rgba(79, 195, 247, 0.1) !important;
  }
  .classUI-master-system .classUI-value {
    color: #ECEFF1 !important;
  }
  .classUI-master-system .classUI-task-active {
    background-color: rgba(79, 195, 247, 0.15) !important;
    color: #4FC3F7 !important;
    border-color: rgba(79, 195, 247, 0.3) !important;
  }
  .classUI-master-system .classUI-task-completed {
    background-color: rgba(129, 199, 132, 0.15) !important;
    color: #81C784 !important;
    border-color: rgba(129, 199, 132, 0.3) !important;
  }
  .classUI-master-system .classUI-task-failed {
    background-color: rgba(229, 115, 115, 0.15) !important;
    color: #E57373 !important;
    border-color: rgba(229, 115, 115, 0.3) !important;
  }
  .classUI-compass-option {
    color: #ECEFF1 !important;
    background-color: #37474F !important;
    border-color: #455A64 !important;
  }
  .classUI-compass-option:hover,
  .classUI-compass-option:focus-visible {
    background-color: #455A64 !important;
    border-color: #81D4FA !important;
  }
  .classUI-bubble-bar {
    background-color: #37474F !important;
    border-color: #455A64 !important;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  }
  .classUI-bar-text {
    color: #ECEFF1 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  }
  .classUI-bar-fill.pink { background-color: #AD1457 !important; }
  .classUI-bar-fill.dark, .classUI-bar-fill.black { background-color: #4527A0 !important; }
  .classUI-bar-fill.blue { background-color: #0277BD !important; }
  .classUI-bar-fill.purple { background-color: #7B1FA2 !important; }
  .classUI-bar-fill.teal, .classUI-bar-fill.cyan { background-color: #00838F !important; }
  .classUI-bar-fill.green { background-color: #388E3C !important; }
  .classUI-bar-fill.yellow, .classUI-bar-fill.gold { background-color: #F57F17 !important; }
  .classUI-top-dashboard {
    background-color: #1c252a !important;
    border-color: #455A64 !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  }
  .classUI-top-dashboard .classUI-system-line:nth-child(1) {
    border-bottom-color: #546E7A !important;
    color: #81D4FA !important;
  }
  .classUI-top-dashboard .classUI-system-line:not(:nth-child(1)) {
    background-color: #37474F !important;
    border-color: #455A64 !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
  }
  .classUI-top-dashboard .classUI-system-line:not(:nth-child(1)):hover {
    border-color: #81D4FA !important;
    background-color: #455A64 !important;
  }
  .classUI-top-dashboard .classUI-system-line:not(:nth-child(1)) .classUI-value {
    color: #B0BEC5 !important;
  }
  .classUI-dev-tag {
    background-color: #01579B !important;
    background-image: linear-gradient(135deg, #0277BD 0%, #01579B 100%) !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.4);
    border-color: rgba(255,255,255,0.2) !important;
  }
  .momo-talk-wrapper {
    background-color: #1B2A3B !important;
    border: 1px solid #263342 !important;
    box-shadow: none;
  }
  .momo-header {
    background-color: #1a2233 !important;
    border-bottom-color: #263342 !important;
  }
  .momo-body {
    background-color: #1B2A3B !important;
  }
  .momo-bubble {
    background-color: #2C3E50 !important;
    color: #ECEFF1 !important;
  }
  .momo-msg.student-side .momo-bubble::before {
    border-color: transparent #2C3E50 transparent transparent;
  }
  .momo-msg.sensei-side .momo-bubble {
    background-color: #4A7C3F !important;
    color: #FFFFFF !important;
  }
  .momo-msg.sensei-side .momo-bubble::after {
    border-color: transparent transparent transparent #4A7C3F !important;
  }
  .momo-name {
    color: #90CAF9 !important;
    text-shadow: none;
  }
}
/* ========== 人际关系网络面板样式 v2.0 ========== */
.relation-network {
  max-width: 680px;
  margin: 1.5em auto;
  background: #f8f6f9;
  border: 1px solid #dcd5e6;
  border-radius: 12px;
  font-family: 'Noto Serif JP', 'Source Han Serif', 'Hiragino Mincho Pro', serif;
  box-shadow: 0 3px 12px rgba(0,0,0,0.05);
  overflow: hidden;
}
.relation-network[open] .relation-summary {
  border-bottom: 1px dashed #cfc3da;
}
.relation-summary {
  list-style: none !important;
  cursor: pointer;
  padding: 0.9em 1.4em;
  font-size: 1.1em;
  font-weight: 700;
  color: #463c5a !important;
  background: #ece4f2;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  gap: 0.5em;
  user-select: none;
  border-radius: 12px 12px 0 0;
}
.relation-summary::marker { display: none; }
.relation-summary::-webkit-details-marker { display: none; }
.relation-content {
  padding: 1.4em 1.6em;
  display: flex;
  flex-direction: column;
  gap: 1.2em;
  background: #f8f6f9;
}
.relation-section {
  background: #ffffff;
  padding: 0.8em 1.2em;
  border-left: 5px solid #aaa;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.relation-section.core {
  border-left-color: #e05a6b;
  background: #fffafb;
}
.relation-section.normal {
  border-left-color: #5a8ec0;
  background: #fafcff;
}
.relation-section.dormant {
  border-left-color: #b5a58c;
  background: #fafaf8;
}
.relation-section.social {
  border-left-color: #5a9e7c;
  background: #f9fdfa;
}
.relation-section-title {
  font-weight: 700;
  font-size: 0.95em;
  color: #4a3e5c;
  margin-bottom: 0.5em;
  display: flex;
  align-items: center;
  gap: 0.3em;
}
.relation-list {
  margin: 0;
  padding-left: 1.2em;
  list-style: none;
}
.relation-list li {
  font-size: 0.92em;
  line-height: 1.65;
  color: #3d3548;
  position: relative;
  padding: 0.15em 0;
}
.relation-list li::before {
  content: "•";
  position: absolute;
  left: -1.2em;
  color: #b9a7c9;
  font-weight: bold;
}
.relation-empty {
  font-style: italic;
  color: #a092b0 !important;
}
.relation-empty::before {
  display: none;
}
@media (prefers-color-scheme: dark) {
  .relation-network { background: #3a3540; border-color: #5a4e5e; box-shadow: 0 3px 12px rgba(0,0,0,0.3); }
  .relation-summary { background: #4d4255; color: #e8daf0 !important; }
  .relation-content { background: #3a3540; }
  .relation-section { background: #453c4a; box-shadow: 0 1px 4px rgba(0,0,0,0.2); }
  .relation-section.core { background: #4d3f44; border-left-color: #e05a6b; }
  .relation-section.normal { background: #3f4852; border-left-color: #5a8ec0; }
  .relation-section.dormant { background: #44403c; border-left-color: #b5a58c; }
  .relation-section.social { background: #3f4a42; border-left-color: #5a9e7c; }
  .relation-section-title { color: #d4cae0; }
  .relation-list li { color: #e0d8ea; }
  .relation-list li::before { color: #b9a7c9; }
  .relation-empty { color: #8a7a9a !important; }
}
/* =========================================
   [终极防断层版] 字号精准自适应，解决换行割裂，手机端头像放大
   ========================================= */
/* 1. 名字行基础布局：限制整体空间 */
.classUI-top-dashboard .classUI-system-line.classUI-name-row {
  grid-column: 1 / -1 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: space-between !important;
  align-items: center !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 5px 0 12px 0 !important;
  margin-bottom: 10px !important;
  border-bottom: 2px solid !important;
  border-image: linear-gradient(to right, #A8D5C5, #E6C07B, #A8D5C5) 1 !important;
}

/* 2. 名字文字区域：自适应可用空间 */
.classUI-name-area {
  display: flex !important;
  align-items: center !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  overflow: hidden !important;
}

/* 前面的“姓名”标签 */
.classUI-name-area .classUI-label {
  flex-shrink: 0 !important;
  font-size: 0.95em !important;
  white-space: nowrap !important;
}

/* 名字内容：废除导致断层的webkit-box，采用紧凑行高+彻底的断词换行 */
.classUI-name-area .classUI-value {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  font-size: 1.25em !important;   /* 电脑端默认字号 */
  font-weight: 800 !important;
  padding-left: 4px !important;
  
  /* 核心修复：解决长名字换行时，上下字间距过大(撕裂)的问题 */
  line-height: 1.15 !important;
  white-space: normal !important;
  word-break: break-all !important; /* 确保长名字能在任何字断开换行，绝不越界 */
  display: inline-block !important; /* 保持为内联块，使紧凑line-height完美生效 */
}

/* 3. 右侧头像容器：电脑端保持不变 (85px) */
.classUI-avatar-wrapper {
  flex-shrink: 0 !important;          
  width: 85px !important;
  height: 85px !important;
  min-width: 85px !important;
  min-height: 85px !important;
  max-width: 85px !important;
  max-height: 85px !important;
  margin-left: 15px !important;
  box-sizing: border-box !important;

  border-radius: 50% !important;      
  clip-path: circle(50% at 50% 50%) !important;  
  border: 3px solid #E6C07B !important;
  overflow: hidden !important;
  background: #F5EFE6 !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  box-shadow: 0 4px 12px rgba(230, 192, 123, 0.3) !important;
  transition: all 0.3s ease !important;
}

.classUI-avatar-wrapper:hover {
  transform: scale(1.05) rotate(-2deg) !important;
  border-color: #D4A85A !important;
}

/* 4. 头像图片自身强制约束 */
.classUI-avatar {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  border-radius: 50% !important;     
  object-fit: cover !important;
  object-position: top center !important; 
  display: block !important;
}

/* 5. 适配暗色模式 */
.classUI-avatar-wrapper:is(.dark *) {
  border-color: #D4A85A !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
  background: #4D443A !important;
}
.classUI-avatar-wrapper:hover:is(.dark *) {
  border-color: #E6C07B !important;
}

/* 6. 移动端适配：强制缩小字号，同时进一步放大头像 */
@media (max-width: 768px) {
  .classUI-avatar-wrapper {
    /* 手机端头像大幅放大至 80px (非常接近电脑端尺寸) */
    width: 80px !important;
    height: 80px !important;
    min-width: 80px !important;
    min-height: 80px !important;
    max-width: 80px !important;
    max-height: 80px !important;
    border-width: 2px !important;
    margin-left: 10px !important;
  }
  /* 强制缩小字号，防止名字过长换行 */
  .classUI-name-area .classUI-value {
    font-size: 1.05em !important; 
  }
  .classUI-name-area .classUI-label {
    font-size: 0.85em !important;
  }
}

/* 7. 小屏手机极值适配 */
@media (max-width: 420px) {
  .classUI-avatar-wrapper {
    /* 极小屏头像也强行保持 75px 的大尺寸（原来只有52px） */
    width: 75px !important;
    height: 75px !important;
    min-width: 75px !important;
    min-height: 75px !important;
    max-width: 75px !important;
    max-height: 75px !important;
    margin-left: 8px !important;
  }
  /* 极限缩小字号，把空间全让给名字，绝不溢出 */
  .classUI-name-area .classUI-value {
    font-size: 0.9em !important; 
  }
  .classUI-name-area .classUI-label {
    font-size: 0.8em !important;
  }
}