:root {
  --bg: #070b12;
  --bg-2: #0e1520;
  --bg-3: #131c2a;
  --panel: rgba(9, 14, 23, 0.88);
  --panel-solid: #0b111a;
  --line: rgba(95, 211, 208, 0.28);
  --line-soft: rgba(220, 232, 236, 0.1);
  --cyan: #5fd3d0;
  --amber: #e8b24c;
  --red: #e05a6a;
  --violet: #c9bdf0;
  --text: #dce8ec;
  --dim: #8fa4ae;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", "Hiragino Sans GB", sans-serif;
  --mono: "Bahnschrift", "DIN Alternate", "SF Mono", "Consolas", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --radius: 4px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #020409;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body { user-select: none; }
button, input { font-family: inherit; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; }
h1, h2, h3, h4, p, dl, dd { margin: 0; }
svg { flex: none; display: inline-block; vertical-align: middle; }
::selection { background: rgba(95, 211, 208, 0.35); }

#stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1280px;
  height: 720px;
  transform-origin: center;
  background: var(--bg);
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(95, 211, 208, 0.12), 0 40px 100px rgba(0, 0, 0, 0.7);
}

.screen { position: absolute; inset: 0; display: none; overflow: hidden; }
.screen.active { display: block; }
.screen.enter { animation: screen-in 0.6s var(--ease); }
@keyframes screen-in { from { opacity: 0; } to { opacity: 1; } }

.corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(95, 211, 208, 0.55);
  pointer-events: none;
  z-index: 30;
}
.corner.tl { left: 10px; top: 10px; border-right: 0; border-bottom: 0; }
.corner.tr { right: 10px; top: 10px; border-left: 0; border-bottom: 0; }
.corner.bl { left: 10px; bottom: 10px; border-right: 0; border-top: 0; }
.corner.br { right: 10px; bottom: 10px; border-left: 0; border-top: 0; }

#modals { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
#modals > * { pointer-events: auto; }
#toasts { position: absolute; top: 78px; right: 28px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; }

/* ---------- 通用控件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: rgba(14, 21, 32, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 15px;
  letter-spacing: 1px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, color 0.2s;
}
.btn:hover, .btn:focus-visible { border-color: var(--cyan); background: rgba(95, 211, 208, 0.1); outline: none; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cyan); border-color: var(--cyan); color: #061014; font-weight: 700; }
.btn.primary:hover, .btn.primary:focus-visible { background: #7fe0dd; }
.btn.danger { border-color: rgba(224, 90, 106, 0.5); color: #f2a3ad; }
.btn.danger:hover { background: rgba(224, 90, 106, 0.15); border-color: var(--red); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-soft);
  background: transparent;
  color: var(--dim);
  transition: all 0.2s;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--cyan); background: rgba(95, 211, 208, 0.1); }

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--dim);
  font-size: 15px;
  letter-spacing: 1px;
  transition: color 0.2s, border-color 0.2s;
}
.tab:hover { color: var(--text); }
.tab.on { color: var(--cyan); border-bottom-color: var(--cyan); }
.tab-n { font-family: var(--mono); font-size: 12px; color: var(--dim); }
.tab.on .tab-n { color: var(--cyan); }

.switch {
  position: relative;
  width: 52px;
  height: 28px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, 0.06);
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}
.switch-knob { position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--dim); transition: transform 0.22s var(--ease), background 0.2s; }
.switch.on { background: rgba(95, 211, 208, 0.25); border-color: var(--cyan); }
.switch.on .switch-knob { transform: translateX(24px); background: var(--cyan); }
.switch:focus-visible { outline: none; border-color: var(--cyan); }

.segmented { display: inline-flex; border: 1px solid var(--line-soft); border-radius: var(--radius); overflow: hidden; }
.seg { padding: 7px 16px; background: transparent; border: 0; color: var(--dim); font-size: 14px; transition: all 0.2s; }
.seg + .seg { border-left: 1px solid var(--line-soft); }
.seg:hover { color: var(--text); }
.seg.on { background: rgba(95, 211, 208, 0.15); color: var(--cyan); }

/* ---------- 加载画面 ---------- */
#boot {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: radial-gradient(ellipse at 50% 40%, #101a28 0%, #070b12 60%, #03050a 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.8s;
}
#boot.done { opacity: 0; pointer-events: none; }
.boot-inner { width: 420px; text-align: center; }
.boot-emblem img { width: 72px; height: 72px; filter: drop-shadow(0 0 18px rgba(95, 211, 208, 0.5)); animation: boot-pulse 2.4s ease-in-out infinite; }
@keyframes boot-pulse { 0%, 100% { opacity: 0.75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
.boot-title { margin-top: 14px; font-size: 34px; font-weight: 800; letter-spacing: 12px; text-indent: 12px; color: var(--text); }
.boot-sub { margin-top: 4px; font-family: var(--mono); font-size: 12px; letter-spacing: 6px; color: var(--cyan); }
.boot-bar { margin: 34px 0 10px; height: 3px; background: rgba(255, 255, 255, 0.08); position: relative; overflow: hidden; }
.boot-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: linear-gradient(90deg, var(--cyan), #9fe0d6); transition: width 0.25s ease-out; }
.boot-meta { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 12px; color: var(--dim); letter-spacing: 2px; }
.boot-tip { margin-top: 26px; font-size: 13px; color: var(--dim); letter-spacing: 2px; animation: boot-pulse 2s ease-in-out infinite; }

#rotate-hint { display: none; }
