/* =====================================================
   youragent — Unified Design System
   Pure white + film grain + violet-blue accents
   Covers: Homepage (index.html) + Query Page (query.html)
   ===================================================== */

/* Film grain noise texture */
@keyframes grain {

  0%,
  100% {
    transform: translate(0, 0);
  }

  10% {
    transform: translate(-5%, -10%);
  }

  20% {
    transform: translate(-15%, 5%);
  }

  30% {
    transform: translate(7%, -25%);
  }

  40% {
    transform: translate(-5%, 25%);
  }

  50% {
    transform: translate(-15%, 10%);
  }

  60% {
    transform: translate(15%, 0%);
  }

  70% {
    transform: translate(0%, 15%);
  }

  80% {
    transform: translate(3%, 35%);
  }

  90% {
    transform: translate(-10%, 10%);
  }
}

/* ── Variables ── */
:root {
  --bg: #fafafa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --gradient: linear-gradient(135deg, #7c3aed, #2563eb);
  --gradient-soft: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(37, 99, 235, 0.08));
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.08);
  --radius: 12px;
  --radius-lg: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', monospace;
  --accent-green: #34d399;
  --accent-violet: #a78bfa;
  --accent-blue: #60a5fa;
  --accent-yellow: #fbbf24;
  --accent-red: #f87171;
  --accent-orange: #fb923c;
}

/* ── Reset & Base ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Film grain overlay */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 200px;
  animation: grain 8s steps(10) infinite;
}

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

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

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  font-family: var(--font);
}

.btn-primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.25);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

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

.btn-outline:hover {
  border-color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.02);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

/* ── Navbar ── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  transition: all 0.3s ease;
  background: transparent;
}

.navbar.scrolled {
  background: rgba(250, 250, 250, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient);
  color: #fff;
}

.nav-name {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

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

.nav-link {
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: color 0.2s;
  font-weight: 500;
}

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

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

.lang-toggle {
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--border-hover);
  background: transparent;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  letter-spacing: 0.02em;
}

.lang-toggle:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  width: 28px;
  height: 28px;
}

.nav-mobile {
  display: none;
  flex-direction: column;
  padding: 16px 24px;
  background: rgba(250, 250, 250, 0.98);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
}

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

.nav-mobile-link {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text-secondary);
}

@media (max-width: 768px) {

  .nav-links,
  .nav-actions {
    display: none;
  }

  .nav-toggle {
    display: block;
  }
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 24px 80px;
  text-align: center;
  overflow: hidden;
}

/* Subtle background pattern */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(rgba(0, 0, 0, 0.15) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.15) 1px, transparent 1px);
  background-size: 60px 60px;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 700px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 100px;
  border: 1px solid rgba(124, 58, 237, 0.2);
  background: rgba(124, 58, 237, 0.04);
  margin-bottom: 32px;
  font-size: 0.85rem;
  color: #7c3aed;
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.4;
  }
}

.hero-title {
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  letter-spacing: 0.02em;
}

.hero-typewriter {
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 48px;
  font-family: var(--mono);
  font-size: 1.1rem;
  color: #7c3aed;
}

.typewriter-cursor {
  border-right: 2px solid #7c3aed;
  animation: blink 1s infinite;
}

@keyframes blink {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0;
  }
}

