/* ═══════════════════════════════════════════
   SEO智检 - AI SEO Audit Platform
   ═══════════════════════════════════════════ */

:root {
  --bg: #0a0a0f;
  --bg-card: #12121a;
  --bg-card-hover: #1a1a28;
  --border: #1e1e2e;
  --text: #e4e4e7;
  --text-dim: #71717a;
  --text-muted: #52525b;
  --primary: #6366f1;
  --primary-light: #818cf8;
  --primary-dark: #4f46e5;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --info: #3b82f6;
  --gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --gradient-bg: linear-gradient(135deg, #0a0a0f 0%, #0f0f1a 50%, #0a0a0f 100%);
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0,0,0,0.3);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

/* ─── Hero ──────────────────────────────── */

.hero {
  position: relative;
  padding: 100px 0 80px;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse 600px 400px at 50% 0%, rgba(99,102,241,0.15), transparent),
    radial-gradient(ellipse 400px 300px at 30% 60%, rgba(139,92,246,0.08), transparent),
    radial-gradient(ellipse 400px 300px at 70% 40%, rgba(99,102,241,0.06), transparent);
  z-index: 0;
}

.hero > .container { position: relative; z-index: 1; }

.hero-badge {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 100px;
  font-size: 13px;
  color: var(--primary-light);
  margin-bottom: 24px;
  letter-spacing: 0.5px;
}

.hero h1 {
  font-size: clamp(48px, 8vw, 80px);
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 8px;
}

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

.hero-subtitle {
  font-size: clamp(18px, 3vw, 24px);
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 300;
}

.hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 40px;
  line-height: 1.8;
}

/* ─── Audit Form ────────────────────────── */

.audit-form {
  max-width: 640px;
  margin: 0 auto 32px;
}

