/* =========================================================
 * PLAYDNF — 深渊暗色 + 鎏金主题
 * 品级配色：下载=史诗金 / 更新=稀有紫 / 维护=蓝 / 活动=神器粉
 * ========================================================= */

:root {
  color-scheme: dark;
  --ink: #0c0a08;
  --coal: #16120d;
  --coal-2: #1e1913;
  --parchment: #eae0c9;
  --parchment-dim: #9c9077;
  --gold: #c9a227;
  --gold-bright: #e8c355;
  --line: rgba(201, 162, 39, 0.16);
  --line-strong: rgba(201, 162, 39, 0.38);
  --font-display: "Palatino Linotype", Georgia, "Songti SC", "STSong", "SimSun", serif;
  --font-body: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: var(--font-body);
  line-height: 1.7;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.02em;
}

:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 3px;
}

/* ---------- 顶栏 ---------- */

.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 clamp(18px, 5vw, 72px);
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.92), rgba(12, 10, 8, 0.78));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  transition: height 180ms ease, background 180ms ease;
}

.site-header[data-compact="true"] {
  height: 56px;
  background: rgba(12, 10, 8, 0.96);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}

.brand-name {
  display: block;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.1;
}

.brand-sub {
  display: block;
  color: var(--parchment-dim);
  font-size: 11px;
  letter-spacing: 0.22em;
  line-height: 1.2;
  text-transform: uppercase;
}

.site-nav {
  gap: 8px;
}

.site-nav a,
.back-link {
  padding: 8px 0;
  color: var(--parchment-dim);
  font-size: 14px;
  border-bottom: 1px solid transparent;
  transition: color 140ms ease, border-color 140ms ease;
}

.site-nav a:hover,
.back-link:hover {
  color: var(--gold-bright);
  border-color: var(--gold-bright);
}

/* ---------- 首页 Hero ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--ink);
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transition: opacity 1400ms ease;
}

.hero-bg.is-entering {
  opacity: 0;
}

.hero-home .hero-bg {
  animation: hero-drift 26s ease-in-out infinite alternate;
}

@keyframes hero-drift {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.06);
  }
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(12, 10, 8, 0.55) 0%, rgba(12, 10, 8, 0.2) 40%, rgba(12, 10, 8, 0.96) 100%),
    linear-gradient(90deg, rgba(12, 10, 8, 0.6) 0%, rgba(12, 10, 8, 0.1) 60%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: end;
  min-height: min(78vh, 720px);
  padding: 140px clamp(18px, 6vw, 88px) 64px;
}

.hero-eyebrow {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
}

.hero-inner h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(44px, 7.5vw, 96px);
  line-height: 1.12;
}

.hero-lede {
  max-width: 560px;
  margin-bottom: 0;
  color: var(--parchment-dim);
  font-size: 16px;
}

/* ---------- 版本立牌 ---------- */

.version-band {
  padding: 72px clamp(18px, 6vw, 88px) 96px;
  border-top: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  max-width: 1240px;
  margin: 0 auto 30px;
}

.section-heading h2 {
  margin-bottom: 0;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.15;
}

.version-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  max-width: 1240px;
  margin: 0 auto;
}

.realm-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 400px;
  padding: 26px 24px 24px;
  overflow: hidden;
  background: var(--coal);
  border: 1px solid var(--line);
  opacity: 0;
  transform: translateY(14px);
  animation: card-enter 520ms ease var(--enter-delay, 0ms) forwards;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}

@keyframes card-enter {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.realm-card:hover {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong), 0 18px 44px rgba(0, 0, 0, 0.55);
}

.realm-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 25%;
  filter: saturate(0.72) brightness(0.5);
  transition: filter 260ms ease, transform 260ms ease;
}

.realm-card:hover .realm-art {
  filter: saturate(0.92) brightness(0.66);
  transform: scale(1.035);
}

