/* ============================================================
   Windows 开机全流程 —— 两阶段样式
   阶段一 #post：BIOS POST 终端代码屏（青色辉光/点线日志/发光进度条）
   阶段二 #boot：Windows 系统开机（白徽标/六点追逐转圈/状态文字）
   切换：body.phase-boot 交叉淡入淡出
   ============================================================ */

:root {
  --bg: #04070a;
  --ink: #c7d5dc;
  --dim: #54646e;
  --cyan: #4fd8c8;
  --cyan-glow: rgba(79, 216, 200, .38);
  --ok: #58e07a;
  --line: rgba(79, 216, 200, .16);
  --mono: "Cascadia Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  width: 100%; height: 100%;
  background: #000;
  overflow: hidden;
}

body {
  font-family: "Segoe UI", "Microsoft YaHei", Tahoma, Arial, sans-serif;
  color: #fff;
  user-select: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  -ms-user-select: none;
  cursor: default;
}

/* ============================================================
   阶段一：BIOS POST
   ============================================================ */
#post {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  z-index: 2;
  background:
    radial-gradient(120% 90% at 50% 10%, rgba(79,216,200,.05), transparent 55%),
    radial-gradient(140% 120% at 50% 110%, rgba(20,60,70,.25), transparent 60%),
    var(--bg);
  animation: crt-hum 7s infinite;
  transition: opacity .9s ease;
  font-family: var(--mono);
}
@keyframes crt-hum { 0%,96%,100% {opacity:1} 97% {opacity:.93} 98% {opacity:.99} }

#post::before {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,.028) 0px, rgba(255,255,255,.028) 1px,
    transparent 1px, transparent 3px);
}

.vignette {
  position: absolute; inset: 0;
  pointer-events: none;
  background: radial-gradient(115% 100% at 50% 50%, transparent 62%, rgba(0,0,0,.55) 100%);
}

.scanbeam {
  position: absolute; left: 0; right: 0;
  height: 120px;
  pointer-events: none;
  background: linear-gradient(to bottom,
    transparent, rgba(79,216,200,.045) 55%, rgba(79,216,200,.09) 62%, transparent);
  animation: beam 9s linear infinite;
}
@keyframes beam { from { top: -140px; } to { top: 110%; } }

/* ---- 顶栏 / 底栏 ---- */
.bar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 52px;
  padding: 0 26px;
  font-size: 13px;
  letter-spacing: .12em;
  color: var(--dim);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 10, 12, .55);
}
.bar.bottom { border-bottom: 0; border-top: 1px solid var(--line); height: 58px; }

.brand { display: flex; align-items: center; gap: 10px; color: var(--cyan); font-weight: 700; }
.brand .em { color: var(--ink); font-weight: 400; margin-left: -6px; }
.brand .ver { color: var(--dim); font-weight: 400; margin-left: 12px; letter-spacing: .08em; }
.clock { color: var(--cyan); text-shadow: 0 0 8px var(--cyan-glow); font-variant-numeric: tabular-nums; }

.pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 10px var(--cyan-glow);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% {opacity:1} 50% {opacity:.25} }

/* ---- 主舞台 ---- */
#stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 30px 7vw 18px;
  max-width: 1080px;
  width: 100%;
  margin: 0 auto;
}

.title-row { margin-bottom: 26px; }
.title-row h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  letter-spacing: .22em;
  color: #eafffb;
  text-shadow: 0 0 18px var(--cyan-glow), 0 0 2px rgba(255,255,255,.4);
}
.title-row p { margin: 8px 0 0; font-size: 12px; letter-spacing: .34em; color: var(--dim); }

/* ---- 日志流 ---- */
#log {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  font-size: clamp(12px, 1.35vw, 15px);
  line-height: 2.1;
}

.row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  transform: translateY(4px);
  animation: row-in .28s ease forwards;
}
@keyframes row-in { to { opacity: 1; transform: none; } }

.row .ts   { color: var(--dim); font-size: .82em; flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.row .key  { color: var(--cyan); flex: 0 0 auto; letter-spacing: .04em; }
.row .dots { flex: 1 1 auto; min-width: 24px; border-bottom: 1px dotted rgba(199,213,220,.22); transform: translateY(-4px); }
.row .val  { color: #eef6f4; text-align: right; text-shadow: 0 0 10px rgba(120,220,205,.18); word-break: break-all; }
.row .tick { flex: 0 0 auto; color: var(--ok); opacity: 0; transform: scale(.4); }
.row .tick.show { animation: tick-in .25s ease forwards; }
@keyframes tick-in { to { opacity: 1; transform: scale(1); } }

.row.plain .val { text-align: left; }
.row.indent { padding-left: 26px; }

.row.phase {
  padding: 14px 0 4px;
  color: var(--cyan);
  font-size: .8em;
  letter-spacing: .3em;
  text-shadow: 0 0 10px var(--cyan-glow);
}
.row.phase::before, .row.phase::after {
  content: "";
  align-self: center;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line));
  flex: 1 1 auto;
}
.row.phase::after { background: linear-gradient(90deg, var(--line), transparent); }
.row.phase > span { flex: 0 0 auto; padding: 0 14px; }

.cursor {
  display: inline-block;
  width: .55em; height: 1.05em;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan-glow);
  vertical-align: text-bottom;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---- 内存高光块 ---- */
#memwrap {
  flex: 0 0 auto;
  margin: 18px 0 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(79,216,200,.05), rgba(79,216,200,.015));
  box-shadow: inset 0 0 40px rgba(79,216,200,.04);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
#memwrap.show { opacity: 1; transform: none; }
#memwrap.hidden { display: none; }

