/* ============================================================
   CODERTAO.SYS — cyberpunk terminal blog
   纯手写，无框架。设计语言：磷光绿终端 / HUD 面板 / CRT 质感
   ============================================================ */
:root {
  --bg: #05070a;
  --bg-panel: #0a0f14;
  --bg-panel-2: #0d141b;
  --line: #16241f;
  --line-bright: #1f3a2e;
  --fg: #b8cfc2;
  --fg-dim: #5d7a6d;
  --fg-faint: #3a4f45;
  --acc: #00ff9c;          /* 磷光绿 */
  --acc-dim: #0a4a32;
  --amber: #ffb000;        /* 琥珀警告色 */
  --red: #ff3b3b;
  --cyan: #37d5d5;
  --glow: 0 0 8px rgba(0, 255, 156, 0.45);
  --glow-soft: 0 0 20px rgba(0, 255, 156, 0.12);
  --mono: "JetBrains Mono", "Cascadia Code", "Fira Code", Consolas, "Courier New", monospace;
  --cjk: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono), var(--cjk);
  font-size: 15px;
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ---- CRT 氛围层：扫描线 + 晕影 + 噪点 ---- */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9000;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px, transparent 2px,
    rgba(0, 0, 0, 0.12) 2px, rgba(0, 0, 0, 0.12) 4px
  );
  mix-blend-mode: multiply;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9001;
  background:
    radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.55) 100%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)'/%3E%3C/svg%3E");
}

::selection { background: var(--acc-dim); color: var(--acc); }

a { color: var(--acc); text-decoration: none; }
a:hover { text-shadow: var(--glow); }

/* ---- 开机自检动画 ---- */
#boot {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  padding: 8vh 8vw;
  font-size: 14px;
  color: var(--fg-dim);
  white-space: pre-wrap;
  transition: opacity 0.6s ease, visibility 0.6s;
}
#boot.done { opacity: 0; visibility: hidden; }
#boot .ok { color: var(--acc); }
#boot .warn { color: var(--amber); }
#boot .cursor {
  display: inline-block; width: 9px; height: 16px;
  background: var(--acc);
  vertical-align: text-bottom;
  animation: blink 0.9s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

/* ---- 顶栏 ---- */
header {
  position: sticky; top: 0;
  z-index: 100;
  background: rgba(5, 7, 10, 0.85);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.hud-bar {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; gap: 20px;
  font-size: 13px;
}
.hud-logo {
  color: var(--acc);
  font-weight: 700;
  letter-spacing: 1px;
  text-shadow: var(--glow);
  white-space: nowrap;
}
.hud-logo .dim { color: var(--fg-faint); }
nav { display: flex; gap: 4px; flex: 1; }
nav a {
  color: var(--fg-dim);
  padding: 3px 12px;
  border: 1px solid transparent;
  transition: all 0.15s;
}
nav a:hover { color: var(--acc); border-color: var(--line-bright); text-shadow: none; }
nav a::before { content: "/"; color: var(--fg-faint); margin-right: 2px; }
.hud-status {
  display: flex; gap: 16px; align-items: center;
  color: var(--fg-faint); font-size: 12px;
  white-space: nowrap;
}
.hud-status .dot {
  display: inline-block; width: 7px; height: 7px;
  background: var(--acc); border-radius: 50%;
  box-shadow: var(--glow);
  margin-right: 5px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.35; } }
@media (max-width: 720px) { .hud-status .hide-m { display: none; } }

/* ---- 布局 ---- */
main { max-width: 1080px; margin: 0 auto; padding: 0 24px 80px; }

