/* ============ Xtang API 企业级样式 ============ */
:root {
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-hover: #4f46e5;
  --bg-dark: #0a0f1e;
  --bg-darker: #060912;
  --bg-card: #131a2e;
  --bg-card-hover: #1a2340;
  --bg-light: #f6f8fb;
  --text-primary: #f1f5f9;
  --text-secondary: #8b95b0;
  --text-muted: #5a6480;
  --border: #1e2a45;
  --border-light: #2a3a5c;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.2);
  --shadow-hover: 0 12px 40px rgba(99,102,241,0.15);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', Roboto, sans-serif;
  line-height: 1.6; color: #1e293b; background: var(--bg-dark);
}
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(10, 15, 30, 0.85); backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.nav-brand { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.nav-brand span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.nav-links { display: flex; gap: 36px; align-items: center; }
.nav-links a { color: var(--text-secondary); font-size: 14px; font-weight: 500; transition: all 0.2s; }
.nav-links a:hover { color: #fff; }
.nav-btn { padding: 9px 22px; border-radius: 8px; font-size: 14px; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s; }
.nav-btn-primary { background: var(--primary); color: #fff; }
.nav-btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }
.nav-btn-outline { background: transparent; color: #fff; border: 1px solid var(--border-light); }
.nav-btn-outline:hover { border-color: var(--primary); color: var(--primary-light); }

/* ===== Hero区 ===== */
.hero {
  background: var(--bg-dark);
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(99,102,241,0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(139,92,246,0.1), transparent);
  padding: 160px 0 100px; text-align: center; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.03) 1px, transparent 1px);
  background-size: 50px 50px; mask-image: radial-gradient(ellipse 60% 60% at 50% 50%, black, transparent);
}
.hero > * { position: relative; z-index: 1; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 100px;
  background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.2);
  font-size: 13px; color: var(--primary-light); margin-bottom: 24px;
}
.hero h1 {
  font-size: 56px; font-weight: 800; margin-bottom: 24px; letter-spacing: -2px; line-height: 1.1;
  background: linear-gradient(180deg, #fff 0%, #a5b4fc 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p { font-size: 19px; color: var(--text-secondary); max-width: 640px; margin: 0 auto 40px; line-height: 1.7; }
.hero-btns { display: flex; gap: 16px; justify-content: center; }
.btn {
  padding: 14px 36px; border-radius: 10px; font-size: 15px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.btn-outline { background: rgba(255,255,255,0.05); color: #fff; border: 1px solid var(--border-light); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: var(--primary); }

/* ===== 通用区块 ===== */
.section { padding: 100px 0; }
.section-dark { background: var(--bg-dark); color: #fff; }
.section-light { background: var(--bg-light); color: #1e293b; }
.section-title { text-align: center; font-size: 36px; font-weight: 700; margin-bottom: 16px; letter-spacing: -1px; }
.section-desc { text-align: center; color: var(--text-secondary); margin-bottom: 56px; font-size: 17px; max-width: 560px; margin-left: auto; margin-right: auto; }

/* ===== 模型卡片 ===== */
.model-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 24px; }
.model-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 16px; padding: 28px; transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative; overflow: hidden;
}
.model-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient); opacity: 0; transition: opacity 0.3s;
}
.model-card:hover { transform: translateY(-6px); border-color: var(--primary); box-shadow: var(--shadow-hover); background: var(--bg-card-hover); }
.model-card:hover::before { opacity: 1; }
.model-category { display: inline-block; padding: 5px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; margin-bottom: 16px; }
.cat-language { background: rgba(99,102,241,0.15); color: #818cf8; }
.cat-image { background: rgba(236,72,153,0.15); color: #f472b6; }
.cat-audio { background: rgba(16,185,129,0.15); color: #34d399; }
.model-name { font-size: 19px; font-weight: 700; color: #fff; margin-bottom: 10px; letter-spacing: -0.3px; }
.model-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; min-height: 60px; line-height: 1.6; }
.model-types { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.type-badge { font-size: 12px; padding: 4px 10px; background: rgba(255,255,255,0.05); border-radius: 6px; color: #b0bbd6; border: 1px solid var(--border); }
.model-price { font-size: 15px; color: #fbbf24; font-weight: 700; }

/* ===== 代码块 ===== */
.code-block {
  background: #0d1117; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; margin: 20px 0; box-shadow: var(--shadow-card);
}
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #161b22; border-bottom: 1px solid var(--border); }
.code-header span { font-size: 13px; color: var(--text-secondary); font-weight: 500; }
.copy-btn {
  background: var(--primary); color: #fff; border: none; padding: 6px 14px;
  border-radius: 6px; font-size: 12px; font-weight: 500; cursor: pointer; transition: all 0.2s;
}
.copy-btn:hover { background: var(--primary-hover); }
.code-block pre { padding: 20px; overflow-x: auto; color: #e6edf3; font-size: 13px; line-height: 1.7; font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace; }

/* ===== 定价表 ===== */
.pricing-table {
  width: 100%; border-collapse: collapse; background: var(--bg-card);
  border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-card); border: 1px solid var(--border);
}
.pricing-table th, .pricing-table td { padding: 16px 24px; text-align: left; border-bottom: 1px solid var(--border); }
.pricing-table th { background: #0d1424; color: #fff; font-weight: 600; font-size: 14px; }
.pricing-table td { color: var(--text-secondary); font-size: 14px; }
.pricing-table tr:last-child td { border-bottom: none; }

/* ===== 表单/登录 ===== */
.auth-page {
  background: var(--bg-dark); min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background-image: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(99,102,241,0.1), transparent);
}
.auth-box {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; padding: 48px; width: 420px; box-shadow: var(--shadow-card);
}
.auth-box h2 { color: #fff; margin-bottom: 28px; text-align: center; font-size: 24px; font-weight: 700; }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; color: var(--text-secondary); font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.form-group input {
  width: 100%; padding: 12px 16px; background: rgba(0,0,0,0.2);
  border: 1px solid var(--border); border-radius: 10px; color: #fff; font-size: 14px;
  transition: all 0.2s;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.auth-box .btn { width: 100%; margin-top: 12px; justify-content: center; }
.auth-footer { text-align: center; margin-top: 20px; font-size: 14px; color: var(--text-secondary); }
.auth-footer a { color: var(--primary-light); }

/* ===== 后台布局 ===== */
.admin-layout { display: flex; min-height: 100vh; background: var(--bg-light); }
.sidebar {
  width: 250px; background: #0f1525; color: #fff; padding: 24px 0;
  border-right: 1px solid var(--border);
}
.sidebar-brand { padding: 0 28px 24px; font-size: 20px; font-weight: 800; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.sidebar-brand span { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.sidebar-menu { list-style: none; }
.sidebar-menu li {
  padding: 13px 28px; cursor: pointer; color: var(--text-secondary); font-size: 14px; font-weight: 500;
  transition: all 0.2s; border-left: 3px solid transparent;
}
.sidebar-menu li:hover { background: rgba(255,255,255,0.03); color: #fff; }
.sidebar-menu li.active { background: rgba(99,102,241,0.1); color: var(--primary-light); border-left-color: var(--primary); }
.main-content { flex: 1; padding: 36px; overflow-y: auto; }
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.page-header h2 { font-size: 26px; color: #0f1525; font-weight: 700; letter-spacing: -0.5px; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 32px; }
.stat-card {
  background: #fff; border-radius: 16px; padding: 28px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #eef1f6;
  transition: all 0.2s;
}
.stat-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); transform: translateY(-2px); }
.stat-label { font-size: 13px; color: #64748b; margin-bottom: 10px; font-weight: 500; }
.stat-value { font-size: 32px; font-weight: 800; color: #0f1525; letter-spacing: -1px; }
.stat-value.primary { color: var(--primary); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }

/* ===== 表格 ===== */
.data-table {
  width: 100%; background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05); border: 1px solid #eef1f6;
}
.data-table th, .data-table td { padding: 14px 20px; text-align: left; border-bottom: 1px solid #eef1f6; font-size: 14px; }
.data-table th { background: #fafbfc; font-weight: 600; color: #475569; font-size: 13px; text-transform: uppercase; letter-spacing: 0.5px; }
.data-table tr:hover { background: #f8fafc; }
.data-table tr:last-child td { border-bottom: none; }

/* ===== 按钮 ===== */
.btn-sm { padding: 7px 16px; font-size: 13px; font-weight: 500; border-radius: 8px; border: none; cursor: pointer; transition: all 0.2s; }
.btn-danger { background: #fef2f2; color: #dc2626; }
.btn-danger:hover { background: #fee2e2; }
.btn-success { background: #ecfdf5; color: #059669; }
.btn-success:hover { background: #d1fae5; }
.btn-info { background: #eff6ff; color: #2563eb; }
.btn-info:hover { background: #dbeafe; }

/* ===== Footer ===== */
.footer {
  background: var(--bg-darker); color: var(--text-muted); padding: 48px 0;
  text-align: center; font-size: 14px; border-top: 1px solid var(--border);
}

/* ===== 标签页 ===== */
.tabs { display: flex; gap: 8px; margin-bottom: 32px; justify-content: center; }
.tab {
  padding: 10px 24px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 500;
  background: rgba(255,255,255,0.05); color: var(--text-secondary); border: 1px solid var(--border);
  transition: all 0.2s;
}
.tab:hover { background: rgba(255,255,255,0.1); color: #fff; }
.tab.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .hero { padding: 120px 0 60px; }
  .hero h1 { font-size: 36px; letter-spacing: -1px; }
  .hero p { font-size: 16px; }
  .nav-links { display: none; }
  .model-grid { grid-template-columns: 1fr; }
  .section { padding: 60px 0; }
  .section-title { font-size: 28px; }
  .sidebar { width: 70px; }
  .sidebar-brand { display: none; }
  .sidebar-menu li { padding: 14px; text-align: center; font-size: 11px; }
  .main-content { padding: 20px; }
}
