/* 容器基础设置 */
.ui-frame {
  max-width: 960px; /* 略微扩大容器宽度 */
  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.6); /* 更深的阴影 */
  overflow: hidden;
  border: 1px solid #3a3f5a; /* 略深的边框 */
  font-size: 14px;
  line-height: 1.6;
}

/* 1. 场景头部 */
.ui-frame .scene-header {
  background: linear-gradient(135deg, #24283b 0%, #1f2335 100%);
  padding: 20px;
  border-bottom: 2px solid #a67c52; /* 奢华的金色调边框 */
  text-align: center;
  color: #e0e0e0;
}

.ui-frame .scene-header h1 {
  font-size: 2.2em;
  color: #e0e0e0;
  margin-bottom: 5px;
  text-shadow: 0 0 8px rgba(166, 124, 82, 0.5);
}

.ui-frame .scene-header p {
  font-size: 0.9em;
  color: #a9b1d6;
  font-style: italic;
}

.ui-frame .header-row {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 15px;
}

.ui-frame .tag {
  background: #4a4a5a; /* 更深沉的标签背景 */
  color: #a67c52; /* 金色调标签文字 */
  padding: 4px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ui-frame .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  font-size: 13px;
  color: #c0caf5;
  margin-bottom: 10px;
}

.ui-frame .scene-summary {
  font-style: italic;
  color: #7a7e9e; /* 略带灰度的描述文字 */
  border-left: 3px solid #a67c52;
  padding-left: 15px;
  font-size: 13px;
  margin-top: 15px;
}

/* 2. 正文 (段落排版优化) */
.ui-frame .story-content {
  padding: 25px 30px;
  color: #e0e0e0;
  font-size: 16px;
  background-color: #1a1b26;
  text-align: justify;
  display: flex;
  flex-direction: column;
  gap: 12px;
  line-height: 1.8;
}

.ui-frame .story-content p {
  margin: 0;
  text-indent: 2em; /* 首行缩进 */
}

/* 3. 折叠面板通用 */
.ui-frame .collapsible-panel {
  border-top: 1px solid #3a3f5a;
}

.ui-frame summary {
  padding: 15px 25px;
  background: #24283b;
  cursor: pointer;
  font-weight: bold;
  color: #a67c52; /* 金色调标题 */
  user-select: none;
  transition: background 0.3s ease-in-out, color 0.3s ease-in-out;
  border-bottom: 1px solid #3a3f5a;
}

.ui-frame summary:hover {
  background: #2f334d;
  color: #cfb99b; /* 悬停时颜色变亮 */
}

.ui-frame .panel-content {
  padding: 20px 25px;
  background: #16161e;
}

/* 状态栏具体样式 */
.ui-frame .status-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #3a3f5a;
}

.ui-frame .group-title {
  color: #bb9af7; /* 紫色调标题 */
  margin-bottom: 12px;
  font-weight: bold;
  font-size: 1.1em;
  text-shadow: 0 0 5px rgba(187, 154, 247, 0.3);
}

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

.ui-frame .stat-box {
  background: #1f2335;
  padding: 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
  border: 1px solid #2f334d;
}

.ui-frame .stat-box .label {
  width: 60px;
  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;
  border: 1px solid #2f334d;
}

.ui-frame .fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s ease-out;
}

