/* ============================================================
   计算机文化数字展馆 · style.css
   配色仅四色：纸白 / 墨黑 / 朱砂 / 青灰
   ============================================================ */

:root {
  --paper: #f6f2ea;
  --paper-2: #efe9dd;
  --ink: #1e1c19;
  --ink-soft: #57524a;
  --vermilion: #b0462f;
  --celadon: #3d6159;
  --line: rgba(30, 28, 25, 0.14);
  --line-soft: rgba(30, 28, 25, 0.08);

  --serif: "Noto Serif SC", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", "STSong", serif;
  --sans: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Noto Sans CJK SC", sans-serif;

  --gap: clamp(14px, 3.2vw, 26px);
  --pad: clamp(16px, 4.5vw, 40px);
  --head-h: 62px;
  --radius: 3px;
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.75;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, canvas { max-width: 100%; height: auto; }
p, h1, h2, h3, h4, li { overflow-wrap: anywhere; }

a { color: var(--vermilion); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:focus-visible {
  outline: 2px solid var(--vermilion);
  outline-offset: 3px;
}

/* ---------- 双语排版：英文为主，中文为注释层 ---------- */

.zh {
  font-size: .9em;
  line-height: 1.85;
  color: rgba(30, 28, 25, .62);
  letter-spacing: .01em;
}

.intro-lead.zh { margin-top: 10px; font-size: .9em; }

.zh-name {
  display: block;
  margin-top: 6px;
  font-family: var(--sans);
  font-size: .72em;
  font-weight: 400;
  letter-spacing: .03em;
  color: var(--ink-soft);
}

.zh-title {
  display: block;
  margin-top: 10px;
  font-family: var(--sans);
  font-size: .44em;
  font-weight: 400;
  letter-spacing: .14em;
  color: rgba(30, 28, 25, .52);
}

.hall-intro.zh { margin-top: 8px; font-size: .9em; }

.h4-zh {
  margin-left: 6px;
  font-size: .9em;
  font-weight: 400;
  letter-spacing: .1em;
  color: rgba(30, 28, 25, .4);
}

.intro-hall-text { display: flex; flex-direction: column; gap: 1px; }
.intro-hall-text b { font-weight: 500; font-size: .92rem; color: var(--ink); }
.intro-hall-text em {
  font-style: normal;
  font-size: .78rem;
  color: rgba(30, 28, 25, .5);
  letter-spacing: .04em;
}

.tl-zh {
  display: block;
  font-size: .74rem;
  color: rgba(30, 28, 25, .42);
  letter-spacing: .04em;
  line-height: 1.5;
}

/* ---------- 开场引导页 ---------- */

.intro {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: var(--pad);
  background: var(--paper);
  transition: opacity .5s ease, visibility .5s ease;
}

.intro.is-gone { opacity: 0; visibility: hidden; pointer-events: none; }

.intro-art { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.ring {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.ring.r1 { width: 74vmin; height: 74vmin; right: -20vmin; top: -16vmin; }
.ring.r2 { width: 52vmin; height: 52vmin; right: -9vmin; top: -5vmin; border-color: rgba(176, 70, 47, .22); }
.ring.r3 { width: 30vmin; height: 30vmin; right: 2vmin; top: 4vmin; border-style: dashed; }

.punch {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 2px;
  background: var(--ink);
  opacity: .18;
}
.punch.p1 { left: 8%;  bottom: 16%; }
.punch.p2 { left: 15%; bottom: 23%; }
.punch.p3 { left: 22%; bottom: 16%; }
.punch.p4 { left: 15%; bottom: 9%;  background: var(--vermilion); opacity: .5; }
.punch.p5 { left: 29%; bottom: 23%; opacity: .1; }
.punch.p6 { left: 29%; bottom: 9%;  opacity: .1; }

.intro-inner {
  position: relative;
  width: min(680px, 100%);
  max-height: 100%;
  overflow-y: auto;
  padding: 4px 2px 8px;
  animation: rise .7s ease both;
}

.eyebrow {
  margin: 0 0 18px;
  font-size: .74rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--vermilion);
}

.intro h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 11vw, 4.6rem);
  line-height: 1.08;
  letter-spacing: .01em;
}

.intro-lead {
  margin: 22px 0 0;
  max-width: 34em;
  color: var(--ink-soft);
  font-size: clamp(.95rem, 3.4vw, 1.05rem);
}

.intro-halls {
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.intro-halls li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: .86rem;
  color: var(--ink-soft);
}

.intro-halls span {
  font-family: var(--serif);
  color: var(--vermilion);
  font-size: .9rem;
}

.intro-actions {
  margin-top: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-start {
  appearance: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: .95rem;
  letter-spacing: .06em;
  padding: 13px 30px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .25s ease, transform .25s ease;
}
.btn-start:hover { background: var(--vermilion); border-color: var(--vermilion); transform: translateY(-1px); }

.btn-ghost {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .88rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.btn-ghost:hover { color: var(--vermilion); border-color: var(--vermilion); }

.intro-note {
  margin: 20px 0 0;
  font-size: .74rem;
  letter-spacing: .04em;
  color: rgba(30, 28, 25, .45);
}

/* ---------- 顶栏 ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas:
    "brand visited"
    "nav   nav";
  align-items: center;
  gap: 4px var(--gap);
  padding: 10px var(--pad);
  background: rgba(246, 242, 234, .92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}

.brand-mark {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px; height: 26px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: .86rem;
}

.brand-text {
  font-family: var(--serif);
  font-size: .95rem;
  letter-spacing: .02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hall-nav {
  grid-area: nav;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.hall-tab {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .79rem;
  padding: 7px 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.25;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.hall-tab .t-short { display: none; }

.hall-tab .t-zh {
  display: inline;
  margin-left: 2px;
  font-size: .78em;
  color: rgba(30, 28, 25, .42);
  letter-spacing: .06em;
}
.hall-tab[aria-selected="true"] .t-zh { color: rgba(246, 242, 234, .72); }

.hall-tab i {
  font-style: normal;
  font-family: var(--serif);
  font-size: .68rem;
  color: var(--vermilion);
  letter-spacing: .08em;
}

.hall-tab:hover { border-color: var(--ink); color: var(--ink); }

.hall-tab[aria-selected="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.hall-tab[aria-selected="true"] i { color: #e5a08d; }

.visited {
  grid-area: visited;
  margin: 0;
  font-size: .72rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
  white-space: nowrap;
}
.visited-total { color: rgba(30, 28, 25, .45); }

/* ---------- 展厅 ---------- */

main { display: block; }

.hall {
  padding: clamp(30px, 7vw, 64px) var(--pad) clamp(18px, 4vw, 30px);
  max-width: 1120px;
  margin: 0 auto;
  animation: fade .45s ease both;
}

.hall-head { max-width: 46em; }

.hall-index {
  margin: 0 0 12px;
  font-size: .7rem;
  letter-spacing: .2em;
  color: var(--vermilion);
  font-variant-numeric: tabular-nums;
}
.hall-index span { color: rgba(30, 28, 25, .42); letter-spacing: .1em; margin-left: 10px; }

.hall h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.6rem, 6.4vw, 2.5rem);
  line-height: 1.25;
  letter-spacing: .01em;
}

.hall-intro {
  margin: 14px 0 0;
  color: var(--ink-soft);
  font-size: clamp(.9rem, 3.3vw, .98rem);
  max-width: 40em;
}

.grid {
  margin-top: clamp(22px, 5vw, 40px);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr));
  gap: var(--gap);
  align-items: start;
}