.hero-ctas {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-scroll {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0.35;
  z-index: 2;
}

.hero-scroll span {
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.scroll-indicator {
  width: 20px;
  height: 32px;
  border-radius: 100px;
  border: 1.5px solid var(--text-muted);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 6px;
}

.scroll-dot {
  width: 4px;
  height: 8px;
  border-radius: 100px;
  background: var(--text-muted);
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {

  0%,
  100% {
    transform: translateY(0);
    opacity: 1;
  }

  50% {
    transform: translateY(8px);
    opacity: 0.3;
  }
}

/* ── Stats ── */
.stats-section {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  text-align: center;
  padding: 32px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.2s, box-shadow 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-value {
  display: block;
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Section Common ── */
.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(124, 58, 237, 0.2);
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.04);
  margin-bottom: 16px;
}

.section-title {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 8px;
}

.section-desc {
  color: var(--text-muted);
  font-size: 1rem;
}

/* ── Features ── */
.features-section {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.feature-card {
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.25s ease;
}

.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.feature-icon svg {
  width: 22px;
  height: 22px;
}

.feature-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.feature-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

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

/* ── Price Advantage ── */
.price-advantage-section {
  padding: 80px 0 64px;
  position: relative;
  overflow: hidden;
}

.price-advantage-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% 0%, rgba(124, 58, 237, 0.07) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 30% 100%, rgba(37, 99, 235, 0.05) 0%, transparent 50%),
    radial-gradient(ellipse 60% 40% at 70% 100%, rgba(124, 58, 237, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.pa-badge {
  border-color: rgba(251, 191, 36, 0.3) !important;
  color: #d97706 !important;
  background: rgba(251, 191, 36, 0.08) !important;
}

.pa-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.pa-card {
  position: relative;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.15);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0;
  overflow: hidden;
  transition: all 0.35s ease;
}

.pa-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(124, 58, 237, 0.12), 0 8px 24px rgba(0, 0, 0, 0.06);
  border-color: rgba(124, 58, 237, 0.3);
}

.pa-card-glow {
  position: absolute;
  top: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: linear-gradient(90deg, transparent, #7c3aed, #2563eb, transparent);
  opacity: 0.6;
}

.pa-header {
  padding: 28px 28px 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pa-model-badge {
  padding: 4px 14px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pa-claude {
  background: linear-gradient(135deg, #d4a574, #c4956a);
  color: #fff;
}

.pa-codex {
  background: linear-gradient(135deg, #10a37f, #059669);
  color: #fff;
}

.pa-opus-pro {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
}

.pa-official-api {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
}

.pa-model-name {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.pa-tag {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  vertical-align: middle;
  margin-left: 4px;
}

.pa-body {
  padding: 24px 28px;
}

.pa-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pa-row-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

.pa-row-price {
  font-weight: 800;
  font-family: var(--mono);
}

.pa-row-price small {
  font-size: 0.65em;
  font-weight: 500;
  opacity: 0.5;
  margin-left: 2px;
}

.pa-price-old {
  font-size: 1.5rem;
  color: var(--text-muted);
  text-decoration: line-through;
  text-decoration-color: var(--accent-red);
  text-decoration-thickness: 2px;
  opacity: 0.6;
}

.pa-price-new {
  font-size: 2.4rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.pa-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
  color: var(--accent-green);
  animation: bounceDown 2s ease-in-out infinite;
}

@keyframes bounceDown {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(4px);
  }
}

.pa-footer {
  padding: 0 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pa-token-info {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.pa-token-info svg {
  color: var(--accent-yellow);
  flex-shrink: 0;
}

.pa-save-badge {
  padding: 5px 16px;
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: 0 2px 12px rgba(52, 211, 153, 0.3);
  animation: savePulse 3s ease-in-out infinite;
  white-space: nowrap;
}

@keyframes savePulse {

  0%,
  100% {
    box-shadow: 0 2px 12px rgba(52, 211, 153, 0.3);
  }

  50% {
    box-shadow: 0 4px 20px rgba(52, 211, 153, 0.5);
  }
}

.pa-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 32px;
  letter-spacing: 0.02em;
}

@media (max-width: 768px) {
  .pa-cards {
    grid-template-columns: 1fr;
    max-width: 400px;
  }

  .pa-model-name {
    font-size: 1.1rem;
  }

  .pa-price-new {
    font-size: 2rem;
  }
}

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

.pricing-toggle {
  display: inline-flex;
  gap: 4px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 100px;
  padding: 4px;
  border: 1px solid var(--border);
  margin-top: 20px;
}

.toggle-btn {
  padding: 8px 20px;
  border-radius: 100px;
  border: none;
  background: transparent;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-muted);
  font-family: var(--font);
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-btn.active {
  background: var(--gradient);
  color: #fff;
}

.toggle-save {
  font-size: 0.7rem;
  background: var(--accent-green);
  color: #fff;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 600;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.pricing-card {
  position: relative;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.pricing-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.pricing-card.popular {
  border-color: rgba(124, 58, 237, 0.3);
  background: rgba(124, 58, 237, 0.02);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 4px 16px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--gradient);
  white-space: nowrap;
}

.pricing-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.pricing-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.pricing-price {
  margin-bottom: 24px;
}

.price-amount {
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1;
}

.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 4px;
}

.pricing-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 28px;
  flex: 1;
}

.pricing-features li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.pricing-features svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.pricing-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 32px;
}

@media (max-width: 768px) {
  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 400px;
    margin: 0 auto;
  }
}

/* ── CTA ── */
.cta-section {
  padding: 100px 0;
  text-align: center;
  position: relative;
}

.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(124, 58, 237, 0.04) 0%, transparent 60%);
}

.cta-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  position: relative;
}

.gradient-text {
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.cta-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 32px;
  position: relative;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

.cta-trust {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
  position: relative;
}

.cta-trust span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cta-trust svg {
  width: 16px;
  height: 16px;
}

/* ── FAQ ── */
.faq-section {
  padding: 80px 0 64px;
}

.faq-list {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
  transition: all 0.25s ease;
}

.faq-item:hover {
  border-color: var(--border-hover);
}

.faq-item.open {
  border-color: rgba(124, 58, 237, 0.2);
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.06);
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  line-height: 1.5;
}

.faq-question svg {
  flex-shrink: 0;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
  color: #7c3aed;
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 24px;
}

.faq-item.open .faq-answer {
  max-height: 200px;
  padding: 0 24px 20px;
}

.faq-answer p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* CTA contact buttons */
.cta-contact-btn {
  gap: 10px !important;
}

.cta-contact-btn svg {
  flex-shrink: 0;
}

/* ── WeChat Modal ── */
.wechat-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  align-items: center;
  justify-content: center;
}

.wechat-modal.show {
  display: flex;
}

.wechat-modal-content {
  position: relative;
  background: #fff;
  border-radius: 20px;
  padding: 40px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  max-width: 380px;
  width: 90%;
  animation: modalIn 0.3s ease;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.wechat-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}

.wechat-modal-close:hover {
  color: var(--text-primary);
}

.wechat-modal-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: linear-gradient(135deg, #07c160, #06ad56);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.wechat-modal-content h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.wechat-id-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 20px;
  margin-bottom: 12px;
}

.wechat-id {
  font-family: var(--mono);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.wechat-copy-btn {
  padding: 6px 16px;
  border-radius: 8px;
  border: none;
  background: var(--gradient);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: all 0.2s;
  min-width: 52px;
}

.wechat-copy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.wechat-modal-note {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Footer ── */
.site-footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: 8px;
}

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

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color 0.2s;
}

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

.footer-bottom {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  opacity: 0.7;
}

/* =====================================================
   Query Page Styles (query.html)
   ===================================================== */

/* ── Query Section ── */
.query-section {
  max-width: 600px;
  margin: 0 auto;
  padding: 32px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-wrapper input {
  width: 100%;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.input-wrapper input:focus {
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.08);
}

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

.toggle-key-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  display: flex;
  align-items: center;
}

.toggle-key-btn svg {
  width: 20px;
  height: 20px;
}

.query-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--gradient);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.25);
}

