/* ==================== 全局变量定义 ==================== */
:root {
  --primary-color: #6b8cce;
  --secondary-color: #f4a6b8;
  --bg-light: #fefefe;
  --bg-dark: #2c2c2c;
  --text-light: #333;
  --text-dark: #eee;
  --border-radius: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 思维链隐藏 ==================== */
think {
  display: none;
}

/* ==================== 顶部状态栏 ==================== */
status-top {
  display: block;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 12px 20px;
  border-radius: var(--border-radius) var(--border-radius) 0 0;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
  margin-bottom: 0;
}

status-top p {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

/* ==================== 正文区域 ==================== */
text {
  display: block;
  background: var(--bg-light);
  padding: 25px 30px;
  line-height: 1.8;
  font-size: 15px;
  color: var(--text-light);
  border-left: 3px solid var(--primary-color);
  border-right: 3px solid var(--primary-color);
  margin: 0;
}

text p {
  margin: 0 0 15px 0;
  text-indent: 2em;
}

text p:last-child {
  margin-bottom: 0;
}

/* ==================== 底部状态栏容器 ==================== */
status-bottom {
  display: block;
  background: linear-gradient(to bottom, #f8f9fa 0%, #e9ecef 100%);
  padding: 20px;
  border-radius: 0 0 var(--border-radius) var(--border-radius);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  margin-top: 0;
}

/* ==================== details折叠块通用样式 ==================== */
status-bottom details {
  background: white;
  border-radius: 6px;
  margin-bottom: 12px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: var(--transition);
}

status-bottom details:last-child {
  margin-bottom: 0;
}

status-bottom details:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
}

status-bottom details[open] {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* ==================== summary标题样式 ==================== */
status-bottom summary {
  padding: 14px 18px;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  background: linear-gradient(to right, #ffeef8 0%, #fff5f7 100%);
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}

status-bottom summary:hover {
  background: linear-gradient(to right, #ffe0f0 0%, #ffebf0 100%);
  padding-left: 22px;
}

status-bottom summary::marker {
  content: '';
}

status-bottom summary::before {
  content: '▶';
  display: inline-block;
  transition: transform 0.3s;
  color: var(--primary-color);
  font-size: 12px;
}

status-bottom details[open] summary::before {
  transform: rotate(90deg);
}

/* ==================== 折叠块内容区域 ==================== */
status-bottom details p,
status-bottom details div {
  padding: 15px 18px;
  margin: 0;
  line-height: 1.7;
  font-size: 14px;
  color: #555;
  border-top: 1px solid #f0f0f0;
  text-indent: 0;
}

status-bottom details p:first-of-type {
  padding-top: 15px;
}

status-bottom details strong {
  color: var(--primary-color);
  font-weight: 600;
}

/* ==================== 互动提示特殊样式 ==================== */
status-bottom details:has(summary:contains('互动提示')) p {
  background: #fffbf0;
  border-left: 3px solid #ffc107;
  padding-left: 15px;
}

/* ==================== 记忆区列表样式 ==================== */
status-bottom details:has(summary:contains('记忆区')) p {
  padding-left: 25px;
  position: relative;
}

status-bottom details:has(summary:contains('记忆区')) p::before {
  content: '•';
  position: absolute;
  left: 10px;
  color: var(--secondary-color);
  font-weight: bold;
}

/* ==================== 好感度进度条 ==================== */
.affection-bar {
  width: 100%;
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin: 10px 0;
}

.affection-fill {
  height: 100%;
  background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
  border-radius: 10px;
  transition: width 0.5s ease;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  color: white;
  font-size: 11px;
  font-weight: bold;
}

/* ==================== 图标装饰（用伪元素实现） ==================== */
status-bottom summary:has-text('当前状态')::after {
  content: '💗';
  margin-left: auto;
}

status-bottom summary:has-text('内心独白')::after {
  content: '🧠';
  margin-left: auto;
}

status-bottom summary:has-text('互动提示')::after {
  content: '📱';
  margin-left: auto;
}

status-bottom summary:has-text('记忆区')::after {
  content: '📝';
  margin-left: auto;
}

/* ==================== 响应式适配 ==================== */
@media (max-width: 768px) {
  status-top p {
    font-size: 12px;
    gap: 10px;
  }
  
  text {
    padding: 18px 20px;
    font-size: 14px;
  }
  
  status-bottom {
    padding: 15px;
  }
  
  status-bottom summary {
    font-size: 14px;
    padding: 12px 15px;
  }
}

/* ==================== 暗色模式（可选） ==================== */
@media (prefers-color-scheme: dark) {
  text {
    background: var(--bg-dark);
    color: var(--text-dark);
  }
  
  status-bottom {
    background: linear-gradient(to bottom, #1a1a1a 0%, #2c2c2c 100%);
  }
  
  status-bottom details {
    background: #333;
  }
  
  status-bottom details p {
    color: #ccc;
    border-top-color: #444;
  }
  
  status-bottom summary {
    background: linear-gradient(to right, #2a2a2a 0%, #3a3a3a 100%);
  }
  
  status-bottom summary:hover {
    background: linear-gradient(to right, #3a3a3a 0%, #4a4a4a 100%);
  }
}

/* ==================== 动画效果 ==================== */
@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

status-bottom details[open] > *:not(summary) {
  animation: slideIn 0.3s ease;
}

/* ==================== 选项按钮美化（如果在互动提示中用到） ==================== */
status-bottom details p:has-text('A.'),
status-bottom details p:has-text('B.'),
status-bottom details p:has-text('C.') {
  background: linear-gradient(to right, #e3f2fd 0%, #f3e5f5 100%);
  border-left: 4px solid var(--primary-color);
  padding: 10px 15px;
  margin: 8px 0;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

status-bottom details p:has-text('A.'):hover,
status-bottom details p:has-text('B.'):hover,
status-bottom details p:has-text('C.'):hover {
  background: linear-gradient(to right, #bbdefb 0%, #e1bee7 100%);
  transform: translateX(5px);
}