:root {
  --bg: #f7fafc;
  --bg-secondary: #edf2f7;
  --bg-card: rgba(255, 255, 255, 0.85);
  --text: #1e293b;
  --text-secondary: #475569;
  --muted: #64748b;
  --line: rgba(0, 0, 0, 0.08);
  --primary: #08409a;
  --primary-dark: #2563eb;
  --accent: #10b981;
  --accent-dark: #059669;
  --ink: #0f172a;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.08);
  --nav-bg: rgba(247, 250, 252, 0.88);
  --source-bg: #0f172a;
  --source-text: #fff;
  --video-player-bg: #edf2f7;
  --video-back-bg: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] {
  --bg: #0b0f1a;
  --bg-secondary: #111827;
  --bg-card: rgba(30, 41, 59, 0.7);
  --text: #e8edf5;
  --text-secondary: #94a3b8;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.12);
  --primary: #1661bd;
  --primary-dark: #205dbf;
  --accent: #34d399;
  --accent-dark: #10b981;
  --ink: #f1f5f9;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  --nav-bg: rgba(11, 15, 26, 0.85);
  --source-bg: #fff;
  --source-text: #06111f;
  --video-player-bg: #050813;
  --video-back-bg: rgba(255, 255, 255, 0.07);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
}

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

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
  background: var(--nav-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.navbar-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1200px, 100%);
  height: 62px;
  margin: 0 auto;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 800;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.nav-brand:hover .nav-dot,
.nav-brand[aria-expanded="true"] .nav-dot {
  background: var(--primary);
}

.nav-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
}

[data-theme="dark"] .nav-dot {
  background: #fff;
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 120;
  display: grid;
  min-width: 150px;
  padding: 8px;
  visibility: hidden;
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-6px);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown.active {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.nav-dropdown-item:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.nav-links li a,
.nav-links li button,
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  background: transparent;
  border: 0;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.nav-links li a:hover,
.nav-links li button:hover,
.theme-toggle:hover {
  color: var(--text);
  background: var(--bg-secondary);
}

.nav-links .nav-cta {
  font-weight: 700;
}

.theme-toggle {
  min-width: 52px;
  border: 1px solid var(--line);
  font-size: 0.85rem;
}

.site-shell {
  width: min(1120px, calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 56px;
}

.page {
  width: min(900px, calc(100% - 36px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.page-wide {
  width: min(1100px, calc(100% - 32px));
}

#projects {
  scroll-margin-top: 82px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 32px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.back-link:hover {
  color: var(--primary);
}

h1 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: 0;
}

.subtitle {
  margin: 0 0 32px;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
}

.content {
  color: var(--text-secondary);
  font-size: 0.93rem;
  line-height: 1.85;
}

.content h2 {
  margin: 32px 0 10px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 700;
  opacity: 0.9;
}

.content h2:first-child {
  margin-top: 0;
}

.content p {
  margin: 0 0 12px;
}

.content ul {
  margin: 4px 0 14px;
  padding-left: 20px;
}

.content li {
  margin-bottom: 4px;
}

.content strong {
  color: var(--text);
}

[data-theme="dark"] .content {
  color: #cbd5e1;
}

[data-theme="dark"] .content h2,
[data-theme="dark"] .content strong {
  color: #e2e8f0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 36px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.btn-outline,
.btn-filled,
.btn-source,
.btn-home {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  padding: 0 22px;
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-outline {
  color: var(--text);
  background: var(--bg-secondary);
  border: 1px solid var(--line);
}

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

.btn-filled,
.btn-home {
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, var(--primary-dark), var(--accent-dark));
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.18);
}

.btn-filled:hover,
.btn-home:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(37, 99, 235, 0.28);
}

.btn-source {
  color: var(--source-text);
  background: var(--source-bg);
}

footer {
  padding: 36px 0 0;
  margin-top: 40px;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--line);
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 0 48px;
  text-align: center;
}

.hero-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 24px;
}

.hero-icon::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.18) 0%, rgba(5, 150, 105, 0.08) 40%, transparent 70%);
  animation: heroGlow 3s ease-in-out infinite alternate;
}

[data-theme="dark"] .hero-icon::before {
  background: radial-gradient(circle, rgba(96, 165, 250, 0.28) 0%, rgba(52, 211, 153, 0.14) 40%, transparent 70%);
}

@keyframes heroGlow {
  from {
    opacity: 0.6;
    transform: scale(0.95);
  }

  to {
    opacity: 1;
    transform: scale(1.08);
  }
}

