/* ==========================================================================
   BF WAR TEAM · 附属战队 (RES) 页面样式
   ----------------------------------------------------------------------------
   设计原则 —— 与主队"收敛"
   · 冷色调：浅蓝底 + 钢蓝文字 + 蓝灰强调（主队用红）
   · 不使用 Caveat 手写体（主队用了，副队避免）
   · 标题字号小一档、副标更短、不做卷首语
   · 动态背景用 CSS + SVG 模拟"主宰"雷达扫描（冷蓝调）
   ========================================================================== */

:root {
  /* 冷色调（浅蓝家族） */
  --bg:        #eef4f9;  /* 主背景：淡冰蓝 */
  --bg-card:   #f6f9fc;  /* 卡片背景 */
  --bg-deep:   #0f1d2e;  /* 深色（页脚 / hero 文字区） */

  --ink:       #1a2b3d;  /* 主文字：钢蓝黑 */
  --ink-soft:  #3a5066;  /* 次文字 */
  --ink-faint: #6c8195;  /* 弱文字 */

  --rule:      rgba(26, 43, 61, 0.16);
  --rule-soft: rgba(26, 43, 61, 0.07);

  --accent:    #3d6a8a;  /* 强调蓝（钢蓝） */
  --accent-2:  #5b8fb9;  /* 次强调（亮一点） */
  --accent-3:  #93b8d4;  /* 浅蓝（光斑） */
  --gold:      #ad8b3e;  /* 主队用的金色，副队不用 */

  /* 字体（保持杂志感，不引入 Caveat） */
  --serif: "Playfair Display", "Noto Serif SC", "Times New Roman", Georgia, serif;
  --sans:  "Inter", -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;

  --container: 1120px;
  --gap: clamp(20px, 3vw, 48px);
  --section-pad: clamp(56px, 8vw, 112px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

::selection {
  background: var(--accent);
  color: var(--bg);
}

.res-container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 56px);
}

/* ==========================================================================
   HERO · 顶部 banner（含动态主宰背景）
   ========================================================================== */

.res-hero {
  position: relative;
  overflow: hidden;
  background: var(--bg-deep);
  color: var(--bg);
  padding: clamp(64px, 10vw, 120px) clamp(20px, 4vw, 56px) clamp(48px, 8vw, 96px);
  border-bottom: 1px solid var(--rule);
}

/* === 动态主宰背景（CSS + SVG 雷达扫描） === */
.res-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(91, 143, 185, 0.30), transparent 55%),
    radial-gradient(ellipse at 75% 70%, rgba(61, 106, 138, 0.22), transparent 60%),
    linear-gradient(180deg, #0a1626 0%, #0f1d2e 40%, #14283f 100%);
  z-index: 0;
}

/* SVG 雷达扫描层 */
.res-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 400' preserveAspectRatio='none'><defs><radialGradient id='rg' cx='50%25' cy='50%25' r='50%25'><stop offset='0%25' stop-color='%235b8fb9' stop-opacity='0.5'/><stop offset='100%25' stop-color='%235b8fb9' stop-opacity='0'/></radialGradient><radialGradient id='rg2' cx='20%25' cy='80%25' r='40%25'><stop offset='0%25' stop-color='%2393b8d4' stop-opacity='0.3'/><stop offset='100%25' stop-color='%2393b8d4' stop-opacity='0'/></radialGradient></defs><rect width='800' height='400' fill='url(%23rg)'/><rect width='800' height='400' fill='url(%23rg2)'/><g stroke='%235b8fb9' stroke-width='0.5' fill='none' opacity='0.25'><circle cx='400' cy='200' r='80'/><circle cx='400' cy='200' r='160'/><circle cx='400' cy='200' r='240'/></g><line x1='0' y1='200' x2='800' y2='200' stroke='%235b8fb9' stroke-width='0.5' opacity='0.15'/><line x1='400' y1='0' x2='400' y2='400' stroke='%235b8fb9' stroke-width='0.5' opacity='0.15'/></svg>");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  z-index: 1;
  opacity: 0.7;
  animation: radarSweep 18s linear infinite;
  pointer-events: none;
}

