/* Tierspire — 深铜绿底、羊皮纸字、黄铜点缀。唯一的「大动作」是 tier 栏:
   像 1920 年代旅馆大堂的字母指示板(The Baroness Hotel),其余一律安静。 */

:root {
  color-scheme: dark;
  --bg: #101816;
  --panel: #16211e;
  --panel-2: #1b2824;
  --line: #273632;
  --text: #e9e2cf;
  --muted: #93a098;
  --brass: #cda45e;
  --brass-soft: rgba(205, 164, 94, 0.14);
  --up: #86c497;
  --down: #e08a70;
  --t-s: #d9b264;
  --t-a: #c98457;
  --t-b: #6fa68f;
  --t-c: #7f95a8;
  --t-d: #807b74;
  --display: "Josefin Sans", "Futura", "Century Gothic", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.55 var(--body);
  font-variant-numeric: tabular-nums;
}
a {
  color: var(--text);
  text-decoration-color: rgba(205, 164, 94, 0.55);
  text-underline-offset: 3px;
}
a:hover {
  color: var(--brass);
}
:focus-visible {
  outline: 2px solid var(--brass);
  outline-offset: 2px;
  border-radius: 3px;
}
img {
  display: block;
}
h1,
h2,
h3,
h4 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}
h1 {
  font-size: clamp(2rem, 5vw, 3.1rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
  padding-top: 0.15em; /* Josefin 的字身偏上 */
}
h2 {
  font-size: 1.35rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 2.6rem 0 0.9rem;
  padding-top: 0.12em;
}
h3 {
  font-size: 1.02rem;
  letter-spacing: 0.03em;
}
p {
  margin: 0 0 0.9rem;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.sr-only,
.skip:not(:focus) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.skip:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10;
  background: var(--panel);
  padding: 8px 12px;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ── 页头、页脚 ─────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--line);
  background: rgba(16, 24, 22, 0.92);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(6px);
}
.bar {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 56px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.logo .mark {
  flex: none;
}
.logo span {
  padding-top: 0.18em; /* Josefin 字身偏上,和标志对齐 */
}
.logo b {
  color: var(--brass);
  font-weight: inherit;
}
header.site nav {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-left: auto;
}
header.site nav a {
  padding: 8px 10px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  white-space: nowrap;
  border-radius: var(--r);
}
header.site nav a:hover,
header.site nav a[aria-current="page"] {
  color: var(--text);
}
header.site nav a[aria-current="page"] {
  box-shadow: inset 0 -2px 0 var(--brass);
  border-radius: 0;
}
footer.site {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding: 2rem 0 3rem;
  color: var(--muted);
  font-size: 0.88rem;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin-bottom: 1rem;
}
.foot-links a {
  color: var(--text);
}
.fine {
  font-size: 0.8rem;
}

/* ── 页面标题区 ─────────────────────────────── */
.page-head {
  padding: 2.2rem 0 1.4rem;
  max-width: 760px;
}
.eyebrow {
  color: var(--brass);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.lede {
  font-size: 1.06rem;
  color: #d6cfbd;
  margin-top: 0.9rem;
}
.jump,
.links-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin: 1.2rem 0;
}
.links-row a::after {
  content: " →";
  color: var(--brass);
}
.callout {
  border-left: 3px solid var(--brass);
  background: var(--brass-soft);
  padding: 10px 14px;
  border-radius: 0 var(--r) var(--r) 0;
}
.summary {
  max-width: 760px;
  margin-top: 14px;
  color: #d6cfbd;
}
.note {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

/* ── 段位切换 ─────────────────────────────── */
.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 14px;
}
.seg button {
  font: inherit;
  font-size: 0.88rem;
  color: var(--muted);
  background: none;
  border: 0;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.seg button[aria-selected="true"] {
  background: var(--panel-2);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--brass);
}

/* ── tier 栏:字母指示板 ─────────────────────── */
.board {
  border: 1px solid #33302a;
  border-radius: 4px;
  background:
    repeating-linear-gradient(to bottom, rgba(0, 0, 0, 0) 0 7px, rgba(0, 0, 0, 0.22) 7px 8px),
    #1a1a17;
  padding: 6px;
  box-shadow:
    inset 0 0 0 4px #1a1a17,
    inset 0 0 0 5px rgba(205, 164, 94, 0.35);
}
.tier-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  min-height: 92px;
}
.tier-row + .tier-row {
  border-top: 1px dashed rgba(233, 226, 207, 0.12);
}
.tier-letter {
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 2.6rem;
  color: var(--tier);
  border-right: 1px solid rgba(233, 226, 207, 0.12);
}
.tier-letter span {
  padding-top: 0.12em;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}