.mem-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  letter-spacing: .26em;
  color: var(--cyan);
  margin-bottom: 12px;
}
.mem-count { color: var(--ink); letter-spacing: .04em; }
.mem-count b {
  font-size: 26px;
  color: #eafffb;
  text-shadow: 0 0 14px var(--cyan-glow);
  font-variant-numeric: tabular-nums;
}

.mem-track {
  height: 10px;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(79,216,200,.25);
  overflow: hidden;
}
.mem-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, rgba(79,216,200,.55), var(--cyan));
  box-shadow: 0 0 14px var(--cyan-glow);
}

.mem-sub {
  display: flex;
  justify-content: space-between;
  margin-top: 9px;
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--dim);
}
#mempct { color: var(--cyan); font-variant-numeric: tabular-nums; }

/* ---- 底栏 ---- */
.status { display: flex; align-items: center; gap: 10px; color: var(--cyan); letter-spacing: .18em; }
#phase { color: var(--cyan); }

.prompt { display: flex; align-items: center; gap: 8px; color: var(--dim); letter-spacing: .1em;
  opacity: 0; transition: opacity .6s ease; }
.prompt.show { opacity: 1; }
.prompt i { width: 1px; height: 14px; background: var(--line); margin: 0 6px; }
.prompt kbd {
  padding: 2px 8px;
  border: 1px solid rgba(79,216,200,.35);
  color: var(--cyan);
  font-family: inherit;
  font-size: 11px;
  letter-spacing: .08em;
}

/* ============================================================
   阶段二：Windows 系统开机
   ============================================================ */
#boot {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-7vh);
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .9s ease;
}
body.phase-boot #post { opacity: 0; pointer-events: none; }
body.phase-boot #boot { opacity: 1; z-index: 4; }

.logo-wrap { line-height: 0; opacity: 0; }
.spinner  { position: relative; width: 64px; height: 64px; margin-top: 64px; opacity: 0; }

/* 入场动画仅在切换后触发 */
#boot.go .logo-wrap { animation: logo-in .55s ease .15s forwards; }
#boot.go .spinner   { animation: logo-in .55s ease .35s forwards; }
@keyframes logo-in {
  from { opacity: 0; transform: scale(.96); }
  to   { opacity: 1; transform: none; }
}

.winlogo { width: 92px; height: 92px; color: #dfe7ee; }

.spinner i {
  position: absolute;
  inset: 0;
  opacity: 0;
  animation: orbit 2.35s cubic-bezier(.42, .05, .5, .95) infinite;
  animation-delay: calc(var(--i) * -.392s);
}
.spinner i::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  width: 6px; height: 6px;
  margin-left: -3px;
  border-radius: 50%;
  background: #fff;
}
@keyframes orbit {
  0%   { transform: rotate(0deg);   opacity: 0; }
  10%  { opacity: 1; }
  55%  { opacity: 1; }
  100% { transform: rotate(360deg); opacity: 0; }
}

.bstatus {
  margin-top: 42px;
  min-height: 24px;
  font-size: 16px;
  letter-spacing: .06em;
  color: #f2f2f2;
  opacity: 0;
  transition: opacity .45s ease;
}
.bstatus.show { opacity: 1; }

/* ============================================================
   弱提示（两阶段共用）
   ============================================================ */
.hint {
  position: fixed;
  right: 16px;
  bottom: 12px;
  z-index: 10;
  font-size: 12px;
  letter-spacing: .08em;
  color: rgba(255, 255, 255, .18);
  pointer-events: none;
}

/* ============================================================
   SETUP（POST 阶段 DEL/F2）
   ============================================================ */
#setup {
  position: fixed; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background: rgba(2,5,7,.92);
  backdrop-filter: blur(2px);
}
#setup.hidden { display: none; }

.setup-box {
  width: min(720px, 92vw);
  border: 1px solid rgba(79,216,200,.4);
  background: rgba(4,10,12,.97);
  box-shadow: 0 0 60px rgba(79,216,200,.12), 0 0 0 1px rgba(79,216,200,.08);
  font-family: var(--mono);
}
.s-head {
  display: flex; justify-content: space-between;
  padding: 10px 16px;
  background: rgba(79,216,200,.1);
  border-bottom: 1px solid var(--line);
  color: #eafffb;
  letter-spacing: .16em;
  font-size: 13px;
}
.s-head span:last-child { color: var(--dim); }
.s-tabs {
  display: flex; gap: 26px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--dim);
}
.s-tabs .on { color: var(--cyan); border-bottom: 2px solid var(--cyan); padding-bottom: 4px; }
.s-body { padding: 12px 16px; }
.srow {
  display: flex; justify-content: space-between;
  padding: 7px 10px;
  font-size: 13px;
  letter-spacing: .05em;
  border-radius: 3px;
}
.srow .val { color: #eef6f4; }
.srow.sel { background: rgba(79,216,200,.1); outline: 1px solid rgba(79,216,200,.3); }
.srow.sel span:first-child { color: var(--cyan); }
.s-foot {
  padding: 9px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--dim);
}

/* ============================================================
   窄屏
   ============================================================ */
@media (max-width: 640px) {
  #stage { padding: 20px 6vw 12px; }
  #log { line-height: 1.9; font-size: 12px; }
  .bar { padding: 0 14px; font-size: 11px; }
  .brand .ver { display: none; }
  .row .ts { display: none; }
  .mem-count b { font-size: 20px; }
  .prompt { display: none; }
  .winlogo { width: 68px; height: 68px; }
  .spinner { width: 52px; height: 52px; margin-top: 48px; }
  .spinner i::before { width: 5px; height: 5px; margin-left: -2.5px; }
  .bstatus { font-size: 14px; }
}