.realm-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 8, 0.14) 0%, rgba(12, 10, 8, 0.42) 52%, rgba(12, 10, 8, 0.94) 100%);
}

.realm-numeral {
  position: absolute;
  top: 12px;
  left: 18px;
  z-index: 1;
  color: rgba(234, 224, 201, 0.5);
  font-family: var(--font-display);
  font-size: clamp(64px, 6.4vw, 92px);
  font-weight: 700;
  line-height: 1;
  transition: color 220ms ease;
}

.realm-numeral sup {
  margin-left: 4px;
  font-size: 0.34em;
  letter-spacing: 0.1em;
}

.realm-card:hover .realm-numeral {
  color: var(--gold-bright);
}

.realm-meta {
  position: relative;
  z-index: 1;
}

.realm-meta h3 {
  margin-bottom: 6px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.2vw, 30px);
  line-height: 1.15;
  word-break: keep-all;
}

.realm-subtitle {
  margin-bottom: 14px;
  color: var(--parchment-dim);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.realm-latest {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--parchment-dim);
  font-size: 12px;
}

.realm-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gold);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.realm-action::after {
  content: "→";
  transition: transform 180ms ease;
}

.realm-card:hover .realm-action::after {
  transform: translateX(4px);
}

/* ---------- 版本页 Hero ---------- */

.hero-version {
  min-height: 300px;
}

.hero-version .hero-inner {
  min-height: 300px;
  padding: 128px clamp(18px, 6vw, 88px) 42px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
}

.hero-version h1 {
  margin-bottom: 8px;
  font-size: clamp(40px, 6vw, 72px);
}

.hero-subtitle {
  margin-bottom: 0;
  color: var(--parchment-dim);
  font-size: 14px;
  letter-spacing: 0.14em;
}

/* ---------- 公告板 ---------- */

.board {
  padding: 44px clamp(18px, 6vw, 88px) 96px;
  border-top: 1px solid var(--line);
}

.board-inner {
  max-width: 960px;
  margin: 0 auto;
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.category-tab {
  padding: 8px 18px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--parchment-dim);
  font-size: 14px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: color 140ms ease, border-color 140ms ease, background 140ms ease;
}

.category-tab:hover {
  color: var(--parchment);
  border-color: var(--line-strong);
}

.category-tab[aria-pressed="true"] {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
  font-weight: 700;
}

.notice-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.notice-row {
  display: grid;
  grid-template-columns: 96px 64px minmax(0, 1fr) 28px;
  gap: 18px;
  align-items: center;
  padding: 20px 6px;
  border-bottom: 1px solid var(--line);
  transition: background 140ms ease;
}

.notice-row:hover {
  background: rgba(201, 162, 39, 0.05);
}

