/* 锻造师生成 - 新夜之城：扭曲契约 CSS美化 */

/* 容器基础设置 */
.ui-frame {
  max-width: 900px; /* 调整最大宽度以适应更宽的内容 */
  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), 0 0 15px rgba(122,162,247,0.3); /* 更强的阴影和霓虹光晕 */
  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: 18px 25px; /* 增加内边距 */
  border-bottom: 2px solid #7aa2f7; /* 蓝色强调线 */
  position: relative; /* 用于霓虹效果 */
  overflow: hidden; /* 确保伪元素不溢出 */
}

.ui-frame .scene-header::before { /* 顶部霓虹光效 */
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #bb9af7, #7aa2f7, #7dcfff, #bb9af7);
  background-size: 200% 100%;
  animation: neon-border-pulse 4s linear infinite;
}

.ui-frame .header-row {
  display: flex;
  flex-wrap: wrap; /* 允许换行 */
  gap: 15px; /* 增加间距 */
  margin-bottom: 12px;
  align-items: center;
}

.ui-frame .tag {
  background: #3b4261; /* 深蓝灰色 */
  color: #7aa2f7; /* 蓝色文字 */
  padding: 4px 10px; /* 调整内边距 */
  border-radius: 5px;
  font-size: 13px;
  font-weight: bold;
  box-shadow: 0 0 5px rgba(122,162,247,0.5); /* 霓虹光晕 */
  transition: all 0.3s ease;
}

.ui-frame .tag:hover {
  background: #4b5278;
  box-shadow: 0 0 8px rgba(122,162,247,0.8);
  transform: translateY(-2px);
}

.ui-frame .info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* 调整最小宽度 */
  gap: 10px;
  font-size: 13px;
  color: #c0caf5; /* 浅灰色文字 */
  margin-bottom: 12px;
}

.ui-frame .info-item { /* 为每个信息项添加样式 */
  background-color: #2a2e41;
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #3b4261;
}

.ui-frame .scene-summary {
  font-style: italic;
  color: #565f89; /* 暗淡的文字 */
  border-left: 3px solid #bb9af7; /* 紫色强调线 */
  padding-left: 15px;
  font-size: 13px;
  background-color: #2a2e41;
  padding: 10px 15px;
  border-radius: 6px;
  margin-top: 15px;
}

/* 2. 正文 (段落排版优化) */
.ui-frame .story-content {
  padding: 25px;
  color: #e0e0e0;
  font-size: 16px;
  background-color: #1a1b26;
  text-align: justify;
  display: flex;
  flex-direction: column;
  gap: 12px; /* 增加段落间距 */
  border-bottom: 1px solid #2f334d;
}

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

.ui-frame .story-content strong { /* 强调文字 */
  color: #f7768e; /* 粉色 */
}

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

.ui-frame summary {
  padding: 15px 25px; /* 增加内边距 */
  background: #24283b;
  cursor: pointer;
  font-weight: bold;
  color: #7aa2f7;
  user-select: none;
  transition: background 0.3s, color 0.3s;
  border-bottom: 1px solid #2f334d;
  position: relative;
}

.ui-frame summary::before { /* 折叠图标 */
  content: '▶';
  display: inline-block;
  width: 1em;
  margin-right: 0.5em;
  transition: transform 0.2s;
  color: #bb9af7;
}

.ui-frame details[open] summary::before {
  transform: rotate(90deg);
}

.ui-frame summary:hover {
  background: #2f334d;
  color: #c0caf5;
}

.ui-frame .panel-content {
  padding: 18px 25px; /* 增加内边距 */
  background: #16161e; /* 更深的背景 */
  border-bottom: 1px solid #2f334d;
}

/* 状态栏具体样式 */
.ui-frame .status-group {
  margin-bottom: 25px;
  padding-bottom: 20px;
  border-bottom: 1px dashed #3b4261; /* 更柔和的虚线 */
}

.ui-frame .group-title {
  color: #bb9af7; /* 紫色 */
  margin-bottom: 12px;
  font-weight: bold;
  font-size: 1.1em;
  border-left: 4px solid #bb9af7;
  padding-left: 10px;
}

.ui-frame .stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); /* 调整最小宽度 */
  gap: 15px; /* 增加间距 */
}

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

.ui-frame .stat-box .label {
  width: 60px; /* 调整标签宽度 */
  font-size: 13px;
  color: #a9b1d6;
  flex-shrink: 0; /* 防止标签被压缩 */
}

.ui-frame .progress-bar {
  flex-grow: 1;
  height: 8px; /* 增加高度 */
  background: #16161e;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.4);
}

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

