/* ============ 基础 ============ */
:root {
  --paper: #fbfaf6;
  --ink: #111111;
  --red: #e0201b;
  --shadow: 8px 8px 0 rgba(17, 17, 17, 0.9);
  --shadow-sm: 4px 4px 0 rgba(17, 17, 17, 0.9);
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;
}
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
img { user-select: none; }

/* ============ 开场视频 ============ */
.intro {
  position: fixed; inset: 0; z-index: 60;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
}
.intro.is-hidden { opacity: 0; visibility: hidden; transition: opacity 0.45s ease, visibility 0s 0.45s; }
.intro-video { width: 100%; height: 100%; object-fit: contain; display: block; }
.intro-fallback { max-width: 100%; max-height: 100%; object-fit: contain; }
/* ============ 主画面 ============ */
.stage {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
}
.scene {
  position: relative;
  width: min(100vw, calc(100vh * 1.7768));
  aspect-ratio: 1672 / 941;
  max-height: 100vh;
}
.cover, .state-image {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
}
.state-image {
  opacity: 0;
  transition: opacity 0.16s ease;
  will-change: opacity;
  pointer-events: none;
}
.state-image.is-active {
  opacity: 1;
}

/* 四张票券热区（百分比按设计图实测包围盒） */
.hotspot { position: absolute; background: transparent; border-radius: 10px; }
.hotspot:focus-visible { outline: 3px dashed var(--red); outline-offset: 3px; }
.hs-projects   { left: 2.87%;  top: 17.45%; width: 21.77%; height: 29.36%; }
.hs-experience { left: 26.79%; top: 4.89%;  width: 21.30%; height: 27.11%; }
.hs-github     { left: 51.91%; top: 5.74%;  width: 21.30%; height: 26.39%; }
.hs-skills     { left: 75.12%; top: 17.87%; width: 21.77%; height: 28.94%; }

/* 手机端栏目入口 */
.mobile-nav { display: none; }

/* ============ 弹窗 ============ */
.modal {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  visibility: hidden; opacity: 0;
  transition: opacity 0.25s ease, visibility 0s 0.25s;
}
.modal.is-open { visibility: visible; opacity: 1; transition: opacity 0.25s ease; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(17, 17, 17, 0.45); }
.modal-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(84vh, 900px);
  display: flex; flex-direction: column;
  background: #fffdf9;
  border: 3px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 26px 18px;
  transform: translateY(14px) scale(0.98);
  transition: transform 0.25s ease;
}
.modal.is-open .modal-card { transform: translateY(0) scale(1); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.modal-kicker { display: flex; align-items: baseline; gap: 10px; }
.modal-kicker b {
  font-size: 44px; font-weight: 900; color: var(--red);
  letter-spacing: -0.02em;
}
.modal-kicker span { font-size: 12px; font-weight: 700; letter-spacing: 0.22em; color: #8a8578; }
.modal-close {
  width: 38px; height: 38px; flex: none;
  border: 2px solid var(--ink); border-radius: 50%;
  background: #fff; font-size: 20px; font-weight: 700; line-height: 1;
  box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.85);
  transition: transform 0.15s ease;
}
.modal-close:hover { background: var(--red); border-color: var(--red); color: #fff; transform: rotate(90deg); }
.modal-title { font-size: 26px; font-weight: 900; margin: 2px 0 14px; }
.modal-body { overflow-y: auto; padding-right: 6px; flex: 1; }
.modal-foot {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 2px dashed rgba(17, 17, 17, 0.25);
  margin-top: 14px; padding-top: 12px;
}
.modal-foot a { color: var(--ink); font-weight: 700; font-size: 13px; text-decoration: none; }
.modal-foot a:hover { color: var(--red); }
.entry-action {
  display: inline-block;
  margin-top: 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}
.entry-action:hover { text-decoration: underline; }
.entry-action-disabled { color: #99937f; font-weight: 700; }
.modal-barcode {
  width: 92px; height: 22px;
  background: repeating-linear-gradient(90deg,
    var(--ink) 0 2px, transparent 2px 4px, var(--ink) 4px 7px, transparent 7px 9px,
    var(--ink) 9px 10px, transparent 10px 13px, var(--ink) 13px 15px, transparent 15px 17px);
  opacity: 0.85;
}

/* 弹窗内容块 */
.m-entry { border: 2px solid var(--ink); border-radius: 12px; background: #fff; box-shadow: var(--shadow-sm); padding: 16px 18px; margin-bottom: 16px; }
.m-entry-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 12px; margin-bottom: 6px; }
.m-entry-title h3 { font-size: 17px; font-weight: 900; }
.m-entry-title .m-time { font-size: 12.5px; font-weight: 700; color: var(--red); }
.m-entry-title .m-role { font-size: 12.5px; color: #6f6a5e; margin-left: auto; }
.m-stack { font-size: 12.5px; color: #6f6a5e; margin-bottom: 8px; }
.m-stack b { color: var(--ink); }
.m-desc { font-size: 14px; line-height: 1.75; color: #333; margin-bottom: 8px; }
.m-list { list-style: none; }
.m-list li {
  position: relative; padding-left: 16px;
  font-size: 13.5px; line-height: 1.72; color: #333; margin-bottom: 6px;
}
.m-list li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 7px; height: 7px; background: var(--red); border-radius: 2px; }
.m-list li b { color: var(--ink); }
.m-info { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.m-info div { border: 1.5px solid rgba(17,17,17,0.2); border-radius: 8px; padding: 7px 10px; font-size: 12.5px; color: #55503f; background: var(--paper); }
.m-info b { display: block; font-size: 11px; letter-spacing: 0.12em; color: #99937f; margin-bottom: 2px; }
.m-note { font-size: 12px; color: #99937f; margin: 2px 2px 12px; }

/* ============ 手机端 ============ */
@media (max-width: 760px) {
  .stage { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .scene { width: 100vw; max-height: none; }
  .mobile-nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(251, 250, 246, 0.94);
    border-top: 2px solid var(--ink);
    backdrop-filter: blur(6px);
  }
  .mobile-nav button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    border: 2px solid var(--ink); border-radius: 10px;
    background: #fff; padding: 8px 2px;
    font-size: 12px; font-weight: 900;
    box-shadow: 3px 3px 0 rgba(17, 17, 17, 0.85);
  }
  .mobile-nav button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 rgba(17,17,17,.85); }
  .mobile-nav i { font-style: normal; color: var(--red); font-weight: 900; font-size: 14px; }
  .modal { padding: 12px; }
  .modal-card { padding: 16px 16px 12px; border-radius: 12px; }
  .modal-kicker b { font-size: 34px; }
  .modal-title { font-size: 21px; }
}

/* ============ 减少动态 ============ */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after {
  transition: none !important;
  animation: none !important;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
