/* ============================================================
   梦之海 · DSMH — 官网样式
   冷峻 / 诗意 / 史诗
   ============================================================ */

:root {
  --bg: #04060b;
  --bg-soft: #070c15;
  --ink: #e9f2f8;
  --ink-soft: #b7c8d5;
  --muted: #7f93a4;
  --ice: #9fe8ff;
  --ice-2: #63c6e6;
  --line: rgba(159, 232, 255, 0.13);
  --line-strong: rgba(159, 232, 255, 0.3);
  --wrap: min(1180px, 92vw);
  --serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans SC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --ease: cubic-bezier(0.16, 0.84, 0.3, 1);
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(159, 232, 255, 0.28); color: #fff; }

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

.skip {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 999;
  padding: 0.8rem 1.2rem;
  background: var(--ice);
  color: #04121a;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- 背景层 ---------- */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.progress {
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  z-index: 60;
  background: rgba(255, 255, 255, 0.04);
}
.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, transparent, var(--ice));
  box-shadow: 0 0 12px rgba(159, 232, 255, 0.8);
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  background: rgba(4, 6, 11, 0.5);
  border-bottom: 1px solid transparent;
  backdrop-filter: blur(14px) saturate(120%);
  -webkit-backdrop-filter: blur(14px) saturate(120%);
  transition: background 0.4s ease, border-color 0.4s ease;
}
.nav.is-scrolled {
  background: rgba(4, 6, 11, 0.82);
  border-bottom-color: var(--line);
}

.nav__inner {
  width: var(--wrap);
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  white-space: nowrap;
}

.brand__mark {
  width: 17px;
  height: 17px;
  border: 1px solid var(--ice);
  border-radius: 50%;
  box-shadow: 0 0 14px rgba(159, 232, 255, 0.45), inset 0 0 8px rgba(159, 232, 255, 0.25);
}

.brand__name {
  font-family: var(--serif);
  font-size: 1.12rem;
  letter-spacing: 0.24em;
  color: var(--ink);
}

.brand__tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.26em;
  color: var(--ice);
  border: 1px solid var(--line-strong);
  padding: 0.12rem 0.42rem;
  border-radius: 2px;
}

.nav__links {
  display: flex;
  gap: 2.2rem;
  margin-left: auto;
}
.nav__links a {
  position: relative;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.86rem;
  letter-spacing: 0.16em;
  padding: 0.3rem 0;
  transition: color 0.3s ease;
}
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 0.95rem 1.9rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.01);
  color: var(--ink);
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s var(--ease);
}
.btn:hover {
  border-color: rgba(159, 232, 255, 0.65);
  background: rgba(159, 232, 255, 0.08);
  transform: translateY(-2px);
}
.btn:focus-visible { outline: 1px solid var(--ice); outline-offset: 4px; }

.btn--primary {
  border-color: rgba(159, 232, 255, 0.5);
  background: rgba(159, 232, 255, 0.09);
  color: #ecfbff;
  box-shadow: 0 0 34px rgba(99, 198, 230, 0.14), inset 0 0 22px rgba(159, 232, 255, 0.06);
}
.btn--primary:hover {
  background: rgba(159, 232, 255, 0.17);
  box-shadow: 0 0 52px rgba(99, 198, 230, 0.26), inset 0 0 26px rgba(159, 232, 255, 0.1);
}

.btn--ghost { color: var(--ink-soft); }

.btn--small { padding: 0.58rem 1.25rem; font-size: 0.8rem; }

.btn--block { width: 100%; margin-top: 1.6rem; }

.btn__arrow { transition: transform 0.35s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(4px); }

.btn.is-todo { animation: todo-flash 1.4s var(--ease); }
@keyframes todo-flash {
  0%, 100% { border-color: var(--line-strong); background: rgba(159, 232, 255, 0.09); }
  35% { border-color: rgba(255, 205, 140, 0.85); background: rgba(255, 205, 140, 0.12); }
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 120px 0 130px;
  overflow: hidden;
  isolation: isolate;
}

.hero__orbits {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 0;
  height: 0;
  z-index: -1;
  pointer-events: none;
}

