@import url('https://fonts.googleapis.com/css2?family=Exo+2:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700&display=swap');

:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --line: #e0e0e0;
  --maxw: 1120px;
  --dock-h: 4.5rem;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Exo 2", "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.8;
  padding-bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 1.25rem);
  transition: none;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: 0.28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

a { color: inherit; }

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

h1, h2, h3 {
  font-family: "Orbitron", "Exo 2", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
}

/* ---------- 底部固定条 ---------- */

.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem clamp(0.5rem, 3vw, 1.25rem);
  padding-bottom: calc(0.5rem + env(safe-area-inset-bottom, 0px));
  background: var(--paper);
  border-top: 1px solid var(--ink);
  transition: none;
}

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  text-decoration: none;
  background: var(--paper-2);
}

.mark-glyph {
  font-family: "Orbitron", "Exo 2", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.mark-img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  display: block;
}

.mark:hover { background: var(--ink); color: var(--paper); }

.dock-nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  padding-inline: 0.2rem;
}

.dock-nav::-webkit-scrollbar { display: none; }

.dock-nav p {
  display: flex;
  gap: 0.1rem;
  margin: 0;
  white-space: nowrap;
}

.dock-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  font-size: 1rem;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  border-radius: 10px 10px 0 0;
}

.dock-nav a:hover { background: var(--paper-2); }

.dock-nav a[aria-current="true"] {
  border-bottom-color: var(--ink);
  font-weight: 600;
}

.contact {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.7rem;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 10px;
}

.contact:hover { background: var(--ink); color: var(--paper); }

.dock-menu {
  position: relative;
  flex: 0 0 auto;
}

.dock-menu summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.8rem;
  font-size: 1rem;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--paper-2);
}

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

.dock-menu[open] summary { background: var(--ink); color: var(--paper); }

.menu-body {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.6rem);
  width: min(86vw, 30rem);
  display: grid;
  gap: 0.55rem;
  padding: 0.75rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 10px;
  box-shadow: 0 0 0 4px var(--paper);
}

.menu-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin: 0;
}

.menu-row:first-child {
  padding-bottom: 0.55rem;
  border-bottom: 1px solid var(--line);
}

.menu-row a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.75rem;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--ink);
  border-radius: 10px;
}

.menu-row a:hover { background: var(--paper-2); }

/* ---------- 报头 ---------- */

.paper {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 clamp(0.9rem, 4vw, 2rem);
}

.hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-end;
  text-align: right;
  gap: 1.1rem;
  padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--ink);
}

.hero-tag {
  margin: 0;
  padding: 0.25rem 0.85rem;
  font-size: 1rem;
  letter-spacing: 0.18em;
  border: 1px solid var(--ink);
  border-bottom-width: 3px;
  border-radius: 10px;
  background: var(--paper-2);
}

.hero h1 {
  margin: 0;
  max-width: 18ch;
  font-size: clamp(2.1rem, 7.6vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

/* ---------- 双栏 ---------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 216px) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3.5rem);
  padding-block: clamp(2rem, 5vw, 3.5rem);
}

.rail {
  position: sticky;
  top: 1.5rem;
  align-self: start;
  border-top: 3px solid var(--ink);
  padding-top: 0.7rem;
}

.rail small {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.22em;
  color: var(--ink);
}

.rail h2 {
  margin: 0.15rem 0 0;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.rail ul {
  list-style: none;
  margin: 0.9rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.rail li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 0.75rem;
  font-size: 1rem;
  text-decoration: none;
  background: var(--paper-2);
  border-bottom: 2px solid var(--ink);
  border-radius: 10px;
}

.rail li a:hover { background: #eceae5; }

.rail li a[aria-current="true"] {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 正文 ---------- */

.content {
  min-width: 0;
  max-width: 70ch;
}

.content > section {
  padding-block: clamp(1.75rem, 4vw, 2.75rem);
}

.content > section + section {
  border-top: 1px solid var(--line);
}

.content section[id] { scroll-margin-top: 1.5rem; }

.content small {
  display: inline-block;
  margin-bottom: 0.45rem;
  padding-bottom: 0.15rem;
  font-size: 1rem;
  letter-spacing: 0.2em;
  border-bottom: 1px solid var(--ink);
}

.content h2 {
  margin: 0 0 0.9rem;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.28;
  letter-spacing: -0.01em;
}

.content h3 {
  margin: 1.6rem 0 0.6rem;
  font-size: 1.2rem;
  line-height: 1.4;
}

.content p { margin: 0 0 1.05em; }

.content a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.content ul,
.content ol { padding-left: 1.35em; }

.content li { margin: 0.35em 0; }

.content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.4rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.content blockquote {
  margin: 1.4rem 0;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
}

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

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
  margin: 1.3rem 0;
}

.content th,
.content td {
  border-bottom: 1px solid var(--line);
  padding: 0.55rem 0.5rem;
  text-align: left;
  vertical-align: top;
}

.content code {
  font-family: "Exo 2", ui-monospace, Menlo, Consolas, monospace;
  background: var(--paper-2);
  padding: 0.08em 0.35em;
  border-radius: 6px;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

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

footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.75rem clamp(0.9rem, 4vw, 2rem);
  text-align: center;
  border-top: 1px solid var(--ink);
}

footer p {
  margin: 0;
  font-size: 1rem;
}

footer a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 0.4rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

footer small {
  display: block;
  margin-top: 0.2rem;
  font-size: 1rem;
  letter-spacing: 0.24em;
}

/* ---------- 动效 ---------- */

@keyframes tick {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-tag,
  .hero h1,
  .rail,
  .content > div,
  footer {
    animation: tick 0.5s steps(5, end) both;
  }

  .hero h1 { animation-delay: 0.05s; }
  .rail { animation-delay: 0.1s; }
  .content > div:nth-child(1) { animation-delay: 0.1s; }
  .content > div:nth-child(2) { animation-delay: 0.15s; }
  .content > div:nth-child(3) { animation-delay: 0.2s; }
  .content > div:nth-child(4) { animation-delay: 0.25s; }
  .content > div:nth-child(5) { animation-delay: 0.3s; }
  .content > div:nth-child(6) { animation-delay: 0.35s; }
  .content > div:nth-child(7) { animation-delay: 0.4s; }
  footer { animation-delay: 0.45s; }
}

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

/* ---------- 断点 ---------- */

@media (min-width: 900px) {
  .dock {
    padding-inline: max(1.25rem, calc((100vw - var(--maxw)) / 2));
  }
}

@media (max-width: 820px) {
  .split {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .rail {
    position: static;
    border-top-width: 2px;
  }

  .rail ul {
    display: flex;
    gap: 0.4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 0.3rem;
  }

  .rail ul::-webkit-scrollbar { display: none; }

  .rail li { flex: 0 0 auto; }

  .content { max-width: none; }

  .hero { min-height: 66vh; }
}

@media (max-width: 480px) {
  .dock { gap: 0.25rem; }
  .dock-nav a { padding: 0 0.55rem; }
  .contact { display: none; }
  .hero h1 { font-size: clamp(1.9rem, 10vw, 2.6rem); }
}

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