/* ========== 首页 ========== */
.hero { display: grid; grid-template-columns: 1.15fr .85fr; align-items: center; gap: 20px; min-height: min(62vh, 520px); }
.hero-txt { display: flex; flex-direction: column; gap: 18px; align-items: flex-start; }
.hero-art { display: grid; place-items: center; }
.hero-art .globe { border: 0; background: none; width: min(380px, 100%) !important; }
.glitch { position: relative; font-size: clamp(64px, 13vw, 136px); font-weight: 900; line-height: 1.05; letter-spacing: .06em; }
[data-theme="neon"] .glitch { color: #fff; text-shadow: 0 0 18px rgba(0, 240, 255, .6), 0 0 70px rgba(255, 43, 214, .45); }
[data-theme="neon"] .glitch::before, [data-theme="neon"] .glitch::after { content: attr(data-text); position: absolute; left: 0; top: 0; text-shadow: none; clip-path: inset(0 0 100% 0); }
[data-theme="neon"] .glitch::before { color: var(--accent); animation: gl-a 3.4s steps(1) infinite; }
[data-theme="neon"] .glitch::after { color: var(--accent2); animation: gl-b 2.9s steps(1) infinite; }
@keyframes gl-a {
  0%, 90%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  91% { clip-path: inset(8% 0 62% 0); transform: translate(-6px, -1px); }
  94% { clip-path: inset(52% 0 18% 0); transform: translate(5px, 1px); }
  97% { clip-path: inset(30% 0 46% 0); transform: translate(-3px, 0); }
}
@keyframes gl-b {
  0%, 86%, 100% { clip-path: inset(0 0 100% 0); transform: none; }
  87% { clip-path: inset(60% 0 8% 0); transform: translate(6px, 1px); }
  90% { clip-path: inset(14% 0 66% 0); transform: translate(-5px, -1px); }
  93% { clip-path: inset(40% 0 34% 0); transform: translate(3px, 0); }
}
[data-theme="space"] .glitch { background: linear-gradient(120deg, #fff 20%, var(--accent) 60%, var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; letter-spacing: .12em; }
[data-theme="term"] .glitch { color: var(--accent); text-shadow: 0 0 18px rgba(57, 255, 122, .6); }
[data-theme="term"] .glitch::after { content: "_"; animation: blink 1s steps(1) infinite; }
.typed { font-size: clamp(15px, 2vw, 19px); min-height: 1.7em; margin: 0; }
.caret { display: inline-block; width: .55em; height: 1.1em; margin-left: 3px; vertical-align: -.18em; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.hud-grid { display: grid; gap: 16px; grid-template-columns: 1.3fr 1.3fr 1fr 1.3fr; margin-top: 10px; }
.hud-grid .stat b { font-size: clamp(22px, 2.6vw, 30px); }
.hud-grid .stat.big b { font-size: clamp(28px, 3.6vw, 42px); letter-spacing: .04em; text-shadow: var(--glow); }
.bar { height: 6px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 14%, transparent); overflow: hidden; margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: var(--grad); border-radius: 9px; }
.post-row { display: flex; gap: 14px; padding: 9px 0; border-bottom: 1px dashed var(--line); color: var(--text); }
.post-row:hover { color: var(--accent); text-decoration: none; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 18px; font-size: 13.5px; }
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-art { order: -1; }
  .hero-art .globe { width: min(250px, 70vw) !important; }
  .hud-grid { grid-template-columns: 1fr 1fr; }
}

/* ========== 表单补充 ========== */
input[type="datetime-local"] { width: 100%; padding: 9px 12px; border-radius: var(--r); border: 1px solid var(--line); outline: none;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); font: 14px var(--font-body); }
input.bad { border-color: var(--bad) !important; box-shadow: 0 0 14px color-mix(in srgb, var(--bad) 40%, transparent) !important; }
.x { flex: none; width: 28px; height: 28px; border-radius: 50%; border: 1px solid transparent; background: none; color: var(--dim); font-size: 18px; line-height: 1; cursor: pointer; }
.x:hover { color: var(--bad); border-color: var(--bad); }
.ck { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 14px; }
.res { margin: 8px 0 0; min-height: 1.7em; color: var(--accent); font-size: 14px; word-break: break-all; }
code { font-family: var(--font-mono); font-size: .92em; padding: 2px 7px; border-radius: 6px; background: color-mix(in srgb, var(--accent) 10%, transparent); color: var(--accent); word-break: break-all; }

/* ========== 游戏 ========== */
.react { width: 100%; min-height: 320px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; cursor: pointer;
  border-radius: var(--r); border: 1px solid var(--line); background: var(--panel); color: var(--text); font-family: var(--font-body); transition: background .12s; user-select: none; touch-action: manipulation; }
.react strong { font-size: clamp(30px, 6vw, 56px); font-weight: 800; }
.react span { font-size: 15px; opacity: .85; min-height: 1.6em; }
.react.wait { background: color-mix(in srgb, var(--bad) 34%, var(--solid)); border-color: var(--bad); }
.react.go { background: var(--ok); color: #03140b; border-color: var(--ok); box-shadow: 0 0 60px color-mix(in srgb, var(--ok) 55%, transparent); }
.react.done { border-color: var(--accent); box-shadow: var(--glow); }
.react.done strong { color: var(--accent); }
.react.early strong { color: var(--accent2); }
.mem { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 86px)); gap: 10px; justify-content: center; perspective: 900px; width: 100%; }
.mem-card { aspect-ratio: 1; border: 0; padding: 0; background: none; cursor: pointer; }
.mem-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .38s; }
.mem-card.on .mem-in, .mem-card.done .mem-in { transform: rotateY(180deg); }
.mem-f, .mem-b { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r); border: 1px solid var(--line);
  backface-visibility: hidden; -webkit-backface-visibility: hidden; font-size: clamp(20px, 5vw, 30px); font-weight: 700; }