/* 扫描线扫光 */
.res-hero-scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: conic-gradient(
    from 0deg,
    transparent 0deg,
    rgba(91, 143, 185, 0.18) 12deg,
    transparent 24deg
  );
  animation: scanSpin 8s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* 战地感"数据点"（闪烁的小光） */
.res-hero-dots {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image:
    radial-gradient(circle, rgba(147, 184, 212, 0.8) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(91, 143, 185, 0.7) 1px, transparent 1.5px),
    radial-gradient(circle, rgba(147, 184, 212, 0.5) 1px, transparent 1.5px);
  background-size: 240px 180px, 360px 240px, 180px 120px;
  background-position: 20% 30%, 70% 60%, 50% 80%;
  opacity: 0.5;
  pointer-events: none;
}

@keyframes scanSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes radarSweep {
  0%, 100% { opacity: 0.6; }
  50%      { opacity: 0.85; }
}

.res-hero-inner {
  position: relative;
  z-index: 5;
  max-width: 880px;
  margin: 0 auto;
  text-align: center;
}

.res-hero-kicker {
  display: inline-block;
  margin: 0 0 16px;
  padding: 6px 14px;
  border: 1px solid rgba(147, 184, 212, 0.35);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-3);
  background: rgba(15, 29, 46, 0.4);
  backdrop-filter: blur(6px);
}

.res-hero-title {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(40px, 6.4vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--bg);
}

.res-hero-title .res-accent {
  color: var(--accent-3);
  font-style: italic;
}

.res-hero-deck {
  margin: 0 auto;
  max-width: 640px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 1.6vw, 20px);
  line-height: 1.5;
  color: rgba(238, 244, 249, 0.85);
}

/* 分割指示条（4 部分导航） */
.res-parts-bar {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 32px 0 0;
  flex-wrap: wrap;
}

.res-parts-bar a {
  display: inline-block;
  padding: 6px 14px;
  border: 1px solid rgba(147, 184, 212, 0.3);
  border-radius: 999px;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: rgba(238, 244, 249, 0.75);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.res-parts-bar a:hover {
  background: rgba(147, 184, 212, 0.12);
  color: var(--bg);
  border-color: var(--accent-3);
}

/* ==========================================================================
   DIVIDER · 扉页 → Part One 过渡图
   ========================================================================== */

.res-divider {
  margin: 0;
  padding: 0;
  background: var(--bg-deep);
  position: relative;
  overflow: hidden;
}

.res-divider img {
  display: block;
  width: 100%;
  height: clamp(280px, 56vh, 640px);
  object-fit: cover;
  object-position: center 40%;
  filter: saturate(0.92) contrast(1.03);
}

/* 顶 / 底渐变，与上下的 hero（深色）和 Part One（浅色）柔和过渡 */
.res-divider::before,
.res-divider::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 80px;
  pointer-events: none;
  z-index: 1;
}
.res-divider::before {
  top: 0;
  background: linear-gradient(to bottom, rgba(15, 29, 46, 0.55), transparent);
}
.res-divider::after {
  bottom: 0;
  background: linear-gradient(to top, rgba(238, 244, 249, 0.45), transparent);
}

.res-divider-cap {
  position: absolute;
  right: 24px;
  bottom: 18px;
  z-index: 2;
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  color: rgba(238, 244, 249, 0.78);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

@media (max-width: 720px) {
  .res-divider img { height: clamp(220px, 44vh, 420px); }
  .res-divider-cap { right: 16px; bottom: 12px; font-size: 11px; }
}

/* ==========================================================================
   PART HEADERS（part one / two / three / four 通用头）
   ========================================================================== */

.res-part {
  padding: var(--section-pad) 0;
  border-bottom: 1px solid var(--rule-soft);
  position: relative;
}

.res-part:nth-child(even) {
  background: var(--bg-card);
}

.res-part-header {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 14px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}

.res-part-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(24px, 3vw, 34px);
  color: var(--accent);
  letter-spacing: -0.02em;
}

