:root {
  --bg: #0d1117;
  --fg: #c9d1d9;
  --fg-muted: #8b949e;
  --accent: #58a6ff;
  --accent-hover: #388bfd;
  --card-bg: #161b22;
  --border: #30363d;
  --radius: 8px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root.light-theme {
  --bg: #ffffff;
  --fg: #24292f;
  --fg-muted: #57606a;
  --accent: #0969da;
  --accent-hover: #0859c6;
  --card-bg: #f6f8fa;
  --border: #d0d7de;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.75;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent-hover);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

/* 导航 */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.navbar.scrolled {
  padding: 0.5rem 0;
  background: rgba(13, 17, 23, 0.98);
}

.light-theme .navbar {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.light-theme .navbar.scrolled {
  background: rgba(255, 255, 255, 0.98);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
}
.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.3s ease;
}
.logo:hover {
  transform: scale(1.05);
}
.logo img {
  filter: drop-shadow(0 0 8px rgba(88, 166, 255, 0.5));
}
.nav {
  display: flex;
  gap: 2rem;
  align-items: center;
}
.nav-link {
  color: var(--fg-muted);
  font-weight: 500;
  position: relative;
  padding: 0.5rem 0;
  transition: all 0.3s ease;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
}
.nav-link.active,
.nav-link:hover {
  color: var(--accent);
}
.nav-link.active::after,
.nav-link:hover::after {
  width: 100%;
}
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.5rem;
  cursor: pointer;
}

.theme-toggle {
  background: none;
  border: none;
  color: var(--fg);
  font-size: 1.2rem;
  cursor: pointer;
  margin-left: 1rem;
  vertical-align: middle;
  transition: transform 0.3s ease;
}
.theme-toggle:hover {
  transform: rotate(20deg);
}

/* 区块 */
.section {
  padding: 5rem 0;
  position: relative;
}
.section.bg-dark {
  background: var(--card-bg);
}
h2 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--fg);
  text-align: center;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}
h2::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}
h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--fg);
  display: flex;
  align-items: center;
  gap: 10px;
}
h3::before {
  content: '▶';
  color: var(--accent);
  font-size: 0.8rem;
}
p {
  color: var(--fg-muted);
  margin-bottom: 1rem;
}
ul {
  list-style: none;
  margin: 0.5rem 0 1rem;
}
li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--fg-muted);
  margin-bottom: 0.5rem;
}
li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
  animation: pulse 2s infinite;
}

/* 按钮 */
.actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  border: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}
.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
  z-index: -1;
}
.btn:hover::before {
  transform: translateX(100%);
}
.btn:active {
  transform: translateY(2px);
}
.btn-primary {
  background: linear-gradient(45deg, var(--accent), var(--accent-hover));
  color: #fff;
  border: 2px solid var(--accent-hover);
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(45deg, var(--accent-hover), #0a5ccf);
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.5);
  transform: translateY(-2px);
  color: #fff;
}
.btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 15px rgba(88, 166, 255, 0.2);
}
.btn-secondary:hover {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 6px 20px rgba(88, 166, 255, 0.4);
  transform: translateY(-2px);
}

