:root {
  --ink: #101314;
  --frame-line: rgba(20, 24, 25, 0.42);
  --frame-gap: 22px;
  --serif-editorial: "Cormorant Garamond", "Playfair Display", "Times New Roman", Georgia, "Noto Serif SC", "Songti SC", serif;
  --sans-clean: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei UI", "Segoe UI", sans-serif;
}

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

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 34%, #f1f4f4 0%, #dce1e2 56%, #c1c8ca 100%);
  color: var(--ink);
  font-family: var(--sans-clean);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

body::before {
  content: "";
  position: fixed;
  inset: var(--frame-gap);
  z-index: 2;
  border: 1px solid var(--frame-line);
  border-radius: 10px;
  pointer-events: none;
}

/* 3D 画布跨在 1px 画框线(z=2)之上形成立体破框感，同时位于文案导航层(z=6)之下绝不遮挡文字与备案号 */
#three-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 4;
  pointer-events: none;
}

.gallery-frame {
  position: fixed;
  inset: var(--frame-gap);
  z-index: 6;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 26px 16px;
  pointer-events: none;
}

.topbar,
.bottom-bar {
  position: relative;
  z-index: 8;
  pointer-events: auto;
}

.hero-center {
  position: absolute;
  left: 50%;
  top: 13.5vh;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.stem-arrow {
  position: relative;
  z-index: 9;
  pointer-events: auto;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
}

.brand {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif-editorial);
  font-style: italic;
  font-size: 19px;
  letter-spacing: 0.01em;
}

.brand-asterisk {
  font-style: normal;
  font-size: 16px;
  display: inline-block;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand:hover .brand-asterisk {
  transform: rotate(90deg);
}

.brand-text {
  border-bottom: 1px solid rgba(16, 19, 20, 0.55);
  padding-bottom: 1px;
}

.top-nav {
  justify-self: center;
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.35vw, 23px);
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(246, 248, 248, 0.46);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 19, 20, 0.11);
}

.nav-item {
  display: inline-flex;
  align-items: baseline;
  gap: 3.5px;
  color: var(--ink);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  border-bottom: 1px solid transparent;
  padding: 2px 0;
  white-space: nowrap;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-num {
  font-family: var(--serif-editorial);
  font-style: italic;
  font-size: 13px;
  font-weight: 500;
  color: rgba(16, 19, 20, 0.46);
}

.nav-lock {
  font-style: normal;
  font-size: 10px;
  opacity: 0.62;
  margin-left: 1px;
}

.nav-item:hover {
  color: #8b334a;
  border-bottom-color: rgba(139, 51, 74, 0.58);
  transform: translateY(-1px);
}

.nav-item:hover .nav-num {
  color: #8b334a;
}

.top-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(16, 19, 20, 0.28);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(6px);
  color: var(--ink);
  font-family: var(--serif-editorial);
  font-size: 15px;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.sound-btn:hover {
  background: rgba(255, 255, 255, 0.68);
  border-color: rgba(16, 19, 20, 0.55);
}

.eq-bars {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  height: 12px;
}

.eq-bars i {
  display: block;
  width: 2px;
  height: 4px;
  border-radius: 1px;
  background: var(--ink);
}

.sound-btn.is-playing .eq-bars i:nth-child(1) { animation: eq-bounce 0.85s ease-in-out infinite; }
.sound-btn.is-playing .eq-bars i:nth-child(2) { animation: eq-bounce 0.65s ease-in-out 0.15s infinite; }
.sound-btn.is-playing .eq-bars i:nth-child(3) { animation: eq-bounce 0.95s ease-in-out 0.3s infinite; }
.sound-btn.is-playing .eq-bars i:nth-child(4) { animation: eq-bounce 0.75s ease-in-out 0.1s infinite; }

@keyframes eq-bounce {
  0%, 100% { height: 3px; }
  50% { height: 12px; }
}

.menu-btn {
  width: 32px;
  height: 26px;
  padding: 4px 2px;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 100%;
  height: 1.2px;
  background: var(--ink);
  transition: transform 0.22s ease;
}

.menu-btn:hover span:nth-child(2) { transform: translateX(-3px); }
.menu-btn:hover span:nth-child(3) { transform: translateX(3px); }

.hero-title {
  margin: 0;
  font-family: var(--serif-editorial);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(52px, 7.2vw, 108px);
  line-height: 0.94;
  letter-spacing: -0.022em;
  color: #0d1011;
  text-shadow: 0 8px 30px rgba(255, 255, 255, 0.55);
  animation: title-rise 1.1s cubic-bezier(0.19, 1, 0.22, 1) both;
}

.hero-title span {
  display: block;
}

.hero-subtitle {
  margin: 14px 0 0;
  font-size: 12.5px;
  letter-spacing: 0.26em;
  text-indent: 0.26em;
  color: rgba(16, 19, 20, 0.56);
  animation: title-rise 1.28s cubic-bezier(0.19, 1, 0.22, 1) 0.1s both;
}

.stem-arrow {
  margin-top: 18px;
  border: 0;
  background: none;
  padding: 6px 16px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  opacity: 0.92;
  transition: transform 0.3s ease, opacity 0.3s ease;
  animation: title-rise 1.42s cubic-bezier(0.19, 1, 0.22, 1) 0.18s both;
}

.stem-arrow:hover {
  transform: translateY(4px);
  opacity: 1;
}

.stem-dot {
  width: 4.5px;
  height: 4.5px;
  border-radius: 50%;
  background: rgba(16, 19, 20, 0.78);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.85);
}

