/* 风格 4 · 终端 Amber Terminal
   琥珀单色磷光屏：整个页面是一台终端。等宽、扫描线、打字机 boot、命令行检索。 */
html[data-style="terminal"] {
  --desk: #0a0703;
  --scr: #161003;
  --amber: #ffb000;
  --amber-hi: #ffd782;
  --amber-dim: #9c7a2e;
  --amber-faint: #6b5626;
  --line: #3d3a1c;
  --mono: "JetBrains Mono Variable", ui-monospace, "SF Mono", "Cascadia Mono", "JetBrains Mono", Menlo, Consolas, "Sarasa Mono SC", "PingFang SC", monospace;
  color-scheme: dark;
  background: var(--desk);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.6;
}
html[data-style="terminal"] body { background: var(--desk); }
html[data-style="terminal"] ::selection { background: var(--amber); color: #161003; }

/* ---- 窗口框架 ---- */
.tm-frame {
  position: relative; max-width: 1120px; margin: clamp(12px, 3vh, 40px) auto;
  border: 1px solid #4a3a14; border-radius: 10px; overflow: hidden;
  background: var(--scr);
  box-shadow: 0 30px 90px rgb(0 0 0 / .7), 0 0 120px rgb(255 176 0 / .05);
  display: flex; flex-direction: column;
  height: calc(100dvh - var(--lab-bar-h, 0px) - clamp(24px, 6vh, 80px));
}
html[data-style="terminal"] body { overflow: hidden; }
.tm-bar {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px;
  background: #241b08; border-bottom: 1px solid #4a3a14; flex: none;
}
.tm-dots { display: flex; gap: 7px; }
.tm-dots i { width: 11px; height: 11px; border-radius: 50%; background: #4a3a14; }
.tm-dots i:nth-child(1) { background: #8a3b2e; }
.tm-dots i:nth-child(2) { background: #8a6d2e; }
.tm-dots i:nth-child(3) { background: #5d6e2e; }
.tm-title { flex: 1; text-align: center; color: var(--amber-dim); font-size: 12px; letter-spacing: .04em; }
.tm-clock { color: var(--amber-dim); font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---- 屏幕 ---- */
.tm-screen {
  flex: 1; overflow-y: auto; padding: 20px 22px 8px;
  text-shadow: 0 0 6px rgb(255 176 0 / .25);
  scrollbar-color: #4a3a14 transparent;
}
.tm-boot { margin: 0 0 18px; color: var(--amber-dim); white-space: pre-wrap; }
.tm-banner { color: var(--amber-hi); font-size: clamp(6px, 1.1vw, 12px); line-height: 1.15; margin: 6px 0 14px; overflow-x: auto; text-shadow: 0 0 10px rgb(255 200 90 / .5); }
.tm-sec { margin: 0 0 22px; }
.tm-sec::before {
  content: "dsl> " attr(data-cmd);
  display: block; color: var(--amber-hi); font-weight: 700; margin-bottom: 8px;
}
.tm-sec p { margin: 0 0 3px; overflow-wrap: anywhere; }
.tm-key { color: var(--amber-hi); font-weight: 700; }
.tm-dim { color: var(--amber-dim); }
.tm-stat b { color: var(--amber-hi); font-weight: 700; }
.tm-code { background: rgb(255 176 0 / .06); border: 1px dashed #4a3a14; padding: 12px 14px; margin: 6px 0 10px; overflow-x: auto; color: var(--amber-hi); }
.tm-link { color: var(--amber-hi); text-decoration: none; border-bottom: 1px dashed var(--amber-faint); }
.tm-link:hover { background: var(--amber); color: #161003; border-bottom-color: transparent; text-shadow: none; }
.tm-skills a { display: inline-block; min-width: 30ch; }

/* ---- style --list：当前风格整行点亮 ---- */
.tm-sty { display: inline-block; min-width: 24ch; }
.tm-sty[aria-current] { background: var(--amber); color: #161003; border-bottom-color: transparent; font-weight: 700; }

/* ---- 目录行 ---- */
.tm-live { margin-top: 4px; }
.tm-echo { color: var(--amber-hi); font-weight: 700; border-top: 1px dashed #4a3a14; padding-top: 14px; }
.tm-prompt { color: #7fd47f; }
.tm-row { margin: 0; padding: 1px 6px; border-radius: 2px; }
.tm-row:hover { background: rgb(255 176 0 / .09); }
.tm-dir { cursor: pointer; }
.tm-dir-name { color: #7fd47f; font-weight: 700; display: inline-block; min-width: 11ch; }
.tm-dir-zh { display: inline-block; min-width: 9ch; color: var(--amber-hi); }
.tm-back { color: #7fd47f; border-bottom: 1px dashed var(--amber-faint); }
.tm-sub { margin: 14px 0 4px !important; color: var(--amber-hi); font-weight: 700; }
.tm-sub::before { content: "▸ "; color: var(--amber-dim); }
.tm-tier { display: inline-block; min-width: 4ch; color: var(--amber-dim); }
.tm-tS { color: var(--amber-hi); font-weight: 700; }
.tm-tB { color: var(--amber-faint); }
.tm-shot { color: #7fd47f; cursor: pointer; font-size: 12px; }
.tm-shot:hover { background: #7fd47f; color: #161003; text-shadow: none; }
.tm-help p, .tm-err { margin: 2px 0; }
.tm-err { color: #ff7a5c; }
.tm-foot { border-top: 1px dashed #4a3a14; padding-top: 12px; color: var(--amber-dim); }

/* ---- 输入行 ---- */
.tm-input {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid #4a3a14; background: #1d1607;
  padding: 12px 22px; flex: none;
}
.tm-input input {
  flex: 1; background: none; border: 0; color: var(--amber-hi);
  font-family: var(--mono); font-size: 14px; caret-color: var(--amber-hi);
}
.tm-input input:focus { outline: none; }
.tm-input input::placeholder { color: var(--amber-faint); }
.tm-cursor { width: 9px; height: 18px; background: var(--amber); animation: tm-blink 1.06s steps(1) infinite; flex: none; }
@keyframes tm-blink { 50% { opacity: 0; } }

/* ---- 截图查看器 ---- */
.tm-shotview {
  position: absolute; inset: 46px 5% 5%; z-index: 20;
  background: #0d0a02; border: 1px solid #4a3a14; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgb(0 0 0 / .8);
  animation: tm-pop .18s ease-out;
}
@keyframes tm-pop { from { transform: scale(.96); opacity: 0; } }
.tm-shotbar { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-bottom: 1px solid #4a3a14; color: var(--amber-dim); font-size: 12px; }
.tm-shotbar button { background: none; border: 1px solid #4a3a14; color: var(--amber); padding: 3px 10px; font-family: var(--mono); }
.tm-shotbar button:hover { background: var(--amber); color: #161003; }
.tm-shotview img { flex: 1; object-fit: contain; min-height: 0; width: 100%; }

/* ---- CRT 效果 ---- */
.tm-scan {
  position: absolute; inset: 0; pointer-events: none; z-index: 30; border-radius: inherit;
  background: repeating-linear-gradient(0deg, rgb(0 0 0 / .14) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}
.tm-vig {
  position: absolute; inset: 0; pointer-events: none; z-index: 31; border-radius: inherit;
  background: radial-gradient(120% 90% at 50% 40%, transparent 60%, rgb(0 0 0 / .35));
}
@media (prefers-reduced-motion: reduce) {
  .tm-cursor { animation: none; }
  .tm-shotview { animation: none; }
}

@media (max-width: 760px) {
  html[data-style="terminal"] { font-size: 12.5px; }
  .tm-frame { margin: 0; height: calc(100dvh - var(--lab-bar-h, 0px)); border-radius: 0; border: 0; }
  .tm-dir-name { min-width: 8ch; }
  .tm-skills a { min-width: 0; }
}
