:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1b1f2a;
  --muted: #6b7280;
  --line: #e5e7eb;
  --primary: #4f46e5;
  --primary-d: #4338ca;
  --good: #10b981;
  --bad: #ef4444;
  --flat: #94a3b8;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  background-color: #f4f5fa;
  background-image:
    /* 宣纸纹理：细密横竖交叉线 */
    repeating-linear-gradient(0deg,
      rgba(27, 31, 42, 0.012) 0px,
      rgba(27, 31, 42, 0.012) 1px,
      transparent 1px, transparent 4px),
    repeating-linear-gradient(90deg,
      rgba(27, 31, 42, 0.012) 0px,
      rgba(27, 31, 42, 0.012) 1px,
      transparent 1px, transparent 4px),
    /* 墨晕 1：左上淡紫 */
    radial-gradient(ellipse 900px 700px at 15% 18%,
      rgba(99, 102, 241, 0.16), transparent 55%),
    /* 墨晕 2：右下淡青 */
    radial-gradient(ellipse 800px 900px at 88% 72%,
      rgba(34, 211, 238, 0.12), transparent 55%),
    /* 墨晕 3：底部淡绿 */
    radial-gradient(ellipse 1000px 500px at 50% 100%,
      rgba(16, 185, 129, 0.10), transparent 60%),
    /* 墨晕 4：右上淡金 */
    radial-gradient(ellipse 700px 800px at 78% 8%,
      rgba(251, 191, 36, 0.08), transparent 55%),
    /* 墨晕 5：左上淡墨（黑） */
    radial-gradient(ellipse 600px 900px at 5% 50%,
      rgba(27, 31, 42, 0.06), transparent 60%);
  background-attachment: fixed;
  background-size:
    auto, auto,
    200% 200%, 200% 200%, 200% 200%, 200% 200%, 200% 200%;
  background-position:
    0 0, 0 0,
    0% 0%, 100% 100%, 50% 100%, 70% 0%, 0% 50%;
  background-repeat: repeat, repeat, no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
  animation: ink-drift 60s ease-in-out infinite alternate;
  will-change: background-position;
}

@keyframes ink-drift {
  0% {
    background-position:
      0 0, 0 0,
      0% 0%, 100% 100%, 50% 100%, 70% 0%, 0% 50%;
  }
  50% {
    background-position:
      0 0, 0 0,
      18% 12%, 82% 88%, 45% 92%, 62% 18%, 8% 60%;
  }
  100% {
    background-position:
      0 0, 0 0,
      8% 25%, 92% 78%, 55% 96%, 76% 5%, 3% 40%;
  }
}

a { color: var(--primary); text-decoration: none; }

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 700; font-size: 16px; }
.nav .btn { padding: 6px 12px; font-size: 14px; }

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.card h1 { margin: 0 0 6px; font-size: 22px; }
.card h3 { margin: 0 0 12px; font-size: 16px; }

.subtitle { color: var(--muted); margin: 0 0 20px; }

.form .grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.form .grid .span-2 { grid-column: span 2; }
label {
  display: flex; flex-direction: column;
  font-size: 13px; color: var(--muted);
  gap: 4px;
}
input, select {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 15px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.12);
}