.res-part-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.res-part-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.res-part-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.res-part-headline {
  margin: 0 auto 28px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(28px, 4.2vw, 48px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  max-width: 820px;
}

.res-part-deck {
  margin: 0 auto 56px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 680px;
  text-align: center;
}

/* ==========================================================================
   PART ONE · 由来
   ========================================================================== */

.res-origin-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}

@media (max-width: 720px) {
  .res-origin-grid { grid-template-columns: 1fr; }
}

.res-origin-side {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink-soft);
  padding-right: 24px;
  border-right: 1px solid var(--rule);
}

@media (max-width: 720px) {
  .res-origin-side {
    border-right: none;
    border-bottom: 1px solid var(--rule);
    padding-right: 0;
    padding-bottom: 20px;
  }
}

.res-origin-side .res-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: rgba(61, 106, 138, 0.1);
  border: 1px solid rgba(61, 106, 138, 0.25);
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}

.res-origin-body p {
  margin: 0 0 18px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.res-origin-body p strong {
  color: var(--accent);
  font-weight: 700;
}

/* 队训（英文引言，独立盒子） */
.res-motto {
  margin: 48px auto 0;
  max-width: 760px;
  padding: 36px 44px;
  border: 1px solid var(--rule);
  background: var(--bg-card);
  text-align: center;
  position: relative;
}

.res-motto::before,
.res-motto::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  border: 2px solid var(--accent);
  opacity: 0.45;
}

.res-motto::before {
  top: 12px;
  left: 12px;
  border-right: none;
  border-bottom: none;
}

.res-motto::after {
  bottom: 12px;
  right: 12px;
  border-left: none;
  border-top: none;
}

.res-motto-label {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
}

.res-motto-text {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.4;
  color: var(--ink);
  letter-spacing: 0.02em;
}

/* 中文引言（用户给的那段） */
.res-quote {
  margin: 48px auto 0;
  max-width: 720px;
  padding: 28px 36px;
  border-left: 3px solid var(--accent);
  background: rgba(61, 106, 138, 0.05);
}

.res-quote p {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.75;
  color: var(--ink);
  text-align: justify;
}

.res-quote-sign {
  display: block;
  margin-top: 14px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ==========================================================================
   PART TWO · 称号墙
   ========================================================================== */

.res-titles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.res-title-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 22px 22px;
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 10px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.res-title-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(26, 43, 61, 0.08);
}

/* 空占位卡片（等待 user 填入）。虚线边框 + 斜体名字 + 略淡，避免与正式卡混淆 */
.res-title-empty {
  border-style: dashed;
  background: repeating-linear-gradient(
    -45deg,
    rgba(61, 106, 138, 0.025) 0,
    rgba(61, 106, 138, 0.025) 6px,
    transparent 6px,
    transparent 14px
  );
}
.res-title-empty .res-title-name {
  font-style: italic;
  color: var(--ink-faint);
  font-weight: 600;
  font-size: 18px;
}

.res-title-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(61, 106, 138, 0.12);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  align-self: flex-start;
}

.res-title-name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: 22px;
  line-height: 1.2;
  color: var(--ink);
}

.res-title-line {
  margin: 0;
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}

.res-title-region {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px dashed var(--rule);
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
}

.res-title-region strong {
  color: var(--ink-soft);
  font-weight: 600;
}

/* ==========================================================================
   PART THREE · 全体成员 + 致谢
   ========================================================================== */

.res-roster {
  margin: 0 auto;
  max-width: 980px;
}

.res-roster-grid {
  /* 两排纵列：CSS columns 自上而下填左列、再填右列（column-major） */
  list-style: none;
  padding: 0;
  border-top: 1px solid var(--rule);
  max-width: 760px;
  margin: 0 auto;
  column-count: 2;
  column-gap: 0;
}

