/* AI算力出海平台 · 全局样式 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* Tailwind CSS via CDN - base styles */
@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
  --bg-primary: #0a0f1e;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --border-color: #1e2d4a;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --cyan: #22d3ee;
  --gradient-accent: linear-gradient(135deg, #6366f1, #8b5cf6);
}

html { font-size: 16px; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(10, 15, 30, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; gap: 2rem;
}
.navbar-brand {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1.125rem; font-weight: 800; color: white; text-decoration: none;
}
.navbar-logo {
  width: 32px; height: 32px;
  background: var(--gradient-accent);
  border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 1rem;
}
.navbar-links { display: flex; gap: 1.5rem; margin-left: auto; }
.navbar-link { color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; font-weight: 500; transition: color 0.2s; }
.navbar-link:hover { color: white; }
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.content { padding: 2rem 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  padding: 0.5rem 1.25rem; border-radius: 8px; font-size: 0.875rem; font-weight: 600;
  cursor: pointer; border: none; text-decoration: none; transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--gradient-accent); color: white; }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-secondary { background: var(--bg-card); color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-secondary); border-color: var(--accent); }
.btn-success { background: var(--success); color: white; }
.btn-danger { background: var(--danger); color: white; }
.btn-sm { padding: 0.35rem 0.75rem; font-size: 0.8rem; border-radius: 6px; }
.btn-lg { padding: 0.75rem 1.5rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Cards */
.card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; overflow: hidden;
}
.card-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 0.9rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; }
.card-body { padding: 1.5rem; }

/* Stats */
.stat-card {
  background: var(--bg-card); border: 1px solid var(--border-color);
  border-radius: 12px; padding: 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
}
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.25rem; }
.stat-value { font-size: 1.75rem; font-weight: 800; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 500; }
.stat-change { font-size: 0.8rem; font-weight: 600; }
.stat-change.up { color: var(--success); }

/* Tables */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 0.75rem 1rem; text-align: left; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  background: var(--bg-secondary); border-bottom: 1px solid var(--border-color);
}
.table td {
  padding: 0.875rem 1rem; font-size: 0.875rem; border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(99,102,241,0.05); }
.table .text-center { text-align: center; }
.table .text-muted { color: var(--text-muted); }
.table .actions { display: flex; gap: 0.5rem; }

/* Badges */
.badge {
  display: inline-flex; align-items: center;
  padding: 0.25rem 0.6rem; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-primary { background: rgba(99,102,241,0.15); color: var(--accent); }
.badge-info { background: rgba(34,211,238,0.15); color: var(--cyan); }

/* Forms */
.form-group { display: flex; flex-direction: column; gap: 0.5rem; }
.form-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); }
.form-input, .form-select {
  padding: 0.625rem 0.875rem; background: var(--bg-secondary); border: 1px solid var(--border-color);
  border-radius: 8px; color: var(--text-primary); font-size: 0.875rem; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s; font-family: inherit;
}
.form-input:focus, .form-select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}
.form-input::placeholder { color: var(--text-muted); }
.form-hint { font-size: 0.75rem; color: var(--text-muted); }

