/* ============================================
   赛博协议 · 双生风格 UI 样式 (v1.0)
   默认状态：近未来洁净城市质感
   悬停状态：霓虹呼吸灯赛博朋克
   ============================================ */

/* --- 基础重置与主题变量 (基于对话容器作用域) --- */
details.w * {
  all: revert;
  box-sizing: border-box;
}

details.w {
  --bg-clean: #f0f2f5;
  --border-clean: #d0d5dd;
  --text-clean: #1a1d23;
  --accent-clean: #3b82f6;
  --bg-neon: #0d0d1a;
  --border-neon: #ff007f;
  --text-neon: #e0e0ff;
  --accent-neon: #00f0ff;
  --glow-neon: 0 0 15px var(--border-neon), 0 0 30px var(--border-neon), 0 0 45px var(--accent-neon);
  --radius: 12px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;

  font-family: var(--font);
  background: var(--bg-clean);
  border: 1px solid var(--border-clean);
  border-radius: var(--radius);
  padding: 8px 14px;
  margin-bottom: 8px;
  color: var(--text-clean);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
}

/* 默认状态微妙的顶部光晕（模拟洁净玻璃反射） */
details.w::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.3) 0%, transparent 60%);
  pointer-events: none;
  transition: opacity 0.4s;
  opacity: 0;
}

details.w:hover::before {
  opacity: 0;
}

/* --- 默认洁净城市细节 --- */
details.w summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 1.05em;
  letter-spacing: 0.02em;
  color: var(--text-clean);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  user-select: none;
  transition: color 0.3s;
}

details.w summary::-webkit-details-marker {
  color: var(--border-clean);
  transition: color 0.3s;
}

details.w .c {
  padding: 10px 0 4px 0;
  font-size: 0.9em;
  line-height: 1.6;
  color: #2c2e36;
  border-top: 1px dashed #dce0e8;
  margin-top: 8px;
}

details.w .c b {
  font-weight: 600;
  color: #1a1d23;
}

details.w .m {
  background: repeating-linear-gradient(45deg, #c0c5d0 0px, #c0c5d0 4px, #e8ecf2 4px, #e8ecf2 8px);
  color: transparent;
  border-radius: 3px;
  padding: 0 2px;
}

details.w table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.85em;
  margin: 6px 0;
  background: rgba(255,255,255,0.5);
  backdrop-filter: blur(2px);
  border-radius: 6px;
  overflow: hidden;
}

details.w th {
  background: #e8ecf2;
  color: #2c2e36;
  font-weight: 600;
  padding: 4px 6px;
  text-align: left;
  border-bottom: 1px solid #d0d5dd;
}

details.w td {
  padding: 4px 6px;
  border-bottom: 1px solid #e2e6ee;
}

/* --- 悬停切换：霓虹呼吸灯赛博朋克 --- */
details.w:hover {
  background: var(--bg-neon);
  border-color: var(--border-neon);
  box-shadow: var(--glow-neon), inset 0 0 20px rgba(255, 0, 127, 0.05);
  color: var(--text-neon);
  transform: translateY(-1px);
}

details.w:hover summary {
  color: var(--accent-neon);
  text-shadow: 0 0 8px var(--accent-neon), 0 0 20px var(--accent-neon);
}

details.w:hover summary::-webkit-details-marker {
  color: var(--accent-neon);
}

details.w:hover .c {
  color: #c8c8f0;
  border-top-color: rgba(0, 240, 255, 0.3);
}

details.w:hover .c b {
  color: #ffffff;
  text-shadow: 0 0 5px rgba(0, 240, 255, 0.4);
}

details.w:hover .m {
  background: repeating-linear-gradient(45deg, #1a1a3e 0px, #1a1a3e 4px, #2a2a5e 4px, #2a2a5e 8px);
  box-shadow: inset 0 0 6px rgba(255, 0, 127, 0.2);
}

details.w:hover table {
  background: rgba(20, 20, 50, 0.7);
  backdrop-filter: blur(4px);
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.15);
}

details.w:hover th {
  background: #1a1a3e;
  color: #00f0ff;
  border-bottom-color: #ff007f;
  text-shadow: 0 0 6px #00f0ff;
}

details.w:hover td {
  border-bottom-color: #2a2a5e;
  color: #d0d0ff;
}

/* --- 呼吸灯动画（背景光晕脉动） --- */
details.w:hover::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: calc(var(--radius) + 2px);
  background: linear-gradient(45deg, #ff007f, #00f0ff, #ff007f, #00f0ff);
  background-size: 400% 400%;
  z-index: -1;
  filter: blur(8px);
  opacity: 0.45;
  animation: neon-breath 3s ease-in-out infinite;
  pointer-events: none;
}

@keyframes neon-breath {
  0% { opacity: 0.25; background-position: 0% 50%; }
  50% { opacity: 0.55; background-position: 100% 50%; }
  100% { opacity: 0.25; background-position: 0% 50%; }
}