.input-group {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.input-icon {
  font-size: 20px;
  padding: 0 12px;
}

.input-group input {
  flex: 1;
  background: none;
  border: none;
  color: var(--text);
  font-size: 16px;
  padding: 14px 8px;
  outline: none;
  font-family: inherit;
}

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

.input-group button {
  padding: 14px 28px;
  background: var(--gradient);
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  font-family: inherit;
}

.input-group button:hover {
  opacity: 0.9;
  transform: scale(1.02);
}

.input-group button:active {
  transform: scale(0.98);
}

.input-group button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-right: 6px;
  vertical-align: middle;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Coverage Options */

.coverage-options {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
}

.coverage-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.coverage-option:hover {
  border-color: rgba(99,102,241,0.4);
}

.coverage-option:has(input:checked) {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
}

.coverage-option input { display: none; }

.coverage-label {
  font-size: 13px;
  font-weight: 600;
}

.coverage-desc {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Trust badges */

.trust-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}

.trust-badges span {
  padding: 4px 0;
}

/* ─── Progress ──────────────────────────── */

.progress-section {
  padding: 60px 0;
}

.progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.progress-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.audit-url {
  color: var(--primary-light);
  font-weight: 400;
  font-size: 15px;
}

.timer {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  color: var(--primary-light);
  font-weight: 600;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-bar {
  height: 100%;
  background: var(--gradient);
  border-radius: 3px;
  width: 0%;
  transition: width 0.5s ease;
  animation: shimmer 2s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.progress-log {
  max-height: 200px;
  overflow-y: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  padding: 12px;
  background: rgba(0,0,0,0.2);
  border-radius: 8px;
}

.progress-log .log-line {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.progress-log .log-line:last-child {
  color: var(--text);
}

/* ─── Results ───────────────────────────── */

.results-section {
  padding: 60px 0;
}

.score-overview {
  display: flex;
  align-items: center;
  gap: 48px;
  margin-bottom: 48px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.score-circle-wrapper {
  text-align: center;
  flex-shrink: 0;
}

.score-circle {
  position: relative;
  width: 180px;
  height: 180px;
}

.score-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 8;
}

.score-ring {
  fill: none;
  stroke: var(--primary);
  stroke-width: 8;
  stroke-linecap: round;
  transition: stroke-dashoffset 1.5s ease, stroke 0.5s;
}

.score-value {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-value span:first-child {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
}

.score-label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.score-grade {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.score-meta { flex: 1; }

.result-url {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 20px;
  word-break: break-all;
}

.meta-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
}

.meta-stat {
  display: flex;
  flex-direction: column;
}

.meta-value {
  font-size: 28px;
  font-weight: 700;
}

.meta-label {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ─── Categories ────────────────────────── */

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.section-title h3 {
  font-size: 20px;
  font-weight: 700;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: border-color 0.2s, transform 0.2s;
}

.category-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-2px);
}

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

.category-name {
  font-size: 14px;
  font-weight: 600;
}

.category-score {
  font-size: 22px;
  font-weight: 800;
}

.category-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.category-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 1s ease;
}

.category-issues {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Issues ────────────────────────────── */

.filter-buttons {
  display: flex;
  gap: 8px;
}

.filter-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.filter-btn:hover, .filter-btn.active {
  border-color: var(--primary);
  color: var(--primary-light);
  background: rgba(99,102,241,0.08);
}

.issues-list {
  margin-bottom: 48px;
}

.issue-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 8px;
  transition: border-color 0.2s;
  cursor: pointer;
}

.issue-item:hover {
  border-color: rgba(99,102,241,0.3);
}

.issue-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.issue-severity {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.severity-error { background: rgba(239,68,68,0.15); color: #ef4444; }
.severity-warning { background: rgba(245,158,11,0.15); color: #f59e0b; }
.severity-notice { background: rgba(59,130,246,0.15); color: #3b82f6; }

.issue-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}

.issue-category {
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  padding: 2px 8px;
  border-radius: 4px;
}

.issue-details {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

.issue-item.expanded .issue-details {
  display: block;
}

.issue-urls {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
}

.issue-urls a {
  color: var(--primary-light);
  text-decoration: none;
}

.issue-urls a:hover { text-decoration: underline; }

/* ─── AI Section ────────────────────────── */

.ai-section {
  margin-bottom: 48px;
}

.ai-recommendations {
  background: var(--bg-card);
  border: 1px solid rgba(99,102,241,0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  font-size: 14px;
  line-height: 1.8;
  white-space: pre-wrap;
  color: var(--text-dim);
}

/* ─── Actions ───────────────────────────── */

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 32px 0;
}

.action-btn {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.action-btn:hover {
  border-color: var(--primary);
  background: rgba(99,102,241,0.08);
}

.action-btn.primary {
  background: var(--gradient);
  border: none;
  color: white;
  font-weight: 600;
}

.action-btn.primary:hover {
  opacity: 0.9;
}

/* ─── Features ──────────────────────────── */

.features {
  padding: 80px 0;
  background: rgba(99,102,241,0.02);
}

.features h2 {
  text-align: center;
  font-size: 24px;
  margin-bottom: 48px;
}

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

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(99,102,241,0.3);
  transform: translateY(-4px);
}

.feature-icon {
  font-size: 32px;
  display: block;
  margin-bottom: 12px;
}

.feature-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.7;
}

/* ─── Recent ────────────────────────────── */

.recent-section {
  padding: 60px 0;
}

.recent-section h2 {
  text-align: center;
  margin-bottom: 32px;
}

.recent-list {
  display: grid;
  gap: 12px;
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s;
}

.recent-item:hover {
  border-color: rgba(99,102,241,0.3);
}

.recent-score {
  font-size: 24px;
  font-weight: 800;
  width: 56px;
  text-align: center;
}

.recent-info { flex: 1; }

.recent-url {
  font-size: 14px;
  font-weight: 600;
}

.recent-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* ─── Footer ────────────────────────────── */

.footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.footer-sub {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
}

/* ─── Error ──────────────────────────────── */

.error-message {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 16px 20px;
  color: #ef4444;
  font-size: 14px;
  text-align: center;
  margin: 20px 0;
}

/* ─── Responsive ─────────────────────────── */

@media (max-width: 768px) {
  .hero { padding: 60px 0 40px; }
  .score-overview { flex-direction: column; gap: 24px; text-align: center; }
  .meta-stats { justify-content: center; }
  .coverage-options { flex-direction: column; align-items: center; }
  .filter-buttons { flex-wrap: wrap; }
  .result-actions { flex-wrap: wrap; }
  .categories-grid { grid-template-columns: 1fr 1fr; }
}

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

/* ─── Print ──────────────────────────────── */

@media print {
  body { background: white; color: black; }
  .hero, .features, .footer, .progress-section, .result-actions { display: none !important; }
  .results-section { padding: 0; }
  .score-overview, .category-card, .issue-item { border-color: #ddd; }
}