.query-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.35);
}

.query-btn svg {
  width: 18px;
  height: 18px;
}

.query-btn.loading {
  opacity: 0.7;
  pointer-events: none;
}

/* ── Status Messages ── */
.status-msg {
  max-width: 600px;
  margin: 16px auto;
  padding: 14px 20px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  line-height: 1.6;
}

.status-msg.error {
  background: rgba(248, 113, 113, 0.06);
  border: 1px solid rgba(248, 113, 113, 0.15);
  color: #dc2626;
}

.status-msg.success {
  background: rgba(52, 211, 153, 0.06);
  border: 1px solid rgba(52, 211, 153, 0.15);
  color: #059669;
}

/* ── Results ── */
.results {
  padding-top: 16px;
}

/* ── Balance Cards ── */
.balance-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.balance-card {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.25s ease;
}

.balance-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.balance-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.balance-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.balance-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}

.balance-icon svg {
  width: 18px;
  height: 18px;
}

.icon-total {
  background: rgba(96, 165, 250, 0.1);
  color: #2563eb;
}

.icon-used {
  background: rgba(251, 146, 60, 0.1);
  color: #ea580c;
}

.icon-remain {
  background: rgba(52, 211, 153, 0.1);
  color: #059669;
}

.icon-expire {
  background: rgba(167, 139, 250, 0.1);
  color: #7c3aed;
}