/* 进度条颜色 */
.ui-frame .fill.red { background: linear-gradient(90deg, #f7768e, #e06c75); }
.ui-frame .fill.blue { background: linear-gradient(90deg, #7aa2f7, #61afef); }
.ui-frame .fill.purple { background: linear-gradient(90deg, #bb9af7, #c678dd); }
.ui-frame .fill.cyan { background: linear-gradient(90deg, #7dcfff, #56b6c2); }
.ui-frame .fill.pink { background: linear-gradient(90deg, #ff9e64, #e5c07b); }
.ui-frame .fill.hot-pink { background: linear-gradient(90deg, #f7768e, #ff6b88); }
.ui-frame .fill.gradient-flow {
  background: linear-gradient(90deg, #7aa2f7, #f7768e, #bb9af7, #7aa2f7);
  background-size: 200% 100%;
  animation: gradient-flow 3s linear infinite;
}

.ui-frame .value {
  font-size: 13px;
  width: 40px; /* 调整数值宽度 */
  text-align: right;
  opacity: 0.9;
  color: #c0caf5;
  flex-shrink: 0;
}

/* NPC 卡片 */
.ui-frame .npc-card {
  background: #1f2335;
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 20px;
  border: 1px solid #292e42;
  box-shadow: 0 4px 15px 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 #3b4261;
  padding-bottom: 8px;
}

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

.ui-frame .npc-tags {
  font-size: 12px;
  color: #565f89;
  background-color: #2a2e41;
  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: #a9b1d6;
}

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

.ui-frame .npc-details-text strong {
  color: #7aa2f7;
}

.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 dashed #3b4261;
}

.ui-frame .part-item {
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #1f2335;
  border: 1px solid #2f334d;
}

.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 8px;
  font-weight: bold;
  border-bottom: 1px solid #3b4261;
  padding-bottom: 5px;
}

.ui-frame .table-wrapper {
  overflow-x: auto; /* 允许表格横向滚动 */
  border-radius: 8px;
  background-color: #1f2335;
  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,
.ui-frame .mem-table td {
  padding: 10px 12px;
  text-align: left;
  white-space: nowrap; /* 防止内容换行 */
}

.ui-frame .mem-table th {
  background: #24283b;
  color: #7aa2f7;
  border-bottom: 2px solid #7aa2f7;
  font-weight: bold;
}

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

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

.ui-frame .mem-table tbody tr:hover {
  background-color: #2a2e41; /* 鼠标悬停效果 */
}


/* 5. 选项 */
.ui-frame .choices-container {
  padding: 25px;
  background: #16161e;
  border-top: 1px solid #2f334d;
  position: relative;
}

.ui-frame .choices-container::before { /* 底部霓虹光效 */
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, #bb9af7, #7aa2f7, #7dcfff, #bb9af7);
  background-size: 200% 100%;
  animation: neon-border-pulse 4s linear infinite reverse;
}

.ui-frame .choice-header {
  color: #bb9af7;
  margin-bottom: 15px;
  font-weight: bold;
  font-size: 1.1em;
  text-align: center;
  position: relative;
}

.ui-frame .choice-header::before,
.ui-frame .choice-header::after {
  content: '---';
  color: #565f89;
  margin: 0 10px;
}

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

.ui-frame .choice-btn:hover {
  background: #3b4261;
  border-color: #7aa2f7;
  color: #fff;
  transform: translateX(8px); /* 移动效果 */
  box-shadow: 0 4px 15px rgba(122,162,247,0.4), 0 0 10px rgba(122,162,247,0.6); /* 增强光晕 */
}

/* 动画效果 */
@keyframes neon-border-pulse {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

@keyframes gradient-flow {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* 移动端适配 */
@media (max-width: 768px) {
  .ui-frame {
    margin: 10px auto;
    border-radius: 8px;
    font-size: 13px;
  }
  .ui-frame .scene-header,
  .ui-frame .story-content,
  .ui-frame summary,
  .ui-frame .panel-content,
  .ui-frame .choices-container {
    padding: 15px 20px;
  }
  .ui-frame .header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ui-frame .info-grid {
    grid-template-columns: 1fr;
  }
  .ui-frame .tag {
    padding: 3px 8px;
    font-size: 12px;
  }
  .ui-frame .scene-summary {
    padding-left: 10px;
    font-size: 12px;
  }
  .ui-frame .story-content {
    font-size: 15px;
    gap: 10px;
  }
  .ui-frame .group-title {
    font-size: 1em;
    padding-left: 8px;
  }
  .ui-frame .stats-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .ui-frame .stat-box {
    padding: 8px 12px;
    gap: 8px;
  }
  .ui-frame .stat-box .label {
    width: 50px;
    font-size: 12px;
  }
  .ui-frame .value {
    width: 35px;
    font-size: 12px;
  }
  .ui-frame .npc-card {
    padding: 12px 15px;
  }
  .ui-frame .npc-name {
    font-size: 1.1em;
  }
  .ui-frame .npc-details-text p,
  .ui-frame .stat-row {
    font-size: 13px;
  }
  .ui-frame .body-parts-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  .ui-frame .mem-table {
    font-size: 12px;
    min-width: 500px; /* 调整最小宽度 */
  }
  .ui-frame .mem-table th,
  .ui-frame .mem-table td {
    padding: 8px 10px;
  }
  .ui-frame .choice-btn {
    padding: 10px 15px;
    font-size: 14px;
    margin-bottom: 8px;
  }
  .ui-frame .choice-btn:hover {
    transform: translateX(5px);
  }
}