/* 云山剑影 · CrosslineGames portal
   Song-dynasty restyle: 定窑牙白 + 卷草剔花 + 如意云头 + 宋代红点缀
   Self-contained — no CDN
*/

:root {
  /* Ding kiln ivory / cream ground */
  --ivory: #f7f0e0;
  --ivory-deep: #efe4cc;
  --parchment: #f3e6c8;
  --parchment-deep: #e8d4a8;
  --cream: #faf6ec;

  /* Carved 卷草 ochre / umber (定窑剔花浅褐) */
  --ochre: #c4a06a;
  --ochre-soft: #b8953a;
  --umber: #5c4632;
  --umber-deep: #3d2e20;
  --ink-soft: #4a3c2e;

  /* Song red — accent only */
  --song-red: #8b1a1a;
  --song-red-deep: #6b1212;
  --song-red-soft: #a52a2a;

  /* Gold trim (game UI) */
  --gold: #b8953a;
  --gold-bright: #d4b35c;
  --gold-dim: #8a6e2e;
  --gold-line: rgba(184, 149, 58, 0.55);

  --panel-shadow: 0 6px 28px rgba(92, 70, 50, 0.12), 0 2px 8px rgba(92, 70, 50, 0.08);
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

/* ——— Body: warm ivory + faint 卷草 / 如意 pattern ——— */
body {
  margin: 0;
  min-height: 100vh;
  color: var(--umber-deep);
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.75;
  /* Soft parchment wash — no near-black ink night */
  background-color: var(--ivory);
  background-image:
    /* faint Song-red glow at top (lacquer accent, not wash) */
    radial-gradient(ellipse 70% 35% at 50% -5%, rgba(139, 26, 26, 0.06), transparent 55%),
    /* warm gold haze */
    radial-gradient(ellipse 50% 40% at 85% 80%, rgba(184, 149, 58, 0.07), transparent 50%),
    /* 卷草 repeating — soft ochre, low opacity (定窑剔花感) */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='80' viewBox='0 0 120 80'%3E%3Cg fill='none' stroke='%23b8953a' stroke-width='1.1' opacity='0.22'%3E%3Cpath d='M0 40c12-18 28-18 40 0s28 18 40 0 28-18 40 0'/%3E%3Cpath d='M10 40c6-8 14-8 20 0M50 40c6-8 14-8 20 0M90 40c6-8 14-8 20 0'/%3E%3Cpath d='M20 28c4-6 8-4 10 2M60 52c4 6 8 4 10-2'/%3E%3C/g%3E%3C/svg%3E"),
    /* 如意云头 dots — very faint */
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160' viewBox='0 0 160 160'%3E%3Cg fill='%238b1a1a' opacity='0.04'%3E%3Cpath d='M40 28c8 0 12 6 12 12 0-6 4-12 12-12-8 0-12-6-12-12 0 6-4 12-12 12z'/%3E%3Cpath d='M120 108c8 0 12 6 12 12 0-6 4-12 12-12-8 0-12-6-12-12 0 6-4 12-12 12z'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(180deg, var(--cream) 0%, var(--ivory) 45%, var(--ivory-deep) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

a {
  color: var(--song-red);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:hover {
  color: var(--gold-dim);
}

/* Soft ambient layers (warm, not ink mist) */
.mist {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.5;
}
.mist-a {
  background:
    radial-gradient(circle at 18% 25%, rgba(255, 250, 240, 0.55), transparent 42%),
    radial-gradient(circle at 78% 65%, rgba(232, 212, 168, 0.35), transparent 38%);
}
.mist-b {
  background:
    linear-gradient(105deg, transparent 42%, rgba(184, 149, 58, 0.04) 50%, transparent 58%);
}

.topbar,
main,
.site-footer {
  position: relative;
  z-index: 1;
}

/* ——— Top bar ——— */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  color: var(--umber);
  line-height: 1.2;
}
.brand:hover {
  color: var(--song-red);
}
.brand-mark {
  font-size: 1.15rem;
  letter-spacing: 0.2em;
  color: var(--song-red);
  font-weight: 700;
}
.brand-sub {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  opacity: 0.65;
  color: var(--umber);
}

.nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.nav a {
  color: var(--umber);
  font-size: 0.95rem;
  letter-spacing: 0.15em;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.nav a:hover {
  color: var(--song-red);
  border-bottom-color: var(--gold);
}

/* ——— Panels: cream parchment + gold + 如意 corner feel ——— */
.panel {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.45), transparent 42%),
    linear-gradient(180deg, var(--cream) 0%, var(--parchment) 55%, var(--parchment-deep) 100%);
  border: 2px solid var(--gold-dim);
  box-shadow:
    var(--panel-shadow),
    inset 0 0 0 1px rgba(212, 179, 92, 0.4),
    inset 0 0 48px rgba(184, 149, 58, 0.05);
  border-radius: 3px;
  position: relative;
}

/* Gold corner brackets */
.panel::before,
.panel::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--gold);
  border-style: solid;
  pointer-events: none;
  z-index: 1;
}
.panel::before {
  top: 5px;
  left: 5px;
  border-width: 2px 0 0 2px;
}
.panel::after {
  bottom: 5px;
  right: 5px;
  border-width: 0 2px 2px 0;
}

