/* ===== Claude Version B — Terminal Geek (終端極客) ===== */

:root {
  --term-bg: #0D1117;
  --term-surface: #161B22;
  --term-border: #30363D;

  --term-text: #C9D1D9;
  --term-text-muted: #8B949E;

  --term-green: #39D353;
  --term-cyan: #58A6FF;
  --term-yellow: #D29922;
  --term-red: #F85149;
  --term-purple: #BC8CFF;
  --term-orange: #F0883E;

  --term-glow: 0 0 10px rgba(57, 211, 83, 0.3);
  --term-scanline: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );

  --font-mono: 'IBM Plex Mono', monospace;
  --font-display: 'Clash Display', sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.875rem;
  --text-lg: 1rem;
  --text-xl: 1.25rem;
  --text-2xl: 1.5rem;
  --text-3xl: 2rem;

  --leading: 1.6;
  --radius: 0;
  --border: 1px solid var(--term-border);
  --shadow-panel: 4px 4px 0 var(--term-border);
  --shadow-panel-hover: 6px 6px 0 var(--term-border);
}

[data-theme="light"] {
  --term-bg: #FAFBFC;
  --term-surface: #F0F2F5;
  --term-border: #D0D7DE;
  --term-text: #24292F;
  --term-text-muted: #656D76;
  --term-green: #1A7F37;
  --term-cyan: #0969DA;
  --term-yellow: #9A6700;
  --term-red: #CF222E;
  --term-glow: none;
  --term-scanline: none;
}

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

body {
  background-color: var(--term-bg);
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  line-height: var(--leading);
  letter-spacing: 0.01em;
  overflow-x: hidden;
  height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

/* Skip link */
.skip-link {
  position: absolute; top: -100%;
  left: 16px;
  background: var(--term-green);
  color: var(--term-bg);
  padding: 4px 12px;
  z-index: 1000;
  font-size: var(--text-xs);
}
.skip-link:focus { top: 8px; }

/* CRT Overlay */
.crt-overlay {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 9999;
  background: var(--term-scanline);
  opacity: 1;
  transition: opacity 0.3s;
}

/* Terminal Frame */
.terminal-frame {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  border-left: var(--border);
  border-right: var(--border);
}

/* Header */
.term-header {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 24px;
  border-bottom: var(--border);
  position: sticky; top: 0;
  background: var(--term-bg);
  z-index: 50;
}
.term-title {
  font-weight: 500;
  color: var(--term-yellow);
  white-space: nowrap;
}
.term-nav {
  display: flex;
  gap: 20px;
  flex-grow: 1;
}
.term-nav a {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: -0.02em;
  color: var(--term-text-muted);
  text-decoration: none;
  transition: color 0.2s, text-shadow 0.2s;
}
.term-nav a:hover, .term-nav a.active {
  color: var(--term-green);
  text-shadow: var(--term-glow);
}
.term-nav a:focus-visible {
  outline: 2px solid var(--term-cyan);
  outline-offset: 4px;
}

.theme-toggle {
  background: none; border: none;
  color: var(--term-text);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: transform 0.3s;
}
.theme-toggle:hover { transform: rotate(15deg); }
.theme-toggle:active { transform: rotate(180deg); }

/* Body */
.term-body {
  flex-grow: 1;
  padding: 32px 24px;
  overflow-y: auto;
}

/* Boot Sequence */
.boot-section {
  color: var(--term-green);
}
.boot-section div {
  margin-bottom: 2px;
}

/* Prompt */
.prompt {
  margin: 24px 0 16px;
  color: var(--term-text);
}
.prompt-char {
  color: var(--term-green);
  font-weight: bold;
  margin-right: 8px;
}

/* ASCII Banner */
.ascii-banner {
  font-size: 11px;
  line-height: 1.2;
  color: var(--term-green);
  margin-bottom: 24px;
  white-space: pre;
  text-shadow: var(--term-glow);
}
.ascii-fallback {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  color: var(--term-green);
  text-shadow: var(--term-glow);
  display: none;
}

/* Bio Output */
.bio-output {
  color: var(--term-cyan);
  margin-bottom: 32px;
}
.bio-output p {
  margin-bottom: 4px;
}

/* STATUS Box */
.status-box {
  border: var(--border);
  padding: 20px 24px;
  margin-bottom: 32px;
  position: relative;
  box-shadow: var(--shadow-panel);
  transition: box-shadow 0.2s;
}
.status-box:hover {
  box-shadow: var(--shadow-panel-hover);
}
.status-box-title {
  color: var(--term-yellow);
  font-weight: 700;
  margin-bottom: 12px;
  font-size: var(--text-lg);
}
.status-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 6px;
}
.status-label {
  width: 100px;
  color: var(--term-text-muted);
  font-weight: 500;
  flex-shrink: 0;
}
.status-value {
  color: var(--term-text);
}
.progress-bar {
  width: 120px;
  height: 8px;
  background: var(--term-border);
  flex-shrink: 0;
}
.progress-fill {
  display: block;
  height: 100%;
  background: var(--term-green);
}