.ui-frame .fill.red { background: linear-gradient(90deg, #f7768e, #e04a60); }
.ui-frame .fill.blue { background: linear-gradient(90deg, #7aa2f7, #5c84e0); }
.ui-frame .fill.purple { background: linear-gradient(90deg, #bb9af7, #9b72e0); }
.ui-frame .fill.cyan { background: linear-gradient(90deg, #7dcfff, #5aaddb); }
.ui-frame .fill.pink { background: linear-gradient(90deg, #ff9e64, #e07a3c); }
.ui-frame .fill.hot-pink { background: linear-gradient(90deg, #f7768e, #e04a60); }
.ui-frame .fill.gold { background: linear-gradient(90deg, #a67c52, #e0af68); } /* 新增金色调 */
.ui-frame .fill.gradient-flow {
  background: linear-gradient(90deg, #7aa2f7, #bb9af7, #f7768e);
  animation: progressPulse 2s infinite alternate;
}

@keyframes progressPulse {
  0% { transform: scaleX(0.95); opacity: 0.8; }
  100% { transform: scaleX(1); opacity: 1; }
}

.ui-frame .value {
  font-size: 13px;
  width: 40px;
  text-align: right;
  opacity: 0.9;
  color: #cfb99b;
  font-weight: bold;
}

/* NPC 卡片 */
.ui-frame .npc-card {
  background: #1f2335;
  border-radius: 10px;
  padding: 15px;
  margin-bottom: 20px;
  border: 1px solid #3a3f5a;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.ui-frame .npc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  border-bottom: 1px solid #4a4f6a;
  padding-bottom: 8px;
}

.ui-frame .npc-name {
  color: #a67c52; /* 金色调NPC名称 */
  font-weight: bold;
  font-size: 1.2em;
  text-shadow: 0 0 5px rgba(166, 124, 82, 0.4);
}

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

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

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

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

.ui-frame .npc-details-text strong {
  color: #a67c52; /* 金色调强调文字 */
}

.ui-frame .body-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  margin-top: 15px;
  background: #16161e;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #2f334d;
}

.ui-frame .part-item {
  font-size: 13px;
  padding: 6px;
  border-radius: 5px;
  background: #1f2335;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.2);
}

.ui-frame .part-item.full-width {
  grid-column: 1 / -1;
}

.ui-frame .part-item .state {
  color: #9ece6a; /* 绿色调状态 */
  float: right;
  font-weight: bold;
}

/* 4. 记忆表格 */
.ui-frame .mem-title {
  color: #e0af68; /* 金色调记忆标题 */
  font-size: 1.1em;
  margin: 15px 0 10px;
  font-weight: bold;
  text-shadow: 0 0 5px rgba(224, 175, 104, 0.3);
}

.ui-frame .table-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #3a3f5a;
  box-shadow: inset 0 0 5px rgba(0,0,0,0.3);
}

.ui-frame .mem-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 600px; /* 确保表格在小屏幕下可滚动 */
}

.ui-frame .mem-table th {
  background: #24283b;
  color: #a67c52;
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #4a4f6a;
}

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

.ui-frame .mem-table tr:nth-child(even) {
  background-color: #1f2335; /* 交替行背景 */
}

/* 5. 选项 */
.ui-frame .choices-container {
  padding: 25px;
  background: #16161e;
  border-top: 1px solid #3a3f5a;
  box-shadow: inset 0 5px 10px rgba(0,0,0,0.3);
}

.ui-frame .choice-header {
  color: #bb9af7;
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 1.1em;
  text-shadow: 0 0 5px rgba(187, 154, 247, 0.3);
}

.ui-frame .choice-btn {
  display: block;
  background: #24283b;
  padding: 12px 20px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: 1px solid #3a3f5a;
  color: #c0caf5;
  transition: all 0.3s ease-in-out;
  cursor: pointer;
  text-align: left;
  font-size: 15px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.ui-frame .choice-btn:hover {
  background: #3b4261;
  border-color: #a67c52; /* 悬停时金色边框 */
  color: #cfb99b;
  transform: translateY(-3px); /* 悬停时上浮效果 */
  box-shadow: 0 6px 15px rgba(0,0,0,0.5);
}

/* 移动端适配 */
@media (max-width: 768px) {
  .ui-frame {
    margin: 10px auto;
    border-radius: 8px;
  }
  .ui-frame .scene-header {
    padding: 15px;
  }
  .ui-frame .scene-header h1 {
    font-size: 1.8em;
  }
  .ui-frame .header-row {
    flex-direction: column;
    gap: 8px;
  }
  .ui-frame .tag {
    padding: 3px 10px;
    font-size: 11px;
  }
  .ui-frame .info-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .ui-frame .story-content {
    padding: 15px 20px;
    font-size: 14px;
    gap: 8px;
  }
  .ui-frame .story-content p {
    text-indent: 1.5em;
  }
  .ui-frame summary {
    padding: 12px 20px;
    font-size: 0.95em;
  }
  .ui-frame .panel-content {
    padding: 15px 20px;
  }
  .ui-frame .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ui-frame .stat-box .label {
    width: 50px;
    font-size: 12px;
  }
  .ui-frame .value {
    font-size: 12px;
    width: 35px;
  }
  .ui-frame .npc-card {
    padding: 12px;
    margin-bottom: 15px;
  }
  .ui-frame .npc-name {
    font-size: 1.1em;
  }
  .ui-frame .npc-tags {
    font-size: 11px;
  }
  .ui-frame .stat-row {
    font-size: 12px;
  }
  .ui-frame .npc-details-text p {
    font-size: 13px;
  }
  .ui-frame .body-parts-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 6px;
    padding: 8px;
  }
  .ui-frame .part-item {
    font-size: 12px;
    padding: 4px;
  }
  .ui-frame .mem-title {
    font-size: 1em;
    margin: 10px 0 8px;
  }
  .ui-frame .mem-table {
    font-size: 12px;
  }
  .ui-frame .mem-table th, .ui-frame .mem-table td {
    padding: 8px;
  }
  .ui-frame .choices-container {
    padding: 20px;
  }
  .ui-frame .choice-header {
    font-size: 1em;
    margin-bottom: 10px;
  }
  .ui-frame .choice-btn {
    padding: 10px 15px;
    font-size: 14px;
    border-radius: 6px;
  }
}