/* ---- Hero ---- */
.hero {
  padding: 72px 0 48px;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.hero .path {
  color: var(--fg-faint); font-size: 13px;
}
.hero .path .u { color: var(--cyan); }
.hero h1 {
  font-size: clamp(30px, 6vw, 54px);
  letter-spacing: 3px;
  color: var(--fg);
  margin: 10px 0 6px;
  font-weight: 800;
}
.hero h1 .g { color: var(--acc); text-shadow: var(--glow); }
.hero h1 .glitch { position: relative; display: inline-block; }
.hero .tagline {
  font-size: clamp(15px, 2.4vw, 19px);
  color: var(--fg-dim);
  min-height: 1.8em;
}
.hero .tagline .prompt { color: var(--acc); margin-right: 8px; }
.hero .tagline .typed { color: var(--fg); }
.hero .tagline .cursor {
  display: inline-block; width: 10px; height: 1.1em;
  background: var(--acc); vertical-align: text-bottom;
  margin-left: 2px;
  animation: blink 0.9s steps(1) infinite;
}

/* 状态芯片行 */
.chips {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 26px;
}
.chip {
  font-size: 12px;
  color: var(--fg-dim);
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  padding: 4px 12px;
  display: inline-flex; gap: 8px; align-items: center;
}
.chip b { color: var(--acc); font-weight: 600; }
.chip.warn b { color: var(--amber); }

/* ---- 区块标题 ---- */
section { margin-top: 64px; }
.sec-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}
.sec-head .no { color: var(--fg-faint); font-size: 13px; }
.sec-head h2 {
  font-size: 17px; letter-spacing: 2px;
  color: var(--acc); text-shadow: var(--glow-soft);
  font-weight: 700;
}
.sec-head .cn { color: var(--fg-dim); font-family: var(--cjk); font-size: 14px; }
.sec-head .fill { flex: 1; }
.sec-head .hex { color: var(--fg-faint); font-size: 12px; }

/* ---- 传输记录（文章列表）---- */
.term {
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  box-shadow: var(--glow-soft);
}
.term-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  font-size: 12px; color: var(--fg-faint);
}
.term-bar .btns { display: flex; gap: 6px; }
.term-bar .btns i {
  width: 10px; height: 10px; border-radius: 50%;
  border: 1px solid var(--line-bright);
}
.term-bar .btns i:first-child { background: var(--acc-dim); border-color: var(--acc-dim); }
.term-bar .title { margin-left: 8px; }
.term-body { padding: 18px 20px; }
.term-body .cmd { color: var(--fg-faint); margin-bottom: 12px; }
.term-body .cmd .p { color: var(--acc); }

.post-line {
  display: flex; gap: 14px; align-items: baseline;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-left: 2px solid var(--line-bright);
  margin-bottom: 6px;
  transition: all 0.15s;
}
.post-line:hover {
  border-color: var(--line-bright);
  border-left-color: var(--acc);
  background: rgba(0, 255, 156, 0.04);
  transform: translateX(4px);
}
.post-line .date { color: var(--fg-faint); font-size: 13px; white-space: nowrap; }
.post-line .name { color: var(--fg); flex: 1; }
.post-line:hover .name { color: var(--acc); }
.post-line .tag { color: var(--fg-faint); font-size: 12px; white-space: nowrap; }
.post-line .tag::before { content: "#"; color: var(--acc-dim); }
@media (max-width: 640px) { .post-line .tag { display: none; } }

/* ---- 模块卡片（工具/服务） ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.card {
  position: relative;
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  padding: 18px 18px 14px;
  transition: all 0.2s;
  overflow: hidden;
}
.card::before, .card::after,
.card .ck::before, .card .ck::after {
  content: "";
  position: absolute; width: 10px; height: 10px;
  border-color: var(--acc); border-style: solid;
  opacity: 0; transition: opacity 0.2s;
}
.card::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.card::after { top: -1px; right: -1px; border-width: 2px 2px 0 0; }
.card .ck::before { bottom: -1px; left: -1px; border-width: 0 0 2px 2px; }
.card .ck::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.card:hover { border-color: var(--acc-dim); box-shadow: var(--glow-soft); transform: translateY(-2px); }
.card:hover::before, .card:hover::after,
.card:hover .ck::before, .card:hover .ck::after { opacity: 1; }

.card .id {
  position: absolute; top: 10px; right: 12px;
  color: var(--fg-faint); font-size: 11px;
}
.card h3 {
  color: var(--acc); font-size: 15px;
  margin-bottom: 4px; letter-spacing: 1px;
}
.card h3::before { content: "▸ "; color: var(--fg-faint); }
.card .desc {
  color: var(--fg-dim); font-size: 13px;
  font-family: var(--cjk);
  margin-bottom: 10px;
}
.card .meta {
  color: var(--fg-faint); font-size: 11px;
  display: flex; gap: 10px;
}
.card .meta .up { color: var(--acc-dim); }
.card.disabled { opacity: 0.45; }
.card.disabled h3 { color: var(--fg-dim); }

/* ---- NOW 面板 ---- */
.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; gap: 14px;
}
@media (max-width: 720px) { .now-grid { grid-template-columns: 1fr; } }
.now-panel {
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  padding: 18px 20px;
}
.now-panel h3 {
  color: var(--amber); font-size: 13px; letter-spacing: 2px;
  margin-bottom: 12px;
}
.now-panel h3::before { content: "● "; animation: pulse 2s infinite; }
.now-panel ul { list-style: none; }
.now-panel li {
  color: var(--fg-dim); font-family: var(--cjk);
  font-size: 14px; padding: 4px 0;
}
.now-panel li::before { content: "  > "; color: var(--acc-dim); font-family: var(--mono); }
.now-panel li b { color: var(--fg); font-weight: 600; }

