@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

:root {
  --ink: #172620;
  --ink-deep: #0b120f;
  --ink-dark: #0e1a15;
  --mint: #b4fde1;
  --sky: #add8e6;
  --line: rgba(180, 253, 225, 0.3);
  --serif: "Playfair Display", "Source Serif 4", "Songti SC", "Noto Serif SC", Georgia, serif;
  --body: "Source Serif 4", "Songti SC", "Noto Serif SC", Georgia, "Microsoft YaHei", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, monospace;
  --r-lg: 24px;
  --r-sm: 16px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(120% 70% at 85% -5%, #21382c 0%, rgba(33, 56, 44, 0) 60%),
    radial-gradient(90% 60% at 5% 100%, #1b3026 0%, rgba(27, 48, 38, 0) 55%),
    var(--ink);
  color: #e8f6ef;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.72;
  min-height: 100vh;
}

img { max-width: 100%; }

a { color: var(--mint); }

/* ---------- 顶栏 ---------- */
.topbar {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr) minmax(0, auto);
  align-items: center;
  gap: 14px;
  padding: 16px clamp(14px, 4vw, 44px);
  border-bottom: 4px solid var(--line);
  background: linear-gradient(180deg, rgba(180, 253, 225, 0.14), rgba(173, 216, 230, 0.04));
}

.drawer { position: relative; }

.drawer summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 16px;
  border: 4px solid var(--ink-deep);
  border-radius: var(--r-sm);
  background: linear-gradient(160deg, var(--mint), var(--sky));
  color: var(--ink);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: inset -2px -2px 8px rgba(23, 38, 32, 0.28), 4px 4px 0 rgba(7, 14, 10, 0.6);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
  user-select: none;
}

.drawer summary::-webkit-details-marker { display: none; }

.drawer summary:hover { transform: translateY(-1px); }

.drawer summary:active {
  transform: translate(2px, 2px);
  box-shadow: inset -2px -2px 8px rgba(23, 38, 32, 0.28), 1px 1px 0 rgba(7, 14, 10, 0.6);
}

.bars {
  width: 16px;
  height: 12px;
  display: inline-block;
  border-top: 3px solid var(--ink);
  border-bottom: 3px solid var(--ink);
  position: relative;
}

.bars::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 3px;
  border-top: 3px solid var(--ink);
}

.drawer menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 12px);
  left: 0;
  margin: 0;
  padding: 14px;
  list-style: none;
  min-width: min(248px, 82vw);
  max-height: 66vh;
  overflow-y: auto;
  background: linear-gradient(165deg, var(--mint), #d6f4e9 60%, var(--sky));
  border: 4px solid var(--ink-deep);
  border-radius: var(--r-lg);
  box-shadow: inset -3px -3px 10px rgba(255, 255, 255, 0.65), 8px 8px 0 rgba(7, 14, 10, 0.6);
}

.drawer menu li + li { margin-top: 4px; }

.drawer menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  transition: background 0.18s ease-out, transform 0.18s ease-out;
}

.drawer menu a::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--ink);
  opacity: 0.35;
  flex: 0 0 auto;
}

.drawer menu a:hover {
  background: rgba(23, 38, 32, 0.12);
  transform: translateX(2px);
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--mint);
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(18px, 2.6vw, 26px);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand img {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 3px solid var(--line);
}

.finder {
  justify-self: end;
  display: flex;
  gap: 8px;
}

.finder input {
  width: clamp(104px, 17vw, 196px);
  min-height: 44px;
  padding: 0 14px;
  border: 4px solid var(--ink-deep);
  border-radius: 14px;
  background: rgba(232, 246, 239, 0.94);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  box-shadow: inset 2px 2px 6px rgba(23, 38, 32, 0.22);
}

.finder input::placeholder { color: rgba(23, 38, 32, 0.55); }

.finder button {
  min-height: 44px;
  padding: 0 16px;
  border: 4px solid var(--ink-deep);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--sky), var(--mint));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: inset -2px -2px 8px rgba(23, 38, 32, 0.25), 3px 3px 0 rgba(7, 14, 10, 0.6);
  transition: transform 0.2s ease-out;
}

.finder button:active { transform: translate(2px, 2px); }

/* ---------- 二级粘性条 ---------- */
.anchorbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px clamp(14px, 4vw, 44px);
  background: rgba(11, 18, 15, 0.94);
  border-bottom: 3px solid var(--line);
  scrollbar-width: thin;
}

.anchorbar a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 15px;
  border: 3px solid var(--line);
  border-radius: 999px;
  color: var(--mint);
  text-decoration: none;
  font-size: 16px;
  white-space: nowrap;
  transition: background 0.18s ease-out, color 0.18s ease-out, border-color 0.18s ease-out;
}

