:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef1f5;
  --text: #1a1f2e;
  --muted: #5c6678;
  --border: #dde3ea;
  --accent: #0078d4;
  --accent-hover: #106ebe;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --max: 1080px;
  --header-h: 64px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --surface: #171a21;
  --surface-2: #1f2430;
  --text: #eef2f7;
  --muted: #9aa4b2;
  --border: #2a3140;
  --accent: #4c9aff;
  --accent-hover: #78b6ff;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
}

.site-header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  white-space: nowrap;
}

.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
}

.site-nav a {
  color: var(--muted);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
}

.site-nav a:hover,
.site-nav a.active {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 18px;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-ghost {
  background: transparent;
}

.site-main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 20px 72px;
}

.section {
  margin-bottom: 28px;
}

.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.section-title {
  margin: 0 0 16px;
  font-size: 24px;
  line-height: 1.3;
}

.section-subtitle {
  margin: 0 0 20px;
  color: var(--muted);
}

.hero {
  padding: 56px 28px;
  text-align: center;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 5vw, 44px);
  line-height: 1.15;
}

.hero-tagline {
  margin: 0 auto 24px;
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.version-badge {
  display: inline-block;
  margin-top: 18px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 13px;
}

.download-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.download-note {
  color: var(--muted);
  font-size: 14px;
}

.changelog-item {
  padding: 24px 0;
  border-bottom: 1px solid var(--border);
}

.changelog-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.changelog-item h3 {
  margin: 0 0 12px;
  font-size: 20px;
}

.changelog-item ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
}

.changelog-item li { margin-bottom: 8px; }

.version-password {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.gallery img,
.effect-img {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}

.effect-block {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px dashed var(--border);
  text-align: center;
}

.effect-block h4 {
  margin: 0 0 14px;
  font-size: 17px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.contact-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-2);
}

.contact-card strong {
  display: block;
  margin-bottom: 8px;
}

.donate-wrap {
  position: relative;
  display: inline-block;
}

.donate-qr {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  transform: translateX(-50%);
  width: 280px;
  max-width: 80vw;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: #fff;
}

.donate-wrap:hover .donate-qr,
.donate-wrap:focus-within .donate-qr {
  display: block;
}

.feedback-box textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.feedback-meta {
  margin: 8px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.disclaimer {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 100;
}

.modal-mask.hidden { display: none; }
.hidden { display: none !important; }

.modal-card {
  position: relative;
  max-width: 900px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.modal-card img {
  width: 100%;
  border-radius: 10px;
  display: block;
}

.modal-close {
  position: absolute;
  top: -12px;
  right: -12px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 20px;
  cursor: pointer;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  display: none;
  z-index: 120;
}

.toast.show { display: block; }

@media (max-width: 860px) {
  .site-header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 4px;
  }

  .section-card,
  .hero {
    padding: 20px;
  }
}
