/* 首页主题色与字体。调整全站底色、文字色时从这里入手。 */
:root {
  color-scheme: dark;
  --ink: #181614;
  --panel: #201c18;
  --parchment: #f5ebd7;
  --muted: #bcad9c;
  --ember: #e58868;
  --line: #3d342d;
  --sans: system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", STSong, SimSun, serif;
  font: 16px/1.7 var(--sans);
  color: var(--parchment);
  background: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p, figure, ol, dl, dd { margin: 0; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid #ffab84; outline-offset: 5px; }
.wrap { width: min(1240px, 100% - 112px); margin-inline: auto; }
.skip { position: fixed; z-index: 10; top: 10px; left: 10px; padding: 8px 18px; background: var(--ink); transform: translateY(-160%); }
.skip:focus { transform: none; }
.opening { position: relative; isolation: isolate; }
/* 首屏由图片与多层渐变叠加。换图时同步查看下方手机样式中的图片路径。 */
.opening::before {
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: 720px;
  background:
    linear-gradient(0deg, var(--ink), transparent 31%),
    linear-gradient(90deg, #181614cf 0%, #1816148c 37%, transparent 66%),
    linear-gradient(180deg, #13110f9c 0%, transparent 27%),
    url("./assets/jinghong-hero.png") 75% top / cover no-repeat,
    radial-gradient(ellipse at 76% 36%, #5d3529, var(--ink) 70%);
  content: "";
}
.header { min-height: 83px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid #ead3b129; }
.brand { display: inline-flex; align-items: center; gap: 11px; flex: 0 0 auto; }
.brand span { display: grid; gap: 3px; line-height: 1.15; }
.brand strong { font: 700 20px/1.1 var(--serif); letter-spacing: .12em; max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand small { font-size: 10px; letter-spacing: .13em; color: #c0aa96; }
.header nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px clamp(12px, 2.5vw, 36px); color: #e1d1bd; font-size: 14px; }
.header nav a { white-space: nowrap; }
.header nav a:hover, .chapter-links a:hover, .back-top:hover { color: var(--ember); }
.admin-link { padding: 8px 14px; border: 1px solid #e4b39b73; font-size: 13px; white-space: nowrap; }
.admin-link span { color: var(--ember); margin-left: 6px; }
.admin-link:hover { background: #e5886817; }
.hero { min-height: 570px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; position: relative; padding-block: 54px 88px; }
.hero-content { width: 100%; max-width: 565px; }
.eyebrow { display: flex; align-items: center; gap: 10px; font-size: 11px; font-weight: 700; letter-spacing: .18em; color: #e59d83; }
.eyebrow span { display: inline-block; width: 9px; height: 9px; background: #bc543c; transform: rotate(45deg); margin: 0 3px; }
.eyebrow b { font-weight: 400; color: #a48675; }
.hero h1 { font: 800 clamp(65px, 8.6vw, 124px)/1.16 var(--serif); letter-spacing: .07em; margin: 17px -.07em 9px 0; text-shadow: 0 4px 30px #140d0966; overflow-wrap: anywhere; }
.hero h1.long-name { font-size: clamp(40px, 5.5vw, 72px); }
.hero-motto { font: 700 clamp(20px, 2.65vw, 34px)/1.5 var(--serif); color: #e6bc9e; letter-spacing: .11em; overflow-wrap: anywhere; }
.hero-description { color: #ddcfbf; max-width: 385px; margin-top: 22px; font-size: 15px; line-height: 1.9; }
.hero-caption { position: absolute; bottom: 17px; font-size: 11px; letter-spacing: .1em; color: #ccb7a3; }
.hero-caption i, .map figcaption i { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: #d06b50; margin-right: 6px; vertical-align: 2px; }
/* 首屏下方的快捷导航和正文章节布局。 */
.chapter-bar { border-block: 1px solid var(--line); background: #211b17b3; }
.chapter-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.35fr) repeat(3, minmax(0, 1fr)); }
.chapter-links a { display: flex; align-items: center; gap: clamp(7px, 1vw, 15px); min-height: 72px; padding-inline: clamp(10px, 1.4vw, 24px); border-inline-start: 1px solid var(--line); }
.chapter-links a:last-child { border-inline-end: 1px solid var(--line); }
.chapter-links a > span:first-child { font: 600 11px/1 ui-monospace, monospace; color: #e28c70; }
.chapter-links a > span:last-child { margin-left: auto; color: #c18e7b; }
.chapter-links strong { font-size: 14px; letter-spacing: .05em; }
.section { padding-block: 94px; }
.section h2 { font: 750 clamp(31px, 4.2vw, 52px)/1.25 var(--serif); letter-spacing: .08em; margin: 12px 0 16px; }
.alliance, .history, .charter { display: grid; grid-template-columns: 1fr 1.2fr; align-items: center; gap: clamp(32px, 7vw, 105px); }
.section-lede { font-size: 17px; color: #e9d3bb; margin-bottom: 8px; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.9; max-width: 440px; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.facts dt { font-size: 12px; color: var(--muted); }
.facts dd { font-size: 15px; color: var(--parchment); margin-top: 3px; overflow-wrap: anywhere; }
.map { border: 1px solid #554538; padding: 6px; background: #201c18; }
.map img { width: 100%; height: auto; background: #201b19; }
.map figcaption { display: flex; justify-content: space-between; padding: 8px 8px 4px; color: #b8a592; font-size: 11px; letter-spacing: .12em; }
.alliance-visual { min-width: 0; }
/* 同盟介绍、通知、历程、分团和活动共用相册样式，列数随容器宽度调整。 */
.site-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
.site-gallery figure { min-width: 0; border: 1px solid #554538; padding: 6px; background: #201c18; }
.site-gallery a { display: block; }
.site-gallery img { width: 100%; max-height: 420px; object-fit: contain; background: #181614; }
.site-gallery figcaption { padding: 6px 4px 2px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
/* 同盟介绍每次显示一张图，保持展示区域高度，左右切换时说明位于图下。 */
#alliance-gallery { grid-template-columns: minmax(0, 1fr); }
.alliance-slide-media {
  position: relative;
  aspect-ratio: 10 / 7;
  max-height: 420px;
  background: var(--ink);
}
.alliance-slide-media > a { position: absolute; inset: 0; }
.alliance-slide-media img { height: 100%; }
.alliance-gallery-controls {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: clamp(6px, 2.6vw, 16px);
  pointer-events: none;
}
.alliance-gallery-controls button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #e4b39b80;
  border-radius: 50%;
  background: #201c18e8;
  color: var(--parchment);
  font: 22px/1 var(--sans);
  cursor: pointer;
  pointer-events: auto;
}
.alliance-gallery-controls button:hover {
  border-color: #e4b39b;
  background: #36271f;
}
.alliance-gallery-controls button:focus-visible { outline-offset: 2px; }
.alliance-slide figcaption { padding: 8px 6px 4px; white-space: pre-wrap; }
.entry-gallery { margin-top: 12px; }
/* 章节使用不同的渐变和菱形分隔。活动栏目另有淡化的战场背景。 */
.chapter-section { position: relative; isolation: isolate; border-top: 1px solid #a3775544; }
.chapter-section::after {
  content: "";
  position: absolute;
  z-index: 1;
  top: -5px;
  left: calc(50% - 4px);
  width: 8px;
  height: 8px;
  transform: rotate(45deg);
  border: 1px solid #a87659;
  background: #271e18;
  box-shadow: 0 0 0 4px var(--ink);
  pointer-events: none;
}
#notices { background: radial-gradient(ellipse at 24% 0%, #65392d65, transparent 72%), linear-gradient(145deg, #251c18, #1b1815); }
#history { background: radial-gradient(ellipse at 14% 0%, #5533297d, transparent 70%), linear-gradient(140deg, #241c18, #1b1815); }
#charter { background: radial-gradient(ellipse at 83% 100%, #4332286b, transparent 72%), linear-gradient(170deg, #211b17, #191715); }
#groups {
  background:
    linear-gradient(0deg, #1b1714, transparent 100%),
    repeating-linear-gradient(0deg, #d3a57e09 0 1px, transparent 1px 38px),
    repeating-linear-gradient(90deg, #d3a57e09 0 1px, transparent 1px 38px),
    radial-gradient(ellipse at 45% 0%, #4c3428, #241d18 79%);
}
#events { background: linear-gradient(115deg, #211b17, #1b1714); }
#events::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 auto auto 0;
  width: min(740px, 82%);
  height: min(100%, 430px);
  opacity: .29;
  background: linear-gradient(90deg, #1b1714a8, #1b1714 98%), linear-gradient(0deg, #1b1714, transparent 67%), url("./assets/battlefield.jpg") 63% 62% / cover;
  pointer-events: none;
}
.history, .charter { align-items: start; }
.timeline { list-style: none; padding: 0; border-top: 1px solid var(--line); }
.timeline > li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 17px; padding: 17px 0; border-bottom: 1px solid var(--line); }
.entry-number { color: #e28c70; font: 600 12px/1 ui-monospace, monospace; }
.timeline h3 { font-size: 17px; margin-bottom: 3px; overflow-wrap: anywhere; }
.timeline p, .group-card p { color: var(--muted); font-size: 14px; }
.timeline .entry-date { color: #d6a68f; font-size: 12px; margin-bottom: 5px; overflow-wrap: anywhere; }
.empty-entry { color: var(--muted); font-size: 14px; border: 1px solid var(--line); padding: 16px 18px; background: #18161478; }
/* 多套阵容在通知内部预览，展开更多卡片也不会持续拉长整页。 */
.notice-lineups { min-width: 0; margin-top: 16px; }
.lineup-preview-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; margin-bottom: 5px; }
.lineup-preview-heading h4 { margin: 0; font: 700 18px/1.4 var(--serif); color: #f2dac2; }
.lineup-count { color: #d6aa8b; font-size: 14px; }
.timeline .lineup-scroll-hint { margin: 0 0 10px; font-size: 14px; line-height: 1.6; }
.lineup-scroll {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  max-height: min(40rem, 75vh);
  overflow-y: scroll;
  overscroll-behavior-y: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #a87659 var(--panel);
  scrollbar-width: thin;
  padding: 2px 5px 2px 2px;
}
.lineup-scroll:focus-visible { outline: 2px solid #e28c70; outline-offset: 2px; }
.lineup-scroll::-webkit-scrollbar { width: 8px; }
.lineup-scroll::-webkit-scrollbar-track { background: var(--panel); }
.lineup-scroll::-webkit-scrollbar-thumb { border: 2px solid var(--panel); border-radius: 8px; background: #a87659; }
.lineup-panel {
  container-type: inline-size;
  margin-top: 16px;
  padding: clamp(10px, 2vw, 16px);
  border: 1px solid #654b3a;
  background: linear-gradient(160deg, #30231d, #1c1815 65%);
}
.lineup-scroll > .lineup-panel { min-width: 0; margin-top: 0; }
/* 标题和布阵在窄屏自动换行，长阵型名称也不会撑宽武将卡。 */
.lineup-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 11px; }
.lineup-group > .lineup-header { margin-bottom: 0; padding: 0; }
.lineup-group[open] > .lineup-header { margin-bottom: 11px; }
.lineup-title { min-width: 0; flex: 1 1 6em; margin: 0; font: 700 18px/1.4 var(--serif); color: #f2dac2; overflow-wrap: anywhere; }
.lineup-group > .lineup-header > .toggle { flex: 0 0 12px; margin-left: 0; }
.lineup-header .lineup-formation {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid #85563e;
  background: linear-gradient(120deg, #482920, #2d211b);
  color: #f1c28e;
  font-size: 16px;
  overflow-wrap: anywhere;
}
.lineup-formation-label { flex-shrink: 0; color: #d6aa8b; font-size: 14px; }
.lineup-formation strong { min-width: 0; font-weight: 700; }
.lineup-grid, .lineup-details { list-style: none; margin: 0; padding: 0; }
.lineup-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 10px; }
.lineup-card { min-width: 0; border: 1px solid #604937; background: var(--panel); }
.lineup-portrait {
  aspect-ratio: 4 / 5;
  display: grid;
  place-items: center;
  position: relative;
  border-bottom: 1px solid #604937;
  background: radial-gradient(ellipse at top, #4b3026, #211a16 78%);
}
.lineup-portrait a { position: absolute; inset: 0; }
.lineup-portrait img { width: 100%; height: 100%; object-fit: contain; }
.lineup-portrait-fallback { color: #baa495; font-size: 12px; }
.lineup-card-body { padding: 9px; overflow-wrap: anywhere; }
.lineup-general { margin: 0 0 8px; font: 700 18px/1.35 var(--serif); text-align: center; }
.lineup-details { display: grid; gap: 4px; }
.lineup-detail-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  min-height: 36px;
  gap: 2px 6px;
  padding: 5px 7px;
  font-size: 13px;
  font-weight: 700;
}
.lineup-details li > div { border: 1px solid var(--line); background: #241d18; }
.lineup-details .lineup-innate > * { border-color: #7b5140; background: #39271f; }
.lineup-detail-label { font-size: 11px; color: #d7ad93; font-weight: 600; }
.lineup-detail-heading .toggle { width: 10px; height: 10px; flex-basis: 10px; }
.lineup-details .lineup-description { padding: 0 7px 7px; font-size: 12px; }
.lineup-card-body .lineup-books-label { margin: 9px 0 4px; color: #e3bf9d; font-size: 12px; font-weight: 700; }
.lineup-books .lineup-detail-heading { min-height: 32px; font-weight: 550; }
@container (max-width: 360px) {
  .lineup-grid { grid-template-columns: 1fr; }
  .lineup-portrait { aspect-ratio: 3 / 2; max-height: 220px; }
}
/* 各团卡片按屏幕宽度换行，成员名单在各自卡片内展开。 */
.group-cards { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; gap: 18px; }
.group-card {
  min-width: 0;
  border: 1px solid #76544085;
  border-top-color: #a16e4f;
  background: linear-gradient(155deg, #2b211b, #1d1916 75%);
  padding: clamp(16px, 2.15vw, 26px);
}
.group-card:only-child { max-width: 760px; }
.group-card h3 { font: 700 22px/1.4 var(--serif); margin-bottom: 7px; overflow-wrap: anywhere; }
.group-card .site-gallery { grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr)); }
.group-card .site-gallery img { max-height: 300px; }
.group-roster { margin-top: 16px; }
.group-roster summary { min-height: 46px; padding: 10px 13px; font-size: 14px; }
.roster-count { font-weight: 400; font-size: 12px; color: #d6a68f; }
/* 名单超过高度上限后在卡片内滚动，调整 max-height 可改变可见范围。 */
.roster-members {
  max-height: min(18rem, 45vh);
  overflow-y: auto;
  scrollbar-color: #a87659 var(--panel);
  scrollbar-width: thin;
  list-style: none;
  margin: 0;
  padding: 0 13px;
}
.roster-members:focus-visible { outline-offset: -2px; }
.roster-members li { border-top: 1px solid var(--line); padding-block: 10px; overflow-wrap: anywhere; }
.roster-members strong { font-size: 14px; color: #f1dec7; }
.member-redness { margin-inline-start: 8px; font-size: 12px; color: var(--ember); }
.roster-members p { margin-top: 3px; }
.roster-empty { border-top: 1px solid var(--line); padding: 10px 13px; }
#groups-empty { margin-top: 20px; }
.charter-documents { display: grid; gap: 12px; }
details { border: 1px solid var(--line); background: var(--panel); }
summary { cursor: pointer; display: flex; align-items: center; gap: 13px; list-style: none; padding: 16px 18px; font-weight: 700; }
summary::-webkit-details-marker { display: none; }
summary:hover { color: #ffd6c4; }
.document-number { color: #e28c70; font: 600 11px/1 ui-monospace, monospace; }
.toggle { width: 14px; height: 14px; flex: 0 0 14px; position: relative; margin-left: auto; color: #df9c83; }
.toggle::before, .toggle::after { content: ""; position: absolute; top: 50%; width: 100%; border-top: 1px solid; }
.toggle::after { transform: rotate(90deg); }
details[open] .toggle::after { display: none; }
#honors { background: radial-gradient(ellipse at 68% 0%, #623e295c, transparent 70%), #1e1916; }
.honor-seasons { display: grid; gap: 14px; margin-top: 24px; }
.honor-seasons:empty { margin-bottom: 0; }
.honor-season > summary { color: var(--parchment); overflow-wrap: anywhere; }
.honor-season-body { display: grid; gap: 14px; padding: clamp(12px, 2vw, 22px); border-top: 1px solid var(--line); }
.honor-grid, .honor-hall-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.honor-hall { margin-top: 32px; }
.honor-hall > h3 { margin-bottom: 12px; font-family: var(--serif); }
.honor-hall-list, .honor-ranks { list-style: none; margin: 0; padding: 0; }
.honor-card { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); background: #211b16; overflow-wrap: anywhere; }
.honor-card > :is(h3, h4) { margin-bottom: 6px; }
.honor-card p { color: var(--muted); font-size: 14px; }
.honor-hall-season { margin-bottom: 6px; }
.honor-ranks li { display: grid; grid-template-columns: 58px minmax(0, 1fr); align-items: baseline; gap: 8px; padding: 9px 0; border-top: 1px solid var(--line); }
.honor-rank { color: #e4ac85; font-size: 13px; font-weight: 700; }
.document-body { padding: 0 18px 19px 44px; color: var(--muted); font-size: 14px; }
.footer { border-top: 1px solid var(--line); background: #151311; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-block: 25px; }
.back-top { font-size: 12px; color: var(--muted); white-space: nowrap; }
.back-top span { margin-left: 4px; color: var(--ember); }
@media (max-width: 850px) {
  .wrap { width: calc(100% - 60px); }
  .header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding-top: 12px; }
  .header nav { grid-row: 2; grid-column: 1 / -1; justify-content: space-between; padding-block: 12px; }
  .admin-link { grid-row: 1; grid-column: 2; }
  .hero { min-height: 545px; }
  .opening::before { height: 680px; background-position: 0 0, 0 0, 0 0, 61% 42%, 0 0; }
  .chapter-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chapter-links a { min-height: 52px; }
  .chapter-links a:nth-child(3n) { border-inline-end: 1px solid var(--line); }
  .chapter-links a:nth-child(n+4) { border-block-start: 1px solid var(--line); }
  .chapter-links a:last-child { grid-column: 1 / -1; }
  .section { padding-block: 66px; }
  .alliance, .history, .charter { gap: 30px; }
}
/* 手机端重新安排导航和首屏裁切，替换背景文件名时同步修改此处。 */
@media (max-width: 640px) {
  .wrap { width: calc(100% - 36px); }
  .header nav { font-size: 12px; gap: 4px 8px; }
  .header nav a { padding-block: 3px; }
  .brand img { width: 37px; height: 37px; }
  .hero { min-height: 510px; padding-block: 90px 66px; }
  .opening::before { height: 600px; background-image: linear-gradient(0deg, var(--ink), #18161438 71%), linear-gradient(90deg, #181614db, #1816145c 100%), linear-gradient(180deg, #13110f9c, transparent 28%), url("./assets/jinghong-hero.png"), radial-gradient(ellipse at 76% 36%, #5d3529, var(--ink) 70%); background-position: 0 0, 0 0, 0 0, 84% top, 0 0; background-size: auto, auto, auto, cover, auto; }
  .hero h1 { font-size: clamp(49px, 12.1vw, 77px); }
  .hero-description { max-width: 330px; }
  .chapter-links { width: 100%; }
  .chapter-links a { min-height: 62px; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 6px; padding-inline: 3px; }
  .chapter-links strong { font-size: 11px; letter-spacing: 0; }
  .chapter-links a > span:last-child { display: none; }
  .chapter-links a:nth-child(3n+1) { border-inline-start: 0; }
  .chapter-links a:nth-child(3n) { border-inline-end: 0; }
  .alliance, .history, .charter { grid-template-columns: 1fr; }
  .section { padding-block: 56px; }
  .footer-inner { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