.anchorbar a:hover {
  background: var(--mint);
  color: var(--ink);
  border-color: var(--ink-deep);
}

/* ---------- 头部拼贴 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.92fr);
  align-items: center;
  gap: clamp(16px, 4vw, 48px);
  padding: clamp(22px, 4vw, 50px) clamp(14px, 4vw, 44px);
  border-bottom: 4px solid var(--line);
}

.hero-ghost {
  position: absolute;
  right: -1%;
  bottom: -8%;
  margin: 0;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(120px, 26vw, 260px);
  line-height: 0.78;
  color: rgba(180, 253, 225, 0.08);
  pointer-events: none;
  user-select: none;
}

.hero-collage {
  position: relative;
  height: clamp(176px, 32vh, 290px);
}

.shot {
  position: absolute;
  overflow: hidden;
  border: 4px solid var(--ink-deep);
  border-radius: var(--r-lg);
  background:
    radial-gradient(90% 90% at 25% 20%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(150deg, var(--mint), var(--sky));
  box-shadow: inset -3px -3px 10px rgba(23, 38, 32, 0.28), 8px 8px 0 rgba(7, 14, 10, 0.55);
  transition: transform 0.25s ease-out;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shot.a {
  width: 62%;
  height: 78%;
  left: 0;
  top: 4%;
  transform: rotate(-4deg);
}

.shot.b {
  width: 52%;
  height: 62%;
  right: 0;
  bottom: 2%;
  transform: rotate(5deg);
}

.hero-collage:hover .shot.a { transform: rotate(-6deg) translateY(-3px); }
.hero-collage:hover .shot.b { transform: rotate(7deg) translateY(3px); }

.hero-copy {
  position: relative;
  z-index: 2;
  text-align: right;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(29px, 5.4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  color: var(--mint);
  text-shadow: 2px 3px 0 rgba(7, 14, 10, 0.45);
}

.hero-copy p {
  margin: 0 0 0 auto;
  max-width: 32ch;
  color: #cbe7dc;
  font-size: 17px;
}

/* ---------- 主区 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 258px) minmax(0, 1fr);
  align-items: start;
  gap: clamp(18px, 3vw, 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(26px, 4vw, 56px) clamp(14px, 4vw, 44px);
}

.rail { position: sticky; top: 76px; }

.rail-card {
  padding: 18px;
  border: 4px solid var(--ink-deep);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--mint), #d9f6ec 58%, var(--sky));
  color: var(--ink);
  box-shadow: inset -3px -3px 10px rgba(255, 255, 255, 0.7), 8px 8px 0 rgba(7, 14, 10, 0.5);
}

.rail-card h2,
.rail-card h3 {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.3;
  color: var(--ink);
}

.rail-card h2 span,
.rail-card h3 span {
  display: inline-block;
  padding-bottom: 2px;
  border-bottom: 3px solid var(--ink);
}

.rail-card h3 { margin-top: 16px; }

.rail-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-card li + li { margin-top: 3px; }

.rail-card a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  transition: background 0.18s ease-out, transform 0.18s ease-out;
}

.rail-card a:hover {
  background: rgba(23, 38, 32, 0.13);
  transform: translateX(2px);
}

.stream { min-width: 0; }

.stream-fig {
  margin: 0 0 28px;
  overflow: hidden;
  border: 4px solid var(--ink-deep);
  border-radius: var(--r-lg);
  background: linear-gradient(150deg, rgba(180, 253, 225, 0.34), rgba(173, 216, 230, 0.3));
  box-shadow: inset -3px -3px 10px rgba(23, 38, 32, 0.2), 6px 6px 0 rgba(7, 14, 10, 0.5);
}

.stream-fig .frame {
  display: block;
  min-height: 168px;
}

.stream-fig img {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}

/* ---------- 正文 ---------- */
.stream > article[id] {
  scroll-margin-top: 92px;
  margin: 0 0 28px;
  padding: clamp(18px, 3vw, 32px);
  border: 3px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(180, 253, 225, 0.06);
  box-shadow: inset -2px -2px 9px rgba(0, 0, 0, 0.3), 6px 6px 0 rgba(0, 0, 0, 0.28);
  transition: transform 0.22s ease-out, box-shadow 0.22s ease-out, border-color 0.22s ease-out;
}

.stream > article[id]:hover {
  transform: translateY(-2px);
  border-color: rgba(180, 253, 225, 0.55);
  box-shadow: inset -2px -2px 9px rgba(0, 0, 0, 0.3), 9px 9px 0 rgba(0, 0, 0, 0.3);
}

