:root {
  --hm-bg: #060d16;
  --hm-surface: #0a1520;
  --hm-surface-2: #10202e;
  --hm-line: rgba(138, 196, 220, 0.22);
  --hm-text: #edf7fb;
  --hm-muted: #91a9b8;
  --hm-blue: #55c9ee;
  --hm-teal: #43d6b4;
  --hm-gold: #efc35b;
  --hm-topbar-height: 56px;
  --hm-max-width: 1600px;
}

.reality-page {
  background: var(--hm-bg);
  color: var(--hm-text);
  overflow: hidden;
}

.reality-bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image:
    radial-gradient(circle at 20% 25%, rgba(85, 201, 238, 0.07) 0%, transparent 42%),
    radial-gradient(circle at 55% 75%, rgba(67, 214, 180, 0.05) 0%, transparent 42%),
    radial-gradient(circle at 85% 30%, rgba(239, 195, 91, 0.05) 0%, transparent 42%),
    linear-gradient(rgba(138, 196, 220, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(138, 196, 220, 0.035) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 100% 100%, 40px 40px, 40px 40px;
}

.reality-page .topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--hm-topbar-height);
  background: rgba(6, 13, 22, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hm-line);
  z-index: 100;
}

.reality-topnav {
  display: flex;
  gap: 10px;
  margin-left: auto;
  margin-right: 16px;
}

.topnav-link {
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  text-decoration: none;
  border: 1px solid var(--hm-line);
  color: var(--hm-muted);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.topnav-link:hover { background: var(--hm-surface-2); }
.topnav-blue { color: var(--hm-blue); border-color: rgba(85, 201, 238, 0.35); }
.topnav-teal { color: var(--hm-teal); border-color: rgba(67, 214, 180, 0.35); }
.topnav-gold { color: var(--hm-gold); border-color: rgba(239, 195, 91, 0.35); }
.topnav-active {
  color: var(--hm-bg);
  background: var(--hm-blue);
  border-color: var(--hm-blue);
  font-weight: 600;
}
.topnav-active:hover { background: var(--hm-blue); }

.reality-shell {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  scroll-behavior: smooth;
}

.reality-screen {
  position: relative;
  height: calc(100svh - var(--hm-topbar-height));
  overflow: hidden;
  scroll-snap-align: start;
  padding: calc(var(--hm-topbar-height) + 10px) max(16px, calc((100vw - var(--hm-max-width)) / 2)) 8px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.reality-screen .screen-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.reality-screen .screen-header.compact {
  margin-bottom: 6px;
}

.reality-screen .screen-number {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--hm-line);
  border-radius: 8px;
  color: var(--hm-blue);
  font: 700 16px var(--font-mono);
  background: var(--hm-surface);
}

.reality-screen .screen-header h2 {
  margin: 0;
  color: var(--hm-text);
  font-size: clamp(20px, 2.2vw, 28px);
  line-height: 1.25;
}

.reality-screen .screen-desc {
  margin: 4px 0 0;
  color: var(--hm-muted);
  font-size: 15.5px;
  max-width: 1080px;
  line-height: 1.55;
}

/* Screen 1: Hero */
.screen-reality-hero {
  justify-content: center;
}

.reality-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.reality-hero .eyebrow,
.reality-outro .eyebrow {
  margin: 0;
  color: var(--hm-blue);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.reality-hero h1 {
  margin: 0;
  color: var(--hm-text);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.15;
  background: linear-gradient(90deg, var(--hm-blue), var(--hm-teal), var(--hm-gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.reality-hero-entitle {
  margin: 0;
  color: var(--hm-muted);
  font: 600 clamp(15px, 1.6vw, 20px) var(--font-mono);
  letter-spacing: 0.08em;
}

.reality-quote {
  margin: 6px 0 0;
  padding: 14px 26px;
  border: 1px solid var(--hm-line);
  border-left: 3px solid var(--hm-gold);
  border-radius: 12px;
  background: var(--hm-surface);
}

.reality-quote .quote-en {
  margin: 0;
  color: var(--hm-text);
  font-size: clamp(16.5px, 1.8vw, 22px);
  line-height: 1.5;
}

.reality-quote .quote-zh {
  margin: 6px 0 0;
  color: var(--hm-muted);
  font-size: clamp(13px, 1.4vw, 16px);
}

.reality-hero-lead {
  margin: 4px 0 0;
  color: var(--hm-muted);
  font-size: clamp(14.5px, 1.45vw, 17.5px);
  line-height: 1.75;
  max-width: 840px;
}

.scroll-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--hm-muted);
  font-size: 12px;
}

.scroll-hint i {
  width: 18px;
  height: 28px;
  border: 1.5px solid var(--hm-line);
  border-radius: 10px;
  position: relative;
}

.scroll-hint i::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 5px;
  background: var(--hm-blue);
  border-radius: 2px;
  animation: scrollHint 1.6s ease-in-out infinite;
}

@keyframes scrollHint {
  0%, 100% { opacity: 1; transform: translateX(-50%) translateY(0); }
  50% { opacity: 0.3; transform: translateX(-50%) translateY(6px); }
}

/* Screen 2: Principles */
.principle-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 8px;
}

.principle-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--hm-line);
  border-radius: 14px;
  background: var(--hm-surface);
  border-top: 3px solid var(--hm-blue);
}