.hero-jelly {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 48px;
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  background: linear-gradient(145deg, #3b82f6, #10b981);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.3), 0 0 40px rgba(16, 185, 129, 0.15);
}

.hero-jelly::after {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 13px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(-50%);
}

.hero-copy {
  width: min(720px, 100%);
}

.hero-greeting {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
  background: linear-gradient(135deg, #334155 0%, #1e40af 50%, #047857 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .hero-greeting {
  background: linear-gradient(135deg, #e2e8f0 0%, #3b82f6 50%, #34d399 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-intro {
  max-width: 560px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.projects-overview {
  padding-top: 4px;
}

.projects-overview h2 {
  margin: 0 0 24px;
  color: var(--ink);
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
  font-weight: 800;
  text-align: center;
  letter-spacing: 0;
}

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

.project-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg-card);
  backdrop-filter: blur(4px);
  transition: all 0.28s ease;
}

.project-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow);
  transform: translateY(-5px);
}

.project-card h3 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0;
}

.project-card-desc {
  flex: 1;
  margin: 0 0 16px;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.72;
}

.project-card-link {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 700;
  transition: gap 0.2s ease;
}

.project-card-link:hover {
  gap: 8px;
}

.github-notice {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 22px;
  margin: 32px 0 18px;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.github-notice-icon {
  flex-shrink: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 50%;
  background: rgba(96, 165, 250, 0.1);
  font-size: 1.2rem;
}

.github-notice strong {
  color: var(--text);
  font-weight: 800;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  visibility: hidden;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.active {
  visibility: visible;
  opacity: 1;
}

.modal-box {
  width: min(380px, calc(100% - 32px));
  padding: 28px 26px 22px;
  text-align: center;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
}

[data-theme="dark"] .modal-box {
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.modal-box h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 800;
}

.modal-sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.85rem;
}

.contact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.9rem;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.contact-row .label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 600;
}

.contact-row .value {
  flex: 1;
  margin-left: 10px;
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

.btn-copy {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  margin-left: 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: all 0.2s ease;
}

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

.btn-copy.copied {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-close-modal {
  padding: 8px 28px;
  margin-top: 18px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  background: var(--bg-secondary);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.btn-close-modal:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.video-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}

.video-nav-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.video-nav .back-link {
  min-height: 42px;
  padding: 0 16px;
  margin-bottom: 0;
  color: var(--text);
  background: var(--video-back-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.video-nav .back-link:hover {
  opacity: 0.8;
  transform: translateY(-2px);
}

.brand {
  color: var(--muted);
  font-weight: 800;
}

.video-intro {
  margin-bottom: 22px;
  text-align: center;
}

.video-intro p {
  margin: 0 0 10px;
  color: var(--accent);
  font-weight: 700;
}

.video-title {
  margin: 0;
  font-size: clamp(1.85rem, 4vw, 3.4rem);
  line-height: 1.16;
}

.player {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  padding: 48px 24px;
  overflow: hidden;
  background: var(--video-player-bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .player {
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.player-icon {
  margin-bottom: 14px;
  font-size: 3.4rem;
  opacity: 0.7;
}

.player-title {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 1.15rem;
  font-weight: 700;
}

.player-desc {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 0.94rem;
}

.btn-watch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 32px;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  border-radius: 8px;
  box-shadow: 0 12px 28px rgba(239, 68, 68, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-watch:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(239, 68, 68, 0.38);
}

.hint {
  margin: 14px 0 0;
  color: #f97316;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.7;
  text-align: center;
}

.video-actions {
  justify-content: center;
  margin-top: 22px;
  padding-top: 0;
  border-top: 0;
}

@media (max-width: 760px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .navbar-inner {
    height: 54px;
  }

  .nav-links li a,
  .nav-links li button {
    padding: 0 10px;
    font-size: 0.82rem;
  }

  .hero {
    padding: 40px 0 32px;
  }

  .hero-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
  }
}

@media (max-width: 560px) {
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .site-shell,
  .page,
  .page-wide {
    width: min(100% - 24px, 1120px);
    padding-top: 18px;
  }

  .hero {
    padding: 28px 0 24px;
  }

  .hero-icon {
    width: 56px;
    height: 56px;
    margin-bottom: 14px;
  }

  .nav-links li a,
  .nav-links li button {
    padding: 0 8px;
    font-size: 0.78rem;
  }

  .video-nav {
    align-items: flex-start;
    flex-direction: column-reverse;
  }

  .actions,
  .video-actions {
    display: grid;
    grid-template-columns: 1fr;
  }
}
