@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 {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --ash: #f5f5f5;
  --soft: #e9e9e9;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --disp: "Orbitron", "Exo 2", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --body: "Exo 2", system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --pad: clamp(16px, 4vw, 26px);
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--ash);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.005em;
  overflow-x: hidden;
}

img, svg { max-width: 100%; }
img { height: auto; }

a { color: var(--ink); }
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
  border-radius: 6px;
}

h1, h2, h3, h4 {
  font-family: var(--body);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}

p { margin: 0 0 1.05em; }

[id] { scroll-margin-top: 96px; }

/* ---------- 顶部：品牌行 + 药丸菜单行 ---------- */

.mast {
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
  padding: 14px var(--pad) 12px;
}

.mast-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  max-width: 1120px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  padding: 4px 2px;
  min-height: 44px;
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  flex: 0 0 auto;
  overflow: hidden;
}

.mark img, img.mark { object-fit: cover; }

.brand-name {
  font-family: var(--disp);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.mast-key {
  font-size: 15px;
  letter-spacing: 0.16em;
  color: var(--ink);
  opacity: 0.62;
  padding: 6px 0;
}

.mast-menu { max-width: 1120px; margin: 10px auto 0; }

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 9px 16px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.3;
  background: var(--paper);
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.menu a:hover { background: var(--ink); color: var(--paper); transform: translateY(-1px); }
.menu a[aria-current="true"] { background: var(--ink); color: var(--paper); }

/* ---------- 主网格 ---------- */

.wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  align-items: start;
  gap: 18px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px var(--pad) 48px;
}

/* ---------- Hero ---------- */

.hero {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: 70vh;
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
  padding: clamp(24px, 5vw, 60px);
}

.ghost {
  position: absolute;
  right: -0.04em;
  bottom: -0.22em;
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(150px, 30vw, 330px);
  line-height: 1;
  color: var(--ash);
  letter-spacing: -0.04em;
  pointer-events: none;
  user-select: none;
  animation: drift 9s ease-in-out infinite alternate;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-14px); }
}

.hero-copy { position: relative; max-width: 34ch; }

.hero-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--ash);
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(30px, 5.2vw, 56px);
  margin-bottom: 0.45em;
}

.hero-lead {
  font-size: 17px;
  line-height: 1.7;
  margin: 0;
  color: #3a3a3a;
}

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

.stage { min-width: 0; }

.prose { display: block; }

.prose > section {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: clamp(20px, 3.2vw, 38px);
  margin-bottom: 18px;
  transition: transform 0.22s ease;
}

.prose > section:nth-of-type(even) { background: var(--ash); }

@media (hover: hover) {
  .prose > section:hover { transform: scale(1.008); }
}

.prose h2 {
  font-size: clamp(22px, 2.7vw, 31px);
  margin-bottom: 1.1em;
}

.prose h2 > span,
.prose h3 > span {
  position: relative;
  display: inline-block;
  padding-bottom: 8px;
}

.prose h2 > span::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  bottom: 0;
  height: 6px;
  background: var(--ink);
  border-radius: 3px;
}

.prose h3 {
  font-size: 20px;
  margin-top: 1.5em;
}

.prose p { color: #2c2c2c; }

.prose a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }

.prose blockquote {
  margin: 0 0 1.1em;
  padding: 4px 0 4px 18px;
  border-left: 6px solid var(--ink);
  font-size: 17px;
}

.prose figure { margin: 0 0 1.2em; }
.prose figcaption { font-size: 15px; opacity: 0.7; margin-top: 6px; }
.prose img { border: 2px solid var(--ink); border-radius: var(--r-sm); display: block; }

.prose hr { border: 0; border-top: 2px dashed var(--soft); margin: 26px 0; }

/* ---------- 右侧栏 ---------- */

.rail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 16px;
}

.tile {
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  padding: 16px;
  transition: transform 0.2s ease;
}

@media (hover: hover) {
  .tile:hover { transform: scale(1.02); }
}

.tile h2 {
  font-size: 16px;
  margin-bottom: 0.9em;
}

.tile h2 > span {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
}

.tile h2 > span::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--ink);
}

.jump {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: jmp;
}

.jump li { counter-increment: jmp; }

.jump a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 10px;
  border-radius: var(--r-sm);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.35;
  transition: background 0.18s ease;
}

.jump a::before {
  content: counter(jmp, decimal-leading-zero);
  font-family: var(--disp);
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0.5;
}

.jump a:hover { background: var(--ash); }
.jump a[aria-current="true"] { background: var(--ink); color: var(--paper); }
.jump a[aria-current="true"]::before { opacity: 0.9; }

.rotator { display: grid; gap: 6px; }
.rotator a {
  display: block;
  padding: 8px 10px;
  min-height: 42px;
  border-radius: var(--r-sm);
  border: 2px solid var(--soft);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
}
.rotator a.on { border-color: var(--ink); animation: pop 0.4s ease both; }

@keyframes pop {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.rot-on a:not(.on) { display: none; }

.backtop { margin: 0; }

.backtop a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: 2px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
}

.backtop a:hover { background: var(--ash); color: var(--ink); }

.tile-quiet { background: var(--ash); }

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

.foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 16px;
  align-items: start;
  width: calc(100% - 2 * var(--pad));
  max-width: 1120px;
  margin: 8px auto 30px;
  padding: clamp(22px, 4vw, 40px);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: var(--r-lg);
}

.foot p { margin: 0; }

.foot-brand {
  font-family: var(--disp);
  font-weight: 700;
  font-size: clamp(30px, 5.6vw, 56px);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.foot-desc { font-size: 16px; line-height: 1.7; color: #3a3a3a; }

.foot-key { font-size: 16px; letter-spacing: 0.1em; opacity: 0.6; }

.foot-copy {
  grid-column: 1 / -1;
  display: block;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 2px solid var(--soft);
  font-size: 15px;
  opacity: 0.65;
}

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

@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
  .hero { min-height: 62vh; }
  .foot { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .hero { min-height: 58vh; padding: 22px; }
  .ghost { font-size: 180px; opacity: 0.9; }
  .hero-ico { width: 54px; height: 54px; margin-bottom: 14px; }
  .foot { grid-template-columns: 1fr; }
  .foot-brand, .foot-copy { grid-column: auto; }
  .mast-key { display: none; }
  .menu a { padding: 9px 13px; font-size: 15.5px; }
}

@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;
  }
  .ghost { animation: none; }
}

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