/* ---------- 展品卡片 ---------- */

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0));
  scroll-margin-top: calc(var(--head-h) + 84px);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.card:hover { border-color: rgba(30, 28, 25, .34); transform: translateY(-2px); }

.card.is-open {
  border-color: var(--ink);
  box-shadow: 0 1px 0 var(--ink), 0 14px 30px -22px rgba(30, 28, 25, .55);
  transform: none;
}

.card.is-flash { animation: flash 1.6s ease; }

.card-face {
  appearance: none;
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: clamp(16px, 3.6vw, 24px);
  cursor: pointer;
  border-radius: var(--radius);
}

.card-no {
  position: absolute;
  top: clamp(12px, 3vw, 18px);
  right: clamp(14px, 3.4vw, 20px);
  font-family: var(--serif);
  font-size: 2.1rem;
  line-height: 1;
  color: rgba(30, 28, 25, .09);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.card-year {
  display: inline-block;
  font-family: var(--serif);
  font-size: .82rem;
  letter-spacing: .1em;
  color: var(--vermilion);
  border-bottom: 1px solid rgba(176, 70, 47, .3);
  padding-bottom: 1px;
  font-variant-numeric: tabular-nums;
}

.card-name {
  margin: 10px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.12rem, 4.4vw, 1.3rem);
  line-height: 1.4;
  padding-right: 2.4em;
}

.card-people {
  margin: 6px 0 0;
  font-size: .78rem;
  color: var(--celadon);
  letter-spacing: .02em;
}

.card-desc {
  margin: 12px 0 0;
  font-size: .9rem;
  line-height: 1.8;
  color: var(--ink-soft);
}

.card-cue {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  font-size: .76rem;
  letter-spacing: .06em;
  color: var(--ink);
}

.card-cue i {
  font-style: normal;
  display: inline-grid;
  place-items: center;
  width: 18px; height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: .8rem;
  transition: transform .25s ease, background .25s ease, color .25s ease;
}

