:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft JhengHei", sans-serif;
  background: #131716;
  color: #f0ecdf;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% 16%, #758b7530, transparent 48%),
    radial-gradient(ellipse at 82% 72%, #b99a5720, transparent 38%),
    #131716;
}

.library-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0 52px;
}

.top-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 32px;
}

.eyebrow {
  margin: 0 0 6px;
  color: #d7b875;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
}

h1 {
  margin: 0;
  font-family: "Noto Serif TC", "Microsoft JhengHei", serif;
  font-size: clamp(32px, 6vw, 46px);
}

.intro {
  margin: 9px 0 0;
  color: #b5b8af;
  line-height: 1.7;
}

.page-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-links a {
  padding: 9px 13px;
  border: 1px solid #d7b87566;
  border-radius: 999px;
  color: #e3c77f;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.page-links a:hover {
  background: #d7b87516;
  border-color: #d7b875;
}

a:focus-visible {
  outline: 2px solid #e3c77f;
  outline-offset: 3px;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
}

.section-heading p {
  margin: 0;
  color: #aeb4a8;
  font-size: 13px;
}

.guide-section,
.ability-guide {
  margin-bottom: 26px;
}

.guide-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.guide-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid #aeb9ad30;
  border-radius: 12px;
  background: #d7e5d408;
  box-shadow: inset 0 1px 0 #ffffff0b;
}

.step-number {
  color: #d7b875;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.guide-card h3 {
  margin: 8px 0 6px;
  font-size: 16px;
}

.guide-card p {
  margin: 0;
  color: #c4c8bd;
  font-size: 13px;
  line-height: 1.7;
}

.ability-guide {
  padding: 18px;
  border: 1px solid #d7b87542;
  border-radius: 12px;
  background: #d7b8750b;
}

.ability-guide h2 {
  margin: 0 0 12px;
  font-size: 17px;
}

.ability-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.ability-details p {
  display: grid;
  align-content: start;
  gap: 4px;
  margin: 0;
  color: #c4c8bd;
  font-size: 13px;
  line-height: 1.6;
}

.ability-details strong {
  color: #e3c77f;
}

.prototype-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #aeb9ad24;
  color: #aeb4a8;
  font-size: 12px;
  line-height: 1.7;
}

.library-section { scroll-margin-top: 18px; }

.character-library {
  margin-top: 14px;
}

.character-select-label {
  display: block;
  margin: 14px 0 6px;
  color: #c4c8bd;
  font-size: 13px;
  font-weight: 700;
}

.character-select {
  width: min(100%, 420px);
  padding: 11px 38px 11px 12px;
  border: 1px solid #d7b87577;
  border-radius: 9px;
  background: #18221e;
  color: #f0ecdf;
  font: inherit;
}

.character-select:focus-visible {
  outline: 2px solid #d7b875;
  outline-offset: 2px;
}

.empty-message {
  margin: 0;
  padding: 22px;
  border: 1px dashed #aeb9ad55;
  border-radius: 12px;
  color: #b5b8af;
  text-align: center;
}

.character-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid #aeb9ad30;
  border-radius: 14px;
  background: #d7e5d408;
  box-shadow: 0 12px 30px #0002, inset 0 1px 0 #ffffff0b;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: transform .16s ease, border-color .16s ease;
}

.character-card:hover {
  transform: translateY(-2px);
  border-color: #d7b87588;
}

.character-icon {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 1px solid #d7b87577;
  border-radius: 50%;
  background: #d7b87516;
  color: #f0ecdf;
  font-size: 25px;
  font-weight: 700;
}

.character-info { min-width: 0; }

.character-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.character-heading h3 {
  margin: 0;
  font-size: 18px;
}

.trait {
  color: #d7b875;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.description {
  margin: 8px 0 13px;
  color: #c4c8bd;
  font-size: 14px;
  line-height: 1.65;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin: 0;
}

.stats div {
  min-width: 0;
  padding: 7px 5px;
  border: 1px solid #aeb9ad24;
  border-radius: 8px;
  background: #ffffff06;
  text-align: center;
}

.stats dt {
  color: #aeb4a8;
  font-size: 11px;
}

