/* ============================================
   GongXinBot — 中文AI工具站
   Design System: Clean, Modern, Chinese-friendly
   ============================================ */

/* --- CSS Variables --- */
:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #60A5FA;
  --primary-bg: #EFF6FF;
  --accent: #F59E0B;
  --accent-light: #FEF3C7;

  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;

  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;

  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans SC', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 50px rgba(0,0,0,0.12);

  --transition: all 0.2s ease;
  --max-width: 1200px;
  --nav-height: 68px;
}

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

html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  color: var(--gray-800);
  background: var(--gray-50);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }

/* --- Utility --- */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.sr-only { position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0; }

/* --- Navigation --- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--gray-200);
  height: var(--nav-height);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

.nav-logo .logo-icon {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 1rem;
}

.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }

.nav-links a {
  color: var(--gray-600);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.nav-mobile-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; }

/* --- Hero Section --- */
.hero {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 50%, #2563eb 100%);
  color: white;
  padding: 80px 0 72px;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

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

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 6px 18px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 24px;
  backdrop-filter: blur(4px);
}

.hero h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.1rem;
  opacity: 0.88;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.7;
}

.hero-tools-count {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  padding-top: 32px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.hero-tools-count .count-item strong {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
}

.hero-tools-count .count-item span {
  font-size: 0.85rem;
  opacity: 0.7;
}

/* --- Section Common --- */
.section { padding: 64px 0; }

.section-header {
  text-align: center;
  margin-bottom: 44px;
}

.section-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--gray-500);
  font-size: 1.02rem;
  max-width: 520px;
  margin: 0 auto;
}

.section-header .header-line {
  width: 48px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--primary-light));
  border-radius: 2px;
  margin: 12px auto 0;
}

/* --- Tool Cards Grid --- */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.tool-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.tool-card .tool-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}

.tool-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.tool-card p {
  font-size: 0.88rem;
  color: var(--gray-500);
  line-height: 1.6;
}

.tool-card .tool-tag-group {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.tool-tag {
  font-size: 0.75rem;
  padding: 4px 10px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 999px;
  font-weight: 500;
}

.tool-card .badge-hot {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--danger);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

/* --- Category Pills --- */
.categories-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: white;
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition);
}

.cat-pill:hover, .cat-pill.active {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* --- How It Works --- */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  margin-top: 24px;
}

.step-card {
  text-align: center;
  padding: 32px 24px;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
}

.step-card .step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  border-radius: 50%;
  margin-bottom: 16px;
}

.step-card h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.step-card p { font-size: 0.9rem; color: var(--gray-500); line-height: 1.6; }

/* ============================================
   TOOL PAGE STYLES
   ============================================ */

.tool-hero {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  color: white;
  padding: 48px 0 40px;
  text-align: center;
}

.tool-hero .container { max-width: 800px; }

.tool-breadcrumb {
  font-size: 0.82rem;
  opacity: 0.7;
  margin-bottom: 14px;
}

.tool-breadcrumb a { color: white; opacity: 0.8; }
.tool-breadcrumb a:hover { opacity: 1; }

.tool-hero h1 {
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  margin-bottom: 10px;
}

.tool-hero p {
  font-size: 1rem;
  opacity: 0.85;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Tool Form Area --- */
.tool-main { padding: 40px 0 60px; }

.tool-main .container { max-width: 900px; }

.tool-form { margin-bottom: 32px; }

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

.form-group label {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
  font-size: 0.95rem;
  margin-bottom: 8px;
}

.form-group textarea {
  width: 100%;
  min-height: 160px;
  padding: 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--gray-800);
  resize: vertical;
  transition: var(--transition);
  background: white;
}

.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-group textarea::placeholder { color: var(--gray-400); }

.form-group input[type="text"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--gray-800);
  transition: var(--transition);
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.form-options {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.option-chip {
  padding: 8px 18px;
  border: 1.5px solid var(--gray-300);
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: var(--transition);
  background: white;
  color: var(--gray-600);
  font-weight: 500;
}

.option-chip:hover { border-color: var(--primary-light); color: var(--primary); }
.option-chip.selected {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

.option-chip input { display: none; }

/* --- Buttons --- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(37,99,235,0.35);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: white;
  color: var(--gray-700);
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm { padding: 6px 16px; font-size: 0.82rem; }

.form-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

/* --- Result Area --- */
.result-section {
  margin-top: 32px;
}

.result-section.loading {
  text-align: center;
  padding: 40px;
}

.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 14px;
}

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

.loading-text {
  color: var(--gray-500);
  font-size: 0.95rem;
}

.result-content {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 32px;
  white-space: pre-wrap;
  line-height: 1.9;
  font-size: 0.98rem;
  color: var(--gray-800);
  max-height: 600px;
  overflow-y: auto;
}

.result-content h2, .result-content h3 {
  margin: 16px 0 8px;
  font-weight: 700;
}

.result-content h2 { font-size: 1.2rem; color: var(--gray-900); }
.result-content h3 { font-size: 1.05rem; color: var(--gray-800); }

.result-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--gray-900);
  color: white;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 9999;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2s forwards;
}

@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* --- Footer --- */
.footer {
  background: var(--gray-900);
  color: var(--gray-400);
  padding: 48px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 36px;
}

.footer-brand h3 {
  color: white;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.88rem;
  line-height: 1.7;
  max-width: 300px;
}

.footer-col h4 {
  color: white;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 14px;
}

.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--gray-400); font-size: 0.88rem; transition: var(--transition); }
.footer-col a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  flex-wrap: wrap;
  gap: 10px;
}

/* --- Ad Placeholder --- */
.ad-section {
  text-align: center;
  padding: 24px 0;
}

.ad-label {
  font-size: 0.72rem;
  color: var(--gray-400);
  text-align: center;
  margin-bottom: 4px;
}

.ad-placeholder {
  background: repeating-linear-gradient(45deg, var(--gray-100), var(--gray-100) 10px, var(--gray-50) 10px, var(--gray-50) 20px);
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-400);
  font-size: 0.82rem;
  font-weight: 500;
  min-height: 90px;
  margin: 0 auto;
  max-width: 728px;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fadeInUp 0.5s ease forwards; }

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; }
  .steps-grid { grid-template-columns: 1fr; max-width: 400px; margin: 24px auto 0; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-mobile-toggle { display: block; }

  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.95rem; }
  .hero-tools-count { gap: 24px; flex-wrap: wrap; }

  .section { padding: 48px 0; }
  .section-header h2 { font-size: 1.4rem; }

  .tools-grid { grid-template-columns: 1fr 1fr; }

  .tool-hero { padding: 36px 0 32px; }
  .tool-hero h1 { font-size: 1.4rem; }

  .result-content { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; }
  .btn-primary { width: 100%; }
  .steps-grid { max-width: 100%; }
}
