/* ================================
   林悠然 Galgame 柔和校园风 UI
   适配：移动端 / 桌面端
================================ */

/* 全局变量 */
:root {
  --ly-blue: #5a9cf5;
  --ly-blue-soft: rgba(90, 156, 245, 0.16);
  --ly-pink: #f5a5c8;
  --ly-pink-soft: rgba(245, 165, 200, 0.18);
  --ly-deep: #2f3a5f;
  --ly-text: #3b4563;
  --ly-muted: #7b8499;
  --ly-white: rgba(255, 255, 255, 0.9);
  --ly-glass: rgba(255, 255, 255, 0.78);
  --ly-border: rgba(90, 156, 245, 0.38);
  --ly-shadow: 0 10px 30px rgba(47, 58, 95, 0.14);
  --ly-radius: 16px;
  --ly-radius-sm: 10px;
}

/* 页面整体氛围 */
body {
  background:
    radial-gradient(circle at 18% 12%, rgba(90, 156, 245, 0.18), transparent 28%),
    radial-gradient(circle at 86% 18%, rgba(245, 165, 200, 0.2), transparent 30%),
    linear-gradient(180deg, #f2f7ff 0%, #fff3f8 100%) !important;
  color: var(--ly-text) !important;
}

/* ================================
   顶部控件
================================ */

/* 模型选择框 */
#customized-model-selector {
  border: 2px solid var(--ly-border) !important;
  border-radius: var(--ly-radius-sm) !important;
  background: var(--ly-glass) !important;
  color: var(--ly-deep) !important;
  box-shadow: var(--ly-shadow) !important;
  backdrop-filter: blur(14px) !important;
}

/* 设置按钮 */
#header-setting-button {
  border-radius: 999px !important;
  border: 2px solid var(--ly-border) !important;
  background: linear-gradient(135deg, var(--ly-blue), var(--ly-pink)) !important;
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(90, 156, 245, 0.25) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

#header-setting-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 0 18px rgba(245, 165, 200, 0.45) !important;
}

/* 开场白选择框 */
#customized-opening-statement-selector {
  border: 2px solid var(--ly-border) !important;
  border-radius: var(--ly-radius-sm) !important;
  background: var(--ly-glass) !important;
  color: var(--ly-deep) !important;
  box-shadow: var(--ly-shadow) !important;
  backdrop-filter: blur(14px) !important;
}

/* ================================
   头像
================================ */

/* 用户提问头像 */
#customized-question-avatar {
  border: 3px solid rgba(90, 156, 245, 0.55) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 16px rgba(90, 156, 245, 0.32) !important;
  background: rgba(255, 255, 255, 0.85) !important;
}

/* 作品回答头像 */
#customized-answer-avatar {
  border: 3px solid rgba(245, 165, 200, 0.6) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 18px rgba(245, 165, 200, 0.35) !important;
  background: rgba(255, 255, 255, 0.85) !important;
}

/* ================================
   聊天内容区
================================ */

/* 用户提问内容区域 */
#customized-question-content {
  position: relative !important;
  border: 2px solid rgba(90, 156, 245, 0.36) !important;
  border-radius: 18px 18px 6px 18px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--ly-deep) !important;
  box-shadow: var(--ly-shadow) !important;
  backdrop-filter: blur(12px) !important;
  line-height: 1.8 !important;
}

/* 作品回答内容区域：Galgame 对话框主样式 */
#customized-answer-content {
  position: relative !important;
  border: 2px solid var(--ly-border) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--ly-text) !important;
  box-shadow: var(--ly-shadow), 0 0 18px rgba(90, 156, 245, 0.12) !important;
  backdrop-filter: blur(14px) !important;
  line-height: 1.86 !important;
  overflow: hidden !important;
}

/* 回答框顶部 Galgame 光线 */
#customized-answer-content::before {
  content: "" !important;
  position: absolute !important;
  top: 0 !important;
  left: 24px !important;
  right: 24px !important;
  height: 3px !important;
  background: linear-gradient(90deg, transparent, var(--ly-blue), var(--ly-pink), transparent) !important;
  border-radius: 999px !important;
}

/* 聊天区内图片 */
#customized-answer-content img,
#customized-question-content img {
  max-width: 100% !important;
  border-radius: 14px !important;
  box-shadow: 0 8px 24px rgba(47, 58, 95, 0.16) !important;
}

/* 表情图：如果插在正文里，限制不要太大 */
#customized-answer-content p > img,
#customized-answer-content div > img {
  max-height: 320px !important;
  object-fit: contain !important;
}

/* ================================
   操作按钮
================================ */

#customized-reload-button,
#customized-edit-button,
#customized-resend-button,
#customized-delete-button,
#customized-create-image-button,
#customized-create-audio-button,
#customized-branch-and-share-button,
#customized-prompt-log-button,
#customized-ai-summary-button,
#customized-flow-button,
#customized-comment-button,
#customized-scroll-to-bottom-button,
#toggle-sub-buttons,
#ai-mod-button {
  border: 2px solid rgba(90, 156, 245, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.84) !important;
  color: var(--ly-deep) !important;
  box-shadow: 0 6px 18px rgba(47, 58, 95, 0.1) !important;
  backdrop-filter: blur(12px) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