.mem-f { background: var(--panel); color: var(--dim); font-family: var(--font-mono); }
.mem-card:hover .mem-f { border-color: var(--accent); color: var(--accent); }
.mem-b { transform: rotateY(180deg); background: color-mix(in srgb, var(--accent) 14%, var(--solid)); color: var(--accent); border-color: var(--accent); text-shadow: 0 0 12px var(--accent); }
.mem-card.done .mem-b { color: var(--accent2); border-color: var(--accent2); text-shadow: 0 0 12px var(--accent2); opacity: .7; }

/* ========== 工具 ========== */
.ring { position: relative; width: min(260px, 70vw); aspect-ratio: 1; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: color-mix(in srgb, var(--accent) 14%, transparent); stroke-width: 8; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .25s linear; filter: drop-shadow(0 0 8px var(--accent)); }
.ring-in { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-t { font-size: clamp(38px, 9vw, 54px); font-weight: 700; color: var(--text); }
.ring-m { color: var(--dim); font-size: 14px; }
.todo { margin: 14px 0; }
.todo-row { display: flex; align-items: center; gap: 12px; padding: 9px 4px; border-bottom: 1px dashed var(--line); cursor: pointer; }
.todo-row span { flex: 1; word-break: break-word; }
.todo-row.done span { color: var(--dim); text-decoration: line-through; }
.day-n { font-size: 44px; font-weight: 700; color: var(--accent); line-height: 1.3; text-shadow: var(--glow); }
.day-n small { font-size: 15px; color: var(--dim); font-weight: 400; text-shadow: none; }
.wheel-r { font-size: 20px; font-weight: 700; color: var(--accent); min-height: 1.6em; text-align: center; }
.pw-out { font-size: clamp(17px, 3vw, 24px); padding: 16px; border-radius: var(--r); border: 1px dashed var(--line); word-break: break-all; color: var(--accent); min-height: 62px; letter-spacing: .04em; }
.sw-row { margin-bottom: 12px; }
.sws { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { flex: 1; min-width: 62px; height: 54px; border-radius: calc(var(--r) * .7); border: 1px solid rgba(255, 255, 255, .16); cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 4px; transition: transform .15s; }
.sw:hover { transform: translateY(-3px); }
.sw span { font: 10.5px var(--font-mono); color: #fff; background: rgba(0, 0, 0, .5); padding: 1px 5px; border-radius: 4px; }
.grad { height: 150px; border-radius: var(--r); border: 1px solid var(--line); margin-top: 12px; }

/* ========== 实验室 ========== */
.drum { display: flex; flex-direction: column; gap: 8px; min-width: 620px; }
.drum-row { display: grid; grid-template-columns: 58px repeat(16, 1fr); gap: 5px; align-items: center; }
.drum-name { font-size: 13px; color: var(--dim); }
.cell { aspect-ratio: 1; min-height: 26px; border-radius: calc(var(--r) * .4); border: 1px solid var(--line); background: color-mix(in srgb, var(--accent) 4%, transparent); cursor: pointer; padding: 0; transition: transform .08s; }
.cell.beat { border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.cell:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.cell.on { background: var(--accent); box-shadow: 0 0 12px var(--accent); border-color: var(--accent); }
.drum-row:nth-child(even) .cell.on { background: var(--accent2); box-shadow: 0 0 12px var(--accent2); border-color: var(--accent2); }
.cell.now { transform: scale(1.14); border-color: var(--text); }

/* ========== 个人空间 / 终端 ========== */
.prose { font-size: 15.5px; line-height: 1.85; }
.prose h3 { font-size: 18px; margin: 22px 0 8px; color: var(--accent); }
.prose ul { margin: 0 0 .8em; padding-left: 1.3em; }
.prose li { margin: 3px 0; }
.term { min-height: 440px; max-height: 68vh; overflow: auto; font-size: 14px; line-height: 1.65; cursor: text; }
.term-l { white-space: pre-wrap; word-break: break-word; }
.term-l.dim { color: var(--dim); }
.term-l.ok { color: var(--ok); }
.term-l.bad { color: var(--bad); }
.term-logo { margin: 0 0 8px; color: var(--accent); font: inherit; font-size: clamp(7px, 1.75vw, 14px); line-height: 1.15; text-shadow: 0 0 10px var(--accent); overflow: hidden; }
.term-line { display: flex; gap: 9px; align-items: center; margin-top: 4px; }
.term-p { color: var(--accent2); white-space: nowrap; }
.term-in { flex: 1; min-width: 0; border: 0 !important; background: none !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important; color: var(--text); font: inherit !important; caret-color: var(--accent); }