/* 悬停时内部元素的额外辉光 */
details.w:hover .c b {
  transition: text-shadow 0.3s;
}

details.w:hover .c {
  transition: all 0.3s;
}

/* 移动端紧凑对齐 */
@media (max-width: 480px) {
  details.w {
    padding: 6px 10px;
    border-radius: 10px;
  }
  details.w .c {
    font-size: 0.85em;
  }
}
/* ============================================
   赛博协议 · 双生风格 UI 样式 (底部栏/分页栏/按钮栏)
   ============================================ */

/* --- 1. 底部栏 (输入区域) --- */
/* 底部栏外层主背景 - 默认洁净 */
.bg-gradient-to-t {
  --bg-clean: rgba(240, 242, 245, 0.95) !important;
  --border-clean: #d0d5dd !important;
  background: var(--bg-clean) !important;
  border-top: 1px solid var(--border-clean) !important;
  backdrop-filter: blur(10px) !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* 输入框容器 */
#ai-chat-bottom-input {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid var(--border-clean) !important;
  border-radius: 12px !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
}

/* 主输入框 */
#ai-chat-input {
  color: #1a1d23 !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  transition: color 0.3s !important;
}

/* 占位符 */
#ai-chat-input::placeholder {
  color: #a0a5b0 !important;
  opacity: 0.7 !important;
  transition: color 0.3s !important;
}

/* 文字选中效果 */
#ai-chat-input::selection {
  background: #3b82f6 !important;
  color: #ffffff !important;
}

/* 悬停/聚焦状态：霓虹切换 - 输入框容器 */
#ai-chat-bottom-input:focus-within {
  --bg-neon: rgba(13, 13, 26, 0.95) !important;
  --border-neon: #ff007f !important;
  --glow-neon: 0 0 15px rgba(255, 0, 127, 0.4), 0 0 30px rgba(255, 0, 127, 0.2) !important;
  background: var(--bg-neon) !important;
  border-color: var(--border-neon) !important;
  box-shadow: var(--glow-neon), inset 0 0 20px rgba(255, 0, 127, 0.05) !important;
  transform: translateY(-1px) !important;
}

#ai-chat-bottom-input:focus-within #ai-chat-input {
  color: #c8c8f0 !important;
}

#ai-chat-bottom-input:focus-within #ai-chat-input::placeholder {
  color: #6a6a8a !important;
}


/* --- 2. 分页栏 (仅视觉样式修改) --- */
/* 分页按钮默认 */
.MuiPaginationItem-root {
  color: #1a1d23 !important;
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 20px !important;   /* 胶囊形按钮 */
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  min-width: 36px !important;
  height: 36px !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

/* 翻页箭头图标默认 */
.MuiPaginationItem-icon {
  color: #6b7280 !important;
  transition: color 0.3s, filter 0.3s !important;
}

/* 分页按钮悬停 */
.MuiPaginationItem-root:hover {
  color: #e0e0ff !important;
  background: rgba(13, 13, 26, 0.8) !important;
  border-color: #ff007f !important;
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.4), 0 0 20px rgba(0, 240, 255, 0.2) !important;
  transform: translateY(-2px) !important;
}

.MuiPaginationItem-root:hover .MuiPaginationItem-icon {
  color: #00f0ff !important;
  filter: drop-shadow(0 0 4px #00f0ff) !important;
}

/* 选中按钮 */
.MuiPaginationItem-root.Mui-selected {
  color: #ffffff !important;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6) !important;
  border-color: transparent !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5) !important;
  font-weight: 600 !important;
}

.MuiPaginationItem-root.Mui-selected:hover {
  background: linear-gradient(135deg, #ff007f, #00f0ff) !important;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.5) !important;
}

/* 禁用按钮 */
.MuiPaginationItem-root.Mui-disabled {
  opacity: 0.4 !important;
  background: rgba(200, 200, 200, 0.3) !important;
  box-shadow: none !important;
  transform: none !important;
}

/* 跳转输入区域容器 */
.MuiStack-root.css-1uwir8f {
  border-left: 2px solid #d0d5dd !important;
  padding-left: 12px !important;
}

/* 跳转输入区域文字 */
.MuiStack-root.css-1uwir8f .MuiBox-root {
  color: #6b7280 !important;
  font-size: 0.8rem !important;
}

/* 跳转输入框 */
.MuiInputBase-input {
  color: #1a1d23 !important;
  background: rgba(255, 255, 255, 0.8) !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  transition: all 0.3s !important;
}

.MuiInputBase-input:focus {
  background: rgba(13, 13, 26, 0.8) !important;
  border-color: #ff007f !important;
  color: #e0e0ff !important;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.3) !important;
  outline: none !important;
}


/* --- 3. 按钮栏 (ai-mod-button2区域) --- */
/* 按钮本身 */
#ai-mod-button2 button.MuiButton-root {
  color: #1a1d23 !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 10px !important;
  padding: 6px 14px !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03) !important;
  position: relative !important;
  overflow: hidden !important;
}