.balance-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.balance-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .balance-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Glass Card (shared) ── */
.glass-card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg-card);
  padding: 28px;
  margin-bottom: 20px;
}

/* ── Usage Ring ── */
.usage-ring-section {
  text-align: center;
}

.ring-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
}

.usage-ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-bg {
  fill: none;
  stroke: rgba(0, 0, 0, 0.04);
  stroke-width: 12;
}

.ring-fill {
  fill: none;
  stroke: url(#ring-gradient);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 534;
  stroke-dashoffset: 534;
  transition: stroke-dashoffset 1s ease;
}

.ring-label {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.ring-percent {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
}

.ring-text {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ── Section Title (query page) ── */
.section-title-query,
h2.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* ── Model Tags ── */
.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.model-tag {
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--gradient-soft);
  color: #7c3aed;
  border: 1px solid rgba(124, 58, 237, 0.1);
}

/* ── Stats Chart ── */
.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 200px;
  padding: 10px 0;
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  border-radius: 6px 6px 2px 2px;
  background: var(--gradient);
  position: relative;
  cursor: pointer;
  transition: opacity 0.2s;
  min-height: 2px;
}

.chart-bar:hover {
  opacity: 0.8;
}

.chart-bar-tooltip {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  z-index: 10;
}

.chart-bar:hover .chart-bar-tooltip {
  display: block;
}

.chart-bar-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.chart-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 0;
  color: var(--text-muted);
}

.chart-placeholder svg {
  width: 40px;
  height: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}

/* ── Filter Select ── */
.filter-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-family: var(--font);
  outline: none;
  cursor: pointer;
}

.filter-select:focus {
  border-color: #7c3aed;
}

/* ── Stats/Logs Headers ── */
.stats-header,
.logs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.stats-filters,
.logs-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refresh-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.refresh-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.refresh-btn svg {
  width: 16px;
  height: 16px;
}

/* ── Logs Table ── */
.logs-table-wrap {
  overflow-x: auto;
}

.logs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.logs-table th {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}

.logs-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
}

.logs-table tr:hover td {
  background: rgba(0, 0, 0, 0.01);
}

.empty-row td {
  text-align: center;
  color: var(--text-muted);
  padding: 32px;
}

.log-model {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--gradient-soft);
  padding: 2px 8px;
  border-radius: 6px;
  color: #7c3aed;
}

.log-quota {
  font-weight: 600;
  color: var(--text-primary);
}

.log-tokens {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.log-content {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

/* ── Pagination ── */
.logs-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
  font-family: var(--font);
}

.page-btn:hover {
  border-color: #7c3aed;
  color: #7c3aed;
}

.page-btn.active {
  background: var(--gradient);
  color: #fff;
  border-color: transparent;
}

/* ── Query Page Layout ── */
.app {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

/* Query page header */
.header {
  text-align: center;
  padding: 100px 0 32px;
}

.header-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.logo svg {
  width: 32px;
  height: 32px;
}

.header-title {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header-subtitle {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.header-contact {
  font-size: 0.85rem;
  color: #7c3aed;
  margin-top: 8px;
  font-weight: 500;
}

/* ── Query Page Footer ── */
.footer {
  text-align: center;
  padding: 32px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-note {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 4px;
}

/* ── Background blobs (hidden) ── */
.bg-blob {
  display: none;
}