/* ============================================
   绯樱女子学院 · Neo-Brutalism 波普风主题
   ============================================ */

/* --- 全局字体与基础变量 --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;700;900&display=swap');

/* --- 正文美化 --- */
.msg-content {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 15px;
  line-height: 1.85;
  color: #1a1a1a;
  letter-spacing: 0.3px;
}

.msg-content p {
  margin: 0.6em 0;
  text-indent: 2em;
  text-align: justify;
}

/*对话引号高亮 */
.msg-content p::first-line {
  font-weight: 700;
}

/* --- 分割线美化 --- */
.msg-content hr {
  border: none;
  height: 3px;
  background: #0a0a0a;
  margin: 16px 0;
  position: relative;
}

.msg-content hr::after {
  content: '◆';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff8e7;
  padding: 0 10px;
  color: #ff4d6d;
  font-size: 14px;
  font-weight: 900;
}

/* ============================================
   状态栏面板 · 通用 section 样式
   ============================================ */

details.section {
  border: 3px solid #0a0a0a;
  border-radius: 0;
  margin: 12px 0;
  background: #fff8e7;
  box-shadow: 5px 5px 0 #0a0a0a;
  position: relative;
  overflow: hidden;
}

/* 各section 顶部装饰色条 */
details.section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
}

details.section.s::before {
  background: #00b4d8;
}

details.section.p::before {
  background: #ff4d6d;
}

details.section.n::before {
  background: #ffd60a;
}

details.section.v::before {
  background: #7b2ff7;
}

details.section.m::before {
  background: #ff6b35;
}

details.section.a::before {
  background: #06d6a0;
}

/* --- summary 标题栏 --- */
details.section > summary {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 900;
  font-size: 15px;
  padding: 12px 16px 10px;
  cursor: pointer;
  list-style: none;
  color: #0a0a0a;
  background: transparent;
  border-bottom: 2px dashed #0a0a0a;
  position: relative;
  user-select: none;
  transition: background 0.15s;
}

details.section > summary::-webkit-details-marker {
  display: none;
}

details.section > summary::before {
  content: '▶';
  display: inline-block;
  margin-right: 8px;
  font-size: 11px;
  transition: transform 0.2s;
  color: #ff4d6d;
}

details.section[open] > summary::before {
  transform: rotate(90deg);
}

details.section > summary:hover {
  background: rgba(255, 77, 109, 0.06);
}

/* summary 右侧装饰标签 */
details.section.s > summary::after {
  content: 'SCENE';
}

details.section.p > summary::after {
  content: 'PLAYER';
}

details.section.n > summary::after {
  content: 'NPC';
}

details.section.v > summary::after {
  content: 'DATA';
}

details.section.m > summary::after {
  content: 'MEMORY';
}

details.section.a > summary::after {
  content: 'ACTION';
}

details.section > summary::after {
  font-family: 'Noto Sans SC', monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 2px 8px;
  border: 2px solid #0a0a0a;
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) rotate(-2deg);
  box-shadow: 2px 2px 0 #0a0a0a;
}

details.section.s > summary::after {
  background: #00b4d8;color: #fff;
}

details.section.p > summary::after {
  background: #ff4d6d;
  color: #fff;
}

details.section.n > summary::after {
  background: #ffd60a;
  color: #0a0a0a;
}

details.section.v > summary::after {
  background: #7b2ff7;
  color: #fff;
}

details.section.m > summary::after {
  background: #ff6b35;
  color: #fff;
}

details.section.a > summary::after {
  background: #06d6a0;
  color: #0a0a0a;
}

/* ============================================
   卡片 .card
   ============================================ */

details.section .card {
  margin: 10px 12px;
  padding: 12px 14px;
  background: #fffdf5;
  border: 2px solid #0a0a0a;
  box-shadow: 3px 3px 0 #0a0a0a;
  position: relative;
}

/* 卡片左上角装饰小方块 */
details.section .card::before {
  content: '';
  position: absolute;
  top: -4px;
  left: -4px;
  width: 12px;
  height: 12px;
  border: 2px solid #0a0a0a;
}

details.section.s .card::before {
  background: #00b4d8;
}

details.section.p .card::before {
  background: #ff4d6d;
}

details.section.n .card::before {
  background: #ffd60a;
}

details.section.v .card::before {
  background: #7b2ff7;
}

details.section.m .card::before {
  background: #ff6b35;
}

