/* ==========================================================================
   页面级组件样式
   ========================================================================== */

/* ---------- 着陆页 Hero ---------- */
.hero {
  position: relative;
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(16, 185, 129, 0.18), transparent),
    #0a0a0a;
  color: #fff;
  overflow: hidden;
  padding: 96px 0 120px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse 70% 60% at 50% 0%, #000, transparent 75%);
}
.hero .container { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  color: var(--brand-light);
  margin-bottom: 28px;
}
.hero h1 {
  font-size: 56px;
  line-height: 1.1;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 22px;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--brand-light), var(--brand));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p.lead {
  font-size: 19px;
  color: var(--gray-400);
  max-width: 620px;
  margin: 0 auto 36px;
}
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.hero .btn-outline { border-color: rgba(255,255,255,0.2); color: #fff; }
.hero .btn-outline:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.35); }

/* Hero 统计条 */
.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  margin-top: 64px;
  flex-wrap: wrap;
}
.hero-stat { text-align: center; }
.hero-stat .num {
  font-size: 40px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
}
.hero-stat .num span { color: var(--brand-light); }
.hero-stat .label { font-size: 14px; color: var(--gray-500); margin-top: 4px; }

/* ---------- 区块 ---------- */
.section { padding: 88px 0; }
.section-head { text-align: center; max-width: 600px; margin: 0 auto 56px; }
.section-head .eyebrow {
  font-size: 14px;
  font-weight: 700;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-head h2 { font-size: 38px; margin: 12px 0; letter-spacing: -0.02em; }
.section-head p { font-size: 17px; color: var(--gray-500); }

/* 特性网格 */
.features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.feature {
  padding: 28px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.feature:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--gray-300); }
.feature .icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-dark);
  margin-bottom: 18px;
}
.feature h3 { font-size: 18px; margin-bottom: 8px; }
.feature p { color: var(--gray-500); font-size: 15px; }

/* API 卡片网格 */
.api-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.api-card {
  display: flex;
  flex-direction: column;
  padding: 22px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all 0.2s;
}
.api-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--brand); }
.api-card .api-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.api-card h3 { font-size: 17px; }
.api-card p { color: var(--gray-500); font-size: 14px; flex: 1; margin-bottom: 16px; }
.api-card .api-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--gray-100);
}
.api-card .price { font-weight: 700; color: var(--gray-900); }
.api-card .price small { font-weight: 400; color: var(--gray-400); }

/* CTA 区块 */
.cta {
  background: linear-gradient(135deg, #0a0a0a, #171717);
  border-radius: var(--radius-xl);
  padding: 64px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.cta::after {
  content: "";
  position: absolute;
  top: -50%;
  right: -10%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(16,185,129,0.25), transparent 70%);
}
.cta h2 { color: #fff; font-size: 34px; position: relative; }
.cta p { color: var(--gray-400); font-size: 17px; margin: 14px 0 28px; position: relative; }
.cta .btn { position: relative; }

/* ---------- 页脚 ---------- */
.footer {
  background: #0a0a0a;
  color: var(--gray-500);
  padding: 48px 0;
  margin-top: 0;
}
.footer .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.footer a:hover { color: var(--brand-light); }

/* ==========================================================================
   认证页
   ========================================================================== */
.auth-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.auth-side {
  background: radial-gradient(ellipse 90% 70% at 30% 20%, rgba(16,185,129,0.2), transparent), #0a0a0a;
  color: #fff;
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-side::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 60% 50% at 30% 30%, #000, transparent);
}
.auth-side > * { position: relative; z-index: 1; }
.auth-side h2 { color: #fff; font-size: 32px; line-height: 1.3; margin-bottom: 16px; }
.auth-side p { color: var(--gray-400); font-size: 16px; }
.auth-side .feat-list { list-style: none; margin-top: 28px; }
.auth-side .feat-list li { display: flex; gap: 10px; margin-bottom: 14px; color: var(--gray-300); }
.auth-side .feat-list svg { color: var(--brand-light); flex-shrink: 0; }
.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--white);
}
.auth-box { width: 100%; max-width: 380px; }
.auth-box h1 { font-size: 28px; margin-bottom: 8px; }
.auth-box .sub { color: var(--gray-500); margin-bottom: 28px; }

@media (max-width: 860px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .features, .api-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 38px; }
  .section-head h2 { font-size: 28px; }
  .cta { padding: 40px 24px; }
}