/* 首页 Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at center, #0a192f 0%, #0d1117 70%);
  padding-top: 4rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 10% 20%, rgba(88, 166, 255, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(56, 139, 253, 0.1) 0%, transparent 20%);
  z-index: 0;
}

.light-theme .hero {
  background: radial-gradient(circle at center, #e6f0ff 0%, #f0f3f6 70%);
}

.light-theme .hero::before {
  background: 
    radial-gradient(circle at 10% 20%, rgba(9, 105, 218, 0.1) 0%, transparent 20%),
    radial-gradient(circle at 90% 80%, rgba(8, 89, 198, 0.1) 0%, transparent 20%);
}

.hero-content {
  max-width: 900px;
  position: relative;
  padding: 3rem;
  border-radius: var(--radius);
  background: linear-gradient(135deg, 
    rgba(22, 27, 34, 0.7), 
    rgba(13, 17, 23, 0.85));
  backdrop-filter: blur(12px);
  border: 1px solid rgba(88, 166, 255, 0.3);
  box-shadow: 0 10px 30px rgba(88, 166, 255, 0.2);
  overflow: hidden;
  z-index: 1;
  margin: 0 auto;
  transform: translateY(0);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-content:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 40px rgba(88, 166, 255, 0.3);
}

.hero-content::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(88, 166, 255, 0.3),
    transparent,
    rgba(56, 139, 253, 0.3),
    transparent
  );
  animation: rotate 10s linear infinite;
  z-index: -1;
}

.hero-content h1,
.hero-content p,
.hero-content .actions {
  position: relative;
  z-index: 2;
}

.hero-content h1 {
  background: linear-gradient(90deg, #58a6ff, #79b8ff, #58a6ff);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 4s ease-in-out infinite alternate, glow 2s ease-in-out infinite alternate;
  font-size: 3.5rem;
  line-height: 1.4;
  margin-bottom: 1.5rem;
}

@keyframes glow {
  0% {
    text-shadow: 0 0 5px rgba(88, 166, 255, 0.5);
  }
  100% {
    text-shadow: 0 0 20px rgba(88, 166, 255, 0.8), 0 0 30px rgba(88, 166, 255, 0.6);
  }
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

@keyframes pulse {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.light-theme .hero-content {
  background: linear-gradient(135deg, 
    rgba(246, 248, 250, 0.8), 
    rgba(255, 255, 255, 0.95));
  border: 1px solid rgba(9, 105, 218, 0.3);
  box-shadow: 0 10px 30px rgba(9, 105, 218, 0.2);
}

.light-theme .hero-content::before {
  background: conic-gradient(
    from 0deg,
    transparent,
    rgba(9, 105, 218, 0.3),
    transparent,
    rgba(8, 89, 198, 0.3),
    transparent
  );
}

.light-theme .hero-content h1 {
  background: linear-gradient(90deg, #0969da, #218aff, #0969da);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradientShift 4s ease-in-out infinite alternate, glow 2s ease-in-out infinite alternate;
}

.hero p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.light-theme .hero p {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 卡片网格 */
.grid {
  display: grid;
  gap: 2rem;
}
@media (min-width: 768px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}
.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  border-color: var(--accent);
}
.card:hover::before {
  transform: scaleX(1);
}
.card h3 {
  margin-top: 0;
  margin-bottom: 1rem;
}
.card ul {
  padding-left: 0;
  flex-grow: 1;
}
.card li {
  margin-bottom: 0.75rem;
  padding-left: 1.5rem;
}

.light-theme .card {
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.light-theme .card:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 下载页提示 */
.notes {
  margin-top: 2rem;
  background: rgba(22, 27, 34, 0.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  font-size: 0.95rem;
  backdrop-filter: blur(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.light-theme .notes {
  background: rgba(240, 242, 245, 0.7);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.notes code {
  font-family: var(--font-mono);
  background: rgba(110, 118, 129, 0.3);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
}

.light-theme .notes code {
  background: rgba(175, 184, 193, 0.3);
}

/* 页脚 */
.footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  text-align: center;
  font-size: 0.875rem;
  color: var(--fg-muted);
  background: var(--card-bg);
}

/* 移动端适配 */
@media (max-width: 767px) {
  .menu-toggle {
    display: block;
  }
  .nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 1rem 0;
    display: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }
  .nav.open {
    display: flex;
  }
  .nav-link {
    padding: 0.75rem 1.5rem;
  }
  .hero-content h1 {
    font-size: 2.5rem;
  }
  .actions {
    flex-direction: column;
  }
  .btn {
    width: 100%;
  }
  h2 {
    font-size: 2rem;
  }
}

/* 粒子背景效果 */
.particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  background: rgba(88, 166, 255, 0.5);
  animation: float 15s infinite linear;
}

@keyframes float {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 0.5;
  }
  100% {
    transform: translateY(-1000%) translateX(1000%) rotate(720deg);
    opacity: 0;
  }
}