/* 容器基础设置 */
.ui-frame {
  max-width: 800px;
  margin: 20px auto;
  background-color: #1a1b26; /* 深蓝灰色背景 */
  color: #a9b1d6; /* 柔和浅蓝文字 */
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); /* 阴影增强立体感 */
  overflow: hidden;
  border: 1px solid #2f334d; /* 边框 */
  font-size: 14px;
  line-height: 1.6;
}

/* 1. 场景头部 */
.ui-frame .scene-header {
  background: linear-gradient(135deg, #24283b 0%, #1f2335 100%); /* 渐变背景 */
  padding: 15px;
  border-bottom: 2px solid #7aa2f7; /* 强调蓝线 */
}

.ui-frame .header-row {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
}

.ui-frame .tag {
  background: #3b4261; /* 标签背景 */
  color: #7aa2f7; /* 标签文字 */
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
}

.ui-frame .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  font-size: 13px;
  color: #c0caf5; /* 信息文字 */
  margin-bottom: 10px;
}

.ui-frame .scene-summary {
  font-style: italic;
  color: #565f89; /* 摘要文字 */
  border-left: 3px solid #7aa2f7; /* 侧边蓝线 */
  padding-left: 10px;
  font-size: 12px;
}

/* 2. 正文 (段落排版优化) */
.ui-frame .story-content {
  padding: 25px;
  color: #e0e0e0; /* 亮白文字 */
  font-size: 16px;
  background-color: #1a1b26; /* 深蓝灰色背景 */
  text-align: justify;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ui-frame .story-content p {
  margin: 0;
  line-height: 1.7;
}

/* 3. 折叠面板通用 */
.ui-frame details {
  border-top: 1px solid #2f334d;
}

.ui-frame summary {
  padding: 12px 20px;
  background: #24283b; /* 摘要背景 */
  cursor: pointer;
  font-weight: bold;
  color: #7aa2f7; /* 摘要文字 */
  user-select: none;
  transition: background 0.2s;
  border-radius: 0; /* 确保无圆角 */
}

.ui-frame summary:hover {
  background: #2f334d; /* 悬停背景 */
}

.ui-frame details[open] summary {
  border-bottom: 1px solid #2f334d; /* 打开时底部线 */
}

.ui-frame .panel-content {
  padding: 15px;
  background: #16161e; /* 内容面板背景 */
}

/* 状态栏具体样式 */
.ui-frame .status-group {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px dashed #2f334d; /* 虚线分隔 */
}

.ui-frame .group-title {
  color: #bb9af7; /* 紫色标题 */
  margin-bottom: 10px;
  font-weight: bold;
  font-size: 1.1em;
}

.ui-frame .stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ui-frame .stat-box {
  background: #1f2335; /* 状态框背景 */
  padding: 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #2f334d;
}

.ui-frame .stat-box .label {
  width: 70px; /* 增加标签宽度 */
  font-size: 13px;
  color: #c0caf5;
  flex-shrink: 0; /* 防止标签收缩 */
}

.ui-frame .progress-bar {
  flex-grow: 1;
  height: 8px; /* 增加进度条高度 */
  background: #16161e;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.ui-frame .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out; /* 平滑过渡动画 */
}

.ui-frame .fill.red { background: #f7768e; } /* 红色 */
.ui-frame .fill.blue { background: #7aa2f7; } /* 蓝色 */
.ui-frame .fill.purple { background: #bb9af7; } /* 紫色 */
.ui-frame .fill.cyan { background: #7dcfff; } /* 青色 */
.ui-frame .fill.green { background: #9ece6a; } /* 绿色 */
.ui-frame .fill.orange { background: #ff9e64; } /* 橙色 */

.ui-frame .value {
  font-size: 13px;
  width: 40px; /* 增加数值宽度 */
  text-align: right;
  opacity: 0.8;
  color: #a9b1d6;
  flex-shrink: 0; /* 防止数值收缩 */
}

/* NPC 卡片 - 调整为夺舍目标信息 */
.ui-frame .npc-card {
  background: #1f2335;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  border: 1px solid #292e42;
}

.ui-frame .npc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  border-bottom: 1px solid #2f334d;
  padding-bottom: 5px;
}

.ui-frame .npc-name {
  color: #f7768e; /* 强调色 */
  font-weight: bold;
  font-size: 1.2em;
}

.ui-frame .npc-tags {
  font-size: 12px;
  color: #565f89;
  background-color: #2f334d;
  padding: 3px 7px;
  border-radius: 4px;
}

.ui-frame .npc-core-stats {
  margin-bottom: 10px;
}

.ui-frame .stat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 4px;
}

.ui-frame .npc-details-text p {
  margin: 4px 0;
  font-size: 13px;
  color: #a9b1d6;
}

.ui-frame .npc-details-text strong {
  color: #7aa2f7; /* 强调色 */
}

/* 4. 记忆表格 */
.ui-frame .mem-title {
  color: #e0af68; /* 金黄色标题 */
  font-size: 1.1em;
  margin: 10px 0 8px;
  font-weight: bold;
}

.ui-frame .table-wrapper {
  overflow-x: auto;
  border: 1px solid #2f334d;
  border-radius: 6px;
}

.ui-frame .mem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  min-width: 500px; /* 确保表格在小屏下不会挤压 */
}

.ui-frame .mem-table th {
  background: #24283b; /* 表头背景 */
  color: #7aa2f7;
  padding: 8px;
  text-align: left;
  border-bottom: 1px solid #2f334d;
}

.ui-frame .mem-table td {
  padding: 8px;
  border-bottom: 1px solid #2f334d;
  color: #a9b1d6;
  vertical-align: top;
}

.ui-frame .mem-table tr:last-child td {
  border-bottom: none;
}

/* 5. 选项 */
.ui-frame .choices-container {
  padding: 20px;
  background: #16161e; /* 选项容器背景 */
  border-top: 1px solid #2f334d;
}

.ui-frame .choice-header {
  color: #bb9af7; /* 紫色标题 */
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 1.1em;
}

.ui-frame .choice-btn {
  display: block;
  background: #24283b; /* 选项按钮背景 */
  padding: 12px 15px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #2f334d;
  color: #c0caf5;
  transition: all 0.3s ease; /* 平滑过渡 */
  cursor: pointer;
  text-align: left;
  font-size: 1em;
}

.ui-frame .choice-btn:hover {
  background: #3b4261; /* 悬停背景 */
  border-color: #7aa2f7; /* 悬停边框 */
  color: #ffffff; /* 悬停文字 */
  transform: translateY(-2px); /* 略微上浮效果 */
  box-shadow: 0 4px 8px rgba(0, 122, 255, 0.2);
}

/* 动画效果 */
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.8; }
  50% { transform: scale(1.02); opacity: 1; }
  100% { transform: scale(1); opacity: 0.8; }
}

.ui-frame .fill.animated {
  animation: pulse 2s infinite alternate; /* 进度条呼吸动画 */
}

/* 移动端适配 */
@media (max-width: 600px) {
  .ui-frame {
    margin: 10px auto;
    border-radius: 0; /* 移动端全屏 */
  }
  .ui-frame .stats-grid {
    grid-template-columns: 1fr; /* 状态网格单列 */
  }
  .ui-frame .header-row {
    flex-direction: column; /* 头部信息堆叠 */
    align-items: flex-start;
  }
  .ui-frame .story-content {
    padding: 15px;
    font-size: 14px;
  }
  .ui-frame summary {
    padding: 10px 15px;
  }
  .ui-frame .panel-content {
    padding: 10px;
  }
  .ui-frame .choice-btn {
    padding: 10px 12px;
    font-size: 0.9em;
  }
  .ui-frame .mem-table {
    font-size: 11px;
  }
  .ui-frame .stat-box .label {
    width: 60px;
  }
  .ui-frame .value {
    width: 30px;
  }
}