.stats dd {
  margin: 4px 0 0;
  color: #f0ecdf;
  font-size: 15px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.stats .special-stat {
  grid-column: 1 / -1;
  text-align: left;
}

.special-stat dd {
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
}

.special-ability-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.special-ability-list li {
  display: grid;
  grid-template-columns: minmax(70px, 100px) minmax(0, 1fr);
  gap: 8px;
}

.special-ability-list strong {
  color: #e3c77f;
}

.special-cooldown {
  margin: 8px 0 0;
  padding-top: 7px;
  border-top: 1px solid #aeb9ad24;
  color: #d7b875;
  font-size: 12px;
  font-weight: 700;
}

.range-note {
  margin: 18px 0 0;
  color: #aeb4a8;
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 680px) {
  .library-shell {
    width: calc(100% - 24px);
    padding-top: 24px;
  }

  .top-bar {
    flex-direction: column;
    margin-bottom: 24px;
  }

  .guide-steps,
  .ability-details {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .character-card {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    padding: 13px;
  }

  .character-icon {
    width: 44px;
    height: 44px;
    font-size: 20px;
  }

  .character-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .special-ability-list li {
    grid-template-columns: 1fr;
    gap: 1px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}

:root {
  color-scheme: light;
  background: #f2faf7;
  color: #23413b;
}

body {
  background:
    radial-gradient(ellipse at 12% 8%, #c9eee466, transparent 38%),
    radial-gradient(ellipse at 92% 18%, #d7edff77, transparent 34%),
    #f2faf7;
}

h1,
.section-heading h2 {
  color: #23413b;
}

.eyebrow,
.step-number,
.ability-details strong,
.trait,
.special-ability-list strong {
  color: #278778;
}

.intro,
.section-heading p,
.guide-card p,
.ability-details p,
.prototype-note,
.character-select-label,
.range-note {
  color: #688179;
}

.page-links a {
  border-color: #9dcfbe;
  color: #278778;
  background: #ffffffb8;
}

.page-links a:hover {
  border-color: #55ab95;
  background: #e6f6ef;
}

a:focus-visible {
  outline-color: #238b7b;
}

.guide-card,
.ability-guide {
  border-color: #d3e6de;
  background: #ffffffc9;
  box-shadow: 0 5px 18px #477f6b0d;
}

.ability-guide {
  border-color: #b8dcca;
  background: linear-gradient(135deg, #f1faf5, #eaf6f2);
}

.prototype-note,
.special-cooldown {
  border-color: #d7e8e0;
}

.character-select {
  border-color: #a9d2c3;
  background: #ffffff;
  color: #294941;
  box-shadow: 0 3px 10px #477f6b0d;
}

.character-select:focus-visible {
  outline-color: #238b7b;
}

.empty-message {
  border-color: #b7d8cc;
  color: #668078;
}

.character-card {
  border-color: #d1e5dc;
  background: #ffffff;
  box-shadow: 0 10px 28px #477f6b14;
}

.character-card:hover {
  border-color: #88c7b3;
}

.character-icon {
  border-color: #9acfbf;
  background: #e8f7f0;
  color: #278778;
}

.description {
  color: #688179;
}

.stats div {
  border-color: #e0ece6;
  background: #f7fbf9;
}

.stats dt {
  color: #71877e;
}

.stats dd {
  color: #294941;
}

.special-cooldown {
  color: #278778;
}


/* 新增戰鬥機制說明版面 */
.battlefield-guide{margin:0 0 26px;padding:20px;border:1px solid #b8dcca;border-radius:16px;background:linear-gradient(135deg,#f1faf5,#ffffff);box-shadow:0 6px 20px #477f6b0d}
.direction-cards{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.direction-cards article{padding:15px;border:1px solid #d7e8e0;border-radius:12px;background:#fff}
.direction-icon{display:inline-grid;width:36px;height:36px;place-items:center;border-radius:10px;background:#e8f7f0;font-size:20px}
.direction-cards h3,.obstacle-card h3{margin:8px 0 5px;color:#294941;font-size:15px}
.direction-cards p,.obstacle-card p{margin:0;color:#688179;font-size:13px;line-height:1.7}
.direction-cards strong{color:#278778}
.obstacle-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.obstacle-card{display:grid;grid-template-columns:42px minmax(0,1fr);gap:10px;align-items:start;padding:13px;border:1px solid #d7e8e0;border-radius:12px;background:#fff}
.obstacle-card>span{display:grid;width:40px;height:40px;place-items:center;border-radius:10px;background:#f0f6f3;font-size:22px}
.obstacle-card small{display:inline-block;margin-top:6px;color:#278778;font-size:12px;font-weight:700}
.obstacle-card.wall>span{background:#edf0ef}
.obstacle-card.glass>span{background:#e3f6f8}
.obstacle-card.spike>span{background:#fff0ed}
.obstacle-card.grass>span{background:#eaf7e6}
@media(max-width:680px){.direction-cards{grid-template-columns:1fr}.obstacle-cards{grid-template-columns:1fr}.battlefield-guide{padding:14px}}