.stream article h2 {
  margin: 0 0 14px;
  font-family: var(--serif);
  font-weight: 900;
  font-size: clamp(23px, 3.4vw, 35px);
  line-height: 1.18;
  color: var(--mint);
}

.stream article h2 span { display: inline; }

.stream article h3 {
  margin: 24px 0 10px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(19px, 2.5vw, 24px);
  line-height: 1.3;
  color: #d9fbee;
}

.stream article p { margin: 0 0 14px; }

.stream article p:last-child { margin-bottom: 0; }

.stream article ul,
.stream article ol {
  margin: 14px 0;
  padding-left: 22px;
}

.stream article li + li { margin-top: 8px; }

.stream article li::marker { color: var(--mint); }

.stream article a {
  color: var(--mint);
  text-decoration: none;
  border-bottom: 2px solid rgba(180, 253, 225, 0.4);
  transition: border-color 0.18s ease-out, background 0.18s ease-out;
}

.stream article a:hover {
  background: rgba(180, 253, 225, 0.14);
  border-bottom-color: var(--mint);
}

.stream article strong { color: var(--mint); }

.stream article img {
  height: auto;
  margin: 8px 0;
  border: 3px solid rgba(180, 253, 225, 0.3);
  border-radius: var(--r-sm);
}

.stream article blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  border-left: 6px solid var(--mint);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  background: rgba(180, 253, 225, 0.09);
}

.stream article blockquote p:last-child { margin-bottom: 0; }

.stream article code {
  font-family: var(--mono);
  font-size: 0.94em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(180, 253, 225, 0.14);
  color: var(--mint);
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 20px;
  padding: clamp(26px, 4vw, 48px) clamp(14px, 4vw, 44px) 24px;
  border-top: 4px solid var(--line);
  background: rgba(7, 14, 10, 0.55);
}

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

.foot-col ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-col a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #d4ecdf;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.18s ease-out;
}

.foot-col a:hover {
  color: var(--mint);
  text-decoration: underline;
}

footer address {
  font-style: normal;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 19px;
  line-height: 1.35;
  color: var(--mint);
}

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1180px;
  margin: 22px auto 0;
  padding-top: 16px;
  border-top: 2px dashed var(--line);
  font-size: 16px;
  color: #a4c4b4;
}

.foot-base p { margin: 0; }

.foot-base ul {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #d4ecdf;
  text-decoration: none;
}

.foot-base a:hover { color: var(--mint); text-decoration: underline; }

/* ---------- 回到顶部 ---------- */
.totop {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  min-height: 44px;
  padding: 0 18px;
  border: 4px solid var(--ink-deep);
  border-radius: 999px;
  background: linear-gradient(160deg, var(--mint), var(--sky));
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: inset -2px -2px 8px rgba(23, 38, 32, 0.25), 4px 4px 0 rgba(7, 14, 10, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease-out, visibility 0.22s ease-out, transform 0.22s ease-out;
}

.totop.is-on { opacity: 1; visibility: visible; }

.totop:active { transform: translate(2px, 2px); }

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .stream > article[id] { animation: bob 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both; }
  .stream > article[id]:nth-of-type(2) { animation-delay: 0.05s; }
  .stream > article[id]:nth-of-type(3) { animation-delay: 0.1s; }
  .stream > article[id]:nth-of-type(4) { animation-delay: 0.15s; }
  .stream > article[id]:nth-of-type(n + 5) { animation-delay: 0.2s; }
}

@keyframes bob {
  from { opacity: 0; transform: translateY(14px) scale(0.99); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .shell {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }
  .rail { position: static; }
  .rail-card ul { display: flex; flex-wrap: wrap; gap: 6px; }
  .rail-card li + li { margin-top: 0; }
  .rail-card a { padding: 8px 12px; border: 2px solid rgba(23, 38, 32, 0.22); }
}

@media (max-width: 760px) {
  .topbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
  }
  .drawer { order: 1; }
  .drawer summary { padding: 0 12px; }
  .brand {
    order: 2;
    flex: 1 1 auto;
    justify-content: center;
    font-size: 17px;
    padding: 6px 8px;
  }
  .finder { order: 3; flex: 1 1 100%; }
  .finder input { flex: 1 1 auto; width: auto; }
  .finder button { padding: 0 18px; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto;
    gap: 14px;
    padding-top: 24px;
  }
  .hero-collage { height: min(36vh, 214px); }
  .hero-copy p { max-width: 100%; }
  .hero-ghost { font-size: clamp(110px, 34vw, 170px); bottom: -6%; }

  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .foot-base { justify-content: space-between; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .anchorbar a { padding: 0 12px; font-size: 15px; }
  .hero-copy h1 { font-size: 27px; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
