:root {
  --bg: #0b1020;
  --panel: #121831;
  --muted: #7f8fb3;
  --text: #e6ecff;
  --primary: #4f7cff;
  --primary-600: #3b63d6;
  --accent: #22d3ee;
  --danger: #ef4444;
  --success: #10b981;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: radial-gradient(1200px 600px at 10% 0%, #121833 0%, #0b1020 40%, #070a16 100%);
  color: var(--text);
}

.app-header { padding: 24px 16px 8px; text-align: center; }
.app-header h1 { margin: 0; font-size: 28px; letter-spacing: 1px; }
.app-header .subtitle { margin: 8px 0 0; color: var(--muted); }

.container { max-width: 1000px; margin: 0 auto; padding: 0 16px 24px; }

.controls .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.autoplay-group { display: flex; gap: 8px; }

button {
  background: #1a2347;
  color: var(--text);
  border: 1px solid #243064;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: transform .08s ease, background .2s ease, border-color .2s ease;
}
button:hover { transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: not-allowed; transform: none; }
button.primary { background: var(--primary); border-color: var(--primary-600); }
button.primary:hover { background: var(--primary-600); }
button.ghost { background: transparent; border-color: #2a396f; }

.stats .card, .log .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 16px;
  margin-top: 14px;
  backdrop-filter: blur(4px);
}

.stats .stat { display: inline-flex; flex-direction: column; gap: 4px; margin: 8px 14px 8px 0; }
.stats .stat span { color: var(--muted); font-size: 12px; }
.stats .stat strong { font-size: 18px; }
.stats .stat.exit-stat { margin-left: auto; margin-right: 0; }

/* 健康值状态样式 */
.stats .stat strong.health-excellent { color: #28a745; font-weight: bold; }
.stats .stat strong.health-good { color: #e6a700; font-weight: bold; }
.stats .stat strong.health-poor { color: #dc3545; font-weight: bold; }
.stats .stat strong.health-lost { color: #6c757d; text-decoration: line-through; font-weight: bold; }
.exit-btn {
  background: var(--danger);
  border-color: #dc2626;
  color: white;
  font-size: 12px;
  padding: 6px 12px;
  margin-top: 8px;
}
.exit-btn:hover { background: #dc2626; }

.health-btn {
  background: #28a745;
  border-color: #28a745;
  color: white;
  font-size: 12px;
  padding: 6px 12px;
  margin-top: 8px;
}
.health-btn:hover { background: #218838; }

/* 健康状态弹窗样式 */
.health-modal {
  max-width: 600px;
  width: 90%;
}

.health-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.close-btn:hover {
  color: #333;
}

.health-body {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.human-silhouette {
  flex: 1;
  min-height: 300px;
  position: relative;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #dee2e6;
}

.health-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.health-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #dee2e6;
}

.health-label {
  font-weight: 600;
  color: #495057;
}

.health-value {
  font-weight: bold;
  font-size: 18px;
}

/* 健康状态颜色 */
.health-excellent { color: #28a745; font-weight: bold; }
.health-good { color: #e6a700; font-weight: bold; }
.health-poor { color: #dc3545; font-weight: bold; }
.health-lost { color: #6c757d; text-decoration: line-through; font-weight: bold; }

/* 人体剪影SVG样式 */
.human-silhouette svg {
  width: 100%;
  height: 100%;
}

.body-part {
  transition: all 0.3s ease;
}

.body-part.healthy { fill: #28a745; stroke: #1e7e34; stroke-width: 2; }
.body-part.warning { fill: #e6a700; stroke: #b8860b; stroke-width: 2; }
.body-part.danger { fill: #dc3545; stroke: #b02a37; stroke-width: 2; }
.body-part.lost { fill: #6c757d; stroke: #495057; stroke-width: 2; opacity: 0.3; }

.log .card h2 { margin: 0 0 8px; font-size: 18px; color: var(--muted); }
.log-hint { font-size: 12px; color: var(--accent); font-weight: normal; }
.log-list { max-height: 52vh; overflow: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.log-list.interactive { cursor: pointer; user-select: none; }
.log-list.interactive:hover { background: rgba(79, 124, 255, 0.05); border-radius: 10px; }
.log-list.interactive:active { background: rgba(79, 124, 255, 0.1); }
.log-item { background: #0f1530; border: 1px solid #202a55; border-radius: 10px; padding: 10px 12px; line-height: 1.5; }
.log-item .meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.log-item.good { border-color: rgba(16,185,129,0.5); }
.log-item.bad { border-color: rgba(239,68,68,0.5); }

.app-footer { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }

/* 主页样式 */
.welcome .card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 24px;
  margin-top: 14px;
  backdrop-filter: blur(4px);
}

.welcome h2 { margin: 0 0 16px; font-size: 24px; color: var(--text); }
.welcome p { margin: 0 0 16px; line-height: 1.6; color: var(--muted); }
.welcome .description { font-size: 16px; color: var(--accent); margin-bottom: 24px; }

.features { margin: 24px 0; }
.features h3 { margin: 0 0 12px; font-size: 18px; color: var(--text); }
.features ul { margin: 0; padding-left: 20px; }
.features li { margin: 8px 0; line-height: 1.5; color: var(--muted); }

.controls { margin-top: 24px; text-align: center; }
button.large { padding: 16px 32px; font-size: 18px; font-weight: 600; }

/* 弹窗样式 */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 24px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  backdrop-filter: blur(8px);
}

.modal-content h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--text);
}

.modal-content p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.input-group input {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 16px;
  outline: none;
  transition: border-color 0.2s ease;
}

.input-group input:focus {
  border-color: var(--primary);
}

.input-group input::placeholder {
  color: var(--muted);
}

.modal-hint {
  font-size: 12px;
  color: var(--accent);
  margin: 0;
}

/* 属性分配弹窗样式 */
.attribute-allocation {
  max-width: 500px;
  width: 90vw;
}

.attribute-grid {
  display: grid;
  gap: 16px;
  margin: 20px 0;
}

.attribute-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
}

.attribute-item label {
  font-weight: 600;
  color: var(--text);
  min-width: 60px;
}

.attribute-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.attr-btn {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: var(--text);
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.attr-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.2);
  border-color: var(--primary);
}

.attr-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.attr-input {
  width: 50px;
  height: 32px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
}

.attr-input:focus {
  outline: none;
  border-color: var(--primary);
}

.allocation-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 20px;
}

.allocation-actions .secondary {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--text);
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.allocation-actions .secondary:hover {
  background: rgba(255,255,255,0.2);
  border-color: var(--accent);
}

#remainingPoints {
  color: var(--accent);
  font-weight: bold;
  font-size: 18px;
}

@media (max-width: 640px) {
  .autoplay-group { width: 100%; }
  .controls .row { gap: 10px; }
  .stats .stat { margin-right: 10px; }
  .stats .stat.exit-stat { margin-left: 0; margin-right: 10px; }
  
  .attribute-item {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .attribute-item label {
    min-width: auto;
  }
  
  .allocation-actions {
    flex-direction: column;
    gap: 8px;
  }
  
  .allocation-actions .secondary,
  .allocation-actions .primary {
    width: 100%;
  }
}