.stem-line {
  width: 1.2px;
  height: 36px;
  background: linear-gradient(to bottom, rgba(16, 19, 20, 0.75), rgba(16, 19, 20, 0.38));
}

.stem-tip {
  width: 7px;
  height: 7px;
  margin-top: -5px;
  border-right: 1.3px solid rgba(16, 19, 20, 0.72);
  border-bottom: 1.3px solid rgba(16, 19, 20, 0.72);
  transform: rotate(45deg);
}

@keyframes title-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.bottom-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.interaction-hint {
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(16, 19, 20, 0.82);
  background: rgba(244, 247, 247, 0.64);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 19, 20, 0.12);
  border-radius: 999px;
  padding: 5px 13px;
}

.footer-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(244, 247, 247, 0.64);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(16, 19, 20, 0.12);
  border-radius: 999px;
  padding: 4px 14px;
}

.beian-links {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: rgba(16, 19, 20, 0.68);
}

.beian-links a {
  color: inherit;
  text-decoration: none;
}

.beian-links a:hover {
  color: var(--ink);
  text-decoration: underline;
}

.corner-signature {
  font-family: var(--serif-editorial);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid rgba(16, 19, 20, 0.48);
}

.portal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(18, 22, 24, 0.34);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fade-in 0.24s ease;
}

.portal-backdrop[hidden] {
  display: none !important;
}

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

.portal-panel {
  width: min(1080px, 100%);
  max-height: calc(100vh - 44px);
  overflow-y: auto;
  background: rgba(246, 248, 248, 0.95);
  border: 1px solid rgba(20, 24, 25, 0.18);
  border-radius: 20px;
  padding: 24px 28px 28px;
  box-shadow: 0 24px 64px rgba(12, 16, 18, 0.24);
}

.portal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.portal-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(16, 19, 20, 0.5);
}

.portal-head h2 {
  margin: 0;
  font-family: var(--serif-editorial);
  font-style: italic;
  font-weight: 400;
  font-size: 30px;
}

.portal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(16, 19, 20, 0.18);
  background: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 15px;
  transition: background 0.2s ease;
}

.portal-close:hover {
  background: #ffffff;
}

.portal-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.filter-pill {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(16, 19, 20, 0.14);
  background: rgba(255, 255, 255, 0.62);
  color: rgba(16, 19, 20, 0.72);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.filter-pill:hover {
  border-color: rgba(16, 19, 20, 0.36);
  color: var(--ink);
}

.filter-pill.is-active {
  background: #141819;
  border-color: #141819;
  color: #ffffff;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}

.portal-card {
  display: flex;
  flex-direction: column;
  padding: 16px 17px;
  border-radius: 14px;
  border: 1px solid rgba(16, 19, 20, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

.portal-card[hidden] {
  display: none !important;
}

.portal-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 51, 74, 0.42);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(16, 19, 20, 0.08);
}

.portal-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.portal-idx {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(16, 19, 20, 0.48);
}

.portal-tag {
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(16, 19, 20, 0.06);
  color: rgba(16, 19, 20, 0.66);
  white-space: nowrap;
}

.portal-tag.is-locked {
  background: rgba(143, 61, 82, 0.1);
  color: #8f3d52;
}

.portal-card strong {
  display: block;
  margin-top: 8px;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink);
}

.portal-card p {
  margin: 6px 0 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(16, 19, 20, 0.68);
  flex: 1;
}

.portal-card-mainlink {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.portal-sublinks {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(16, 19, 20, 0.12);
}

.portal-sublinks a {
  font-size: 12px;
  font-weight: 500;
  color: #8f3d52;
  text-decoration: none;
}

.portal-sublinks a:hover {
  text-decoration: underline;
}

.portal-go {
  font-size: 12.5px;
  font-weight: 500;
  color: #8f3d52;
}

@media (max-width: 1160px) {
  .topbar { grid-template-columns: 1fr auto; }
  .top-nav { display: none; }
  .portal-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  :root { --frame-gap: 12px; }
  .gallery-frame { padding: 14px 16px 12px; }
  .hero-center { top: 11.5vh; }
  .bottom-bar { flex-direction: column; align-items: flex-start; gap: 6px; }
  .footer-right { margin-left: 0; width: 100%; justify-content: space-between; }
  .portal-panel { padding: 18px 16px 20px; }
  .portal-grid { grid-template-columns: 1fr; }
}