/* Divider */
.term-divider {
  border: none;
  border-top: 1px solid var(--term-border);
  margin: 32px 0;
}

/* ls Table (Projects) */
.ls-table-header {
  display: grid;
  grid-template-columns: 100px 1fr 110px 80px;
  gap: 0 16px;
  color: var(--term-text-muted);
  font-weight: 500;
  font-size: var(--text-sm);
  margin-bottom: 4px;
  padding-bottom: 4px;
}
.ls-table-rule {
  border-bottom: 1px dashed var(--term-border);
  margin-bottom: 8px;
}

.project-row {
  display: grid;
  grid-template-columns: 100px 1fr 110px 80px;
  gap: 0 16px;
  padding: 8px 0;
  cursor: pointer;
  transition: background 0.15s;
}
.project-row:hover {
  background: var(--term-surface);
}
.project-row:focus-visible {
  outline: 2px solid var(--term-cyan);
}
.perm { color: var(--term-text-muted); }
.proj-name { color: var(--term-cyan); font-weight: 500; }
.proj-date { color: var(--term-text-muted); }
.proj-stars { color: var(--term-orange); }
.proj-desc {
  grid-column: 1 / -1;
  color: var(--term-text-muted);
  font-size: var(--text-sm);
  padding-left: 116px;
  margin-top: 2px;
}

.view-more {
  display: inline-block;
  margin-top: 16px;
  color: var(--term-cyan);
  text-decoration: none;
  transition: text-decoration 0.2s;
}
.view-more:hover { text-decoration: underline; }

/* Blog Log Entries */
.log-list {
  display: flex;
  flex-direction: column;
}
.log-entry {
  display: block;
  padding: 6px 8px;
  margin-left: -8px;
  text-decoration: none;
  color: var(--term-text);
  transition: background 0.15s, color 0.15s;
}
.log-entry:hover {
  background: var(--term-surface);
}
.log-entry:hover .log-title {
  color: var(--term-cyan);
}
.log-entry:focus-visible {
  outline: 2px solid var(--term-cyan);
}
.log-ts {
  color: var(--term-yellow);
  margin-right: 8px;
}

/* Command Input Area */
.cmd-area {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px dashed var(--term-border);
}
.prompt-line {
  display: flex;
  align-items: center;
}
.cmd-input {
  background: transparent;
  border: none;
  color: var(--term-text);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  outline: none;
  width: 100%;
  caret-color: var(--term-green);
}
.cmd-input::placeholder {
  color: var(--term-text-muted);
  opacity: 0.5;
}

/* Blinking cursor */
.cursor-blink {
  display: inline-block;
  width: 8px;
  height: 18px;
  background: var(--term-green);
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

#cmd-output {
  margin-top: 8px;
  color: var(--term-text);
  white-space: pre-wrap;
}
#cmd-output .cmd-success { color: var(--term-green); }
#cmd-output .cmd-warning { color: var(--term-yellow); }
#cmd-output .cmd-info { color: var(--term-cyan); }
#cmd-output .cmd-error { color: var(--term-red); }

/* Footer */
.term-footer {
  display: flex;
  justify-content: space-between;
  padding: 8px 24px;
  border-top: var(--border);
  background: var(--term-text);
  color: var(--term-bg);
  font-weight: 700;
  font-size: var(--text-xs);
}

/* ===== Responsive ===== */
.hidden-mobile { display: block; }
.visible-mobile { display: none; }

@media (max-width: 640px) {
  .hidden-mobile { display: none !important; }
  .visible-mobile { display: block !important; }
  .terminal-frame { border: none; }
  .term-header { flex-wrap: wrap; gap: 8px; padding: 8px 16px; }
  .term-nav { gap: 12px; font-size: var(--text-sm); }
  .term-body { padding: 16px; }
  .ls-table-header { display: none; }
  .project-row {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px dotted var(--term-border);
  }
  .perm { display: none; }
  .proj-desc { padding-left: 0; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .crt-overlay { display: none; }
  .cursor-blink { animation: none; opacity: 1; }
  .ascii-banner { text-shadow: none; }
}