.principle-card:nth-child(3n+2) { border-top-color: var(--hm-teal); }
.principle-card:nth-child(3n) { border-top-color: var(--hm-gold); }

.principle-index {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 12px;
  border: 1px solid var(--hm-line);
  color: var(--hm-blue);
  font: 700 11px var(--font-mono);
  letter-spacing: 0.1em;
}

.principle-card:nth-child(3n+2) .principle-index { color: var(--hm-teal); }
.principle-card:nth-child(3n) .principle-index { color: var(--hm-gold); }

.principle-card strong {
  color: var(--hm-text);
  font-size: 17px;
  line-height: 1.4;
}

.principle-card p {
  margin: 0;
  color: var(--hm-muted);
  font-size: 14px;
  line-height: 1.65;
}

.principle-note {
  flex-shrink: 0;
  margin: 12px 0 0;
  color: rgba(145, 169, 184, 0.7);
  font-size: 13px;
  text-align: center;
}

/* Screen 3: Case library */
.screen-reality-cases {
  overflow-y: auto;
}

.case-filters {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.case-chip {
  padding: 5px 14px;
  border-radius: 18px;
  border: 1px solid var(--hm-line);
  background: var(--hm-surface);
  color: var(--hm-muted);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.case-chip:hover { background: var(--hm-surface-2); }

.case-chip.active {
  color: var(--hm-bg);
  background: var(--hm-blue);
  border-color: var(--hm-blue);
  font-weight: 600;
}

.case-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 4px;
}

.case-card {
  border: 1px solid var(--hm-line);
  border-radius: 12px;
  background: var(--hm-surface);
  overflow: hidden;
  min-height: 0;
}

.case-card.open {
  border-color: rgba(85, 201, 238, 0.45);
}

.case-toggle {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.case-thumb {
  display: block;
  height: 72px;
  overflow: hidden;
  background: #000;
}

.case-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.9;
}

.case-toggle:hover .case-thumb img { opacity: 1; }

.case-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px 16px 13px;
}