.res-roster-grid li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  border-right: 1px solid rgba(26, 43, 61, 0.22);
  font-size: 14.5px;
  transition: background 0.2s ease;
  /* 防止在列中间断开（CSS columns 可能跨列断行） */
  break-inside: avoid;
  page-break-inside: avoid;
  -webkit-column-break-inside: avoid;
  min-width: 0;
}

.res-roster-grid li:hover {
  background: rgba(61, 106, 138, 0.06);
}

.res-roster-grid .r-name {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  /* 名字必须单行 — 不够宽就加 … */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.res-roster-grid .r-role {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  text-align: right;
  /* 角色标签必须单行，永远保持原始宽度（不被压缩） */
  white-space: nowrap;
  flex: 0 0 auto;
}

.res-thanks {
  margin: 64px auto 0;
  max-width: 720px;
  padding: 36px 40px;
  background: var(--bg-card);
  border: 1px solid var(--rule);
  text-align: center;
}

.res-thanks-label {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
}

.res-thanks p {
  margin: 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.7vw, 20px);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* ==========================================================================
   PART FOUR · 卷尾语
   ========================================================================== */

/* 用 .res-part.res-closing 提升 specificity (0,2,0)，
   否则会被前面的 .res-part:nth-child(even) (0,2,0 同分但先出现) 抢走 background */
.res-part.res-closing {
  background: var(--bg-deep);
  color: var(--bg);
  text-align: center;
  padding: clamp(64px, 10vw, 120px) clamp(20px, 4vw, 56px);
  position: relative;
  overflow: hidden;
  border-bottom: none;
}

.res-closing-inner {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
}

.res-part.res-closing::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(91, 143, 185, 0.18), transparent 70%);
  pointer-events: none;
}

.res-closing-label {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent-3);
}

.res-closing-title {
  margin: 0 0 28px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.res-closing-text {
  margin: 0 auto 36px;
  max-width: 600px;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.6;
  color: rgba(238, 244, 249, 0.85);
}

.res-closing-sign {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 18px;
  border: 1px solid rgba(147, 184, 212, 0.4);
  border-radius: 999px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.06em;
  color: var(--accent-3);
}

/* ==========================================================================
   BACK LINK
   ========================================================================== */

.res-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 24px 0 0;
  padding: 10px 20px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.res-back:hover {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ==========================================================================
   MOBILE FIXES
   ========================================================================== */

@media (max-width: 720px) {
  .res-hero { padding-top: 56px; padding-bottom: 40px; }
  .res-hero-dots { display: none; }
  .res-parts-bar { gap: 6px; }
  .res-parts-bar a { font-size: 10.5px; padding: 5px 10px; }
  .res-motto { padding: 24px 20px; }
  .res-quote { padding: 20px 22px; }
  .res-thanks { padding: 24px 22px; }
  .res-titles-grid { grid-template-columns: 1fr; }
  .res-roster-grid { column-count: 2; }
  .res-roster-grid li { border-right: 1px solid var(--rule); }
}

/* 窄屏手机（iPhone 标准宽度 390–430px）：名字装不下 2 列。
   降到 1 列 + 缩小字号 + 减 padding，让长名（BF｜RES 宗初爱莉希雅）
   在一行内显现。 */
@media (max-width: 520px) {
  .res-roster-grid { column-count: 1; max-width: 100%; }
  .res-roster-grid li {
    padding: 12px 14px;
    font-size: 13.5px;
    border-right: none !important;
  }
  .res-roster-grid .r-name { font-size: 13.5px; }
  .res-roster-grid .r-role { font-size: 10.5px; letter-spacing: 0.06em; }
}

/* 入场动画：已禁——所有元素默认可见，避免截图/无JS/快速滚动时空白。
   hover 效果保留（见 .res-title-card:hover 上面）。 */

/* Easing */
:root {
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}