/* =========================================================
   个人主页样式 — 参照 DeepSeek Harness 深色风格
   设计变量对齐 --ds-* token（深色篇）
   ========================================================= */
:root {
  --bg: #f5f6f8;
  --brand: #4d6bfe;
  --brand-deep: #4d6bfe;
  --text: #1e232c;
  --text-2: rgba(30, 35, 44, .72);
  --text-3: rgba(30, 35, 44, .52);
  --text-4: rgba(30, 35, 44, .36);

  --surface-1: #ffffff;
  --surface-2: #ffffff;
  --surface-3: #f1f3f6;
  --surface-5: #e7ebf1;

  --border-subtle: rgba(15, 23, 42, .10);
  --border-default: rgba(15, 23, 42, .08);
  --border-strong: rgba(15, 23, 42, .20);

  --radius-card: 24px;
  --radius-panel: 16px;
  --radius-input: 10px;
  --radius-pill: 100px;

  --font-body: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-display: "Host Grotesk", "DM Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Noto Sans SC", monospace;

  --container: 1160px;
  --header-h: 68px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 24px); }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(var(--container), 100% - 48px); margin-inline: auto; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: #fff; padding: 10px 16px; border-radius: 0 0 10px 0;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, .85);
  border-bottom: 1px solid var(--border-default);
}
.nav { display: flex; align-items: center; gap: 8px; height: var(--header-h); }

.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 600; }
.brand-mark { display: inline-flex; color: var(--brand); }
.brand-name { font-size: 17px; letter-spacing: -.01em; }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 8px 14px; border-radius: var(--radius-pill); font-size: 14.5px; color: var(--text-2);
  transition: background .18s ease, color .18s ease;
}
.nav-links a:hover { background: var(--surface-3); color: var(--text); }