/* ---- 文章页 ---- */
.article-wrap { max-width: 860px; }
.crumb { color: var(--fg-faint); font-size: 13px; margin: 36px 0 18px; }
.crumb a { color: var(--fg-dim); }
.crumb a:hover { color: var(--acc); }
.article-meta {
  display: flex; flex-wrap: wrap; gap: 14px;
  color: var(--fg-faint); font-size: 12px;
  margin-bottom: 22px;
}
.article-meta .t { color: var(--amber); }
.article-body {
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  padding: 34px 38px;
  font-family: var(--cjk);
}
@media (max-width: 640px) { .article-body { padding: 24px 18px; } }
.article-body h2 {
  color: var(--acc); font-size: 19px;
  margin: 30px 0 12px;
  letter-spacing: 1px;
}
.article-body h2::before { content: "## "; color: var(--fg-faint); }
.article-body p { margin-bottom: 14px; color: var(--fg); font-size: 15px; }
.article-body ul, .article-body ol { margin: 0 0 14px 8px; list-style: none; }
.article-body li { padding: 3px 0; color: var(--fg); }
.article-body li::before { content: "» "; color: var(--acc-dim); font-family: var(--mono); }
.article-body a { border-bottom: 1px dashed var(--acc-dim); }
.article-body a:hover { border-bottom-style: solid; }
.article-body code {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  color: var(--cyan);
  padding: 1px 7px;
  font-size: 13px;
  font-family: var(--mono);
}
.article-body pre {
  background: var(--bg-panel-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--acc-dim);
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
}
.article-body pre code { border: 0; padding: 0; color: var(--fg); background: none; }
.article-body blockquote {
  border-left: 3px solid var(--amber);
  background: rgba(255, 176, 0, 0.05);
  padding: 10px 16px;
  margin-bottom: 14px;
  color: var(--fg-dim);
}
.article-body img { max-width: 100%; border: 1px solid var(--line-bright); }
.article-body hr { border: 0; border-top: 1px dashed var(--line-bright); margin: 24px 0; }
.article-nav {
  display: flex; justify-content: space-between;
  margin-top: 22px; font-size: 13px;
}

/* ---- 页脚 ---- */
footer {
  border-top: 1px solid var(--line);
  margin-top: 40px;
}
.foot-inner {
  max-width: 1080px; margin: 0 auto;
  padding: 26px 24px 34px;
  display: flex; flex-wrap: wrap; gap: 14px;
  justify-content: space-between;
  color: var(--fg-faint); font-size: 12px;
}
.foot-inner .sig { color: var(--acc-dim); }
.foot-inner .sig b { color: var(--acc); font-weight: 400; }

/* ---- 滚动显现 ---- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.on { opacity: 1; transform: none; }

/* ---- 工具提示条（底部固定） ---- */
#ticker {
  position: fixed; bottom: 0; left: 0; right: 0;
  z-index: 8000;
  background: rgba(5, 7, 10, 0.9);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(4px);
  font-size: 11px; color: var(--fg-faint);
  padding: 5px 16px;
  display: flex; gap: 24px;
  overflow: hidden; white-space: nowrap;
}
#ticker .k { color: var(--acc-dim); }
#ticker .v { color: var(--fg-dim); }
@media (max-width: 640px) { #ticker .hide-m { display: none; } }