.card-face[aria-expanded="true"] .card-cue i {
  transform: rotate(45deg);
  background: var(--vermilion);
  border-color: var(--vermilion);
  color: var(--paper);
}

.card-body {
  padding: 0 clamp(16px, 3.6vw, 24px) clamp(16px, 3.6vw, 24px);
  border-top: 1px dashed var(--line);
  margin: 0 clamp(16px, 3.6vw, 24px);
  animation: fade .3s ease both;
}

.card-body h4 {
  margin: 14px 0 4px;
  font-size: .7rem;
  letter-spacing: .2em;
  color: var(--vermilion);
  font-weight: 600;
}

.card-body p {
  margin: 0;
  font-size: .88rem;
  line-height: 1.85;
  color: var(--ink-soft);
}

.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0;
  margin: 14px 0 0;
}

.tags li {
  font-size: .7rem;
  color: var(--celadon);
  border: 1px solid rgba(61, 97, 89, .3);
  border-radius: 999px;
  padding: 2px 9px;
  line-height: 1.6;
}

/* ---------- 时间轴 ---------- */

.timeline-section {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(34px, 8vw, 72px) var(--pad) clamp(20px, 5vw, 40px);
  border-top: 1px solid var(--line);
}

.timeline {
  list-style: none;
  margin: clamp(24px, 5vw, 42px) 0 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 9px;
  width: 1px;
  background: var(--line);
}

.tl-node {
  appearance: none;
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0 10px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: inherit;
  font: inherit;
  padding: 8px 10px 8px 30px;
  margin: 0 0 2px;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.tl-node::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 16px;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--paper);
  border: 1px solid var(--ink);
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.tl-node:hover { background: rgba(176, 70, 47, .06); }
.tl-node:hover::before { background: var(--vermilion); border-color: var(--vermilion); transform: scale(1.15); }

.tl-year {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 4.4vw, 1.4rem);
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
}

.tl-label {
  font-size: .85rem;
  color: var(--ink-soft);
  line-height: 1.6;
}

.tl-hall {
  font-size: .66rem;
  letter-spacing: .14em;
  color: rgba(30, 28, 25, .38);
}

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

.site-foot {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(28px, 6vw, 46px) var(--pad) calc(clamp(28px, 6vw, 46px) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: .82rem;
}

.site-foot p { margin: 0 0 4px; }
.site-foot .foot-note { font-size: .74rem; color: rgba(30, 28, 25, .45); }
.site-foot a { display: inline-block; margin-top: 12px; font-size: .78rem; }

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

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

@keyframes fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes flash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(176, 70, 47, 0); }
  20%      { box-shadow: 0 0 0 3px rgba(176, 70, 47, .35); }
}

/* ---------- 平板 / 桌面 ---------- */

@media (min-width: 720px) {
  .site-head {
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "brand nav visited";
    gap: var(--gap);
    padding: 12px var(--pad);
  }

  .hall-nav { justify-self: center; width: min(720px, 100%); }

    .hall-tab {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 12px;
    font-size: .82rem;
    white-space: nowrap;
  }

  .hall-tab i { font-size: .7rem; }

  /* 时间轴：中轴两侧交错 */
  .timeline::before { left: 50%; transform: translateX(-50%); }

  .timeline li { width: 100%; }

  .tl-node {
    width: 62%;
    margin: 0 0 6px;
    padding: 10px 18px;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    column-gap: 12px;
  }

  .tl-node::before { left: auto; }

  .timeline li:nth-child(odd) .tl-node { margin-right: auto; }
  .timeline li:nth-child(odd) .tl-node::before { right: -18%; left: auto; }

  .timeline li:nth-child(even) .tl-node { margin-left: auto; }
  .timeline li:nth-child(even) .tl-node::before { left: -18%; }

  .tl-hall { grid-column: 1 / -1; }

  .tl-year { font-size: 1.5rem; }
}

@media (min-width: 960px) {
  .tl-node { width: 44%; }
  .timeline li:nth-child(odd) .tl-node::before { right: -13.6%; }
  .timeline li:nth-child(even) .tl-node::before { left: -13.6%; }
}

/* ---------- 手机竖屏 ---------- */

@media (max-width: 480px) {
  .intro-halls { grid-template-columns: 1fr; gap: 8px; }
  .intro-note { font-size: .7rem; }
  .card-no { font-size: 1.8rem; }
  .site-head {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand visited"
      "nav   nav";
    row-gap: 8px;
  }
  .hall-nav { gap: 5px; }
  .hall-tab {
    font-size: .74rem;
    padding: 7px 3px;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    white-space: nowrap;
  }
  .hall-tab i { font-size: .64rem; }
  .hall-tab .t-en { display: none; }
  .hall-tab .t-short { display: inline; }
  .hall-tab .t-zh { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