.orbit {
  position: absolute;
  left: 0;
  top: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(74deg);
  will-change: transform;
}
.orbit--1 { width: 58vmin; height: 58vmin; border-color: rgba(159, 232, 255, 0.24); }
.orbit--2 {
  width: 92vmin;
  height: 92vmin;
  border-color: transparent;
  animation: orbit-spin 120s linear infinite;
}
.orbit--2 i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 200deg,
    transparent 0deg 58deg,
    rgba(159, 232, 255, 0.55) 74deg,
    rgba(159, 232, 255, 0.06) 86deg,
    transparent 96deg 360deg
  );
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 1.5px), #000 calc(100% - 1.5px));
}
.orbit--3 { width: 126vmin; height: 126vmin; border-style: dashed; border-color: rgba(159, 232, 255, 0.07); }

@keyframes orbit-spin {
  from { transform: translate(-50%, -50%) rotateX(74deg) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotateX(74deg) rotate(360deg); }
}

.hero__core {
  position: absolute;
  left: 0;
  top: 0;
  width: 82vmin;
  height: 82vmin;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 232, 255, 0.16), rgba(99, 198, 230, 0.05) 42%, transparent 66%);
  filter: blur(14px);
}

.hero__inner {
  width: var(--wrap);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0 0 2.2rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.34em;
  color: var(--ice-2);
}
.eyebrow__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ice);
  box-shadow: 0 0 12px var(--ice);
  animation: pulse 3.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.7); }
}

.hero__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(4.2rem, 15vw, 10.5rem);
  line-height: 1.05;
  letter-spacing: 0.14em;
  padding-left: 0.14em;
  background: linear-gradient(180deg, #ffffff 8%, #c9e8f3 52%, #5e8ba0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 80px rgba(159, 232, 255, 0.18);
}

.hero__line {
  margin: 1.6rem 0 0;
  font-family: var(--serif);
  font-size: clamp(0.95rem, 1.9vw, 1.18rem);
  letter-spacing: 0.26em;
  color: var(--ice);
  text-indent: 0.26em;
}
.hero__line span { display: inline; }

.hero__lead {
  max-width: 40em;
  margin: 2.2rem auto 0;
  color: var(--ink-soft);
  font-size: clamp(0.92rem, 1.5vw, 1rem);
  line-height: 2.05;
  text-wrap: pretty;
  word-break: keep-all;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.8rem;
}

.hero__keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 clamp(1.6rem, 5vw, 4.2rem);
  margin: 3rem 0 0;
  padding: 1.4rem 0 0;
  list-style: none;
  border-top: 1px solid var(--line);
}
.hero__keys li { padding: 0.4rem 0; }
.hero__keys b {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.02rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink-soft);
}
.hero__keys span {
  display: block;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.56rem;
  letter-spacing: 0.32em;
  color: var(--muted);
}

.scroll-cue {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.4em;
}
.scroll-cue i {
  position: relative;
  display: block;
  width: 1px;
  height: 38px;
  background: linear-gradient(180deg, var(--line-strong), transparent);
  overflow: hidden;
}
.scroll-cue i::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ice);
  transform: translateY(-100%);
  animation: scroll-line 2.8s var(--ease) infinite;
}
@keyframes scroll-line {
  0% { transform: translateY(-100%); }
  60%, 100% { transform: translateY(100%); }
}

/* ---------- 通用版块 ---------- */

.section {
  position: relative;
  z-index: 2;
  width: var(--wrap);
  margin: 0 auto;
  padding: clamp(84px, 11vw, 150px) 0 0;
  scroll-margin-top: 88px;
}

.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.8rem 1.6rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.section__index {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.32em;
  color: var(--ice-2);
}

.section__title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.85rem, 4.4vw, 3.1rem);
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.section__en {
  margin: 0 0 0 auto;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--muted);
  text-transform: uppercase;
}

.section__note {
  max-width: 54ch;
  margin: 1.5rem 0 clamp(2.6rem, 5vw, 4rem);
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 2;
}

/* ---------- 入会规则 ---------- */

.rules {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--line);
  border: 1px solid var(--line);
}

.rule {
  position: relative;
  padding: clamp(1.7rem, 3vw, 2.5rem);
  background: var(--bg);
  transition: background 0.4s ease;
}
.rule:hover { background: var(--bg-soft); }
.rule::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--ice), transparent);
  transition: width 0.6s var(--ease);
}
.rule:hover::after { width: 100%; }

.rule__no {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.rule h3 {
  margin: 1.1rem 0 0.65rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  letter-spacing: 0.12em;
}

.rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.95;
}

/* ---------- 成员招募 ---------- */