.case-title {
  color: var(--hm-text);
  font-size: 16.5px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-insight {
  color: var(--hm-muted);
  font-size: 13.5px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.case-badge {
  padding: 3px 11px;
  border-radius: 12px;
  border: 1px solid rgba(239, 195, 91, 0.4);
  color: var(--hm-gold);
  font: 700 12.5px var(--font-mono);
}

.case-source {
  padding: 3px 11px;
  border-radius: 12px;
  border: 1px solid var(--hm-line);
  color: var(--hm-muted);
  font: 400 12px var(--font-mono);
}

.case-expand-hint {
  margin-left: auto;
  color: var(--hm-blue);
  font-size: 11.5px;
}

.case-card.open .case-expand-hint { color: var(--hm-teal); }

.case-detail {
  padding: 0 14px 12px;
  border-top: 1px dashed var(--hm-line);
}

.case-stages {
  margin: 10px 0 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.case-stage {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 10px;
  align-items: start;
}

.case-stage dt {
  color: var(--hm-blue);
  font: 700 12px var(--font-mono);
  letter-spacing: 0.05em;
  padding-top: 2px;
}

.case-stage:nth-child(4) dt { color: var(--hm-gold); }
.case-stage:nth-child(5) dt { color: var(--hm-teal); }

.case-stage dd {
  margin: 0;
  color: var(--hm-text);
  font-size: 13.5px;
  line-height: 1.6;
}

.case-assets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-assets span {
  padding: 3px 12px;
  border-radius: 14px;
  border: 1px solid rgba(67, 214, 180, 0.4);
  color: var(--hm-teal);
  font-size: 12.5px;
}

.case-footnote {
  margin: 10px 0 0;
  color: rgba(145, 169, 184, 0.6);
  font-size: 12px;
}

/* Screen 4: Reality Loop */
.reality-loop-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reality-loop-svg {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  align-self: center;
}

.rl-box {
  fill: var(--hm-surface);
  stroke-width: 1.5;
}

.rl-box-blue { stroke: rgba(85, 201, 238, 0.5); }
.rl-box-teal { stroke: rgba(67, 214, 180, 0.5); }
.rl-box-gold { stroke: rgba(239, 195, 91, 0.5); }

.rl-title {
  fill: var(--hm-text);
  font-size: 16px;
  font-weight: 600;
}

.rl-sub {
  fill: var(--hm-muted);
  font-size: 11.5px;
}

.rl-flow {
  fill: none;
  stroke-width: 2.5;
}

.rl-flow-return {
  stroke: rgba(145, 169, 184, 0.55);
  stroke-width: 2;
}

.rl-return-label {
  fill: var(--hm-muted);
  font-size: 12px;
}

.reality-loop-motto {
  flex-shrink: 0;
  margin: 0;
  text-align: center;
  color: var(--hm-gold);
  font-size: clamp(15px, 1.6vw, 19px);
  line-height: 1.5;
}

.reality-loop-motto span {
  display: block;
  margin-top: 4px;
  color: var(--hm-muted);
  font-size: 12.5px;
}

/* Screen 5: Outro */
.screen-reality-outro {
  justify-content: center;
}

.reality-outro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  text-align: center;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.reality-outro h2 {
  margin: 0;
  color: var(--hm-text);
  font-size: clamp(20px, 2.4vw, 30px);
  line-height: 1.5;
  max-width: 900px;
}

.route-entry-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  margin-top: 6px;
}

.route-entry {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--hm-line);
  border-radius: 14px;
  background: var(--hm-surface);
  text-decoration: none;
  text-align: left;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.route-entry:hover {
  transform: translateY(-3px);
}

.route-entry.entry-blue:hover { box-shadow: 0 8px 28px rgba(85, 201, 238, 0.15); border-color: var(--hm-blue); }
.route-entry.entry-teal:hover { box-shadow: 0 8px 28px rgba(67, 214, 180, 0.15); border-color: var(--hm-teal); }
.route-entry.entry-gold:hover { box-shadow: 0 8px 28px rgba(239, 195, 91, 0.15); border-color: var(--hm-gold); }

.route-entry strong {
  color: var(--hm-text);
  font-size: 15.5px;
}

.route-entry small {
  color: var(--hm-muted);
  font-size: 12px;
  letter-spacing: 0.04em;
}

.route-entry .entry-go {
  color: var(--hm-muted);
  font-size: 12px;
  margin-top: 4px;
}

.entry-blue .entry-go { color: var(--hm-blue); }
.entry-teal .entry-go { color: var(--hm-teal); }
.entry-gold .entry-go { color: var(--hm-gold); }

.back-home-link {
  margin-top: 4px;
  color: var(--hm-muted);
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s;
}

.back-home-link:hover { color: var(--hm-blue); }

/* Navigator */
.screen-navigator {
  position: fixed;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.screen-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  width: 42px;
  padding: 6px 2px;
  border: 1px solid var(--hm-line);
  border-radius: 8px;
  background: var(--hm-surface);
  color: var(--hm-muted);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.screen-nav-item:hover {
  background: var(--hm-surface-2);
}

.screen-nav-item.active {
  background: var(--hm-blue);
  border-color: var(--hm-blue);
  color: var(--hm-bg);
}

.screen-nav-item span {
  font: 700 11px var(--font-mono);
}

.screen-nav-item small {
  font-size: 9px;
  line-height: 1;
}

.screen-progress {
  position: fixed;
  left: 0;
  bottom: 0;
  right: 0;
  height: 2px;
  z-index: 60;
  background: var(--hm-surface);
}

.screen-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--hm-blue), var(--hm-teal), var(--hm-gold));
  transition: width 0.3s ease;
}

/* ICP 备案页脚：左下角常驻，极小弱化，不干扰整屏布局 */
.icp-footer {
  position: fixed;
  left: 14px;
  bottom: 8px;
  z-index: 55;
}

.icp-footer a {
  color: rgba(145, 169, 184, 0.5);
  font-size: 11px;
  text-decoration: none;
  transition: color 0.2s;
}

.icp-footer a:hover {
  color: var(--hm-muted);
}

/* Animations */
@keyframes hmFadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.reality-screen.is-active .principle-card,
.reality-screen.is-active .case-card,
.reality-screen.is-active .reality-loop-svg,
.reality-screen.is-active .route-entry,
.reality-screen.is-active .reality-quote {
  animation: hmFadeInUp 0.5s ease backwards;
}