#customized-reload-button:hover,
#customized-edit-button:hover,
#customized-resend-button:hover,
#customized-delete-button:hover,
#customized-create-image-button:hover,
#customized-create-audio-button:hover,
#customized-branch-and-share-button:hover,
#customized-prompt-log-button:hover,
#customized-ai-summary-button:hover,
#customized-flow-button:hover,
#customized-comment-button:hover,
#customized-scroll-to-bottom-button:hover,
#toggle-sub-buttons:hover,
#ai-mod-button:hover {
  transform: translateY(-2px) !important;
  border-color: var(--ly-pink) !important;
  box-shadow: 0 0 18px rgba(245, 165, 200, 0.32) !important;
}

/* 删除按钮单独柔化，不做刺眼红 */
#customized-delete-button {
  border-color: rgba(245, 120, 150, 0.35) !important;
  color: #b94a68 !important;
}

/* 生图按钮突出 */
#customized-create-image-button {
  background: linear-gradient(135deg, rgba(90, 156, 245, 0.92), rgba(245, 165, 200, 0.92)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* 生成语音按钮突出 */
#customized-create-audio-button {
  background: linear-gradient(135deg, rgba(245, 165, 200, 0.92), rgba(90, 156, 245, 0.92)) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* ================================
   分页区域
================================ */

#customized-pagination {
  border: 2px solid var(--ly-border) !important;
  border-radius: var(--ly-radius) !important;
  background: var(--ly-glass) !important;
  box-shadow: var(--ly-shadow) !important;
  backdrop-filter: blur(14px) !important;
  color: var(--ly-deep) !important;
}

/* ================================
   底部功能菜单条
================================ */

#ai-mod-button2 {
  border: 2px solid var(--ly-border) !important;
  border-radius: 20px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: var(--ly-shadow), 0 0 18px rgba(90, 156, 245, 0.12) !important;
  backdrop-filter: blur(16px) !important;
  padding: 8px !important;
}

/* 快捷指令按钮：匹配所有序号 */
[id^="customized-shortcut-command-button-"] {
  border: 2px solid rgba(90, 156, 245, 0.32) !important;
  border-radius: 999px !important;
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--ly-deep) !important;
  font-weight: 700 !important;
  box-shadow: 0 6px 18px rgba(47, 58, 95, 0.1) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease !important;
}

[id^="customized-shortcut-command-button-"]:hover {
  transform: translateY(-2px) !important;
  background: linear-gradient(135deg, rgba(90, 156, 245, 0.18), rgba(245, 165, 200, 0.18)) !important;
  box-shadow: 0 0 18px rgba(90, 156, 245, 0.25) !important;
}

/* ================================
   输入框与发送按钮
================================ */

/* 聊天输入框 */
#ai-chat-input {
  border: 2px solid var(--ly-border) !important;
  border-radius: 18px !important;
  background: rgba(255, 255, 255, 0.94) !important;
  color: var(--ly-deep) !important;
  box-shadow: var(--ly-shadow) !important;
  backdrop-filter: blur(14px) !important;
  line-height: 1.7 !important;
}

#ai-chat-input:focus {
  border-color: var(--ly-pink) !important;
  box-shadow: 0 0 0 4px rgba(245, 165, 200, 0.16), var(--ly-shadow) !important;
}

/* 发送按钮 */
#ai-send-button {
  border: none !important;
  border-radius: 999px !important;
  background: linear-gradient(135deg, var(--ly-blue), var(--ly-pink)) !important;
  color: #fff !important;
  font-weight: 900 !important;
  box-shadow: 0 10px 24px rgba(90, 156, 245, 0.28) !important;
  transition: transform 0.18s ease, box-shadow 0.18s ease !important;
}

#ai-send-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 0 22px rgba(245, 165, 200, 0.45) !important;
}

/* ================================
   状态栏 / details 面板
   适配你的：你的面板、林悠然面板、往日回忆、行动选项
================================ */

#customized-answer-content details {
  margin: 14px 0 !important;
  border: 2px solid rgba(90, 156, 245, 0.34) !important;
  border-radius: 16px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 8px 24px rgba(47, 58, 95, 0.1) !important;
  overflow: hidden !important;
  backdrop-filter: blur(12px) !important;
}

#customized-answer-content summary {
  list-style: none !important;
  cursor: pointer !important;
  padding: 12px 14px !important;
  color: var(--ly-deep) !important;
  font-weight: 900 !important;
  background: linear-gradient(90deg, rgba(90, 156, 245, 0.16), rgba(245, 165, 200, 0.16)) !important;
  border-bottom: 1px solid rgba(90, 156, 245, 0.22) !important;
}

