/* =====================================================================
   现代极简浅色 / 暗黑双主题样式系统
   ===================================================================== */

:root {
  --bg: #fafafa;
  --bg-tinted: #f3f5f8;
  --surface: #ffffff;
  --surface-hover: #fbfcfe;
  --surface-subtle: #f1f5f9;
  --header-bg: rgba(250, 250, 250, 0.82);

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --border: rgba(15, 23, 42, 0.085);
  --border-strong: rgba(15, 23, 42, 0.16);

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.09);
  --accent-text: #1d4ed8;

  --status-green: #10b981;
  --status-green-soft: rgba(16, 185, 129, 0.14);

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 4px 14px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 24px 64px rgba(15, 23, 42, 0.16);

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;

  --container: 1120px;
  --header-height: 68px;

  --font-sans: "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --bg-tinted: #0f131c;
  --surface: #131924;
  --surface-hover: #171f2d;
  --surface-subtle: #1b2333;
  --header-bg: rgba(11, 14, 20, 0.8);

  --text-primary: #f1f5f9;
  --text-secondary: #a1b0c6;
  --text-muted: #7888a0;

  --border: rgba(241, 245, 249, 0.09);
  --border-strong: rgba(241, 245, 249, 0.18);

  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-soft: rgba(96, 165, 250, 0.14);
  --accent-text: #93c5fd;

  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.22);
  --shadow-sm: 0 6px 20px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 28px 72px rgba(0, 0, 0, 0.6);
}

/* 基础重置 */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-height) + 20px);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg);
  transition: background-color 0.25s var(--ease), color 0.25s var(--ease);
  overflow-x: hidden;
}

body.modal-open {
  overflow: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

img {
  max-width: 100%;
  display: block;
}

.mono {
  font-family: var(--font-mono);
}

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

/* 顶部阅读进度条 */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #0ea5e9);
  z-index: 120;
  transition: width 0.08s linear;
}

/* =====================================================================
   导航栏
   ===================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--header-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  transition: background-color 0.25s var(--ease), border-color 0.25s var(--ease);
}

.header-inner {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a, #2563eb);
  box-shadow: var(--shadow-xs);
}

[data-theme="dark"] .brand-mark {
  background: linear-gradient(135deg, #2563eb, #0ea5e9);
}

.brand-name {
  font-size: 15px;
  color: var(--text-primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text-primary);
  background: var(--surface-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s var(--ease);
}

.icon-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

/* 主题切换图标状态 */
.icon-sun {
  display: none;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

.mobile-menu-btn {
  display: none;
}

.mobile-nav {
  border-top: 1px solid var(--border);
  padding: 12px 24px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--surface);
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-nav-link {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
}

.mobile-nav-link:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

/* =====================================================================
   按钮系统
   ===================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.btn-sm {
  padding: 9px 15px;
  font-size: 13px;
  border-radius: 10px;
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg);
  box-shadow: var(--shadow-xs);
}

.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}

.btn-ghost:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
}

/* =====================================================================
   Hero 首屏
   ===================================================================== */
.hero-section {
  position: relative;
  padding: 76px 0 88px;
  background:
    radial-gradient(640px 320px at 14% 6%, rgba(37, 99, 235, 0.065), transparent 70%),
    radial-gradient(520px 280px at 88% 12%, rgba(14, 165, 233, 0.055), transparent 72%);
}

[data-theme="dark"] .hero-section {
  background:
    radial-gradient(640px 320px at 14% 6%, rgba(96, 165, 250, 0.09), transparent 70%),
    radial-gradient(520px 280px at 88% 12%, rgba(14, 165, 233, 0.07), transparent 72%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.32fr) minmax(300px, 0.88fr);
  gap: 48px;
  align-items: center;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  box-shadow: var(--shadow-xs);
  margin-bottom: 24px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--status-green);
  box-shadow: 0 0 0 4px var(--status-green-soft);
}

.status-dot.offline {
  background: var(--text-muted);
  box-shadow: none;
}

.hero-title {
  margin: 0 0 20px;
  font-size: clamp(32px, 4.4vw, 48px);
  line-height: 1.2;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-highlight {
  color: var(--accent);
}

.hero-bio {
  margin: 0 0 30px;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 60ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 40px;
}

.hero-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--border);
}

.metric-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}

/* 右侧极简名片卡 */
.profile-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s var(--ease), border-color 0.3s var(--ease);
}

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

.profile-card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.avatar-wrap {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.avatar-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-primary);
}

.profile-handle {
  font-size: 13px;
  color: var(--accent-text);
  margin: 2px 0 4px;
}

.profile-role {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.profile-meta-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.profile-meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.meta-label {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.meta-value {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

.profile-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: var(--radius-pill);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}

.tag-pill:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}

/* =====================================================================
   通用区块排版
   ===================================================================== */
.section {
  padding: 84px 0;
}

.section-tinted {
  background: var(--bg-tinted);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-head {
  margin-bottom: 40px;
}

.section-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.section-label {
  margin: 0 0 10px;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--accent-text);
  text-transform: uppercase;
}

.section-title {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.25;
  letter-spacing: -0.025em;
  font-weight: 700;
  color: var(--text-primary);
}

.section-subtitle {
  margin: 12px 0 0;
  font-size: 15.5px;
  color: var(--text-secondary);
  max-width: 62ch;
}

/* =====================================================================
   01 / 关于我与技能
   ===================================================================== */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 36px;
  align-items: start;
}

.about-paragraphs {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 28px;
}

.about-paragraphs p {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.85;
  color: var(--text-secondary);
}

.principles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.principle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-xs);
}