@media (prefers-reduced-motion: reduce) {
  .scroll-hint i::after { animation: none; }
  .reality-screen.is-active .principle-card,
  .reality-screen.is-active .case-card,
  .reality-screen.is-active .reality-loop-svg,
  .reality-screen.is-active .route-entry,
  .reality-screen.is-active .reality-quote {
    animation: none;
  }
}

/* Compact desktop: narrow width OR short viewport */
@media (max-width: 1400px), (max-height: 960px) {
  .reality-screen {
    padding: calc(var(--hm-topbar-height) + 6px) max(16px, calc((100vw - var(--hm-max-width)) / 2)) 0px;
  }
  .reality-screen .screen-header {
    margin-bottom: 4px;
  }
  .reality-screen .screen-header.compact {
    margin-bottom: 2px;
  }
  .reality-screen .screen-header h2 {
    font-size: 20px;
  }
  .reality-screen .screen-desc {
    font-size: 13px;
  }
  .reality-hero {
    gap: 12px;
  }
  .reality-hero h1 {
    font-size: 32px;
  }
  .reality-hero-lead {
    font-size: 13px;
    line-height: 1.6;
  }
  .reality-quote {
    padding: 10px 20px;
  }
  .principle-grid {
    gap: 10px;
    margin-top: 6px;
  }
  .principle-card {
    padding: 12px 14px;
    gap: 6px;
  }
  .principle-card strong {
    font-size: 14px;
  }
  .principle-card p {
    font-size: 12px;
    line-height: 1.55;
  }
  .principle-note {
    margin-top: 8px;
    font-size: 11px;
  }
  .case-filters {
    gap: 6px;
    margin-bottom: 8px;
  }
  .case-chip {
    padding: 4px 12px;
    font-size: 11px;
  }
  .case-grid {
    gap: 10px;
  }
  .case-thumb {
    height: 40px;
  }
  .case-head {
    padding: 8px 12px 9px;
    gap: 4px;
  }
  .case-title {
    font-size: 13px;
  }
  .case-insight {
    font-size: 11px;
    -webkit-line-clamp: 1;
  }
  .case-badge, .case-source {
    font-size: 10px;
    padding: 1px 8px;
  }
  .case-stage {
    grid-template-columns: 160px 1fr;
    gap: 8px;
  }
  .case-stage dd {
    font-size: 11.5px;
  }
  .rl-title {
    font-size: 14px;
  }
  .rl-sub {
    font-size: 10.5px;
  }
  .reality-loop-motto {
    font-size: 15px;
  }
  .reality-outro {
    gap: 12px;
  }
  .reality-outro h2 {
    font-size: 20px;
  }
  .route-entry {
    padding: 12px 16px;
  }
}

/* Ultra-compact: short laptop windows */
@media (max-height: 700px) and (min-width: 1181px) {
  .reality-hero h1 {
    font-size: 26px;
  }
  .reality-hero-entitle {
    font-size: 13px;
  }
  .reality-quote .quote-en {
    font-size: 14px;
  }
  .reality-quote .quote-zh {
    font-size: 11px;
  }
  .reality-hero-lead {
    font-size: 12px;
    line-height: 1.5;
  }
  .principle-card {
    padding: 10px 12px;
    gap: 4px;
  }
  .principle-card strong {
    font-size: 13px;
  }
  .principle-card p {
    font-size: 11px;
    line-height: 1.5;
  }
  .case-thumb {
    height: 32px;
  }
  .case-title {
    font-size: 12.5px;
    -webkit-line-clamp: 1;
  }
}

/* Short laptop windows (e.g. 1366x768): case library must fit one screen */
@media (max-height: 820px) and (min-width: 1181px) {
  .case-thumb {
    height: 20px;
  }
  .case-head {
    padding: 6px 12px 6px;
    gap: 3px;
  }
  .case-grid {
    gap: 8px;
  }
  .case-title {
    font-size: 12.5px;
  }
  .case-filters {
    margin-bottom: 6px;
  }
}

/* Tablet and below: disable snap, stack */
@media (max-width: 1180px) {
  .reality-shell {
    scroll-snap-type: none;
    height: auto;
    overflow-y: visible;
  }
  .reality-screen {
    min-height: auto;
    height: auto;
    overflow: visible;
    padding: calc(var(--hm-topbar-height) + 12px) 16px 24px;
  }
  .principle-grid,
  .case-grid,
  .route-entry-cards {
    grid-template-columns: 1fr;
  }
  .case-thumb {
    height: 140px;
  }
  .case-title, .case-insight {
    -webkit-line-clamp: unset;
  }
  .case-stage {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .reality-topnav {
    display: none;
  }
  .screen-navigator, .screen-progress, .scroll-hint {
    display: none;
  }
}