details.section.a .card::before {
  background: #06d6a0;
}

/* 卡片右下角装饰小方块 */
details.section .card::after {
  content: '';
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 8px;
  height: 8px;
  background: #0a0a0a;
}

/* --- 卡片内 h3 标题 --- */
details.section .card h3 {
  font-family: 'Noto Sans SC', sans-serif;
  font-weight: 900;
  font-size: 14px;
  color: #0a0a0a;
  margin: 0 0 10px 0;
  padding: 0 0 6px 0;
  border-bottom: 2px solid #0a0a0a;
  position: relative;
}

details.section .card h3::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
}

details.section.s .card h3::after {
  background: #00b4d8;
}

details.section.p .card h3::after {
  background: #ff4d6d;
}

details.section.n .card h3::after {
  background: #ffd60a;
}

details.section.v .card h3::after {
  background: #7b2ff7;
}

details.section.m .card h3::after {
  background: #ff6b35;
}

details.section.a .card h3::after {
  background: #06d6a0;
}

/* ============================================
   表格样式
   ============================================ */

details.section table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 13px;
}

details.section table thead tr {
  border-bottom: 3px solid #0a0a0a;
}

details.section table th {
  font-weight: 900;
  text-align: left;
  padding: 6px 8px;
  color: #0a0a0a;
  font-size: 12px;
  letter-spacing: 1px;text-transform: uppercase;
  white-space: nowrap;
}

/* 各 section 表头背景色 */
details.section.s table th {
  background: rgba(0, 180, 216, 0.15);
}

details.section.p table th {
  background: rgba(255, 77, 109, 0.12);
}

details.section.n table th {
  background: rgba(255, 214, 10, 0.18);
}

details.section.v table th {
  background: rgba(123, 47, 247, 0.1);
}

details.section.m table th {
  background: rgba(255, 107, 53, 0.12);
}

details.section.a table th {
  background: rgba(6, 214, 160, 0.15);
}

details.section table td {
  padding: 7px 8px;
  border-bottom: 1px solid rgba(10, 10, 10, 0.1);
  color: #2a2a2a;
  line-height: 1.5;word-break: break-word;
}

details.section table tbody tr:hover {
  background: rgba(255, 214, 10, 0.08);
}

details.section table tbody tr:last-child td {
  border-bottom: none;
}

/* 表格第一列加粗（属性名） */
details.section table td:first-child {
  font-weight: 800;
  color: #0a0a0a;
  white-space: nowrap;
  min-width: 70px;
}

/* ============================================
   输入框 &聊天界面美化
   ============================================ */

/* 聊天背景 */
.chat-container,
.message-list,
.chat-messages,
[class*="chat-body"],
[class*="message-container"],
[class*="chat-content"] {
  background: #fff8e7 !important;
}

/* 用户消息气泡 */
.msg-user,
[class*="user-message"],
[class*="message-right"] .msg-content,
[class*="self"] .msg-content {
  background: #ff4d6d !important;
  color: #fff !important;
  border: 3px solid #0a0a0a !important;border-radius: 0 !important;
  box-shadow: 4px 4px 0 #0a0a0a !important;
  font-weight: 700 !important;
  padding: 10px 14px !important;
}

/* AI消息气泡 */
.msg-ai,
[class*="ai-message"],
[class*="message-left"] .msg-content,
[class*="other"] .msg-content {
  background: #fffdf5 !important;
  color: #1a1a1a !important;
  border: 3px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 #0a0a0a !important;
  padding: 10px 14px !important;
}

/* 输入框区域 */
textarea,
[class*="input"] textarea,
[class*="chat-input"] textarea,
.message-input textarea {
  background: #fffdf5 !important;
  border: 3px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 4px 4px 0 #0a0a0a inset !important;
  font-family: 'Noto Sans SC', sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  color: #0a0a0a !important;
  padding: 10px 12px !important;
  transition: box-shadow 0.15s, border-color 0.15s !important;
}

textarea:focus,
[class*="input"] textarea:focus,
[class*="chat-input"] textarea:focus,
.message-input textarea:focus {
  border-color: #ff4d6d !important;
  box-shadow: 5px 5px 0 #ff4d6d inset !important;
  outline: none !important;
}

