/**
 * Glass Theme - Glassmorphism Design System
 * Soft gradients, frosted glass effects, smooth animations
 * For: xiushenqijia.cn
 */

:root {
  /* Palette: Lavender, Light Blue, Soft Cream */
  --bg-color: #f8f9ff;
  --text-main: #2d3748;
  --text-muted: #718096;
  --primary: #667eea;
  --accent: #764ba2;
  --glass-bg: rgba(255, 255, 255, 0.35);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  --glass-blur: blur(20px);
  --transition-speed: 0.4s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

/* --- Background Animation --- */
.bg-animation {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  filter: blur(80px);
  opacity: 0.8;
  border-radius: 50%;
  animation: float 20s infinite ease-in-out alternate;
}

.blob-1 {
  top: -10%;
  left: -10%;
  width: 50vw;
  height: 50vw;
  background: #e0c3fc;
  animation-duration: 25s;
}

.blob-2 {
  bottom: -10%;
  right: -10%;
  width: 60vw;
  height: 60vw;
  background: #8ec5fc;
  animation-duration: 30s;
  animation-delay: -5s;
}

.blob-3 {
  top: 40%;
  left: 40%;
  width: 40vw;
  height: 40vw;
  background: #fbc2eb;
  opacity: 0.6;
  animation-duration: 22s;
  animation-delay: -10s;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(30px, 50px) scale(1.1);
  }
  100% {
    transform: translate(-20px, -30px) scale(0.9);
  }
}

/* --- Glass Utility --- */
.glass {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(4px);
  transition: all var(--transition-speed) ease;
  cursor: pointer;
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* --- Layout --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 1200px;
  z-index: 100;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.2rem;
}

.brand img {
  height: 32px;
  width: 32px;
  border-radius: 8px;
}

.brand .title {
  font-weight: 700;
}

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

.nav-links a {
  text-decoration: none;
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.lang-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  padding: 4px;
  gap: 4px;
}

.lang-toggle button {
  border: none;
  background: none;
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.3s;
}

.lang-toggle button.active {
  background: #fff;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* --- Hero Section --- */
.hero {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding-top: 140px;
  padding-bottom: 60px;
  position: relative;
}

.hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards 0.2s;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards 0.4s;
}

.cta-group {
  display: flex;
  gap: 16px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards 0.6s;
}

/* --- Page Header (non-home pages) --- */
.page-header {
  padding-top: 140px;
  padding-bottom: 40px;
  text-align: center;
}

.page-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards 0.2s;
}

.page-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s forwards 0.4s;
}

/* --- Buttons --- */
.btn {
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s;
  display: inline-block;
  border: none;
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-main);
  backdrop-filter: blur(4px);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.8);
}

.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Cards & Grid --- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.card-grid {
  margin-bottom: 48px;
}

.card {
  padding: 40px;
  transition:
    transform 0.4s ease,
    box-shadow 0.4s ease,
    opacity 0.6s ease;
  opacity: 0;
  transform: translateY(40px);
}

.card.visible {
  opacity: 1;
  transform: translateY(0);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.55);
}

.section-title {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text-main);
}

.card h3 {
  font-size: 1.25rem;
  margin-bottom: 12px;
  color: var(--text-main);
}

.card p {
  color: var(--text-muted);
  margin-bottom: 12px;
}

.card p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--text-muted);
}

.highlight {
  margin-top: 16px;
  font-weight: 600;
  color: var(--primary);
}

/* --- Lists --- */
.list {
  list-style: none;
  padding: 0;
}

.list li {
  margin-bottom: 12px;
  padding-left: 24px;
  position: relative;
  color: var(--text-muted);
}

.list li::before {
  content: "\2713";
  position: absolute;
  left: 0;
  color: var(--primary);
}

/* --- Tables --- */
.table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  background: rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  overflow: hidden;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

.table th {
  background: rgba(102, 126, 234, 0.1);
  color: var(--text-main);
  font-weight: 600;
}

.table td {
  color: var(--text-muted);
}

.table a {
  color: var(--primary);
  text-decoration: none;
}

.table a:hover {
  text-decoration: underline;
}

/* --- Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

/* --- Notice Box --- */
.notice {
  background: rgba(102, 126, 234, 0.08);
  border: 1px solid rgba(102, 126, 234, 0.2);
  border-radius: 16px;
  padding: 24px;
}

.notice strong {
  display: block;
  margin-bottom: 12px;
  color: var(--text-main);
}

/* --- KV (Key-Value) Display --- */
.kv-group {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 24px;
}

.kv {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.em {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-main);
}

/* --- Footer --- */
footer {
  padding: 40px 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
  position: relative;
  z-index: 1;
}

.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.copyright {
  color: var(--text-muted);
}

/* --- Download Section --- */
.download-card {
  text-align: center;
  padding: 60px;
  margin-bottom: 80px;
}

/* --- Animations --- */
@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Content Padding for Subpages --- */
.content-section {
  padding-top: 120px;
  padding-bottom: 60px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  header {
    top: 0;
    width: 100%;
    border-radius: 0;
    border-top: none;
    border-left: none;
    border-right: none;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .nav-links {
    display: none;
  }

  .nav-links.mobile-active {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    border-radius: 0 0 24px 24px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
  }

  .kv-group {
    flex-direction: column;
    gap: 20px;
  }

  .card {
    padding: 24px;
  }

  .cta-group {
    flex-direction: column;
    align-items: center;
  }
}

/* --- Mobile Menu Toggle --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle svg {
  width: 24px;
  height: 24px;
  stroke: var(--text-main);
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }
}

/* --- Dark Overlay for Language Content --- */
[data-lang] {
  display: none;
}

[data-lang].active {
  display: block;
}