/* Alerts */
.alert {
  padding: 0.875rem 1rem; border-radius: 10px; font-size: 0.875rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.alert-danger { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: var(--danger); }
.alert-success { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: var(--success); }
.alert-warning { background: rgba(245,158,11,0.1); border: 1px solid rgba(245,158,11,0.3); color: var(--warning); }
.alert-info { background: rgba(99,102,241,0.1); border: 1px solid rgba(99,102,241,0.3); color: var(--accent); }
.hidden { display: none !important; }

/* Grid */
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.m-3 { margin: 1rem; }
.p-3 { padding: 1rem; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

/* Pagination */
.pagination { display: flex; gap: 0.5rem; margin-top: 1rem; justify-content: center; }
.pagination button {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-card); color: var(--text-secondary); cursor: pointer; font-size: 0.875rem;
  transition: all 0.2s;
}
.pagination button:hover { border-color: var(--accent); color: var(--accent); }
.pagination button.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000;
  display: none; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
  width: 100%; max-width: 480px; overflow: hidden;
}
.modal-header {
  padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; color: var(--text-muted); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.modal-close:hover { color: white; }
.modal form { padding: 1.5rem; }

/* Admin Sidebar */
.sidebar {
  width: 240px; min-height: 100vh; background: var(--bg-secondary);
  border-right: 1px solid var(--border-color); flex-shrink: 0;
  position: sticky; top: 0; overflow-y: auto;
}
.sidebar-header {
  padding: 1.25rem 1rem; border-bottom: 1px solid var(--border-color);
}
.sidebar-nav { padding: 0.75rem 0; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.625rem 1rem; margin: 0.125rem 0.75rem; border-radius: 8px;
  color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; font-weight: 500;
  transition: all 0.2s;
}
.sidebar-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.sidebar-link.active { background: rgba(99,102,241,0.15); color: var(--accent); }

.admin-content { flex: 1; min-width: 0; }
.admin-header {
  padding: 1rem 1.5rem; border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; background: var(--bg-primary); z-index: 50;
}

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.pricing-card {
  background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px;
  padding: 2rem; text-align: center; position: relative; transition: transform 0.2s, box-shadow 0.2s;
}
.pricing-card:hover { transform: translateY(-4px); box-shadow: 0 12px 40px rgba(0,0,0,0.3); }
.pricing-card.featured { border-color: var(--accent); box-shadow: 0 0 40px rgba(99,102,241,0.2); }
.pricing-badge { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); background: var(--gradient-accent); color: white; font-size: 0.7rem; font-weight: 700; padding: 0.25rem 0.75rem; border-radius: 999px; }
.pricing-name { font-size: 1rem; font-weight: 700; margin-bottom: 0.75rem; }
.pricing-price { font-size: 2rem; font-weight: 900; }
.pricing-price span { font-size: 0.9rem; font-weight: 500; color: var(--text-muted); }
.pricing-credits { font-size: 0.9rem; color: var(--accent); font-weight: 600; margin: 0.5rem 0 1rem; }
.pricing-features { list-style: none; text-align: left; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 0.5rem; }
.pricing-features li { font-size: 0.85rem; color: var(--text-secondary); display: flex; align-items: center; gap: 0.5rem; }
.pricing-features li::before { content: '✓'; color: var(--success); font-weight: 700; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 16px; padding: 1.75rem; }
.feature-icon { width: 52px; height: 52px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin-bottom: 1rem; }
.feature-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }

/* Code Block */
.code-block { background: #0d1117; border-radius: 10px; overflow: hidden; margin: 0.75rem 0; }
.code-header { display: flex; justify-content: space-between; align-items: center; padding: 0.5rem 1rem; background: rgba(255,255,255,0.05); border-bottom: 1px solid rgba(255,255,255,0.05); }
.code-lang { font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }
.code-copy { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; }
.code-copy:hover { color: white; }
.code-body pre { padding: 1rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.6; color: #c9d1d9; font-family: 'Fira Code', monospace; margin: 0; }
.api-key-display { display: flex; align-items: center; gap: 0.5rem; background: #0d1117; padding: 0.625rem 0.875rem; border-radius: 8px; }
.api-key-value { font-family: 'Fira Code', monospace; font-size: 0.85rem; color: var(--accent); flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* Hero */
.hero { text-align: center; padding: 5rem 1.5rem; background: radial-gradient(ellipse at top, rgba(99,102,241,0.15) 0%, transparent 60%); }
.hero h1 { font-size: 3.5rem; font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem; background: linear-gradient(135deg, #fff 0%, #a5b4fc 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { font-size: 1.125rem; color: var(--text-secondary); max-width: 640px; margin: 0 auto 2rem; line-height: 1.8; }
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; padding: 0.375rem 0.875rem; border-radius: 999px; font-size: 0.8rem; font-weight: 600; margin-bottom: 1.5rem; }

/* Toast */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 20px; border-radius: 10px; font-size: 0.9rem; font-weight: 500; box-shadow: 0 4px 20px rgba(0,0,0,0.3); animation: slideIn 0.3s ease; max-width: 320px; }
.toast-success { background: linear-gradient(135deg, #22c55e, #16a34a); color: white; }
.toast-error { background: linear-gradient(135deg, #ef4444, #dc2626); color: white; }
.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: white; }
.toast-info { background: linear-gradient(135deg, #6366f1, #4f46e5); color: white; }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* Footer */
.footer { background: var(--bg-secondary); border-top: 1px solid var(--border-color); padding: 4rem 0 2rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand { font-size: 1.25rem; font-weight: 800; margin-bottom: 0.75rem; }
.footer-desc { font-size: 0.85rem; color: var(--text-muted); line-height: 1.7; }
.footer-title { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin-bottom: 1rem; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; transition: color 0.2s; }
.footer-links a:hover { color: white; }
.footer-bottom { border-top: 1px solid var(--border-color); padding-top: 1.5rem; text-align: center; font-size: 0.8rem; color: var(--text-muted); }

/* Chart */
.chart-container { height: 240px; padding: 1rem; }

/* Responsive */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pricing-grid { grid-template-columns: repeat(2, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.25rem; }
  .sidebar { width: 200px; }
  .navbar-links { display: none; }
}
@media (max-width: 480px) {
  .hero { padding: 3rem 1rem; }
  .hero h1 { font-size: 1.75rem; }
}