/* 发送按钮 */
[class*="send"] button,
button[class*="send"],
.message-input button,
[class*="chat-input"] button {
  background: #ffd60a !important;
  color: #0a0a0a !important;
  border: 3px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #0a0a0a !important;
  font-weight: 900 !important;
  font-family: 'Noto Sans SC', sans-serif !important;
  text-transform: uppercase !important;
  letter-spacing: 1px !important;
  cursor: pointer !important;
  transition: transform 0.1s, box-shadow 0.1s !important;
}

[class*="send"] button:hover,
button[class*="send"]:hover,
.message-input button:hover,
[class*="chat-input"] button:hover {
  transform: translate(-2px, -2px) !important;
  box-shadow: 5px 5px 0 #0a0a0a !important;
}

[class*="send"] button:active,
button[class*="send"]:active,
.message-input button:active,
[class*="chat-input"] button:active {
  transform: translate(2px, 2px) !important;
  box-shadow: 1px 1px 0 #0a0a0a !important;
}

/* 底部操作栏（评论、回到底部等） */
[class*="toolbar"],
[class*="bottom-bar"],
[class*="action-bar"] {
  background: #fff8e7 !important;
  border-top: 3px solid #0a0a0a !important;
}

[class*="toolbar"] button,
[class*="bottom-bar"] button,
[class*="action-bar"] button {
  background: #fffdf5 !important;
  border: 2px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 2px 2px 0 #0a0a0a !important;
  font-weight: 800 !important;
  color: #0a0a0a !important;
  font-size: 12px !important;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s !important;
}

[class*="toolbar"] button:hover,
[class*="bottom-bar"] button:hover,
[class*="action-bar"] button:hover {
  background: #00b4d8 !important;
  color: #fff !important;
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 #0a0a0a !important;
}

/*快捷回复按钮 */
[class*="quick-reply"],
[class*="quickReply"] {
  background: #06d6a0 !important;
  border: 2px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #0a0a0a !important;
  font-weight: 800 !important;
  color: #0a0a0a !important;
  cursor: pointer !important;
  transition: transform 0.1s, box-shadow 0.1s !important;
}

[class*="quick-reply"]:hover,
[class*="quickReply"]:hover {
  background: #ffd60a !important;
  transform: translate(-2px, -2px) !important;
  box-shadow: 5px 5px 0 #0a0a0a !important;
}

/* 评论区域 */
[class*="comment"],
[class*="review"] {
  background: #fffdf5 !important;
  border: 2px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #0a0a0a !important;
  margin: 6px 0 !important;
}

/* 模组/Mod 区域 */
[class*="mod"],
[class*="plugin"] {
  background: #fffdf5 !important;
  border: 2px solid #0a0a0a !important;
  border-radius: 0 !important;
  box-shadow: 3px 3px 0 #0a0a0a !important;
}

/* ============================================
   滚动条美化
   ============================================ */

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #fff8e7;
  border-left: 2px solid #0a0a0a;
}

::-webkit-scrollbar-thumb {
  background: #ff4d6d;
  border: 2px solid #0a0a0a;
}

::-webkit-scrollbar-thumb:hover {
  background: #ffd60a;
}

/* ============================================
   动效与交互
   ============================================ */

/* 面板展开动画 */
details.section[open] {
  animation: popIn 0.2s ease-out;
}