/* ==========================================================================
   控制台 / 后台 布局（侧边栏）
   ========================================================================== */
.layout { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: #0a0a0a;
  color: var(--gray-400);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar .brand { color: #fff; padding: 8px 10px 20px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.sidebar-nav .nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-weight: 500;
  font-size: 15px;
  transition: all 0.15s;
}
.sidebar-nav .nav-item:hover { background: rgba(255,255,255,0.06); color: #fff; }
.sidebar-nav .nav-item.active { background: var(--brand); color: #fff; }
.sidebar-nav .nav-item svg { flex-shrink: 0; }
.sidebar-nav .group-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray-600);
  padding: 16px 14px 8px;
}
.sidebar-foot { border-top: 1px solid rgba(255,255,255,0.08); padding-top: 12px; }

.main { display: flex; flex-direction: column; background: var(--gray-50); min-width: 0; }
.topbar {
  height: 64px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar h1 { font-size: 20px; }
.topbar .user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px 6px 14px;
  border-radius: 999px;
  background: var(--gray-100);
  font-size: 14px;
  font-weight: 600;
}
.avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: grid; place-items: center;
  font-size: 13px;
}
.content { padding: 28px; flex: 1; }

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.stat-card .stat-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.stat-card .stat-label { font-size: 14px; color: var(--gray-500); font-weight: 500; }
.stat-card .stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
}
.stat-card .stat-value { font-size: 30px; font-weight: 800; color: var(--gray-900); letter-spacing: -0.02em; }
.stat-card .stat-value small { font-size: 15px; font-weight: 600; color: var(--gray-400); }
.stat-card .stat-sub { font-size: 13px; color: var(--gray-400); margin-top: 6px; }

.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
.grid-cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.chart-box { position: relative; height: 300px; }
.chart-box-sm { position: relative; height: 240px; }

/* API Key 展示 */
.key-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--gray-700);
}
.key-display .key-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  padding: 4px; border-radius: 6px; transition: all 0.15s;
}
.icon-btn:hover { color: var(--brand); background: var(--gray-100); }

/* 充值金额选择 */
.amount-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.amount-opt {
  padding: 18px;
  text-align: center;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 700;
  font-size: 18px;
  color: var(--gray-800);
  transition: all 0.15s;
}
.amount-opt:hover { border-color: var(--brand-light); }
.amount-opt.active { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-dark); }

/* ---------- 文档页布局 ---------- */
.docs-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.docs-nav {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 16px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}
.docs-nav .cat-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--gray-400);
  font-weight: 700;
  padding: 12px 10px 6px;
}
.docs-nav a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-600);
  transition: all 0.12s;
}
.docs-nav a:hover { background: var(--gray-100); color: var(--gray-900); }
.docs-nav a.active { background: var(--brand-soft); color: var(--brand-dark); font-weight: 600; }

.method-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
}
.method-get { background: var(--brand-soft); color: var(--brand-dark); }
.method-post { background: rgba(245, 158, 11, 0.14); color: #d97706; }

.endpoint-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--gray-900);
  border-radius: var(--radius);
  color: #e5e5e5;
  font-family: var(--font-mono);
  font-size: 14px;
  overflow-x: auto;
}

@media (max-width: 960px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; z-index: 100; width: 250px; left: -260px; transition: left 0.25s;
  }
  .sidebar.open { left: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-cols-2, .docs-layout { grid-template-columns: 1fr; }
  .docs-nav { position: static; max-height: none; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .mobile-menu-btn { display: inline-flex !important; }
}
.mobile-menu-btn { display: none; }
