/* ========== 全局样式 ========== */
*,*::before,*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background .4s ease, color .4s ease;
  line-height: 1.7;
  font-size: 15px;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; padding: 0; margin: 0; }
img { max-width: 100%; display: block; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ========== Header ========== */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  transition: background .4s, border-color .4s;
}

.header-inner {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
}

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

.nav-links a {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 6px;
  transition: color .2s, background .2s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--border-light);
}

.theme-btn {
  margin-left: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: none;
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s, background .2s;
}

.theme-btn:hover {
  background: var(--border-light);
}

/* Mobile menu */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  background: none;
  border: none;
  color: var(--text);
}

.nav-toggle span {
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

/* ========== Page Transition ========== */
.page-view {
  display: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .45s ease, transform .45s ease;
}

.page-view.active {
  display: block;
}

.page-view.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.page-view.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

/* ========== Buttons ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--bg);
  font-size: 14px;
  font-weight: 500;
  border: none;
  transition: opacity .2s, transform .15s;
  cursor: pointer;
}

.btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-outline:hover {
  background: var(--border-light);
  opacity: 1;
}

.btn-sm {
  padding: 7px 16px;
  font-size: 13px;
}

/* ========== Section ========== */
.section {
  padding: 80px 0;
  border-top: 1px solid var(--border);
}

.section:first-of-type {
  border-top: none;
}

.section h2 {
  font-size: 1.4rem;
  font-weight: 500;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}

.section .lead {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-secondary);
  max-width: 600px;
  margin-bottom: 48px;
}

/* ========== Card ========== */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: border-color .3s, box-shadow .3s;
}

.card:hover {
  border-color: var(--text-tertiary);
  box-shadow: var(--shadow-md);
}

/* ========== Footer ========== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 32px 0;
  font-size: 12px;
  color: var(--text-tertiary);
  transition: border-color .4s;
}

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

.footer-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-tertiary);
  font-size: 12px;
  transition: color .2s;
}

.footer-links a:hover {
  color: var(--text-secondary);
}

/* ========== 404 ========== */
.not-found {
  text-align: center;
  padding: 160px 24px;
}

.not-found h1 {
  font-size: 6rem;
  font-weight: 300;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.not-found p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    padding: 12px 24px;
    gap: 0;
  }

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

  .nav-links a {
    padding: 10px 0;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 56px 0;
  }

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