#customized-answer-content summary::-webkit-details-marker {
  display: none !important;
}

#customized-answer-content summary::before {
  content: "◇ " !important;
  color: var(--ly-blue) !important;
}

#customized-answer-content details[open] summary::before {
  content: "◆ " !important;
  color: var(--ly-pink) !important;
}

/* 状态栏内 markdown 代码块 */
#customized-answer-content pre,
#customized-answer-content code {
  border-radius: 12px !important;
  background: rgba(248, 251, 255, 0.82) !important;
  color: var(--ly-deep) !important;
  border: 1px solid rgba(90, 156, 245, 0.22) !important;
}

/* 状态栏里的表格 */
#customized-answer-content table {
  width: 100% !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.72) !important;
  box-shadow: 0 6px 18px rgba(47, 58, 95, 0.08) !important;
}

#customized-answer-content th {
  background: linear-gradient(90deg, rgba(90, 156, 245, 0.2), rgba(245, 165, 200, 0.2)) !important;
  color: var(--ly-deep) !important;
  font-weight: 900 !important;
}

#customized-answer-content td,
#customized-answer-content th {
  border: 1px solid rgba(90, 156, 245, 0.18) !important;
  padding: 8px 10px !important;
}

/* 林悠然服装图在面板内显示 */
#customized-answer-content details img {
  display: block !important;
  max-width: min(100%, 420px) !important;
  max-height: 620px !important;
  margin: 12px auto !important;
  object-fit: contain !important;
  border-radius: 16px !important;
  box-shadow: 0 12px 28px rgba(47, 58, 95, 0.16) !important;
}

/* 行动选项文字块 */
#customized-answer-content details:last-of-type {
  border-color: rgba(245, 165, 200, 0.42) !important;
}

/* ================================
   Galgame 对话感增强
================================ */

/* 回答内容段落 */
#customized-answer-content p {
  margin: 0.7em 0 !important;
}

/* 分割线 */
#customized-answer-content hr {
  border: none !important;
  height: 1px !important;
  background: linear-gradient(90deg, transparent, rgba(90, 156, 245, 0.45), rgba(245, 165, 200, 0.45), transparent) !important;
  margin: 16px 0 !important;
}

/* 链接 */
#customized-answer-content a {
  color: var(--ly-blue) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
}

#customized-answer-content a:hover {
  color: var(--ly-pink) !important;
}

/* ================================
   移动端适配
================================ */

@media (max-width: 768px) {
  :root {
    --ly-radius: 14px;
    --ly-radius-sm: 9px;
  }

  body {
    font-size: 14px !important;
  }

  #customized-question-content,
  #customized-answer-content {
    border-radius: 14px !important;
    padding: 12px !important;
    line-height: 1.78 !important;
  }

  #customized-answer-content::before {
    left: 16px !important;
    right: 16px !important;
  }

  #customized-question-avatar,
  #customized-answer-avatar {
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    min-height: 40px !important;
  }

  #ai-mod-button2 {
    border-radius: 18px !important;
    padding: 6px !important;
  }

  #ai-chat-input {
    border-radius: 16px !important;
    min-height: 42px !important;
    font-size: 14px !important;
  }

  #ai-send-button {
    min-width: 48px !important;
    min-height: 42px !important;
    border-radius: 14px !important;
  }

  #customized-reload-button,
  #customized-edit-button,
  #customized-resend-button,
  #customized-delete-button,
  #customized-create-image-button,
  #customized-create-audio-button,
  #customized-branch-and-share-button,
  #customized-prompt-log-button,
  #customized-ai-summary-button,
  #customized-flow-button,
  #customized-comment-button,
  #customized-scroll-to-bottom-button,
  #toggle-sub-buttons,
  #ai-mod-button,
  [id^="customized-shortcut-command-button-"] {
    min-height: 36px !important;
    padding: 7px 10px !important;
    font-size: 13px !important;
  }

  #customized-answer-content details {
    margin: 10px 0 !important;
    border-radius: 14px !important;
  }

  #customized-answer-content summary {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }

  #customized-answer-content details img {
    max-width: 100% !important;
    max-height: 480px !important;
    border-radius: 14px !important;
  }

  #customized-answer-content table {
    display: block !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    font-size: 13px !important;
  }

  #customized-answer-content td,
  #customized-answer-content th {
    padding: 7px 8px !important;
  }

  #customized-pagination {
    border-radius: 14px !important;
    font-size: 13px !important;
  }
}

/* 超小屏优化 */
@media (max-width: 420px) {
  #customized-answer-content,
  #customized-question-content {
    font-size: 13.5px !important;
  }

  #customized-answer-content details img {
    max-height: 420px !important;
  }

  #customized-answer-content p > img,
  #customized-answer-content div > img {
    max-height: 260px !important;
  }

  [id^="customized-shortcut-command-button-"] {
    max-width: 100% !important;
    white-space: normal !important;
  }
}