/* ═══════════════════════ 泽潇烛红 · 全局 ═══════════════════════ */
:root {
  --bg: #05070d;
  --ink: #dfe8f5;
  --cyan: #58e6ff;
  --gold: #ffd27a;
  --red: #ff2d3f;
  --red-deep: #7a0a14;
  --quartz: rgba(190, 214, 255, 0.055);
  --quartz-edge: rgba(150, 200, 255, 0.22);
  --serif: "NSimSun", "新宋体", "SimSun", "宋体", serif;
  --kai: "NSimSun", "新宋体", "SimSun", "宋体", serif;
  --sans: -apple-system, "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  overflow: hidden;
}

::selection { background: rgba(88, 230, 255, .25); }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  overflow: hidden;
}
.screen.active { display: block; }
.screen canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.veil {
  position: fixed; inset: 0;
  background: var(--bg);
  opacity: 0; pointer-events: none;
  transition: opacity .55s ease;
  z-index: 90;
}
.veil.on { opacity: 1; pointer-events: all; }

/* ═══════════════════════ 引子 ═══════════════════════ */
#screen-intro { cursor: default; }

/* 暗角：视线收拢到中央标题 */
#screen-intro::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 72% 62% at 50% 46%, transparent 55%, rgba(2, 3, 7, .55) 100%);
  pointer-events: none;
  z-index: 4;
}

.intro-title {
  position: absolute;
  left: 50%; top: 46%;
  transform: translate(-50%, -50%);
  text-align: center;
  opacity: 0;
  z-index: 5;
  pointer-events: none;
  transition: opacity 1.2s ease;
}
.intro-title.show { opacity: 1; }

.title-inner {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(58px, 10.5vw, 136px);
  letter-spacing: .26em;
  text-indent: .26em;
  white-space: nowrap;
  background: linear-gradient(100deg,
    #bffbff 0%, #58e6ff 22%, #f4f8ff 46%,
    #ffd27a 60%, #ff5a4d 82%, #ff2d3f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 22px rgba(88, 230, 255, .45))
          drop-shadow(0 0 46px rgba(255, 45, 63, .34));
}

.t-char {
  display: inline-block;
  opacity: 0;
  transform: translateY(14px) scale(1.05);
  filter: blur(6px);
  transition: opacity .8s cubic-bezier(.2,.8,.25,1),
              transform .8s cubic-bezier(.2,.8,.25,1),
              filter .8s ease;
}
.intro-title.show .t-char { opacity: 1; transform: none; filter: blur(0); }
.intro-title.show .t-char:nth-child(1) { transition-delay: .05s; }
.intro-title.show .t-char:nth-child(2) { transition-delay: .24s; }
.intro-title.show .t-char:nth-child(3) { transition-delay: .43s; }
.intro-title.show .t-char:nth-child(4) { transition-delay: .62s; }

.title-sub {
  margin-top: 18px;
  font-size: clamp(11px, 1.4vw, 15px);
  letter-spacing: .68em;
  text-indent: .68em;
  color: rgba(223, 232, 245, .55);
  opacity: 0;
  transition: opacity 1.4s ease 1.1s;
}
.intro-title.show .title-sub { opacity: 1; }

.title-line {
  margin: 16px auto 0;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  opacity: 0;
  transition: opacity 1.4s ease 1.35s;
}
.intro-title.show .title-line { opacity: 1; }
.title-line i {
  width: clamp(48px, 9vw, 120px); height: 1px;
  background: linear-gradient(90deg, transparent, rgba(88,230,255,.7));
}
.title-line i:last-child {
  background: linear-gradient(90deg, rgba(255,45,63,.7), transparent);
}
.title-line b {
  width: 7px; height: 7px; transform: rotate(45deg);
  background: linear-gradient(135deg, var(--cyan), var(--red));
  box-shadow: 0 0 12px rgba(255,255,255,.5);
}

.intro-enter {
  position: absolute;
  left: 50%; bottom: 9%;
  transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  opacity: 0; pointer-events: none;
  cursor: pointer;
  transition: opacity .9s ease;
  z-index: 6;
}
.intro-enter.show { opacity: 1; pointer-events: all; }
.enter-ring {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 1px solid rgba(88, 230, 255, .55);
  position: relative;
  animation: ringPulse 2.2s ease-out infinite;
}
.enter-ring::after {
  content: "";
  position: absolute; inset: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--cyan), rgba(88,230,255,0) 70%);
  animation: coreBreath 2.2s ease-in-out infinite;
}
@keyframes ringPulse {
  0% { box-shadow: 0 0 0 0 rgba(88,230,255,.35); }
  70% { box-shadow: 0 0 0 16px rgba(88,230,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(88,230,255,0); }
}
@keyframes coreBreath { 0%,100% { transform: scale(.75); opacity:.7 } 50% { transform: scale(1); opacity:1 } }
.enter-text {
  font-size: 14px;
  letter-spacing: .5em;
  text-indent: .5em;
  color: rgba(223, 232, 245, .75);
}

.intro-skip {
  position: absolute;
  right: 28px; bottom: 24px;
  font-size: 12.5px;
  letter-spacing: .2em;
  color: rgba(223, 232, 245, .38);
  cursor: pointer;
  z-index: 6;
  padding: 8px 10px;
  transition: color .3s;
}
.intro-skip:hover { color: rgba(223, 232, 245, .85); }

/* ═══════════════════════ 首页 · 芯片律动 ═══════════════════════ */
.home-head {
  position: relative;
  z-index: 3;
  text-align: center;
  padding-top: max(34px, 5.5vh);
  pointer-events: none;
}
.home-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 46px);
  letter-spacing: .34em;
  text-indent: .34em;
  background: linear-gradient(100deg, #bffbff, #58e6ff 40%, #ffd27a 62%, #ff5a4d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 14px rgba(88,230,255,.25));
}
.home-slogan {
  margin-top: 10px;
  font-size: 13px;
  letter-spacing: .42em;
  text-indent: .42em;
  color: rgba(223, 232, 245, .5);
}

