:root {
  --bg: #0b0f14;
  --panel: #11161d;
  --panel-2: #161d27;
  --border: #263040;
  --border-bright: #39475c;
  --green: #4ade80;
  --green-bright: #00ff9c;
  --cyan: #22d3ee;
  --yellow: #fbbf24;
  --red: #f87171;
  --magenta: #f472b6;
  --orange: #fb923c;
  --text: #c8d3e0;
  --text-bright: #e8eef5;
  --muted: #6b7a8f;
  --dim: #46546a;
  --radius: 8px;
  --max-width: 1080px;
  --mono: "SF Mono", "Cascadia Code", "JetBrains Mono", "Fira Code", Menlo,
    Consolas, "Courier New", monospace;
  --sans: var(--mono);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--mono);
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 15px;
}

::selection {
  background: var(--green);
  color: #06220f;
}

a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--green-bright);
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 10px 16px;
  background: var(--green);
  color: #06220f;
  font-weight: 700;
  border-radius: 0 0 8px 0;
}

.skip-link:focus {
  left: 0;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Terminal window chrome ---------- */
.term {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.term-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
}

.term-bar .dots {
  display: flex;
  gap: 6px;
  margin-right: 8px;
}

.term-bar .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
}

.term-bar .dot.r {
  background: #ff5f57;
}

.term-bar .dot.y {
  background: #febc2e;
}

.term-bar .dot.g {
  background: #28c840;
}

.term-bar .title {
  font-size: 12px;
  letter-spacing: 0.4px;
}

.term-body {
  padding: 20px;
  overflow-x: auto;
}

/* ---------- Prompt & syntax ---------- */
.prompt {
  color: var(--green);
  font-weight: 700;
  user-select: none;
}

.prompt::before {
  content: "$ ";
}

.cmd {
  color: var(--text-bright);
}

.comment {
  color: var(--muted);
  font-style: italic;
}

.comment::before {
  content: "// ";
}

.out {
  color: var(--text);
}

.out-green {
  color: var(--green);
}

.out-cyan {
  color: var(--cyan);
}

.out-yellow {
  color: var(--yellow);
}

.out-red {
  color: var(--red);
}

.out-dim {
  color: var(--muted);
}

.kw {
  color: var(--magenta);
}

.arrow {
  color: var(--cyan);
}

.line {
  white-space: pre-wrap;
  word-break: break-word;
}

.line + .line {
  margin-top: 6px;
}

/* ---------- Cursor & typewriter ---------- */
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  background: var(--green-bright);
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

.typewriter .cursor {
  margin-left: 2px;
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 15, 20, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.brand .tild {
  color: var(--dim);
}

.brand .name {
  color: var(--green-bright);
}

.nav-links {
  display: flex;
  gap: 6px;
  list-style: none;
}

.nav-links li {
  padding: 0 2px;
}

.nav-links a {
  color: var(--muted);
  font-size: 14px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  white-space: nowrap;
}

.nav-links a::before {
  content: "cd ";
  color: var(--dim);
  font-weight: 700;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green);
  border-color: var(--border-bright);
  background: var(--panel-2);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 10px;
}

/* ---------- Hero ---------- */
.hero {
  padding: 64px 0 56px;
  background: radial-gradient(1200px 500px at 20% -10%, rgba(34, 211, 238, 0.08), transparent),
    radial-gradient(1000px 500px at 90% 0%, rgba(74, 222, 128, 0.07), transparent);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: stretch;
}

.tw-slogan {
  font-size: 26px;
  line-height: 1.5;
  color: var(--green-bright);
  margin: 6px 0 2px;
  font-weight: 700;
}

.tw-bio {
  color: var(--text);
  font-size: 14px;
  margin-top: 4px;
  min-height: 3em;
}

/* Profile card (right terminal) */
.profile-card {
  display: flex;
  flex-direction: column;
}

.profile-card .term-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.avatar {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: linear-gradient(135deg, #123524, #0b1f14);
  border: 2px solid var(--green);
  color: var(--green-bright);
  font-size: 36px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px auto 14px;
}

.profile-card h2,
.profile-card h3 {
  color: var(--text-bright);
  text-align: center;
  font-size: 18px;
  margin-bottom: 4px;
}

.profile-card .role {
  text-align: center;
  color: var(--green);
  font-size: 13px;
  margin-bottom: 18px;
}

.stat-table {
  margin-top: auto;
  border-top: 1px dashed var(--border-bright);
  padding-top: 12px;
  font-size: 14px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px dotted var(--border);
}

.stat-row .k {
  color: var(--muted);
}

.stat-row .v {
  color: var(--green-bright);
  font-weight: 700;
}

/* ---------- Buttons ---------- */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--mono);
  border: 1px solid var(--border-bright);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-primary {
  border-color: var(--green);
  color: var(--green);
}