/* 如意云头 corner ornaments (Song red lacquer tassels feel) */
.panel-ruyi {
  position: relative;
}
.panel-ruyi > .ruyi-ornament {
  position: absolute;
  width: 22px;
  height: 14px;
  pointer-events: none;
  z-index: 2;
  opacity: 0.85;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 28'%3E%3Cpath fill='%238b1a1a' d='M22 4c6 0 10 5 10 10 0-5 4-10 10-10-6 0-10-4-10-10 0 6-4 10-10 10-6 0-10-4-10-10 0 6-4 10-10 10 6 0 10 5 10 10 0-5 4-10 10-10z' transform='translate(0 14) scale(1 -1) translate(0 -14)'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ruyi-ornament.tl { top: -2px; left: 22px; }
.ruyi-ornament.tr { top: -2px; right: 22px; transform: scaleX(-1); }
.ruyi-ornament.bl { bottom: -2px; left: 22px; transform: scaleY(-1); }
.ruyi-ornament.br { bottom: -2px; right: 22px; transform: scale(-1); }

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

/* ——— Hero ——— */
.hero {
  margin-top: 1.5rem;
  padding: 2.75rem 2rem 2.25rem;
  text-align: center;
}

.eyebrow {
  margin: 0 0 0.75rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  letter-spacing: 0.35em;
  color: var(--song-red);
}

.title {
  margin: 0 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.title-main {
  font-size: clamp(2.4rem, 6vw, 3.6rem);
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  color: var(--umber-deep);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
}
.title-en {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  color: var(--gold-dim);
  text-transform: uppercase;
}

.lead {
  max-width: 36em;
  margin: 0 auto 1.75rem;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.btn {
  display: inline-block;
  padding: 0.55rem 1.4rem;
  font-family: var(--font-serif);
  font-size: 0.95rem;
  letter-spacing: 0.2em;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.btn:active {
  transform: translateY(1px);
}

/* Primary: Song red plaque (not ink brush smear) */
.btn.brush,
.btn.song {
  background: linear-gradient(180deg, var(--song-red-soft) 0%, var(--song-red) 55%, var(--song-red-deep) 100%);
  color: var(--cream);
  border-color: var(--gold-dim);
  box-shadow:
    0 2px 0 var(--song-red-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 0 1px rgba(184, 149, 58, 0.25);
}
.btn.brush:hover,
.btn.song:hover {
  background: linear-gradient(180deg, var(--song-red) 0%, var(--song-red-deep) 100%);
  color: #fff;
  border-color: var(--gold);
}

/* Ghost: gold outline on parchment */
.btn.ghost {
  background: rgba(255, 252, 245, 0.5);
  color: var(--umber);
  border-color: var(--gold-dim);
  box-shadow: inset 0 0 0 1px rgba(212, 179, 92, 0.2);
}
.btn.ghost:hover {
  border-color: var(--song-red);
  color: var(--song-red);
  background: rgba(255, 250, 240, 0.85);
}

.scroll-hint {
  margin: 1.75rem 0 0;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  color: var(--gold-dim);
  opacity: 0.9;
}

/* ——— Sections ——— */
.section {
  margin-top: 3.5rem;
}

.section-head {
  text-align: center;
  margin-bottom: 1.75rem;
}
.section-head h2 {
  margin: 0 0 0.5rem;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  padding-left: 0.4em;
  color: var(--umber-deep);
}

/* Song-red plaque / ruyi-backed labels (replaces ink-label) */
.plaque-label,
.ink-label {
  display: inline-block;
  padding: 0.22em 1em 0.28em;
  background: linear-gradient(180deg, var(--song-red-soft) 0%, var(--song-red) 60%, var(--song-red-deep) 100%);
  color: var(--cream);
  border-radius: 2px;
  border: 1px solid var(--gold-dim);
  box-shadow:
    0 2px 0 var(--song-red-deep),
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 0 1px rgba(184, 149, 58, 0.3);
  letter-spacing: 0.35em;
  padding-left: calc(1em + 0.35em);
  position: relative;
}
/* tiny 如意 dots flanking the plaque */
.plaque-label::before,
.plaque-label::after,
.ink-label::before,
.ink-label::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23d4b35c' d='M8 2c2.5 0 4 2 4 4 0-2 1.5-4 4-4-2.5 0-4-2-4-4 0 2-1.5 4-4 4-2.5 0-4-2-4-4 0 2-1.5 4-4 4 2.5 0 4 2 4 4 0-2 1.5-4 4-4z'/%3E%3C/svg%3E") center / contain no-repeat;
  opacity: 0.9;
}
.plaque-label::before,
.ink-label::before { left: 6px; }
.plaque-label::after,
.ink-label::after { right: 6px; }

.section-desc {
  margin: 0.75rem auto 0;
  max-width: 28em;
  color: var(--umber);
  opacity: 0.78;
  font-size: 0.92rem;
}

/* Decorative divider under section heads — 卷草 line */
.section-head::after {
  content: "";
  display: block;
  width: 160px;
  height: 12px;
  margin: 0.85rem auto 0;
  opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='12' viewBox='0 0 160 12'%3E%3Cg fill='none' stroke='%238a6e2e' stroke-width='1'%3E%3Cpath d='M4 6h40M116 6h40'/%3E%3Cpath d='M52 6c8-8 16-8 24 0s16 8 24 0'/%3E%3Ccircle cx='80' cy='6' r='2' fill='%238b1a1a' stroke='none'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

/* ——— News ——— */
.news-list {
  display: grid;
  gap: 1rem;
}

.news-card {
  padding: 1.25rem 1.5rem;
}
.news-card time {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  color: var(--song-red);
  margin-bottom: 0.35rem;
}
.news-card h3 {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  letter-spacing: 0.12em;
  color: var(--umber-deep);
}
.news-card p {
  margin: 0;
  color: var(--ink-soft);
}

/* ——— Factions ——— */
.faction-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}

.faction-card {
  padding: 1.35rem 1.25rem 1.35rem;
  text-align: center;
}

.faction-badge {
  position: relative;
  display: inline-block;
  margin-bottom: 0.55rem;
}

.faction-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(92, 70, 50, 0.2));
  display: block;
  margin: 0 auto;
}

/* Song square seal — replaces ink brush name marks */
.song-seal { display: none; /* replaced by SVG roundels */
  /*
  position: absolute;
  right: -6px;
  bottom: -2px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: var(--cream);
  background:
    linear-gradient(145deg, var(--song-red-soft) 0%, var(--song-red) 55%, var(--song-red-deep) 100%);
  border: 1px solid var(--gold-bright);
  box-shadow:
    0 0 0 1px var(--song-red-deep),
    0 2px 4px rgba(92, 70, 50, 0.25),
    inset 0 1px 0 rgba(255,255,255,0.15);
  border-radius: 2px;
  transform: rotate(-6deg);
}

.song-seal svg {
  display: block;
  opacity: 0.95;
}

.faction-card h3 {
  margin: 0.15rem 0 0.15rem;
  font-size: 1.25rem;
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  color: var(--song-red);
}

.seal-caption {
  margin: 0 0 0.55rem !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.28em;
  color: var(--gold-dim) !important;
  text-align: center !important;
}

.faction-card p:not(.seal-caption) {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-align: left;
}

/* ——— About ——— */
.about-panel {
  padding: 1.75rem 1.75rem 1.5rem;
}
.about-panel p {
  margin: 0 0 1rem;
  color: var(--ink-soft);
}
.about-panel p:last-child {
  margin-bottom: 0;
}
.about-link {
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

/* ——— Footer ——— */
.site-footer {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  color: var(--umber);
  opacity: 0.7;
  font-size: 0.88rem;
  letter-spacing: 0.06em;
  border-top: 1px solid rgba(184, 149, 58, 0.25);
  background: linear-gradient(180deg, transparent, rgba(232, 212, 168, 0.35));
}
.site-footer a {
  color: var(--gold-dim);
}
.site-footer a:hover {
  color: var(--song-red);
}
.site-footer .muted {
  margin-top: 0.35rem;
  opacity: 0.8;
  font-size: 0.8rem;
}

@media (max-width: 600px) {
  .hero {
    padding: 2rem 1.15rem 1.75rem;
  }
  .title-main {
    letter-spacing: 0.2em;
    padding-left: 0.2em;
  }
  .nav {
    gap: 0.85rem;
  }
  .about-panel,
  .news-card {
    padding-left: 1.15rem;
    padding-right: 1.15rem;
  }
}