.chip-grid {
  position: relative;
  z-index: 3;
  width: min(92vw, 860px);
  margin: max(26px, 5vh) auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(12px, 2.2vw, 22px);
}

.chip {
  position: relative;
  aspect-ratio: 1.55 / 1;
  border-radius: 10px;
  background:
    linear-gradient(160deg, rgba(120,160,220,.10), rgba(10,14,24,.72) 42%),
    linear-gradient(0deg, rgba(8,10,18,.9), rgba(8,10,18,.9));
  border: 1px solid rgba(140, 180, 235, .18);
  cursor: pointer;
  overflow: hidden;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.4), border-color .35s, box-shadow .35s;
  /* 芯片引脚 */
  --pin: rgba(140, 180, 235, .28);
}
.chip::before, .chip::after {
  content: "";
  position: absolute;
  left: 12%; right: 12%;
  height: 4px;
  background: repeating-linear-gradient(90deg, var(--pin) 0 6px, transparent 6px 16px);
  opacity: .8;
}
.chip::before { top: -2px; }
.chip::after { bottom: -2px; }

.chip:hover {
  transform: translateY(-5px) scale(1.025);
  border-color: var(--ac, rgba(88,230,255,.55));
  box-shadow: 0 10px 34px -8px var(--acg, rgba(88,230,255,.35)),
              inset 0 0 26px -10px var(--acg, rgba(88,230,255,.3));
}
.chip:active { transform: translateY(-1px) scale(.99); }

.chip-name {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(-58%);
  text-align: center;
  font-size: clamp(15px, 2vw, 20px);
  letter-spacing: .3em;
  text-indent: .3em;
  color: var(--ink);
}
.chip-en {
  position: absolute;
  left: 0; right: 0; top: 50%;
  transform: translateY(52%);
  text-align: center;
  font-size: clamp(8.5px, 1vw, 10.5px);
  letter-spacing: .24em;
  color: rgba(223,232,245,.4);
}
.chip-led {
  position: absolute;
  top: 10px; right: 12px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ac, var(--cyan));
  box-shadow: 0 0 10px var(--ac, var(--cyan));
  animation: ledBlink var(--blink, 2.6s) ease-in-out infinite;
}
@keyframes ledBlink { 0%,100% { opacity: 1 } 50% { opacity: .22 } }

/* 芯片内部走线微光 */
.chip-trace {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, transparent 49.6%, rgba(140,180,235,.12) 49.6% 50.4%, transparent 50.4%),
    linear-gradient(0deg, transparent 49.6%, rgba(140,180,235,.12) 49.6% 50.4%, transparent 50.4%);
  pointer-events: none;
}
.chip-sweep {
  position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, var(--acg, rgba(88,230,255,.14)) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep var(--sweep, 5.5s) ease-in-out infinite;
  pointer-events: none;
}
@keyframes sweep { 0%, 55% { transform: translateX(-120%) } 85%, 100% { transform: translateX(120%) } }