.join {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.facts { margin: 0; }

.fact {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 1.2rem;
  padding: 1.6rem 0;
  border-top: 1px solid var(--line);
}
.fact:last-child { border-bottom: 1px solid var(--line); }

.fact dt {
  padding-top: 0.25rem;
  font-size: 0.76rem;
  letter-spacing: 0.22em;
  color: var(--ice-2);
}

.fact dd {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.95;
}
.fact dd b { color: var(--ice); font-weight: 500; }

.contact {
  position: sticky;
  top: 104px;
  padding: clamp(1.6rem, 3vw, 2.2rem);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, rgba(159, 232, 255, 0.055), rgba(159, 232, 255, 0.008));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.contact__label {
  margin: 0 0 1.1rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.36em;
  color: var(--muted);
}

.channels {
  margin: 0;
  padding: 0;
  list-style: none;
}
.channels li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.78rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.85rem;
}
.channels li:first-child { border-top: 1px solid var(--line); }
.channels span { color: var(--muted); letter-spacing: 0.08em; }
.channels code {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--ice);
  background: none;
}

.contact__hint {
  margin: 0.9rem 0 0;
  font-size: 0.72rem;
  line-height: 1.7;
  color: var(--muted);
}

/* ---------- 公会活动 ---------- */

.activities {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.card {
  grid-column: span 2;
  display: flex;
  flex-direction: column;
  min-height: 250px;
  padding: clamp(1.5rem, 2.6vw, 2.2rem);
  background: var(--bg);
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.card:hover {
  background: var(--bg-soft);
  box-shadow: inset 0 1px 0 rgba(159, 232, 255, 0.25);
}

.card__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
}
.card__meta span { color: var(--ice-2); }
.card__meta em {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.58rem;
  letter-spacing: 0.3em;
  color: var(--muted);
}

.card h3 {
  margin: 2.6rem 0 0.75rem;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 0.1em;
}

.card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.95;
}

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

.outro {
  position: relative;
  z-index: 2;
  margin-top: clamp(90px, 12vw, 160px);
  padding: clamp(90px, 12vw, 150px) 0 0;
  overflow: hidden;
  text-align: center;
  scroll-margin-top: 88px;
}

.outro__horizon {
  position: absolute;
  left: 50%;
  bottom: -28vmin;
  width: 150vmin;
  height: 60vmin;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(159, 232, 255, 0.18), rgba(99, 198, 230, 0.05) 45%, transparent 70%);
  filter: blur(18px);
  pointer-events: none;
}

.outro__inner {
  position: relative;
  width: var(--wrap);
  margin: 0 auto;
  padding-bottom: 0;
}

.outro__eyebrow {
  margin: 0 0 2.2rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.4em;
  color: var(--muted);
}

.outro__call {
  max-width: 36em;
  margin: 0 auto 2.8rem;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 3.2vw, 2.3rem);
  line-height: 1.8;
  letter-spacing: 0.1em;
  color: #ecf9ff;
  word-break: keep-all;
  text-wrap: balance;
}

.outro__base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 2rem;
  margin-top: clamp(5rem, 9vw, 8rem);
  padding: 1.6rem 0 1.8rem;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* ---------- 滚动显现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.95s var(--ease), transform 0.95s var(--ease);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 900px) {
  .nav__links { display: none; }
  .hero__keys { gap: 0 2.2rem; }
  .join { grid-template-columns: 1fr; }
  .contact { position: static; }
}

@media (max-width: 640px) {
  .nav__inner { height: 64px; }
  .brand__name { font-size: 1rem; }
  .rules { grid-template-columns: 1fr; }
  .fact { grid-template-columns: 1fr; gap: 0.45rem; }
  .card { grid-column: span 6; min-height: 0; }
  .hero { padding-top: 104px; }
  .hero__lead { font-size: 0.92rem; }
  .hero__line { letter-spacing: 0.18em; text-indent: 0; }
  .hero__line span { display: block; }
  .section__en { display: none; }
  .scroll-cue { display: none; }
  .outro__base { justify-content: flex-start; }
}

@media (max-height: 840px) and (min-width: 641px) {
  .hero { padding: 100px 0 76px; }
  .hero__title { font-size: clamp(3.4rem, 12vw, 7.6rem); }
  .hero__keys { margin-top: 2.2rem; }
  .scroll-cue { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  #starfield { display: none; }
}