/* 按钮图标默认 */
#ai-mod-button2 button.MuiButton-root svg {
  width: 18px !important;
  height: 18px !important;
  color: #6b7280 !important;
  transition: all 0.3s !important;
}

/* 按钮悬停：霓虹切换 */
#ai-mod-button2 button.MuiButton-root:hover {
  color: #e0e0ff !important;
  background: rgba(13, 13, 26, 0.9) !important;
  border-color: #ff007f !important;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4), 0 0 25px rgba(0, 240, 255, 0.2) !important;
  transform: translateY(-2px) !important;
}

#ai-mod-button2 button.MuiButton-root:hover svg {
  color: #00f0ff !important;
  filter: drop-shadow(0 0 4px #00f0ff) !important;
}

/* 按钮聚焦状态 (作为备选) */
#ai-mod-button2 button.MuiButton-root:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(255, 0, 127, 0.5) !important;
}

/* 按钮呼吸光晕 (悬停时背景层) - 模仿details的呼吸灯 */
#ai-mod-button2 button.MuiButton-root:hover::after {
  content: '' !important;
  position: absolute !important;
  top: -2px !important;
  left: -2px !important;
  right: -2px !important;
  bottom: -2px !important;
  border-radius: 12px !important;
  background: linear-gradient(45deg, #ff007f, #00f0ff, #ff007f, #00f0ff) !important;
  background-size: 400% 400% !important;
  z-index: -1 !important;
  filter: blur(6px) !important;
  opacity: 0.5 !important;
  animation: neon-breath-btn 3s ease-in-out infinite !important;
  pointer-events: none !important;
}

@keyframes neon-breath-btn {
  0% { opacity: 0.3; background-position: 0% 50%; }
  50% { opacity: 0.6; background-position: 100% 50%; }
  100% { opacity: 0.3; background-position: 0% 50%; }
}

/* 全局按钮增强 (可选，建议最后添加测试) */
button:not([class*="MuiPaginationItem"]):hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  filter: brightness(1.2) !important;
  box-shadow: 0 0 12px rgba(255, 0, 127, 0.3) !important;
}

/* 页面所有SVG图标 (可选，让图标在悬停时也有微光) */
button:hover svg,
a:hover svg {
  filter: drop-shadow(0 0 3px #00f0ff) !important;
  transition: filter 0.3s !important;
}

/* ============================================
   赛博协议 · 双生风格 (评论区输入栏 - 高覆盖版)
   ============================================ */

/* --- 输入框外层容器（更宽泛的匹配） --- */
div[class*="border-gray-200"]:has(textarea.rc-textarea) {
  background: rgba(240, 242, 245, 0.95) !important;
  border: 1px solid #d0d5dd !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04) !important;
  position: relative !important;
  overflow: hidden !important;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* --- 输入框本体（保持透明背景，不额外设置padding） --- */
textarea.rc-textarea {
  background: transparent !important;
  border: none !important;
  color: #1a1d23 !important;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif !important;
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  transition: color 0.3s !important;
}

textarea.rc-textarea::placeholder {
  color: #a0a5b0 !important;
  opacity: 0.7 !important;
  transition: color 0.3s !important;
}

textarea.rc-textarea::selection {
  background: #3b82f6 !important;
  color: #ffffff !important;
}

/* --- 聚焦状态：容器整体切换 --- */
div[class*="border-gray-200"]:has(textarea.rc-textarea:focus) {
  background: rgba(13, 13, 26, 0.95) !important;
  border-color: #ff007f !important;
  box-shadow: 0 0 15px rgba(255, 0, 127, 0.4), 0 0 30px rgba(255, 0, 127, 0.2), inset 0 0 20px rgba(255, 0, 127, 0.05) !important;
  transform: translateY(-1px) !important;
}

div[class*="border-gray-200"]:has(textarea.rc-textarea:focus) textarea.rc-textarea {
  color: #c8c8f0 !important;
}

div[class*="border-gray-200"]:has(textarea.rc-textarea:focus) textarea.rc-textarea::placeholder {
  color: #6a6a8a !important;
}

/* --- 聚焦时的呼吸光晕（伪元素） --- */
div[class*="border-gray-200"]:has(textarea.rc-textarea:focus)::after {
  content: '' !important;
  position: absolute !important;
  top: -2px !important;
  left: -2px !important;
  right: -2px !important;
  bottom: -2px !important;
  border-radius: 14px !important;
  background: linear-gradient(45deg, #ff007f, #00f0ff, #ff007f, #00f0ff) !important;
  background-size: 400% 400% !important;
  z-index: -1 !important;
  filter: blur(8px) !important;
  opacity: 0.45 !important;
  animation: neon-breath-comment 3s ease-in-out infinite !important;
  pointer-events: none !important;
}

@keyframes neon-breath-comment {
  0% { opacity: 0.25; background-position: 0% 50%; }
  50% { opacity: 0.55; background-position: 100% 50%; }
  100% { opacity: 0.25; background-position: 0% 50%; }
}