.principle-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.principle-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.skills-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.skill-group-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* =====================================================================
   02 / 作品集与项目
   ===================================================================== */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-btn {
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s var(--ease);
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg);
  border-color: var(--text-primary);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xs);
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease), border-color 0.28s var(--ease);
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.project-cover {
  position: relative;
  height: 168px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.project-cover svg {
  width: 100%;
  height: 100%;
  display: block;
  transition: transform 0.45s var(--ease);
}

.project-card:hover .project-cover svg {
  transform: scale(1.03);
}

.project-cover-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.88);
  color: #0f172a;
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .project-cover-badge {
  background: rgba(15, 23, 42, 0.78);
  color: #f8fafc;
}

.project-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.project-year {
  font-size: 12px;
  color: var(--text-muted);
}

.project-featured-tag {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-text);
  background: var(--accent-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.project-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-primary);
  cursor: pointer;
}

.project-title:hover {
  color: var(--accent);
}

.project-summary {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.68;
  color: var(--text-secondary);
  flex: 1;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.mini-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--surface-subtle);
  color: var(--text-secondary);
}

.project-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.project-links {
  display: flex;
  align-items: center;
  gap: 12px;
}

.text-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  transition: color 0.2s var(--ease);
}

.text-link:hover {
  color: var(--accent);
}

.text-link-primary {
  color: var(--accent-text);
}

/* =====================================================================
   03 / GitHub 开源仓库
   ===================================================================== */
.repos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.repo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-xs);
  transition: transform 0.24s var(--ease), border-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.repo-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-sm);
}

.repo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.repo-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  word-break: break-word;
}

.repo-card:hover .repo-name {
  color: var(--accent);
}

.repo-desc {
  margin: 0;
  font-size: 13.8px;
  line-height: 1.65;
  color: var(--text-secondary);
  flex: 1;
}

.repo-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
}

.repo-stat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lang-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

/* =====================================================================
   04 / 个人经历时间线
   ===================================================================== */
.timeline-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
}

.timeline-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 24px;
  box-shadow: var(--shadow-xs);
}

.timeline-period {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent-text);
  padding-top: 3px;
}

.timeline-role {
  margin: 0 0 4px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-org {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.timeline-summary {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--text-secondary);
}

.timeline-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* =====================================================================
   05 / 随笔与笔记
   ===================================================================== */
.notes-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}

.note-row {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 24px 16px;
  border-bottom: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 0.2s var(--ease);
}

.note-row:hover {
  background: var(--surface-subtle);
}

.note-date-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 2px;
}

.note-date {
  font-size: 13px;
  color: var(--text-muted);
}

.note-readtime {
  font-size: 12px;
  color: var(--text-muted);
}

.note-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.note-row:hover .note-title {
  color: var(--accent);
}

.note-excerpt {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.68;
}

.note-action {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 2px;
}

.note-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  white-space: nowrap;
}

/* =====================================================================
   06 / 联系我与页脚
   ===================================================================== */
.section-contact {
  padding-bottom: 92px;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 36px;
  align-items: center;
  box-shadow: var(--shadow-sm);
}

.contact-email-box {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.contact-email-text {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}

.contact-email-actions {
  display: flex;
  gap: 8px;
}

.socials-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.social-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg);
  transition: all 0.2s var(--ease);
}

.social-item:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-xs);
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  flex-shrink: 0;
}

.social-item > div {
  min-width: 0;
  flex: 1;
}

.social-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.social-handle {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 36px;
  background: var(--bg);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-copy {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}

.footer-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  color: var(--text-muted);
  background: var(--surface);
}

.back-top-btn {
  background: none;
  border: none;
  font-size: 13.5px;
  color: var(--text-secondary);
  padding: 4px 6px;
}

.back-top-btn:hover {
  color: var(--accent);
}

/* =====================================================================
   弹窗与 Toast
   ===================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s var(--ease);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s var(--ease);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: var(--text-primary);
  background: var(--surface-subtle);
}

.modal-body {
  padding: 28px 30px 30px;
}

.modal-cover {
  height: 190px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 22px;
}

.modal-cover svg {
  width: 100%;
  height: 100%;
  display: block;
}

.modal-kicker {
  font-size: 12.5px;
  color: var(--accent-text);
  margin: 0 0 8px;
}

.modal-title {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.3;
  font-weight: 700;
  padding-right: 36px;
}

.modal-desc {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
}

.modal-subtitle {
  margin: 20px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-highlights {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14.5px;
  line-height: 1.75;
}

.modal-highlights li + li {
  margin-top: 6px;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.note-article p {
  margin: 0 0 16px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--text-secondary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  z-index: 200;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--text-primary);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: var(--shadow-md);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* 404 页面 */
.not-found-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.not-found-card {
  max-width: 480px;
  width: 100%;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 44px 32px;
  box-shadow: var(--shadow-sm);
}

.not-found-title {
  margin: 0 0 12px;
  font-size: 28px;
}

.not-found-desc {
  margin: 0 0 26px;
  color: var(--text-secondary);
  font-size: 15px;
}

/* 滚动显现动效 */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

/* =====================================================================
   响应式适配
   ===================================================================== */
@media (max-width: 980px) {
  .hero-grid,
  .about-grid,
  .contact-card {
    grid-template-columns: 1fr;
  }

  .projects-grid,
  .repos-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .principles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .hero-section {
    padding: 48px 0 64px;
  }

  .section {
    padding: 64px 0;
  }

  .principles-grid,
  .projects-grid,
  .repos-grid,
  .socials-grid {
    grid-template-columns: 1fr;
  }

  .timeline-item {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 20px;
  }

  .note-row {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 20px 10px;
  }

  .contact-card {
    padding: 26px 20px;
  }

  .modal-body {
    padding: 22px 20px 24px;
  }
}