.nav-cta { margin-left: 8px; }
.nav-toggle { display: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 22px; border-radius: var(--radius-pill);
  font-family: var(--font-body); font-size: 15px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: transform .18s ease, background .18s ease, border-color .18s ease, opacity .18s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-primary { background: var(--brand-deep); color: #fff; }
.btn-primary:hover { background: #3f5ce0; }
.btn-secondary { background: var(--surface-1); color: var(--text); border-color: var(--border-subtle); }
.btn-secondary:hover { background: var(--surface-5); border-color: var(--border-strong); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-1); color: var(--text); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center;
  padding: 96px 0 72px;
}
.hero-glow {
  position: absolute; z-index: -2; top: -180px; left: -120px; width: 620px; height: 620px;
  background: radial-gradient(circle at center, hsla(219, 99%, 70%, .28), transparent 62%);
  filter: blur(20px); pointer-events: none;
}
.hero-grid-bg {
  position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: .5;
  background-image:
    linear-gradient(90deg, hsla(0, 0%, 100%, .035) 1px, transparent 1px),
    linear-gradient(180deg, hsla(0, 0%, 100%, .035) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 30%, transparent 75%);
  mask-image: radial-gradient(ellipse 70% 60% at 30% 0%, #000 30%, transparent 75%);
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: var(--radius-pill);
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 10px var(--brand); }

.hero-title { margin: 22px 0 0; font-size: clamp(40px, 6vw, 68px); line-height: 1.08; }
.hero-title .accent {
  background: linear-gradient(100deg, var(--brand), #9db9ff 60%, var(--brand));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-left: .12em;
}
.hero-sub { margin-top: 22px; max-width: 560px; font-size: 17px; color: var(--text-3); }
.hero-sub strong { color: var(--text-2); font-weight: 500; }
.hero-actions { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-meta { display: flex; align-items: center; gap: 8px; margin-top: 24px; font-size: 13.5px; color: var(--text-3); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #43d17a; box-shadow: 0 0 0 4px hsla(140, 60%, 50%, .14); }

/* terminal card */
.terminal-card {
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  background: linear-gradient(180deg, hsla(0, 0%, 100%, .07), hsla(0, 0%, 100%, .025));
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  overflow: hidden;
}
.terminal-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--border-default); background: hsla(0, 0%, 100%, .03); }
.tl { width: 11px; height: 11px; border-radius: 50%; }
.tl-red { background: #ff5f57; } .tl-yellow { background: #febc2e; } .tl-green { background: #28c840; }
.terminal-title { margin-left: 8px; font-family: var(--font-mono); font-size: 12px; color: var(--text-4); }
.terminal-body { margin: 0; padding: 20px 18px 26px; font-family: var(--font-mono); font-size: 13px; line-height: 1.75; color: var(--text-2); overflow-x: auto; }
.c-prompt { color: var(--brand); } .c-out { color: var(--text-3); } .c-cursor { color: var(--brand); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- sections ---------- */
.section { padding: 88px 0 0; }
.section-head { max-width: 620px; margin-bottom: 40px; }
.section-tag { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .08em; color: var(--brand); }
.section-head h2 { margin: 12px 0 12px; font-size: clamp(28px, 4vw, 40px); }
.section-head p { color: var(--text-3); font-size: 16.5px; }

/* ---------- generic card ---------- */
.card {
  background: var(--surface-2); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card); padding: 28px; box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}
.card:hover { transform: translateY(-3px); border-color: rgba(77, 107, 254, .45); background: #fff; box-shadow: 0 12px 30px rgba(15, 23, 42, .08); }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; align-items: start; }
.about-card { display: grid; gap: 16px; font-size: 16px; color: var(--text-2); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip { font-size: 13px; padding: 5px 12px; border-radius: var(--radius-pill); background: var(--surface-3); border: 1px solid var(--border-subtle); color: var(--text-2); }

.about-facts li { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--border-default); }
.about-facts li:last-child { border-bottom: 0; }
.about-facts li > span { font-size: 18px; line-height: 1.4; }
.about-facts b { display: block; font-weight: 500; font-size: 15px; }
.about-facts small { color: var(--text-3); font-size: 13.5px; }

/* ---------- projects ---------- */
.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.project-card { display: flex; flex-direction: column; gap: 12px; min-height: 210px; }
.project-top { display: flex; align-items: center; justify-content: space-between; }
.project-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: hsla(219, 99%, 70%, .12); color: var(--brand); font-size: 16px; }
.project-arrow { color: var(--text-4); transition: transform .2s ease, color .2s ease; }
.project-card:hover .project-arrow { transform: translate(3px, -3px); color: var(--brand); }
.project-card h3 { font-size: 20px; margin-top: 4px; }
.project-card p { color: var(--text-3); font-size: 15px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }
.tags span { font-size: 12.5px; color: var(--text-3); border: 1px solid var(--border-subtle); border-radius: var(--radius-pill); padding: 3px 10px; }

/* ---------- guestbook ---------- */
.guestbook { display: grid; grid-template-columns: .9fr 1.1fr; gap: 20px; align-items: start; }
.gb-form { display: grid; gap: 12px; }
.gb-form:hover { transform: none; border-color: var(--border-subtle); background: var(--surface-2); }
.gb-row { display: flex; gap: 12px; }
.gb-input {
  width: 100%; background: var(--surface-3); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-input); color: var(--text); font-family: var(--font-body);
  font-size: 15px; line-height: 1.5; padding: 12px 14px; outline: none; resize: vertical;
  transition: border-color .18s ease, background .18s ease;
}
.gb-input::placeholder { color: var(--text-4); }
.gb-input:focus { border-color: var(--brand); background: var(--surface-2); }
.gb-hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.gb-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.gb-tip { font-size: 13.5px; color: var(--brand); }
.gb-tip.is-error { color: #d92d20; }

.gb-list { display: grid; gap: 12px; }
.gb-item { background: var(--surface-3); border: 1px solid var(--border-default); border-radius: var(--radius-panel); padding: 16px 18px; }
.gb-item-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.gb-name { font-weight: 500; font-size: 14.5px; }
.gb-time { font-family: var(--font-mono); font-size: 12px; color: var(--text-4); }
.gb-msg { font-size: 15px; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }
.gb-empty { text-align: center; color: var(--text-4); font-size: 14px; padding: 30px 0; }

/* ---------- contact cta ---------- */
.cta-card {
  position: relative; overflow: hidden; text-align: center;
  border: 1px solid var(--border-subtle); border-radius: var(--radius-card);
  padding: 64px 32px; background: linear-gradient(180deg, hsla(219, 99%, 70%, .10), hsla(0, 0%, 100%, .02));
}
.cta-glow { position: absolute; inset: auto 0 -60% 0; height: 380px; background: radial-gradient(ellipse at center, hsla(219, 99%, 70%, .25), transparent 65%); pointer-events: none; }
.cta-card h2 { font-size: clamp(28px, 4.4vw, 44px); margin: 14px 0 12px; }
.cta-card > p { color: var(--text-3); }
.cta-actions { display: flex; gap: 12px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.copy-tip { display: block; margin-top: 14px; min-height: 22px; font-size: 13.5px; color: var(--brand); }

/* ---------- footer ---------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--border-default); padding: 28px 0; }
.footer-inner { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--text-4); font-size: 13.5px; }
.footer-sep { opacity: .5; }
#visit-count { color: var(--text-3); }

/* ---------- reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1); }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding: 72px 0 56px; }
  .about-grid { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .guestbook { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nav-links {
    position: absolute; top: var(--header-h); left: 0; right: 0; flex-direction: column;
    padding: 12px 24px 20px; gap: 2px; background: rgba(255, 255, 255, .98);
    border-bottom: 1px solid var(--border-subtle); backdrop-filter: blur(12px);
    display: none;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a { padding: 12px 10px; }
  .nav-cta { display: none; }
  .nav-toggle {
    display: inline-flex; flex-direction: column; gap: 5px; margin-left: auto;
    width: 42px; height: 42px; align-items: center; justify-content: center;
    background: transparent; border: 0; cursor: pointer;
  }
  .nav-toggle span { width: 20px; height: 2px; background: var(--text-2); border-radius: 2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}