.t-s { --tier: var(--t-s); }
.t-a { --tier: var(--t-a); }
.t-b { --tier: var(--t-b); }
.t-c { --tier: var(--t-c); }
.t-d { --tier: var(--t-d); }
.tier-heroes {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}
.tier-heroes .empty {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 26px 6px;
}
.chip {
  display: grid;
  justify-items: center;
  width: 74px;
  padding: 4px 2px 5px;
  text-decoration: none;
  border-radius: 4px;
  text-align: center;
}
.chip img {
  width: 56px;
  height: 56px;
  border-radius: 3px;
  background: #242520;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5), 0 0 0 2px color-mix(in srgb, var(--tier) 55%, transparent);
}
.chip .n {
  font-size: 0.74rem;
  line-height: 1.15;
  margin-top: 5px;
  color: var(--text);
}
.chip .wr {
  font-size: 0.7rem;
  color: var(--muted);
}
.chip:hover {
  background: rgba(233, 226, 207, 0.06);
}

/* ── 表格 ─────────────────────────────────── */
.table-toggle {
  margin-top: 14px;
}
.table-toggle > summary,
details > summary {
  cursor: pointer;
  color: var(--text);
  padding: 8px 0;
}
.table-toggle > summary {
  color: var(--brass);
}
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
th,
td {
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sortable th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.sortable th[aria-sort="descending"]::after { content: " ↓"; color: var(--brass); }
.sortable th[aria-sort="ascending"]::after { content: " ↑"; color: var(--brass); }
td:not(:first-child),
th:not(:first-child) {
  text-align: right;
}
.hero-cell,
.item-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.hero-cell img {
  width: 28px;
  height: 28px;
  border-radius: 3px;
}
.item-cell {
  white-space: normal;
  min-width: 260px;
}
.item-cell img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  flex: none;
  align-self: flex-start;
  margin-top: 2px;
}
.item-cell .desc {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  max-width: 460px;
}
table.plain td,
table.plain th {
  text-align: left;
}
.tl {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding: 0.15em 0.3em 0;
  border-radius: 3px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 0.9rem;
  color: #14120e;
  background: var(--tier, var(--line));
}
.tl.t-none {
  background: var(--line);
  color: var(--muted);
}
.dl {
  font-size: 0.85rem;
}
.dl.up { color: var(--up); }
.dl.down { color: var(--down); }
.dl.flat,
.dl.new { color: var(--muted); }
.dl.new {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
h3.cost {
  margin: 1.4rem 0 0.4rem;
  color: var(--brass);
}

/* ── 列表、分栏 ─────────────────────────────── */
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 32px;
}
.cols.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.cols h3 {
  margin-bottom: 4px;
}
.mini {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
}
.mini li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.mini a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}
.mini img {
  width: 32px;
  height: 32px;
  border-radius: 3px;
}
.prose {
  max-width: 720px;
}
.prose li {
  margin-bottom: 0.5rem;
}

.faq details {
  border-bottom: 1px solid var(--line);
  max-width: 760px;
}
.faq summary {
  font-weight: 600;
  padding: 12px 0;
}
.faq details p {
  color: #d6cfbd;
}