/* 主题变体 */
.chip.civ  { --ac: #58e6ff; --acg: rgba(88,230,255,.32); }
.chip.gold { --ac: #ffd27a; --acg: rgba(255,210,122,.30); }
.chip.beast {
  --ac: #ff2d3f; --acg: rgba(255,45,63,.34);
  --pin: rgba(255, 80, 90, .30);
  border-color: rgba(255, 70, 84, .22);
}
.chip.beast:hover { box-shadow: 0 10px 38px -8px rgba(255,45,63,.5), inset 0 0 30px -10px rgba(255,45,63,.4); }
.chip.core {
  border-color: rgba(255, 210, 122, .35);
  background:
    radial-gradient(120% 120% at 50% 0%, rgba(255,210,122,.10), transparent 55%),
    linear-gradient(160deg, rgba(120,160,220,.10), rgba(10,14,24,.72) 42%),
    linear-gradient(0deg, rgba(8,10,18,.9), rgba(8,10,18,.9));
}
.chip.core .chip-name { font-size: clamp(17px, 2.3vw, 23px); }

.home-foot {
  position: absolute;
  left: 0; right: 0; bottom: max(16px, 3vh);
  z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-size: 11px;
  letter-spacing: .3em;
  color: rgba(223, 232, 245, .32);
  pointer-events: none;
}
.foot-dot { width: 4px; height: 4px; transform: rotate(45deg); background: rgba(223,232,245,.3); }

/* ═══════════════════════ 内页 · 六边形 × 石英 ═══════════════════════ */
.quartz-wrap {
  position: absolute;
  inset: clamp(14px, 3.2vw, 44px);
  z-index: 3;
  display: flex;
}
.quartz-panel {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--quartz);
  -webkit-backdrop-filter: blur(14px) saturate(1.25);
  backdrop-filter: blur(14px) saturate(1.25);
  border: 1px solid var(--quartz-edge);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.10),
    inset 0 -1px 0 rgba(0,0,0,.35),
    0 24px 70px -30px rgba(0,0,0,.85);
  overflow: hidden;
}
/* 石英棱光 */
.quartz-panel::before {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(115deg, rgba(255,255,255,.075) 0%, transparent 28%),
    linear-gradient(295deg, rgba(88,230,255,.05) 0%, transparent 30%),
    linear-gradient(45deg, rgba(255,45,63,.045) 0%, transparent 24%);
  pointer-events: none;
}

.detail-head {
  display: flex; align-items: center; gap: 18px;
  padding: clamp(14px, 2.4vh, 22px) clamp(18px, 3vw, 34px);
  border-bottom: 1px solid rgba(150, 200, 255, .14);
  flex: none;
}
.detail-back {
  flex: none;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: .18em;
  color: rgba(223,232,245,.72);
  background: rgba(140, 180, 235, .08);
  border: 1px solid rgba(150, 200, 255, .22);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  transition: .3s;
}
.detail-back:hover { background: rgba(88,230,255,.14); color: #fff; border-color: rgba(88,230,255,.5); }
.detail-title-box { flex: 1; min-width: 0; }
.detail-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: .26em;
  color: #f2f7ff;
  text-shadow: 0 0 18px rgba(88,230,255,.25);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.detail-sub {
  margin-top: 3px;
  font-size: 10.5px;
  letter-spacing: .3em;
  color: rgba(223,232,245,.42);
  text-transform: uppercase;
}
.detail-orn {
  flex: none;
  width: 34px; height: 34px;
  border: 1px solid rgba(150,200,255,.3);
  transform: rotate(45deg);
  position: relative;
}
.detail-orn::after {
  content: "";
  position: absolute; inset: 10px;
  background: linear-gradient(135deg, var(--cyan), var(--red));
  opacity: .75;
}

.detail-body {
  flex: 1;
  overflow-y: auto;
  padding: clamp(18px, 3vh, 30px) clamp(18px, 3.4vw, 40px) 40px;
  scrollbar-width: thin;
  scrollbar-color: rgba(150,200,255,.3) transparent;
}
.detail-body::-webkit-scrollbar { width: 6px; }
.detail-body::-webkit-scrollbar-thumb { background: rgba(150,200,255,.25); border-radius: 3px; }

.d-block { margin-bottom: 30px; max-width: 72ch; }
.d-block h3 {
  font-size: 15px;
  letter-spacing: .3em;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 10px;
}
.d-block h3::before {
  content: "";
  width: 18px; height: 1px;
  background: linear-gradient(90deg, var(--gold), transparent);
}
.d-block.beast h3 { color: #ff7a86; }
.d-block.beast h3::before { background: linear-gradient(90deg, #ff2d3f, transparent); }
.d-block p {
  font-family: var(--serif);
  font-size: 15px;
  line-height: 2.1;
  color: rgba(223, 232, 245, .85);
  letter-spacing: .08em;
  text-align: justify;
}
.d-block p + p { margin-top: 10px; }

.d-tagrow { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.d-tag {
  font-size: 12px;
  letter-spacing: .14em;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid rgba(150,200,255,.25);
  color: rgba(223,232,245,.78);
  background: rgba(140,180,235,.06);
}
.d-tag.beast { border-color: rgba(255,70,84,.35); color: #ffb3ba; background: rgba(255,45,63,.07); }

.d-empty {
  margin-top: 4px;
  font-size: 12.5px;
  letter-spacing: .22em;
  color: rgba(223,232,245,.35);
  border: 1px dashed rgba(150,200,255,.2);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
}

/* ═══════════════════════ 窄屏适配 ═══════════════════════ */
@media (max-width: 640px) {
  .chip-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; width: 94vw; }
  .chip-name { letter-spacing: .12em; text-indent: .12em; }
  .home-slogan { font-size: 11px; }
  .detail-orn { display: none; }
}
@media (max-width: 430px) {
  .chip { aspect-ratio: 1.1 / 1; }
  .chip-en { display: none; }
  .chip-name { font-size: 13px; }
  .home-foot span:last-child, .home-foot .foot-dot { display: none; }
  .home-foot { letter-spacing: .12em; }
}