.actions { margin-top: 18px; }
.btn {
  display: inline-block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease;
}
.btn:hover { background: #f3f4f6; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn.primary:hover { background: var(--primary-d); }
.btn.ghost { color: var(--muted); }

/* 进度条 */
.progress {
  display: flex; gap: 6px;
  margin-bottom: 16px;
  font-size: 12px;
}
.progress-step {
  flex: 1;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--muted);
}
.progress-step.done { background: #e0e7ff; color: #4338ca; }
.progress-step.current {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.event-head { margin-bottom: 8px; }
.age-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.flavor-box {
  background: #fafaff;
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 12px 0 16px;
}
.flavor { margin: 0; font-size: 16px; }

.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--primary); background: #fafaff; }
.option-text { font-size: 15px; font-weight: 500; }
.option-req { font-size: 12px; color: var(--muted); }

.sidebar-attrs .attr-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.attr-row {
  display: flex; flex-direction: column;
  background: #f9fafb;
  border-radius: 10px;
  padding: 8px 10px;
}
.attr-label { font-size: 12px; color: var(--muted); }
.attr-value { font-size: 18px; font-weight: 600; }

.flags { font-size: 12px; color: var(--muted); margin-top: 10px; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}
.timeline-item:last-child { border-bottom: none; }
.timeline-item.ok .tl-age::before { content: "✔"; color: var(--good); margin-right: 4px; }
.timeline-item.no .tl-age::before { content: "✘"; color: var(--bad); margin-right: 4px; }
.tl-age { color: var(--muted); min-width: 56px; }
.tl-flavor { flex: 1; }
.tl-delta { color: var(--muted); font-size: 12px; }

/* 结局页 */
.result-head { text-align: center; }
.result-label { color: var(--muted); margin: 0; }
.result-grade {
  font-size: 56px;
  margin: 6px 0 4px;
  letter-spacing: 4px;
}

.result-score { color: var(--muted); margin: 0; }
.result-sub { color: var(--muted); font-size: 12px; margin-top: 6px; }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 60px 1fr 40px; gap: 10px; align-items: center; font-size: 14px; }
.bar-track { height: 10px; background: #eef2ff; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #818cf8, #4f46e5); border-radius: 999px; }
.bar-value { text-align: right; color: var(--muted); }

.curve-svg { width: 100%; height: 180px; display: block; }
.curve-hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }
.dot-good { fill: #10b981; }
.dot-flat { fill: #94a3b8; }
.dot-bad  { fill: #ef4444; }

.center { text-align: center; }

/* 错误页 */
.error-body { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.error-card { max-width: 480px; text-align: center; }
.error-msg { color: var(--muted); }

/* 免责与页脚 */
.tips ul { margin: 0; padding-left: 20px; color: var(--muted); }
.footer { text-align: center; padding: 16px; }
.disclaimer { font-size: 12px; color: #9ca3af; margin: 0; }

/* 移动端 */
@media (max-width: 560px) {
  .form .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form .grid .span-2 { grid-column: span 2; }
  .sidebar-attrs .attr-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grade { font-size: 44px; }
}


/* ============ 时间轮盘（3D 立体版） ============ */
.wheel-row {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 6px 0;
}
.wheel-group {
  flex: 1;
  min-width: 56px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
.wheel-group.wheel-wide { flex: 1.4; }
.wheel-label {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

/* 轮盘容器 —— 加上透视、立体背景、内阴影 */
.wheel {
  position: relative;
  height: 180px;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(180deg,
      #eef0f6 0%,
      #fafbfe 22%,
      #ffffff 50%,
      #fafbfe 78%,
      #eef0f6 100%);
  border: 1px solid var(--line);
  box-shadow:
    inset 0 10px 14px -10px rgba(31, 41, 55, 0.18),
    inset 0 -10px 14px -10px rgba(31, 41, 55, 0.18),
    0 2px 8px rgba(79, 70, 229, 0.06),
    0 8px 24px -16px rgba(79, 70, 229, 0.25);
  perspective: 500px;
  perspective-origin: 50% 50%;
  touch-action: pan-y;
  cursor: grab;
}
.wheel:active { cursor: grabbing; }

.wheel-list {
  list-style: none;
  margin: 0;
  padding: 72px 0;
  height: 100%;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  transform-style: preserve-3d;
  position: relative;
  z-index: 1;
}
.wheel-list::-webkit-scrollbar { display: none; }

.wheel-list li {
  height: 36px;
  line-height: 36px;
  text-align: center;
  scroll-snap-align: center;
  font-size: 17px;
  font-weight: 500;
  color: #9aa3b2;
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
  cursor: pointer;
  user-select: none;
  transform-origin: 50% 50%;
  transition:
    color .18s ease,
    font-weight .18s ease,
    transform .22s cubic-bezier(.22,.61,.36,1),
    opacity .18s ease,
    filter .18s ease;
  will-change: transform, opacity, filter;
  backface-visibility: hidden;
}
.wheel-list li:hover {
  color: #5b6473;
}
.wheel-list li.active {
  color: var(--primary-d);
  font-weight: 800;
  font-size: 20px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.9), 0 0 12px rgba(79,70,229,0.15);
}

/* 中央指示条：加发光和内光泽 */
.wheel-indicator {
  position: absolute;
  left: 8px; right: 8px;
  top: 50%;
  transform: translateY(-50%);
  height: 40px;
  border-radius: 10px;
  border-top: 1px solid rgba(79, 70, 229, 0.35);
  border-bottom: 1px solid rgba(79, 70, 229, 0.35);
  background:
    linear-gradient(180deg,
      rgba(79, 70, 229, 0.05),
      rgba(79, 70, 229, 0.00) 40%,
      rgba(79, 70, 229, 0.00) 60%,
      rgba(79, 70, 229, 0.05));
  box-shadow:
    0 0 14px rgba(79, 70, 229, 0.10),
    inset 0 0 10px rgba(79, 70, 229, 0.05);
  pointer-events: none;
  z-index: 3;
}

/* 上下渐变遮罩 —— 让两端自然淡出 */
.wheel-mask {
  position: absolute;
  left: 0; right: 0;
  height: 72px;
  pointer-events: none;
  z-index: 2;
}
.wheel-mask.top {
  top: 0;
  background: linear-gradient(
    to bottom,
    rgba(238, 240, 246, 0.98) 0%,
    rgba(250, 251, 254, 0.85) 35%,
    rgba(255, 255, 255, 0.00) 100%);
}
.wheel-mask.bottom {
  bottom: 0;
  background: linear-gradient(
    to top,
    rgba(238, 240, 246, 0.98) 0%,
    rgba(250, 251, 254, 0.85) 35%,
    rgba(255, 255, 255, 0.00) 100%);
}

/* 移动端高度 & padding 同比例缩小 */
@media (max-width: 560px) {
  .wheel-row { gap: 6px; }
  .wheel { height: 160px; perspective: 420px; }
  .wheel-list { padding: 62px 0; }
  .wheel-mask { height: 62px; }
  .wheel-group.wheel-wide { flex: 1.3; }
  .wheel-list li { font-size: 16px; }
  .wheel-list li.active { font-size: 19px; }
}

/* ============ 字段行 & 单选 ============ */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 13px;
  color: var(--muted);
}
.field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 15px;
  background: #fff;
}

.radio-group {
  display: flex;
  gap: 8px;
}
.radio {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 15px;
  background: #fff;
  transition: border-color .15s, background .15s;
}
.radio input { position: absolute; opacity: 0; }
.radio:has(input:checked) {
  border-color: var(--primary);
  background: #eef2ff;
  color: var(--primary);
  font-weight: 600;
}

.btn.big {
  width: 100%;
  padding: 14px;
  font-size: 17px;
  border-radius: 12px;
  margin-top: 8px;
}

@media (max-width: 560px) {
  .wheel-row { gap: 6px; }
  .wheel { height: 160px; }
  .wheel-list { padding: 62px 0; }   /* (160-36)/2 */
  .wheel-mask { height: 62px; }
  .wheel-group.wheel-wide { flex: 1.3; }
  .field-row { grid-template-columns: 1fr; }
}
/* ============ 结局页 V2 新样式 ============ */
.result-head {
  text-align: center;
  position: relative;
  overflow: hidden;
}
.result-head.is-hidden {
  background:
    radial-gradient(ellipse at top, rgba(217,70,239,0.10), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(245,158,11,0.10), transparent 60%),
    #fff;
  border-color: rgba(217,70,239,0.35);
  box-shadow: 0 0 24px rgba(217,70,239,0.18);
}
.hidden-badge {
  display: inline-block;
  background: linear-gradient(90deg, #d946ef, #f59e0b);
  color: #fff;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-weight: 600;
}

.result-grade {
  font-size: 52px;
  margin: 4px 0 0;
  letter-spacing: 6px;
}
.result-title {
  font-size: 26px;
  margin: 8px 0 6px;
  font-weight: 800;
  color: #1b1f2a;
  letter-spacing: 1px;
}
.result-quote {
  font-size: 15px;
  color: #5b6473;
  margin: 8px 0 12px;
  font-style: italic;
}
.result-hidden-note {
  font-size: 13px;
  color: #d946ef;
  margin: 4px 0 10px;
  font-weight: 600;
}
.result-score { font-size: 15px; color: var(--muted); margin: 0; }
.result-sub { font-size: 12px; color: #9ca3af; margin-top: 6px; }

/* 气质对照卡 */
.archetype-card {
  background: linear-gradient(135deg, #fafaff 0%, #f5f7ff 100%);
  border-color: #e0e7ff;
}
.archetype-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.archetype-tag {
  font-size: 12px;
  color: #6b7280;
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: 999px;
}
.archetype-title {
  font-size: 20px;
  font-weight: 800;
  color: #4338ca;
  letter-spacing: 1px;
}
.archetype-desc {
  font-size: 15px;
  color: #374151;
  margin: 8px 0;
}
.archetype-note {
  font-size: 12px;
  color: #9ca3af;
  margin: 6px 0 0;
}

/* 操作按钮栏 */
.actions-result {
  display: flex;
  gap: 12px;
  justify-content: center;
}
.actions-result .btn { flex: 1; max-width: 200px; text-align: center; }

.disclaimer-bottom {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin: 8px 16px 24px;
}

@media (max-width: 560px) {
  .result-grade { font-size: 40px; letter-spacing: 4px; }
  .result-title { font-size: 22px; }
  .actions-result { flex-direction: column; }
  .actions-result .btn { max-width: none; }
}
.ai-summary {
  margin: 12px 0;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fafaff 0%, #f0f4ff 100%);
  border-radius: 12px;
  border-left: 3px solid #6366f1;
  text-align: left;
}
.ai-summary-text {
  font-size: 15px;
  line-height: 1.75;
  color: #374151;
  margin: 0;
}
.ai-badge {
  font-size: 11px;
  color: #a5b4fc;
  text-align: right;
  margin: 8px 0 0;
  letter-spacing: 1px;
}
/* ============================================================
   结局页 V2 视觉升级
   ============================================================ */

/* ---------- 顶部 Hero ---------- */
.result-hero {
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 28px 20px 24px;
  background:
    radial-gradient(ellipse at top, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(217,70,239,0.06), transparent 60%),
    #fff;
}
.result-hero.is-hidden {
  background:
    radial-gradient(ellipse at top, rgba(217,70,239,0.14), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(245,158,11,0.14), transparent 60%),
    #fff;
  border-color: rgba(217,70,239,0.35);
  box-shadow: 0 0 32px rgba(217,70,239,0.18);
}
.hidden-badge {
  display: inline-block;
  background: linear-gradient(90deg, #d946ef, #f59e0b);
  color: #fff;
  font-size: 12px;
  letter-spacing: 2px;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
  font-weight: 600;
}
.hero-grade { margin: 6px 0 10px; }
.grade-badge {
  display: inline-block;
  padding: 8px 28px;
  border-radius: 999px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 6px;
  line-height: 1.1;
}
.grade-badge.grade-tragic     { background: #e5e7eb; color: #4b5563; }
.grade-badge.grade-ordinary   { background: #f3f4f6; color: #6b7280; }
.grade-badge.grade-notable    { background: #cffafe; color: #0e7490; }
.grade-badge.grade-wealthy    { background: linear-gradient(135deg, #fef3c7, #fde68a); color: #b45309; box-shadow: 0 0 20px rgba(251,191,36,0.35); }
.grade-badge.grade-legendary  { background: linear-gradient(135deg, #d946ef, #8b5cf6); color: #fff; box-shadow: 0 0 24px rgba(217,70,239,0.35); }

.result-title {
  font-size: 26px;
  margin: 8px 0 6px;
  font-weight: 800;
  color: #1b1f2a;
  letter-spacing: 1px;
}
.result-quote {
  font-size: 15px;
  color: #5b6473;
  margin: 8px 0 12px;
  font-style: italic;
}
.result-hidden-note {
  font-size: 13px;
  color: #d946ef;
  margin: 4px 0 10px;
  font-weight: 600;
}
.hero-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
  flex-wrap: wrap;
}
.hero-actions .btn { min-width: 140px; }

/* 分享主按钮 */
.btn.share-btn {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-color: transparent;
  font-weight: 700;
  box-shadow: 0 6px 18px rgba(99,102,241,0.35);
}
.btn.share-btn:hover { filter: brightness(1.08); }
.btn.big {
  padding: 14px 24px;
  font-size: 17px;
  border-radius: 12px;
}

/* ---------- AI 总结卡 ---------- */
.summary-card {
  background: linear-gradient(135deg, #fafaff 0%, #f0f4ff 100%);
  border-color: #e0e7ff;
  padding: 20px;
}
.summary-text {
  font-size: 15px;
  line-height: 1.85;
  color: #374151;
  margin: 0;
  white-space: pre-wrap;
}
.summary-byline {
  font-size: 11px;
  color: #c7d2fe;
  text-align: right;
  margin: 10px 0 0;
  letter-spacing: 1px;
}

/* ---------- 属性卡 ---------- */
.attr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.attr-header h3 { margin: 0; }
.grade-stamp {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
}
.grade-stamp.grade-tragic    { background: #e5e7eb; color: #4b5563; }
.grade-stamp.grade-ordinary  { background: #f3f4f6; color: #6b7280; }
.grade-stamp.grade-notable   { background: #cffafe; color: #0e7490; }
.grade-stamp.grade-wealthy   { background: #fef3c7; color: #b45309; }
.grade-stamp.grade-legendary { background: linear-gradient(135deg, #d946ef, #8b5cf6); color: #fff; }

.bars { display: flex; flex-direction: column; gap: 14px; }
.bar-row { display: flex; flex-direction: column; gap: 6px; }
.bar-top {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 10px;
  align-items: baseline;
}
.bar-label { font-size: 14px; font-weight: 600; color: #374151; }
.bar-tier {
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 999px;
  align-self: center;
}
.tier-high { background: #d1fae5; color: #065f46; }
.tier-mid  { background: #dbeafe; color: #1e40af; }
.tier-low  { background: #f3f4f6; color: #6b7280; }
.bar-value {
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: #1b1f2a;
}
.bar-max {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 500;
  margin-left: 2px;
}

.bar-track {
  position: relative;
  height: 12px;
  background: #f1f5f9;
  border-radius: 999px;
  overflow: visible;   /* ← 从 hidden 改为 visible */
}
.bar-threshold {
  position: absolute;
  top: -4px; bottom: -4px;      /* 加长，更明显 */
  width: 2px;
  background: #4f46e5;           /* 实色，不用半透明 */
  border-radius: 2px;
  z-index: 3;                    /* 保证在进度条上层 */
}
.bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width .6s cubic-bezier(.22,.61,.36,1);
  position: relative;
  z-index: 1;
}
.bar-fill.bar-tragic    { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.bar-fill.bar-ordinary  { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.bar-fill.bar-notable   { background: linear-gradient(90deg, #67e8f9, #06b6d4); }
.bar-fill.bar-wealthy   { background: linear-gradient(90deg, #fcd34d, #d97706); box-shadow: 0 0 12px rgba(251,191,36,0.4); }
.bar-fill.bar-legendary { background: linear-gradient(90deg, #d946ef, #8b5cf6); box-shadow: 0 0 12px rgba(217,70,239,0.4); }

.attr-legend {
  font-size: 11px;
  color: #9ca3af;
  margin: 10px 0 0;
  text-align: right;
}

/* ---------- 曲线 ---------- */
.curve-svg {
  width: 100%;
  height: 200px;
  display: block;
  margin-top: 8px;
}
.curve-hint {
  font-size: 12px;
  color: #9ca3af;
  margin: 0 0 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.legend-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.dot-good { fill: #10b981; background: #10b981; }
.dot-flat { fill: #94a3b8; background: #94a3b8; }
.dot-bad  { fill: #ef4444; background: #ef4444; }
.curve-dot { stroke: #fff; stroke-width: 2; }

/* ---------- 时间轴折叠 ---------- */
.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.timeline-header h3 { margin: 0; }
.btn.small {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 8px;
}
.timeline.collapsed .extra { display: none; }

/* ---------- 气质对照（沿用旧样式，可选） ---------- */
.archetype-card {
  background: linear-gradient(135deg, #fafaff 0%, #f5f7ff 100%);
  border-color: #e0e7ff;
}
.archetype-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.archetype-tag {
  font-size: 12px;
  color: #6b7280;
  background: #e0e7ff;
  padding: 2px 8px;
  border-radius: 999px;
}
.archetype-title {
  font-size: 20px;
  font-weight: 800;
  color: #4338ca;
  letter-spacing: 1px;
}
.archetype-desc { font-size: 15px; color: #374151; margin: 8px 0; }
.archetype-note { font-size: 12px; color: #9ca3af; margin: 6px 0 0; }

/* ---------- 底部操作 ---------- */
.actions-result {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.actions-result .btn.primary { flex: 1; max-width: 260px; }
.actions-result .btn.ghost { flex: 0 1 auto; }

/* ---------- 调试信息 ---------- */
.debug-info {
  margin: 10px 0;
  font-size: 12px;
  color: #9ca3af;
}
.debug-info summary {
  cursor: pointer;
  padding: 6px 0;
  list-style: none;
}
.debug-info summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform .2s;
}
.debug-info[open] summary::before { transform: rotate(90deg); }
.debug-info code {
  background: #f3f4f6;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 20px);
  background: rgba(31, 41, 55, 0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 14px;
  opacity: 0;
  transition: opacity .25s, transform .25s;
  z-index: 9999;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.disclaimer-bottom {
  text-align: center;
  font-size: 12px;
  color: #9ca3af;
  margin: 8px 16px 24px;
}

@media (max-width: 560px) {
  .grade-badge { font-size: 32px; letter-spacing: 4px; padding: 6px 20px; }
  .result-title { font-size: 22px; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; }
  .actions-result { flex-direction: column; }
  .actions-result .btn { max-width: none; }
  .curve-svg { height: 160px; }
}

/* 起点标记 */
.bar-init {
  position: absolute;
  top: -4px; bottom: -4px;
  width: 3px;
  background: #94a3b8;           /* 实色 */
  border-radius: 2px;
  z-index: 4;                    /* 起点在最上层 */
}
/* 变化量 */
.bar-gain {
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 4px;
}
.gain-up   { color: #059669; background: #d1fae5; }
.gain-down { color: #dc2626; background: #fee2e2; }
.gain-flat { color: #6b7280; background: #f3f4f6; }

/* 曲线面积填充 */
.area-good { fill: rgba(16, 185, 129, 0.14); }
.area-bad  { fill: rgba(239, 68, 68, 0.14); }

/* bar-top 用 flex 让 gain 靠右 */
.bar-top {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.bar-value { margin-left: auto; }

/* ============================================================
   结局页 V2.1 细节修复
   ============================================================ */

/* 5 档评价 —— 补充极佳/偏弱 */
.tier-excellent { background: #dcfce7; color: #166534; }
.tier-weak      { background: #fee2e2; color: #991b1b; }

/* 属性条"爆表"标记 */
.bar-overflow {
  font-size: 11px;
  color: #dc2626;
  font-weight: 700;
  margin-left: 4px;
  padding: 1px 6px;
  background: #fee2e2;
  border-radius: 4px;
}

/* 时间轴图标 */
.timeline-item {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.tl-icon {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.tl-icon-ok      { color: #10b981; }
.tl-icon-bad     { color: #ef4444; }
.tl-icon-neutral { color: #94a3b8; }

/* 移除旧的 ::before 图标（如果之前加过） */
.timeline-item.ok .tl-age::before,
.timeline-item.no .tl-age::before { content: none; }

/* ============================================================
   跑步小人交互
   ============================================================ */
.option-row {
  position: relative;
  overflow: hidden;
  border-radius: 12px;
}
.option-row .option {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-left: 40px;   /* 给小人留位置 */
}
.runner {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  transition: none;
}
.runner.running {
  opacity: 1;
  animation: runner-cross 0.7s cubic-bezier(.5,.05,.5,.95) forwards;
}
@keyframes runner-cross {
  0%   { left: 10px;  opacity: 1; transform: translateY(-50%) scale(0.9); }
  15%  { transform: translateY(-50%) scale(1.1); }
  85%  { opacity: 1; }
  100% { left: calc(100% - 40px); opacity: 0.4; transform: translateY(-50%) scale(1); }
}

/* ============================================================
   结局卡（等级配色）
   ============================================================ */
.ending-card {
  position: relative;
  padding: 22px 20px;
  border-radius: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  overflow: hidden;
}
.ending-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255,255,255,0.4), transparent 60%);
  pointer-events: none;
}

/* 五档配色 */
.ending-card.card-tragic {
  background: linear-gradient(135deg, #f8fafc, #e5e7eb);
  border-color: #cbd5e1;
}
.ending-card.card-ordinary {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
}
.ending-card.card-notable {
  background: linear-gradient(135deg, #cffafe, #a5f3fc);
  border-color: #22d3ee;
}
.ending-card.card-wealthy {
  background: linear-gradient(135deg, #fef3c7, #fcd34d);
  border-color: #f59e0b;
  box-shadow: 0 8px 24px -12px rgba(245, 158, 11, 0.5);
}
.ending-card.card-legendary {
  background: linear-gradient(135deg, #a855f7, #d946ef 60%, #ec4899);
  border-color: #d946ef;
  color: #fff;
  box-shadow: 0 12px 32px -12px rgba(217, 70, 239, 0.55);
}
.ending-card.card-legendary .card-title,
.ending-card.card-legendary .card-quote,
.ending-card.card-legendary .card-grade,
.ending-card.card-legendary .card-id { color: #fff; }

/* 卡片头 */
.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12px;
}
.card-rarity {
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 700;
  letter-spacing: 1px;
  background: rgba(255,255,255,0.85);
  color: #4338ca;
}
.rarity-传奇 { background: #fff; color: #d946ef; }
.rarity-富贵 { background: #fff8dc; color: #b45309; }
.rarity-出彩 { background: #ecfeff; color: #0e7490; }
.rarity-平凡 { background: #eff6ff; color: #1d4ed8; }
.rarity-惨烈 { background: #f1f5f9; color: #475569; }
.card-id {
  font-family: ui-monospace, Menlo, monospace;
  color: rgba(31,41,55,0.55);
  letter-spacing: 0.5px;
}

/* 卡片主体 */
.card-body { text-align: center; padding: 8px 0 14px; }
.card-grade {
  font-size: 42px;
  font-weight: 900;
  letter-spacing: 6px;
  color: #1b1f2a;
  margin-bottom: 4px;
}
.card-title {
  font-size: 20px;
  font-weight: 700;
  color: #374151;
  letter-spacing: 1px;
  margin-bottom: 10px;
}
.card-quote {
  font-size: 14px;
  font-style: italic;
  color: #5b6473;
  margin: 0;
}

/* 卡片底 */
.card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.card-legendary .card-foot { border-top-color: rgba(255,255,255,0.3); }
.card-reward {
  font-size: 14px;
  font-weight: 700;
  color: #4338ca;
}
.card-legendary .card-reward { color: #fff; }
.reward-icon {
  display: inline-block;
  color: #f59e0b;
  margin-right: 4px;
}
.card-legendary .reward-icon { color: #fde68a; }

.claim-btn {
  background: #fff;
  color: #4338ca;
  border-color: transparent;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 10px;
  box-shadow: 0 4px 12px -4px rgba(0,0,0,0.15);
}
.claim-btn:hover { background: #f8fafc; }
.claimed-badge {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  padding: 6px 12px;
  background: rgba(255,255,255,0.6);
  border-radius: 8px;
}
.card-legendary .claimed-badge { color: #fff; background: rgba(255,255,255,0.2); }

@media (max-width: 560px) {
  .card-grade { font-size: 34px; letter-spacing: 4px; }
  .card-title { font-size: 18px; }
  .card-foot { flex-direction: column; gap: 10px; }
  .claim-btn, .claimed-badge { width: 100%; text-align: center; }
}

.runner.run-anim {
  animation: runner-bob 0.35s ease-in-out infinite alternate;
}
@keyframes runner-bob {
  from { margin-top: 0; }
  to   { margin-top: -4px; }
}

/* ============================================================
   预告卡轮播
   ============================================================ */
.preview-carousel {
  position: relative;
  margin-bottom: 20px;
}

.preview-track {
  position: relative;
  height: 150px;
  border-radius: 20px;
  overflow: hidden;
}

.preview-card {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px 28px;
  border-radius: 20px;
  opacity: 0;
  transform: translateY(16px) scale(0.97);
  transition: opacity 0.7s cubic-bezier(.4,0,.2,1),
              transform 0.7s cubic-bezier(.4,0,.2,1);
  pointer-events: none;
  border: 1px solid transparent;
  will-change: opacity, transform;
}
.preview-card.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* 5 档配色（复用结局卡色系） */
.preview-card.card-legendary {
  background: linear-gradient(135deg, #a855f7, #d946ef 60%, #ec4899);
  color: #fff;
  box-shadow: 0 12px 32px -14px rgba(217, 70, 239, 0.5);
}
.preview-card.card-wealthy {
  background: linear-gradient(135deg, #fef3c7, #fcd34d);
  border-color: #f59e0b;
  color: #92400e;
  box-shadow: 0 12px 32px -14px rgba(245, 158, 11, 0.5);
}
.preview-card.card-notable {
  background: linear-gradient(135deg, #cffafe, #a5f3fc);
  border-color: #22d3ee;
  color: #0e7490;
  box-shadow: 0 12px 32px -14px rgba(34, 211, 238, 0.35);
}
.preview-card.card-ordinary {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1e40af;
  box-shadow: 0 12px 32px -14px rgba(59, 130, 246, 0.3);
}
.preview-card.card-tragic {
  background: linear-gradient(135deg, #f8fafc, #e5e7eb);
  border-color: #cbd5e1;
  color: #475569;
  box-shadow: 0 12px 32px -14px rgba(148, 163, 184, 0.3);
}

.preview-left {
  flex-shrink: 0;
  text-align: center;
  min-width: 80px;
  padding-right: 20px;
  border-right: 1px dashed currentColor;
  opacity: 0.9;
}
.preview-grade {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 4px;
  line-height: 1.1;
}
.preview-reward {
  font-size: 12px;
  font-weight: 700;
  margin-top: 6px;
  opacity: 0.75;
}
.preview-right {
  flex: 1;
  min-width: 0;
}
.preview-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.preview-quote {
  font-size: 13px;
  font-style: italic;
  opacity: 0.85;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.preview-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}
.preview-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
}
.preview-dots .dot.active {
  width: 20px;
  border-radius: 3px;
  background: #6366f1;
}

/* SVG 水墨山水底纹 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 800' preserveAspectRatio='xMidYMax slice'><defs><linearGradient id='m1' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%231b1f2a' stop-opacity='0'/><stop offset='1' stop-color='%231b1f2a' stop-opacity='0.5'/></linearGradient><linearGradient id='m2' x1='0' y1='0' x2='0' y2='1'><stop offset='0' stop-color='%234f46e5' stop-opacity='0'/><stop offset='1' stop-color='%234f46e5' stop-opacity='0.4'/></linearGradient></defs><path d='M0,650 Q150,530 280,570 T560,540 Q700,460 850,510 T1200,480 L1200,800 L0,800 Z' fill='url(%23m1)'/><path d='M0,720 Q200,640 400,680 T800,620 Q950,570 1100,620 T1200,600 L1200,800 L0,800 Z' fill='url(%23m2)'/></svg>");
  background-size: cover;
  background-position: center bottom;
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.topbar, .container, .footer { position: relative; z-index: 1; }
/* ============================================================
   技能卡系统
   ============================================================ */
.skills-header { text-align: center; }
.points-badge {
  display: inline-block;
  background: #eef2ff;
  color: #4338ca;
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 14px;
  margin-top: 8px;
}

.hint {
  font-size: 12px;
  color: #9ca3af;
  font-weight: 400;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.note {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 10px;
  line-height: 1.6;
}

/* 技能卡网格 */
.skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.skill-card {
  position: relative;
  padding: 16px 14px 14px;
  border-radius: 14px;
  border: 2px solid;
  text-align: center;
  transition: transform 0.2s;
  background: #fff;
}
.skill-card:hover { transform: translateY(-2px); }

.sc-tier {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-block;
  margin-bottom: 6px;
}
.sc-name {
  font-size: 18px;
  font-weight: 800;
  margin: 6px 0;
  letter-spacing: 1px;
}
.sc-attr {
  font-size: 14px;
  font-weight: 700;
  margin: 4px 0;
}
.sc-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 6px 0;
  line-height: 1.5;
}
.sc-source {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 8px;
}
.sc-pick {
  margin-top: 10px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 1px solid currentColor;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

/* 4 档配色 */
.skill-card.color-green {
  border-color: #86efac;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
}
.skill-card.color-green .sc-tier { background: #10b981; color: #fff; }
.skill-card.color-green .sc-name { color: #065f46; }
.skill-card.color-green .sc-pick { color: #059669; }

.skill-card.color-blue {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
}
.skill-card.color-blue .sc-tier { background: #3b82f6; color: #fff; }
.skill-card.color-blue .sc-name { color: #1e40af; }
.skill-card.color-blue .sc-pick { color: #2563eb; }

.skill-card.color-purple {
  border-color: #c4b5fd;
  background: linear-gradient(135deg, #f5f3ff, #ede9fe);
}
.skill-card.color-purple .sc-tier { background: #8b5cf6; color: #fff; }
.skill-card.color-purple .sc-name { color: #5b21b6; }
.skill-card.color-purple .sc-pick { color: #7c3aed; }

.skill-card.color-gold {
  border-color: #fcd34d;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  box-shadow: 0 6px 20px -8px rgba(245, 158, 11, 0.5);
}
.skill-card.color-gold .sc-tier { background: #f59e0b; color: #fff; }
.skill-card.color-gold .sc-name { color: #92400e; }
.skill-card.color-gold .sc-pick { color: #b45309; }

.skill-card.color-red {
  border-color: #dc2626;
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  box-shadow: 0 8px 28px -8px rgba(220, 38, 38, 0.6);
  animation: red-pulse 2s ease-in-out infinite alternate;
}
@keyframes red-pulse {
  from { box-shadow: 0 8px 28px -8px rgba(220, 38, 38, 0.6); }
  to   { box-shadow: 0 12px 36px -8px rgba(220, 38, 38, 0.9); }
}
.skill-card.color-red .sc-tier { background: #dc2626; color: #fff; }
.skill-card.color-red .sc-name { color: #991b1b; }
.skill-card.color-red .sc-pick { color: #dc2626; }

@media (max-width: 560px) {
  .skill-grid { grid-template-columns: repeat(2, 1fr); }
  .sc-name { font-size: 16px; }
}
/* ============================================================
   技能库 Hero
   ============================================================ */
.library-hero {
  text-align: center;
  padding: 28px 20px 22px;
  background:
    radial-gradient(ellipse at top, rgba(99,102,241,0.10), transparent 60%),
    radial-gradient(ellipse at bottom, rgba(217,70,239,0.06), transparent 60%),
    #fff;
}
.hero-icon {
  font-size: 44px;
  margin-bottom: 4px;
  filter: drop-shadow(0 4px 8px rgba(99,102,241,0.25));
}
.library-hero h1 {
  font-size: 26px;
  letter-spacing: 3px;
  margin: 4px 0 6px;
}
.hero-sub {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
}
.hero-sub strong {
  color: #4338ca;
  font-size: 16px;
}

/* 稀有度统计条 */
.tier-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.tier-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
}
.tier-pill strong {
  margin-left: 2px;
  font-weight: 800;
}
.tier-pill.tier-green  { background: #dcfce7; color: #065f46; border-color: #86efac; }
.tier-pill.tier-blue   { background: #dbeafe; color: #1e40af; border-color: #93c5fd; }
.tier-pill.tier-purple { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.tier-pill.tier-gold   { background: #fef3c7; color: #92400e; border-color: #fcd34d; box-shadow: 0 2px 8px -4px rgba(245,158,11,0.5); }
.tier-pill.tier-red    { background: #fee2e2; color: #991b1b; border-color: #fca5a5; box-shadow: 0 2px 8px -4px rgba(220,38,38,0.6); }
.empty-hint { color: #9ca3af; font-size: 13px; margin: 0; }

/* ============================================================
   卡片网格
   ============================================================ */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}

/* ============================================================
   战斗卡牌（核心样式）
   ============================================================ */
.battle-card {
  position: relative;
  padding: 18px 16px 16px;
  border-radius: 16px;
  overflow: hidden;
  text-align: center;
  border: 2px solid;
  transition: transform 0.25s cubic-bezier(.34,1.56,.64,1),
              box-shadow 0.25s ease;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.06),
    0 12px 24px -12px rgba(0,0,0,0.15);
  cursor: pointer;
  isolation: isolate;
}
.battle-card:hover {
  transform: translateY(-6px) scale(1.02);
}

/* 稀有度徽章 */
.bc-tier {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.bc-tier-icon { font-size: 11px; }

/* 卡面头像区 */
.bc-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  margin: 4px auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  position: relative;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  box-shadow:
    inset 0 2px 4px rgba(0,0,0,0.04),
    0 4px 12px -4px rgba(0,0,0,0.12);
}
.bc-avatar-glyph {
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.1));
}

/* 卡名 */
.bc-name {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 2px;
  margin: 4px 0 8px;
  position: relative;
  z-index: 2;
}

/* 属性行 */
.bc-attr-row {
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 10px;
  position: relative;
  z-index: 2;
}
.bc-attr-name {
  font-size: 13px;
  opacity: 0.75;
  font-weight: 600;
}
.bc-attr-bonus {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  font-variant-numeric: tabular-nums;
}

/* 描述 */
.bc-desc {
  font-size: 12px;
  line-height: 1.5;
  opacity: 0.72;
  min-height: 34px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

/* 底部 */
.bc-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  opacity: 0.6;
  padding-top: 10px;
  border-top: 1px dashed currentColor;
  position: relative;
  z-index: 2;
}
.bc-id {
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: 0.5px;
}

/* 光泽（斜向反光） */
.bc-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255,255,255,0.55) 48%,
    transparent 62%
  );
  transform: translateX(-100%);
  transition: transform 0.7s ease;
  pointer-events: none;
  z-index: 1;
}
.battle-card:hover .bc-shine {
  transform: translateX(100%);
}

/* ============================================================
   五档稀有度配色（绿 / 蓝 / 紫 / 金 / 红）
   ============================================================ */

/* ---------- 绿卡：普通 ---------- */
.battle-card.card-green {
  border-color: #86efac;
  background: linear-gradient(160deg, #f0fdf4 0%, #dcfce7 100%);
  color: #065f46;
}
.battle-card.card-green .bc-tier {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(34,197,94,0.6);
}
.battle-card.card-green .bc-name { color: #065f46; }
.battle-card.card-green .bc-attr-bonus { color: #16a34a; }

/* ---------- 蓝卡：优秀 ---------- */
.battle-card.card-blue {
  border-color: #93c5fd;
  background: linear-gradient(160deg, #eff6ff 0%, #dbeafe 100%);
  color: #1e40af;
}
.battle-card.card-blue .bc-tier {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 6px -2px rgba(59,130,246,0.6);
}
.battle-card.card-blue .bc-name { color: #1e40af; }
.battle-card.card-blue .bc-attr-bonus { color: #2563eb; }

/* ---------- 紫卡：珍稀 ---------- */
.battle-card.card-purple {
  border-color: #c4b5fd;
  background: linear-gradient(160deg, #f5f3ff 0%, #ede9fe 100%);
  color: #5b21b6;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.06),
    0 12px 24px -12px rgba(139,92,246,0.4);
}
.battle-card.card-purple .bc-tier {
  background: linear-gradient(135deg, #a78bfa, #8b5cf6);
  color: #fff;
  box-shadow: 0 2px 8px -2px rgba(139,92,246,0.7);
}
.battle-card.card-purple .bc-name { color: #5b21b6; }
.battle-card.card-purple .bc-attr-bonus {
  color: #7c3aed;
  text-shadow: 0 0 12px rgba(139,92,246,0.3);
}
.battle-card.card-purple .bc-avatar {
  box-shadow:
    inset 0 2px 4px rgba(139,92,246,0.1),
    0 4px 16px -4px rgba(139,92,246,0.35);
}

/* ---------- 金卡：传说 ---------- */
.battle-card.card-gold {
  border-color: #fcd34d;
  background:
    linear-gradient(160deg, #fffbeb 0%, #fef3c7 60%, #fde68a 100%);
  color: #92400e;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.08),
    0 12px 28px -12px rgba(245,158,11,0.6);
}
.battle-card.card-gold::before {
  content: "";
  position: absolute;
  inset: -50%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(255,215,0,0.15),
    transparent,
    rgba(255,215,0,0.15),
    transparent
  );
  animation: gold-rotate 8s linear infinite;
  pointer-events: none;
  z-index: 0;
}
@keyframes gold-rotate {
  to { transform: rotate(360deg); }
}
.battle-card.card-gold .bc-tier {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: #fff;
  box-shadow: 0 2px 10px -2px rgba(245,158,11,0.8);
}
.battle-card.card-gold .bc-name { color: #92400e; }
.battle-card.card-gold .bc-attr-bonus {
  color: #d97706;
  text-shadow: 0 0 16px rgba(245,158,11,0.5);
}
.battle-card.card-gold .bc-avatar {
  background: rgba(255,255,255,0.95);
  box-shadow:
    0 0 20px rgba(251,191,36,0.5),
    inset 0 2px 4px rgba(245,158,11,0.1);
}

/* ---------- 红卡：命定（彩蛋） ---------- */
.battle-card.card-red {
  border-color: #dc2626;
  background:
    linear-gradient(160deg, #fef2f2 0%, #fee2e2 50%, #fecaca 100%);
  color: #991b1b;
  box-shadow:
    0 2px 8px rgba(0,0,0,0.1),
    0 16px 36px -12px rgba(220,38,38,0.7);
  animation: red-pulse 2.4s ease-in-out infinite alternate;
}
@keyframes red-pulse {
  from {
    box-shadow:
      0 2px 8px rgba(0,0,0,0.1),
      0 16px 36px -12px rgba(220,38,38,0.55);
  }
  to {
    box-shadow:
      0 2px 8px rgba(0,0,0,0.1),
      0 20px 44px -12px rgba(220,38,38,0.9);
  }
}
.battle-card.card-red::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 40%,
    rgba(220,38,38,0.08)
  );
  pointer-events: none;
  z-index: 0;
}
.battle-card.card-red .bc-tier {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  box-shadow: 0 2px 10px -2px rgba(220,38,38,0.9);
  animation: red-shake 0.6s ease-in-out;
}
@keyframes red-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-2px); }
  75% { transform: translateX(2px); }
}
.battle-card.card-red .bc-name {
  color: #991b1b;
  text-shadow: 0 0 12px rgba(220,38,38,0.3);
}
.battle-card.card-red .bc-attr-bonus {
  color: #dc2626;
  text-shadow: 0 0 20px rgba(220,38,38,0.6);
}
.battle-card.card-red .bc-avatar {
  background: rgba(255,255,255,0.95);
  box-shadow:
    0 0 24px rgba(220,38,38,0.5),
    inset 0 2px 4px rgba(220,38,38,0.15);
}

/* ============================================================
   空状态
   ============================================================ */
.empty-card {
  text-align: center;
  padding: 60px 20px;
}
.empty-icon {
  font-size: 56px;
  opacity: 0.4;
  margin-bottom: 12px;
}
.empty-title {
  font-size: 18px;
  font-weight: 700;
  color: #374151;
  margin: 0 0 6px;
}
.empty-desc {
  font-size: 13px;
  color: #9ca3af;
  margin: 0 0 20px;
}

/* ============================================================
   移动端
   ============================================================ */
@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .battle-card {
    padding: 14px 10px 12px;
  }
  .bc-avatar { width: 52px; height: 52px; font-size: 24px; }
  .bc-name { font-size: 16px; letter-spacing: 1px; }
  .bc-attr-bonus { font-size: 18px; }
  .bc-desc { font-size: 11px; min-height: 30px; }
}

/* ============================================================
   技能库排版微调
   ============================================================ */
.card-grid {
  display: grid;
  /* 屏幕宽时自动换行，最小 180px。手机端配合 @media 变 2 列 */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 18px;
  /* ★ 关键：让卡片居中而不是靠左 */
  justify-content: center;
  margin-top: 4px;
  margin-bottom: 8px;
}

/* 如果卡片很少（只有 1~2 张），保持等宽居中 */
@media (min-width: 561px) {
  .card-grid {
    grid-template-columns: repeat(auto-fill, 200px);
  }
}

@media (max-width: 560px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
    justify-content: stretch;
  }
}

/* ============================================================
   上线前修复样式
   ============================================================ */
.ending-card-inline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  background: #fff;
}
.ending-card-inline.card-tragic    { border-left: 4px solid #94a3b8; }
.ending-card-inline.card-ordinary  { border-left: 4px solid #3b82f6; }
.ending-card-inline.card-notable   { border-left: 4px solid #06b6d4; }
.ending-card-inline.card-wealthy   { border-left: 4px solid #f59e0b; }
.ending-card-inline.card-legendary { border-left: 4px solid #d946ef; background: #faf5ff; }

.ec-left { display: flex; align-items: center; gap: 10px; }
.ec-badge {
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 800;
  color: #fff;
}
.ec-badge.grade-tragic    { background: #94a3b8; }
.ec-badge.grade-ordinary  { background: #3b82f6; }
.ec-badge.grade-notable   { background: #06b6d4; }
.ec-badge.grade-wealthy   { background: #f59e0b; }
.ec-badge.grade-legendary { background: #d946ef; }
.ec-title { font-size: 15px; font-weight: 700; color: #1b1f2a; }

.ec-right { display: flex; align-items: center; gap: 12px; font-size: 12px; color: #6b7280; }
.ec-id { font-family: ui-monospace, Menlo, monospace; opacity: 0.7; }
.ec-reward { color: #4338ca; font-weight: 700; }
.ec-claimed { color: #9ca3af; }

/* 心性面板 */
.attr-extra {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}
.attr-extra h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: #6b7280;
}
.attr-extra-list {
  display: flex;
  gap: 16px;
}
.attr-extra-list div {
  display: flex;
  gap: 6px;
  font-size: 14px;
}
.attr-extra-list strong { color: #1b1f2a; }