/* ===== 2erTwo6 · 伪终端个人主页样式 ===== */

:root {
  --bg: #040a12;
  --fg: #c2e2ff;
  --dim: #5d84a8;
  --accent: #42a8ff;
  --dir: #5fd7ff;
  --err: #ff6b6b;
  --warn: #ffd166;
  --up: #ff6b6b;     /* 红涨（A股习惯） */
  --down: #26a69a;   /* 绿跌 */
  --glow: 0 0 6px rgba(66, 168, 255, .3);
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: "Cascadia Code", "JetBrains Mono", ui-monospace, SFMono-Regular,
               Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* ---------- 背景层 ---------- */

#vignette {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(0, 0, 0, .55) 100%);
}

#scanlines {
  position: fixed;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: repeating-linear-gradient(0deg,
    rgba(0, 0, 0, .16) 0 1px,
    transparent 1px 3px);
  animation: flicker 4s infinite steps(90);
}

@keyframes flicker {
  0%, 100% { opacity: .85; }
  50%      { opacity: .7; }
}

/* ---------- 终端 ---------- */

#terminal {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 18px 30vh;   /* 底部大留白，移动端弹键盘时输入行仍可见 */
  text-shadow: var(--glow);
  overscroll-behavior: contain;
  scroll-behavior: auto;     /* 明确禁用平滑滚动；滚轮由 terminal.js 按整行接管 */
  cursor: text;
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
  min-height: 1.5em;
}

.line a {
  color: var(--dir);
  text-decoration: none;
  border-bottom: 1px dashed rgba(95, 215, 255, .5);
}
.line a:hover { color: var(--accent); }

pre.c-file { white-space: pre; overflow-x: auto; padding: 2px 0; }
pre.neofetch { white-space: pre; overflow-x: auto; }

.hidden { display: none !important; }

#input-line {
  display: flex;
  align-items: baseline;
}

#prompt {
  white-space: pre;
  flex: none;
}

#cmd {
  flex: 1;
  min-width: 3ch;
  background: transparent;
  border: 0;
  outline: 0;
  color: var(--fg);
  font: inherit;
  caret-color: var(--accent);
  caret-shape: block;   /* 支持则显示块状光标 */
  padding: 0;
}

/* ---------- 颜色工具类 ---------- */

.c-user   { color: var(--accent); font-weight: 700; }
.c-path   { color: var(--dir); }
.c-dir    { color: var(--dir); font-weight: 600; }
.c-dim    { color: var(--dim); }
.c-err    { color: var(--err); }
.c-warn   { color: var(--warn); }
.c-accent { color: var(--accent); }
.c-up     { color: var(--up); }
.c-down   { color: var(--down); }

/* Tab 补全菜单：当前循环到的候选项反色高亮（zsh menu select 风格） */
.c-sel {
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-shadow: none;
  border-radius: 2px;
}

/* 今日收益：名称列定宽单元格（宽度由 JS 按 CJK 显示宽度注入，ch 单位） */
.p-name { display: inline-block; white-space: pre; }

::selection { background: rgba(66, 168, 255, .28); color: #eaf6ff; }

/* 滚动条 */
#terminal::-webkit-scrollbar { width: 8px; }
#terminal::-webkit-scrollbar-thumb { background: rgba(66, 168, 255, .18); border-radius: 4px; }
#terminal::-webkit-scrollbar-track { background: transparent; }
#terminal { scrollbar-width: thin; scrollbar-color: rgba(66, 168, 255, .25) transparent; }

/* ---------- 移动端 ---------- */

@media (max-width: 700px) {
  body { font-size: 16px; }              /* ≥16px 防 iOS 聚焦缩放 */
  #terminal { padding: 14px 12px 35vh; }
}

@media (prefers-reduced-motion: reduce) {
  #scanlines { animation: none; }
}