.notice-date {
  color: var(--parchment-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.notice-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.notice-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}

.notice-row:hover .notice-title {
  color: var(--gold-bright);
}

.notice-pin {
  flex-shrink: 0;
  padding: 1px 7px;
  border: 1px solid var(--line-strong);
  color: var(--gold);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
}

.notice-summary {
  overflow: hidden;
  color: var(--parchment-dim);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice-arrow {
  color: var(--parchment-dim);
  text-align: right;
  transition: color 140ms ease, transform 180ms ease;
}

.notice-row:hover .notice-arrow {
  color: var(--gold-bright);
  transform: translateX(4px);
}

.notice-empty {
  padding: 40px 6px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  color: var(--parchment-dim);
}

/* ---------- 分类徽章（品级色） ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 3px 10px;
  border: 1px solid;
  font-size: 12px;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.badge-gold {
  border-color: rgba(232, 195, 85, 0.55);
  color: #e8c355;
  background: rgba(232, 195, 85, 0.08);
}

.badge-purple {
  border-color: rgba(178, 132, 240, 0.55);
  color: #b284f0;
  background: rgba(178, 132, 240, 0.08);
}

.badge-blue {
  border-color: rgba(104, 168, 222, 0.55);
  color: #68a8de;
  background: rgba(104, 168, 222, 0.08);
}

.badge-pink {
  border-color: rgba(240, 132, 162, 0.55);
  color: #f084a2;
  background: rgba(240, 132, 162, 0.08);
}

.badge-white {
  border-color: rgba(234, 224, 201, 0.5);
  color: var(--parchment);
  background: rgba(234, 224, 201, 0.06);
}

.badge-plain {
  border-color: var(--line-strong);
  color: var(--parchment-dim);
  background: rgba(234, 224, 201, 0.04);
}

/* ---------- 公告详情页 ---------- */

.hero-notice {
  min-height: 220px;
}

.hero-notice .hero-inner {
  min-height: 220px;
  padding: 118px clamp(18px, 6vw, 88px) 36px;
}

.notice-article-band {
  padding: 44px clamp(18px, 6vw, 88px) 72px;
  border-top: 1px solid var(--line);
}

.notice-article {
  max-width: 760px;
  margin: 0 auto;
}

.notice-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  color: var(--parchment-dim);
  font-size: 13px;
}

.notice-article h1 {
  margin-bottom: 26px;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.25;
}

.notice-body {
  color: var(--parchment);
  font-size: 16px;
}

.notice-body p {
  margin-bottom: 1em;
}

.notice-body a {
  padding-bottom: 1px;
  color: var(--gold-bright);
  border-bottom: 1px solid rgba(232, 195, 85, 0.45);
  overflow-wrap: anywhere;
  transition: border-color 140ms ease;
}

.notice-body a:hover {
  border-bottom-color: var(--gold-bright);
}

.notice-body code {
  padding: 2px 6px;
  background: var(--coal-2);
  border: 1px solid var(--line);
  font-family: "Cascadia Mono", Consolas, monospace;
  font-size: 0.88em;
  overflow-wrap: anywhere;
}

.notice-body ul,
.notice-body ol {
  margin-top: 0;
  padding-left: 1.4em;
}

.other-notices {
  max-width: 760px;
  margin: 56px auto 0;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.other-notices h2 {
  margin-bottom: 16px;
  font-size: 18px;
  letter-spacing: 0.1em;
}

.other-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  transition: background 140ms ease;
}

.other-row:hover {
  background: rgba(201, 162, 39, 0.05);
}

.other-row time {
  flex-shrink: 0;
  color: var(--parchment-dim);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.other-title {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.other-row:hover .other-title {
  color: var(--gold-bright);
}

/* ---------- 页脚 ---------- */

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 6vw, 88px);
  border-top: 1px solid var(--line);
  color: var(--parchment-dim);
  font-size: 13px;
  letter-spacing: 0.08em;
}

/* ---------- 动效偏好 ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-home .hero-bg {
    animation: none;
  }

  .realm-card {
    animation: none;
    opacity: 1;
    transform: none;
  }

  * {
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 响应式 ---------- */

@media (max-width: 1100px) {
  .version-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .realm-card {
    min-height: 340px;
  }
}

@media (max-width: 640px) {
  .site-header {
    position: absolute;
    height: auto;
    min-height: 60px;
    gap: 12px;
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand-sub {
    display: none;
  }

  .hero-inner {
    min-height: 62vh;
    padding: 110px 18px 44px;
  }

  .hero-version .hero-inner,
  .hero-notice .hero-inner {
    min-height: 0;
    padding: 104px 18px 32px;
  }

  .version-band,
  .board,
  .notice-article-band {
    padding-left: 18px;
    padding-right: 18px;
  }

  .version-grid {
    grid-template-columns: 1fr;
  }

  .realm-card {
    min-height: 260px;
  }

  .notice-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
  }

  .notice-text {
    flex-basis: 100%;
    order: 3;
  }

  .notice-arrow {
    display: none;
  }

  .notice-summary {
    white-space: normal;
  }

  .site-footer {
    display: grid;
    gap: 6px;
  }
}