@keyframes popIn {
  0% {
    opacity: 0.7;
    transform: scale(0.98) translateY(4px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 卡片 hover 效果 */
details.section .card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 #0a0a0a;transition: transform 0.15s, box-shadow 0.15s;
}

/* 表格行hover 高亮条*/
details.section table tbody tr {
  transition: background 0.12s;
}

/*============================================
   移动端适配
   ============================================ */

@media (max-width: 768px) {
  details.section {
    margin: 8px 0;
    box-shadow: 3px 3px 0 #0a0a0a;
  }

  details.section .card {
    margin: 8px 8px;
    padding: 10px 10px;
  }

  details.section > summary {
    font-size: 14px;
    padding: 10px 12px 8px;
  }

  details.section > summary::after {
    font-size: 8px;
    padding: 1px 6px;
    right: 8px;
  }

  details.section table {
    font-size: 12px;
  }

  details.section table th,
  details.section table td {
    padding: 5px 6px;
  }

  /* 场景表格横向滚动 */
  details.section.s .card {
    overflow-x: auto;}

  details.section.s table {
    min-width: 500px;
  }
}

@media (max-width: 400px) {
  details.section > summary::after {
    display: none;
  }

  details.section .card::before {
    width: 8px;
    height: 8px;
  }
}

/*============================================
   正文区域 · story-body 美化
   ============================================ */

.story-body {
  background: #fffdf5;
  border: 3px solid #0a0a0a;
  box-shadow: 5px 5px 0 #0a0a0a;
  padding: 24px 20px 28px;
  margin: 14px 0;
  position: relative;
  font-family: 'Noto Sans SC', sans-serif;
  line-height: 1.95;
  font-size: 15px;
  color: #1a1a1a;
}

/* 左上角装饰标签 */
.story-body::before {
  content: 'STORY';
  position: absolute;
  top: -12px;
  left: 14px;
  font-family: 'Noto Sans SC', monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 2px 10px;
  background: #ff4d6d;
  color: #fff;
  border: 2px solid #0a0a0a;
  box-shadow: 2px 2px 0 #0a0a0a;transform: rotate(-2deg);
  z-index: 1;
}

/* 右下角装饰小方块 */
.story-body::after {
  content: '';
  position: absolute;
  bottom: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  background: #ffd60a;
  border: 2px solid #0a0a0a;
}

/* 正文段落 */
.story-body p {
  margin: 0;
  padding: 0.7em 0;
  text-indent: 2em;
  text-align: justify;
  border-bottom: 1px dashed rgba(10, 10, 10, 0.08);
  position: relative;
}

.story-body p:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.story-body p:first-child {
  padding-top: 0;
}

/* 左侧装饰竖线 */
.story-body p::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  bottom: 0.7em;
  width: 3px;
  background: transparent;
  transition: background 0.2s;
}

.story-body p:hover::before {
  background: #ff4d6d;
}

/* 段落hover效果 */
.story-body p:hover {
  background: rgba(255, 77, 109, 0.03);
  padding-left: 10px;
  transition: padding-left 0.2s, background 0.2s;
}

/* ============================================
   ECG 心电图分割线
   ============================================ */

.ecg-line {
  position: relative;
  height: 40px;
  margin: 16px 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 底部基准线 */
.ecg-line::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 3px;
  background: #0a0a0a;
  transform: translateY(-50%);
}

/* 心电图波形 SVG */
.ecg-line::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 40px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 40'%3E%3Cpolyline points='0,20 20,20 30,20 38,20 42,5 46,35 50,10 54,25 58,20 70,20 80,20 85,20 89,8 93,32 97,14 101,24 105,20 120,20' fill='none' stroke='%23ff4d6d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  z-index: 1;
  animation: ecgPulse 2s ease-in-out infinite;
}

/* 心电图背景遮罩（盖住基准线中间部分） */
.ecg-line {
  background: transparent;
}

/* 用渐变遮盖中间基准线让SVG更清晰 */
.ecg-line::before {
  background: linear-gradient(
    to right,
    #0a0a0a 0%,
    #0a0a0a calc(50% - 65px),
    transparent calc(50% - 65px),
    transparent calc(50% + 65px),
    #0a0a0a calc(50% + 65px),
    #0a0a0a 100%
  );
}

/* 心电图脉冲动画 */
@keyframes ecgPulse {
  0%, 100% {
    opacity: 1;
    filter: drop-shadow(0 0 0px #ff4d6d);
  }
  50% {
    opacity: 0.85;
    filter: drop-shadow(0 0 6px #ff4d6d);
  }
}

/* ============================================
   移动端适配补充
   ============================================ */

@media (max-width: 768px) {
  .story-body {
    padding: 20px 14px 24px;
    margin: 10px 0;
    font-size: 14px;
    line-height: 1.85;
    box-shadow: 3px 3px 0 #0a0a0a;
  }

  .story-body::before {
    font-size: 8px;
    padding: 1px 8px;top: -10px;
    left: 10px;
  }

  .story-body::after {
    width: 10px;
    height: 10px;
    bottom: -4px;
    right: -4px;
  }

  .ecg-line {
    height: 32px;
    margin: 12px 0;
  }

  .ecg-line::after {
    width: 90px;
    height: 32px;
  }

  .ecg-line::before {
    background: linear-gradient(
      to right,
      #0a0a0a 0%,
      #0a0a0a calc(50% - 50px),
      transparent calc(50% - 50px),
      transparent calc(50% + 50px),
      #0a0a0a calc(50% + 50px),
      #0a0a0a 100%
    );
  }
}

@media (max-width: 400px) {
  .story-body::before {
    display: none;
  }

  .ecg-line::after {
    width: 70px;
  }
}