.btn-primary:hover {
  background: var(--green);
  color: #06220f;
}

.btn-outline {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-outline:hover {
  background: var(--cyan);
  color: #06220f;
}

/* ---------- Sections ---------- */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-alt {
  background: var(--panel);
}

.section-title {
  font-size: 20px;
  color: var(--green-bright);
  margin-bottom: 10px;
  font-weight: 700;
}

.section-title::before {
  content: "# ";
  color: var(--dim);
}

.section-subtitle {
  color: var(--muted);
  margin-bottom: 32px;
  font-size: 14px;
}

.section-subtitle::before {
  content: "// ";
  color: var(--dim);
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  box-shadow: 0 6px 24px rgba(74, 222, 128, 0.08);
}

.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.card-head .arrow {
  color: var(--cyan);
}

.card-icon {
  color: var(--yellow);
  font-size: 16px;
}

.card h3 {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 700;
  flex: 1;
}

.card p {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Timeline ---------- */
.timeline {
  list-style: none;
}

.timeline li {
  position: relative;
  padding: 14px 18px;
  padding-left: 28px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--green);
  border-radius: 0 8px 8px 0;
  margin-bottom: 14px;
}

.timeline .time {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.timeline .time::before {
  content: ">";
  color: var(--dim);
  margin-right: 6px;
}

.timeline h3,
.timeline h4 {
  color: var(--text-bright);
  margin: 4px 0;
  font-size: 15px;
}

.timeline p {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Achievement list ---------- */
.achievement-list {
  display: grid;
  gap: 12px;
}

.achievement-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.achievement-item:hover {
  border-color: var(--cyan);
}

.achievement-badge {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 6px;
  border: 1px solid var(--green);
  color: var(--green);
  font-weight: 700;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(74, 222, 128, 0.06);
}

.achievement-item h3 {
  color: var(--text-bright);
  font-size: 15px;
  margin-bottom: 4px;
}

.achievement-item h3::before {
  content: "[+] ";
  color: var(--green);
}

.achievement-item p {
  color: var(--muted);
  font-size: 13px;
}

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.contact-card:hover {
  border-color: var(--yellow);
  transform: translateY(-3px);
}

.contact-card .card-icon {
  font-size: 22px;
  color: var(--yellow);
  margin-bottom: 8px;
}

.contact-card h3 {
  color: var(--text-bright);
  font-size: 15px;
  margin-bottom: 6px;
}

.contact-card p {
  color: var(--muted);
  font-size: 13px;
  word-break: break-all;
}

.contact-note {
  margin-top: 28px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--yellow);
  border-left: 3px solid var(--yellow);
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-size: 13px;
}

.contact-note::before {
  content: "> 注意: ";
  color: var(--yellow);
  font-weight: 700;
}

/* ---------- Page header (inner pages) ---------- */
.page-header {
  padding: 48px 0 32px;
  background: radial-gradient(900px 300px at 50% -20%, rgba(34, 211, 238, 0.07), transparent);
}

.page-header h1 {
  font-size: 26px;
  color: var(--text-bright);
  margin-bottom: 8px;
  font-weight: 700;
}

.page-header h1::before {
  content: "$ cat ";
  color: var(--green);
  font-size: 16px;
}

.page-header p {
  color: var(--muted);
  font-size: 13px;
}

.page-header p::before {
  content: "// ";
  color: var(--dim);
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--panel);
  padding: 24px 0;
}

.site-footer .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--green);
}

.footer-links {
  display: flex;
  gap: 18px;
  list-style: none;
}

.footer-links a::before {
  content: "→ ";
  color: var(--dim);
}

/* ---------- Centered CTA ---------- */
.cta-block {
  text-align: center;
}

.cta-block .section-title {
  display: inline-block;
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--panel);
    flex-direction: column;
    gap: 4px;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    display: block;
    padding: 8px 10px;
  }

  .card-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 40px 0;
  }

  .tw-slogan {
    font-size: 19px;
  }

  .btn-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    text-align: center;
  }

  .site-footer .container {
    flex-direction: column;
    text-align: center;
  }
}

/* ---------- 减少动画偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .cursor {
    animation: none !important;
  }
}

/* ---------- 打印 ---------- */
@media print {
  body {
    background: #fff;
    color: #000;
  }

  .site-header,
  .site-footer,
  .skip-link,
  .nav-toggle,
  .back-to-top,
  .btn-row,
  .term-bar,
  .cursor {
    display: none !important;
  }

  .container {
    max-width: none;
  }

  .section-alt,
  .hero {
    background: none;
  }

  a {
    color: #000;
  }

  .card,
  .term {
    border-color: #bbb;
    background: #fff;
    box-shadow: none;
  }
}
