/* 内置CSS - 清纯女神私下的堕落渴望 */
/* 整体基调：优雅、明亮与黑暗、情欲的结合 */

/* ----- 全局背景与容器美化 ----- */
body,
.chat-container,
.main-content,
[class*="chat"],
[class*="message-list"] {
  background: linear-gradient(145deg, #fef8f9 0%, #f2eef4 100%) !important;
}

.story-container,
.message-content,
.assistant-message,
[class*="assistant"] .message-body,
.chat-message.assistant .content {
  background: transparent;
}

.user-message,
[class*="user"] .message-body,
.chat-message.user .content {
  background: linear-gradient(135deg, #e8ecf5 0%, #dbe2f0 100%);
  border-radius: 18px 4px 18px 18px;
  padding: 14px 18px;
  box-shadow: 0 4px 12px rgba(58, 110, 165, 0.15);
  color: #1e3a5f;
  border-right: 3px solid #3a6ea5;
  font-family: 'Segoe UI', '微软雅黑', sans-serif;
}

.assistant-message,
[class*="assistant"] .message-body,
.chat-message.assistant .content {
  background: #fff5f8;
  border-radius: 4px 18px 18px 18px;
  padding: 14px 18px;
  box-shadow: 0 4px 12px rgba(196, 69, 105, 0.12);
  color: #4a2c3a;
  border-left: 3px solid #c44569;
  font-family: 'Georgia', '楷体', 'KaiTi', serif;
}

/* ----- 输入栏美化 ----- */
.input-area,
.chat-input-container,
[class*="input-area"],
[class*="chat-footer"] {
  background: rgba(255, 250, 250, 0.85) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(196, 69, 105, 0.2);
  padding: 16px 20px;
  border-radius: 30px 30px 0 0;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.03);
}

textarea,
input[type="text"],
.chat-input,
.message-input,
[class*="input"] textarea,
[class*="input"] input {
  background: #ffffff !important;
  border: 1.5px solid #e8d5dc !important;
  border-radius: 24px !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  color: #3a2a33 !important;
  font-family: 'Segoe UI', '微软雅黑', sans-serif !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 2px 8px rgba(196, 69, 105, 0.05) !important;
  transition: border 0.25s, box-shadow 0.25s !important;
  resize: vertical;
  line-height: 1.5;
}

textarea:focus,
input[type="text"]:focus,
.chat-input:focus {
  border-color: #c44569 !important;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 0 0 4px rgba(196, 69, 105, 0.1) !important;
  outline: none !important;
}

textarea::placeholder,
input::placeholder {
  color: #b1a0aa !important;
  font-style: italic;
}

/* ----- 按钮美化 ----- */
button,
.btn,
.send-btn,
[class*="send"],
[class*="button"] {
  background: linear-gradient(135deg, #c44569 0%, #a53657 100%) !important;
  border: none !important;
  border-radius: 30px !important;
  padding: 10px 24px !important;
  color: white !important;
  font-weight: 600 !important;
  font-size: 15px !important;
  letter-spacing: 0.3px !important;
  box-shadow: 0 6px 14px rgba(196, 69, 105, 0.3) !important;
  transition: all 0.2s ease !important;
  cursor: pointer !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

button:hover,
.btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 10px 20px rgba(196, 69, 105, 0.4) !important;
  background: linear-gradient(135deg, #d14f76 0%, #b33d5e 100%) !important;
}

button:active,
.btn:active {
  transform: translateY(1px) !important;
  box-shadow: 0 3px 8px rgba(196, 69, 105, 0.3) !important;
}

.btn.secondary,
button.secondary,
[class*="secondary"] {
  background: linear-gradient(135deg, #6a89cc 0%, #4a6fa5 100%) !important;
  box-shadow: 0 4px 10px rgba(58, 110, 165, 0.25) !important;
}

.btn.secondary:hover {
  background: linear-gradient(135deg, #7a9ad6 0%, #5578ad 100%) !important;
  box-shadow: 0 8px 16px rgba(58, 110, 165, 0.35) !important;
}

button:disabled,
.btn:disabled {
  opacity: 0.5;
  transform: none !important;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1) !important;
  cursor: not-allowed;
}

/* ----- 加载模块美化 ----- */
.loading,
.loader,
[class*="loading"],
[class*="spinner"] {
  color: #c44569 !important;
}

.loading-spinner,
.spinner {
  border: 3px solid rgba(196, 69, 105, 0.15);
  border-top: 3px solid #c44569;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-text {
  color: #7a4b5e !important;
  font-style: italic;
}

/* ----- 原有样式 ----- */
.story-container {
  display: flex;
  flex-direction: column;
  max-width: 800px;
  margin: 0 auto;
  font-family: 'Georgia', 'Times New Roman', '宋体', serif;
  color: #3e3e3e;
}

.scene-card {
  background: rgba(255, 249, 249, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 24px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.06);
  border-left: 5px solid #c44569;
  transition: box-shadow 0.3s;
}
.scene-card:hover {
  box-shadow: 0 16px 32px rgba(196, 69, 105, 0.1);
}

.public-scene {
  background: linear-gradient(135deg, rgba(253, 251, 251, 0.95) 0%, rgba(235, 237, 238, 0.95) 100%);
  border-left: 5px solid #6a89cc;
  color: #2c3e50;
  font-style: normal;
  box-shadow: 0 8px 20px rgba(106, 137, 204, 0.12);
}

/* ----- 对话/心理活动美化框（增强区分度）----- */
.dialogue-box {
  position: relative;
  margin: 20px 0 20px 10px;
  padding: 18px 20px 20px 20px;
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  line-height: 1.8;
  font-size: 15px;
  transition: all 0.2s;
}

/* 姓名标签（位于框顶部外侧） */
.dialogue-box::before {
  content: attr(data-name);
  position: absolute;
  top: -12px;
  left: 16px;
  padding: 2px 16px;
  border-radius: 30px;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(0,0,0,0.05);
}

/* 女性（林清音）样式 */
.dialogue-box.female {
  background: #fef4f7;
  border-left: 4px solid #c44569;
  color: #6d2e46;
  font-family: 'Georgia', '楷体', 'KaiTi', serif;
}
.dialogue-box.female::before {
  color: #c44569;
  background: #ffeef2;
  border-bottom: 2px solid #c44569;
}
.dialogue-box.female i, .dialogue-box.female em {
  color: #b3415f;
}

/* 男性（玩家）样式 */
.dialogue-box.male {
  background: #f0f4fa;
  border-right: 4px solid #3a6ea5;
  color: #1e3a5f;
  font-family: 'Segoe UI', '微软雅黑', sans-serif;
  text-align: left;
  border-radius: 16px 4px 16px 16px;
  margin-left: 30px;
  margin-right: 0;
}
.dialogue-box.male::before {
  color: #3a6ea5;
  background: #e1ebf7;
  border-bottom: 2px solid #3a6ea5;
  left: auto;
  right: 16px;
}
.dialogue-box.male i, .dialogue-box.male em {
  color: #2c5b8c;
}

/* 纯心理活动 - 增强区分度 */
.dialogue-box.thought {
  background: linear-gradient(145deg, #f5ede1 0%, #ede0d4 100%);
  border: 2px dashed #b0977a;
  border-radius: 30px 8px 30px 8px;
  color: #4e3e32;
  box-shadow: inset 0 0 0 2px rgba(255, 250, 240, 0.6), 0 4px 12px rgba(0,0,0,0.05);
  font-style: italic;
  position: relative;
  opacity: 0.92;
}
.dialogue-box.thought::before {
  background: #d6c4b2;
  color: #3e2e22;
  border-bottom: 2px solid #a08c7a;
  content: "💭 " attr(data-name);
  font-style: normal;
}
/* 男性心理活动 */
.dialogue-box.male.thought {
  background: linear-gradient(145deg, #e2e8f0 0%, #d0d9e5 100%);
  border-color: #7a9bc2;
  color: #1e3a5f;
}
.dialogue-box.male.thought::before {
  background: #b0c4de;
  color: #1e3a5f;
  border-bottom-color: #5a7da8;
}
/* 女性心理活动 */
.dialogue-box.female.thought {
  background: linear-gradient(145deg, #f7e8ec 0%, #ecd5dc 100%);
  border-color: #c28192;
  color: #5e2e40;
}
.dialogue-box.female.thought::before {
  background: #e0bdc8;
  color: #5e2e40;
  border-bottom-color: #b05f7a;
}
/* 心理活动内的斜体强调 */
.dialogue-box.thought i, .dialogue-box.thought em {
  color: #8b5e3c;
}
.dialogue-box.male.thought i, .dialogue-box.male.thought em {
  color: #2c5b8c;
}
.dialogue-box.female.thought i, .dialogue-box.female.thought em {
  color: #b3415f;
}

/* 状态栏 */
.status-bar {
  background: #1e272e;
  color: #d2dae2;
  padding: 18px 20px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.8;
  margin: 30px 0 20px;
  border: 1px solid #c44569;
  box-shadow: inset 0 0 10px #00000033, 0 5px 15px rgba(0,0,0,0.3);
  font-family: 'Consolas', 'Monaco', monospace;
}
.status-bar strong {
  color: #f8c291;
  font-weight: 600;
}

/* 记忆区 */
.memory {
  margin-top: 25px;
  background: #f4f7f6;
  border-radius: 8px;
  padding: 5px 0;
  border: 1px solid #d1d8e0;
}
.memory summary {
  padding: 12px 18px;
  font-weight: bold;
  color: #2c3e50;
  cursor: pointer;
  background: #e8eeef;
  border-radius: 8px 8px 0 0;
  transition: all 0.3s;
}
.memory summary:hover {
  background: #d1d8e0;
}
.memory .e {
  padding: 15px 20px;
  font-size: 13px;
  color: #34495e;
  background: #ffffff;
  border-radius: 0 0 8px 8px;
  line-height: 1.8;
  border-top: 1px solid #d1d8e0;
}

/* 重点强调 */
.emphasis {
  color: #c44569;
  font-weight: bold;
}
.emphasis-dark {
  color: #2c3e50;
  font-weight: bold;
  font-style: italic;
}

/* 动作/描写细节 */
.action-detail {
  color: #7f8c8d;
  font-size: 0.95em;
  border-bottom: 1px dashed #bdc3c7;
  padding-bottom: 8px;
  margin-bottom: 12px;
}

/* 分割线 */
hr.divider {
  border: 0;
  height: 1px;
  background: linear-gradient(to right, transparent, #c44569, #6a89cc, transparent);
  margin: 25px 0;
}

/* ========== 悬浮记事本样式（已修复位置） ========== */
/* 悬浮按钮容器 - 固定在右侧偏上位置，不遮挡输入框 */
.notebook-float {
  position: fixed;
  top: 120px;
  right: 20px;
  z-index: 999;
  display: block;
  width: auto;
  margin: 0;
}

/* 隐藏默认三角，自定义悬浮按钮 */
.notebook-float > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: linear-gradient(145deg, #c44569, #a53657);
  border-radius: 30px;
  box-shadow: 0 8px 20px rgba(196, 69, 105, 0.4), 0 2px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  border: 2px solid rgba(255, 215, 215, 0.7);
  transition: all 0.25s;
  color: white;
  font-size: 30px;
  text-align: center;
  line-height: 60px;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.notebook-float > summary span {
  display: block;
  transform: rotate(-5deg);
}
.notebook-float > summary:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 28px rgba(196, 69, 105, 0.6);
  background: linear-gradient(145deg, #d14f76, #b33d5e);
}
.notebook-float[open] > summary {
  background: #2c3e50;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  border-color: #6a89cc;
}
.notebook-float > summary::-webkit-details-marker {
  display: none;
}

/* 展开后的侧边栏卡片 - 紧跟在按钮下方 */
.notebook-float[open] {
  width: 320px;
  max-width: calc(100vw - 40px);
}

.notebook-sidebar {
  background: #faf5f7;
  border-radius: 24px;
  padding: 18px 16px 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), inset 0 1px 4px rgba(255,255,255,0.9);
  border: 1px solid rgba(196, 69, 105, 0.4);
  font-family: 'Segoe UI', '微软雅黑', sans-serif;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  max-height: 450px;
  overflow-y: auto;
  position: relative;
  margin-top: 10px;
}

/* 仿记事本线圈 */
.notebook-sidebar::before {
  content: "";
  position: absolute;
  left: 16px;
  top: -6px;
  width: calc(100% - 32px);
  height: 12px;
  background: repeating-linear-gradient(90deg, 
    #d4b0bb 0px, #d4b0bb 6px, 
    transparent 6px, transparent 18px);
  border-radius: 6px 6px 0 0;
}

.nb-header {
  font-size: 18px;
  font-weight: bold;
  color: #5d2e3e;
  text-align: center;
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 2px dashed #c44569;
  letter-spacing: 2px;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.5);
}

.nb-item {
  background: rgba(255, 250, 240, 0.7);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 4px 10px rgba(0,0,0,0.03);
  border-left: 4px solid;
}
.nb-item:nth-of-type(1) { border-left-color: #e67e8f; }
.nb-item:nth-of-type(2) { border-left-color: #6a89cc; }
.nb-item:nth-of-type(3) { border-left-color: #b3415f; }

.nb-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
  color: #3e2a33;
  display: flex;
  align-items: center;
}
.nb-title::before {
  content: "📌";
  margin-right: 8px;
  font-size: 14px;
}

.nb-content {
  font-size: 13.5px;
  line-height: 1.7;
  color: #4a3a40;
  background: rgba(255, 255, 255, 0.6);
  padding: 12px 15px;
  border-radius: 14px;
  text-align: justify;
  word-break: break-word;
  border: 1px solid rgba(196, 69, 105, 0.1);
  max-height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
}
.nb-item:last-child .nb-content {
  background: rgba(245, 225, 230, 0.5);
  font-style: italic;
}

/* 响应式 */
@media (max-width: 600px) {
  .scene-card {
    padding: 16px;
    margin-bottom: 15px;
  }
  .status-bar {
    font-size: 12px;
    padding: 14px 16px;
  }
  .dialogue-box {
    margin-left: 5px;
    margin-right: 5px;
    padding: 16px 15px 15px 15px;
    font-size: 14px;
  }
  .dialogue-box.male {
    margin-left: 15px;
  }
  button, .btn {
    padding: 10px 18px !important;
    font-size: 14px !important;
  }
  .notebook-float {
    top: 80px; /* 移动端稍往上移 */
  }
  .notebook-float > summary {
    width: 52px;
    height: 52px;
    font-size: 26px;
    line-height: 52px;
  }
  .notebook-float[open] {
    width: 280px;
  }
  .nb-content {
    max-height: 180px;
  }
}