/* ── 英雄页 ─────────────────────────────────── */
.crumbs {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  padding-top: 1.2rem;
}
.hero-head {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  align-items: start;
  padding: 1.2rem 0 1.4rem;
}
.hero-head .card {
  width: 140px;
  height: auto;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(205, 164, 94, 0.4);
}
.statline {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.statline.wide {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.statline > div {
  padding: 12px 0;
}
.statline dt {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.statline dd {
  margin: 4px 0 0;
  font-size: 1.15rem;
}
.by-rank {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.by-rank li {
  display: grid;
  gap: 4px;
  justify-items: start;
  padding: 10px 12px;
  background: var(--panel);
  border-radius: var(--r);
  font-size: 0.9rem;
}
.by-rank .muted {
  font-size: 0.78rem;
}
.build-tier h3 {
  margin: 1.2rem 0 0.5rem;
}
.items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.items li {
  display: grid;
  grid-template-columns: 40px 1fr;
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  padding: 8px;
  background: var(--panel);
  border-radius: var(--r);
  border-left: 3px solid var(--slot);
}
.items img {
  grid-row: span 2;
  border-radius: 4px;
}
.items .n {
  font-size: 0.88rem;
  line-height: 1.2;
}
.items .m {
  font-size: 0.76rem;
  color: var(--muted);
}
.items .m b {
  color: var(--text);
  font-weight: 600;
}
.slot-weapon { --slot: #d39a4a; }
.slot-vitality { --slot: #74b06c; }
.slot-spirit { --slot: #a587d6; }
.abilities {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}
.abilities li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
}
.abilities img {
  border-radius: 6px;
  background: var(--panel-2);
}
.abilities p {
  margin: 4px 0 0;
  color: #d6cfbd;
  font-size: 0.93rem;
}
h3.sub {
  margin: 1.4rem 0 0.6rem;
}
.seq {
  list-style: none;
  padding: 0;
  margin: 0 0 0.6rem;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.seq li span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--panel);
}
.change h3 {
  margin: 1rem 0 0.4rem;
  font-family: var(--body);
  font-size: 0.95rem;
}
.change ul,
.notes {
  margin: 0;
  padding-left: 1.1rem;
  color: #d6cfbd;
  font-size: 0.93rem;
}
.notes .sec {
  list-style: none;
  margin: 0.8rem 0 0.3rem -1.1rem;
  color: var(--brass);
  font-weight: 600;
}
.hero-notes h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 1.1rem 0 0.3rem;
  font-family: var(--body);
  font-size: 0.98rem;
}
.hero-notes h4 a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.hero-notes img {
  width: 28px;
  height: 28px;
  border-radius: 3px;
}
details.patch {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
}

/* ── 英雄总览、新英雄 ─────────────────────────── */
.hgrid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}
.hcard {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 6px 10px;
  background: var(--panel);
  border-radius: var(--r);
  text-decoration: none;
  text-align: center;
}
.hcard img {
  width: 64px;
  height: 64px;
  border-radius: 4px;
}
.hcard .n {
  font-size: 0.9rem;
}
.hcard .m {
  font-size: 0.8rem;
  color: var(--muted);
}
.hcard:hover {
  background: var(--panel-2);
}
.newlist {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.nh {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 18px;
  padding: 14px;
  background: var(--panel);
  border-radius: var(--r);
}
.nh img {
  width: 120px;
  height: auto;
  border-radius: 4px;
}
.nh p {
  margin: 0.3rem 0;
}
.chips-plain {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips-plain li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 14px;
}
blockquote {
  margin: 1rem 0;
  padding: 0.6rem 1rem;
  border-left: 3px solid var(--line);
  color: #d6cfbd;
}
blockquote footer {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── 段位 ─────────────────────────────────── */
.ranks {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ranks li {
  display: grid;
  grid-template-columns: 60px 170px 1fr 64px;
  gap: 14px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.ranks .n {
  display: grid;
}
.ranks .meter {
  height: 10px;
  background: var(--panel);
  border-radius: 999px;
  overflow: hidden;
}
.ranks .meter span {
  display: block;
  height: 100%;
  background: var(--c, var(--brass));
  border-radius: 999px;
}
.ranks .v {
  text-align: right;
}

/* ── 生成器 ─────────────────────────────────── */
.maker-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.maker-bar input {
  font: inherit;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.1rem;
  text-transform: uppercase;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 6px 2px 2px;
  min-width: 0;
  flex: 1 1 260px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
button {
  font: inherit;
}
.actions button {
  font-size: 0.88rem;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 7px 12px;
  cursor: pointer;
}
.actions button.primary {
  background: var(--brass);
  color: #14120e;
  border-color: var(--brass);
  font-weight: 600;
}
.maker-board .tier-heroes {
  min-height: 84px;
}
.drop.over {
  background: rgba(205, 164, 94, 0.1);
}
.pool-h {
  font-size: 1rem;
  margin: 1.2rem 0 0.6rem;
  display: flex;
  gap: 12px;
  align-items: baseline;
  flex-wrap: wrap;
}
.pool-h .muted {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--body);
  font-weight: 400;
}
.pool {
  list-style: none;
  margin: 0;
  padding: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 90px;
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.mk-hero {
  display: grid;
  justify-items: center;
  width: 70px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--text);
  cursor: grab;
  border-radius: 4px;
  font-size: 0.72rem;
  line-height: 1.15;
}
.mk-hero img {
  width: 54px;
  height: 54px;
  border-radius: 3px;
  margin-bottom: 4px;
  pointer-events: none;
}
.mk-hero[aria-pressed="true"] {
  background: var(--brass-soft);
  box-shadow: inset 0 0 0 1px var(--brass);
}
.mk-hero.dragging {
  opacity: 0.4;
}

/* ── 窄屏 ─────────────────────────────────── */
@media (max-width: 760px) {
  .bar {
    flex-wrap: wrap;
    gap: 0;
    padding-top: 6px;
  }
  header.site nav {
    margin-left: -10px;
    width: calc(100% + 10px);
  }
  .tier-row {
    grid-template-columns: 38px 1fr;
    min-height: 80px;
  }
  .tier-letter {
    font-size: 1.9rem;
  }
  .tier-heroes {
    padding: 6px 4px;
    gap: 2px;
  }
  .chip {
    width: 56px;
    padding: 4px 0 5px;
  }
  .chip img {
    width: 44px;
    height: 44px;
  }
  .chip .n {
    font-size: 0.68rem;
  }
  .lede {
    font-size: 1rem;
  }
  .cols,
  .cols.three {
    grid-template-columns: 1fr;
  }
  /* 窄屏:卡片缩小放在标题左边,摘要占满整行 */
  .hero-head {
    grid-template-columns: 72px 1fr;
    gap: 0 14px;
  }
  .hero-head > div {
    display: contents;
  }
  .hero-head .card {
    width: 72px;
    grid-row: 1 / span 2;
  }
  .hero-head .eyebrow,
  .hero-head h1 {
    grid-column: 2;
  }
  .hero-head h1 {
    font-size: 1.7rem;
  }
  .hero-head .lede {
    grid-column: 1 / -1;
  }
  .statline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .statline.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .by-rank {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .items {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .ranks li {
    grid-template-columns: 44px 1fr 56px;
  }
  .ranks li img {
    width: 44px;
    height: auto;
  }
  .ranks .meter {
    grid-column: 2 / 4;
    grid-row: 2;
  }
  .nh {
    grid-template-columns: 80px 1fr;
  }
  .nh img {
    width: 80px;
  }
  .mk-hero {
    width: 58px;
  }
  .mk-hero img {
    width: 44px;
    height: 44px;
  }
}
@media (max-width: 420px) {
  .items {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
