/* ============================================
   图萌工具 - 现代化设计系统 v2.0
   ============================================ */

/* ===== CSS Variables ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --accent: #06b6d4;
  --accent-light: #22d3ee;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface: #ffffff;
  --surface-raised: #ffffff;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 25px -3px rgba(0,0,0,0.08), 0 4px 10px -4px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 40px -4px rgba(0,0,0,0.1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans SC', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; }

/* ===== Container ===== */
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ===== Header - Glassmorphism ===== */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255,255,255,0.82);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom: 1px solid rgba(226,232,240,0.6);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset, 0 2px 16px rgba(0,0,0,0.04);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 64px;
}
.logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.logo span { font-size: 1.4rem; }
header nav { display: flex; align-items: center; gap: 4px; }
header nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
header nav a:hover {
  color: var(--primary);
  background: rgba(99,102,241,0.07);
  text-decoration: none;
}

/* ===== Hero Section ===== */
.hero {
  position: relative;
  padding: 80px 0 90px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #06b6d4 100%);
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 20% 40%, rgba(99,102,241,0.4) 0%, transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% 60%, rgba(6,182,212,0.3) 0%, transparent 50%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}
.hero-content { position: relative; z-index: 1; }
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: rgba(255,255,255,0.88);
  max-width: 560px;
  margin: 0 auto 30px;
  line-height: 1.7;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.95);
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

/* ===== Section Title ===== */
.section-title {
  text-align: center;
  margin-bottom: 48px;
}
.section-title h2 {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.section-title p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ===== Tools Grid ===== */
.tools-section { padding: 72px 0 60px; }
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.tool-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  display: block;
  color: inherit;
  overflow: hidden;
}
.tool-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  opacity: 0;
  transition: opacity 0.3s ease;
}
.tool-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,0.2);
  text-decoration: none;
  color: inherit;
}
.tool-card:hover::before { opacity: 1; }
.tool-card.upcoming {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.3);
}
.tool-card.upcoming:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
}
.tool-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: inline-block;
  width: 52px;
  height: 52px;
  line-height: 52px;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.1), rgba(6,182,212,0.1));
  border-radius: var(--radius-md);
}
.tool-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}
.tool-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0;
}
.tool-tag, .tool-tag-new {
  position: absolute;
  top: 16px;
  right: 16px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.tool-tag {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
}
.tool-tag-new {
  background: linear-gradient(135deg, #f59e0b, #f97316);
  color: #fff;
}

/* ===== Features Section ===== */
.features {
  background: var(--surface);
  padding: 72px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.feature-item {
  text-align: center;
  padding: 32px 20px;
  border-radius: var(--radius-lg);
  transition: var(--transition);
}
.feature-item:hover {
  background: var(--bg);
}
.feature-icon {
  font-size: 2rem;
  margin-bottom: 14px;
  display: inline-block;
}
.feature-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}
.feature-item p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== About Section ===== */
.about-section {
  padding: 72px 0;
  background: var(--bg);
}
.about-section h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.about-section p {
  max-width: 680px;
  margin: 0 auto 14px;
  color: var(--text-secondary);
  text-align: center;
  font-size: 0.95rem;
}
.contact-info {
  margin-top: 32px;
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: inline-block;
}
.contact-info h3 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--text);
}
.contact-info a {
  color: var(--primary);
  font-weight: 600;
}
.contact-info a:hover { text-decoration: underline; }
.about-section .contact-wrap { text-align: center; }

/* ===== Main Content ===== */
main { padding: 40px 0 60px; min-height: 60vh; }
main > .container > h1 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}
.subtitle {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 36px;
}

/* ===== QR Generator ===== */
.qr-generator {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 36px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.85rem;
  letter-spacing: 0.01em;
}
.form-group textarea,
.form-group input[type="text"],
.form-group input[type="number"],
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  transition: var(--transition);
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
}
.form-group textarea:focus,
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
  background: #fff;
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.preset-buttons { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.preset-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 50px;
  background: var(--bg);
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}
.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(99,102,241,0.05);
}
.generate-btn {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.01em;
}
.generate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.35);
  opacity: 0.95;
}
#qr-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 20px;
}
#qr-canvas {
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  max-width: 100%;
}
.qr-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.action-btn {
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}
.action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.qr-info { margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); text-align: center; }
input[type="color"] {
  width: 48px;
  height: 36px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  cursor: pointer;
  background: var(--bg);
}
input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ===== Ad Placeholder ===== */
.ad-placeholder {
  max-width: 728px;
  margin: 32px auto;
  padding: 24px;
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Blog ===== */
.blog-list { max-width: 820px; margin: 0 auto; }
.blog-list h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}
.blog-card {
  display: block;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  color: inherit;
  text-decoration: none;
}
.blog-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(99,102,241,0.15);
  text-decoration: none;
  color: inherit;
}
.blog-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.blog-card .blog-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* ===== Article ===== */
.article-content {
  max-width: 740px;
  margin: 0 auto;
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 44px 48px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}
.article-content h1 {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}
.article-content .article-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.article-content h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 14px;
  letter-spacing: -0.01em;
}
.article-content h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin: 24px 0 10px;
}
.article-content p { margin-bottom: 16px; color: var(--text-secondary); font-size: 0.95rem; }
.article-content ul, .article-content ol {
  margin: 14px 0 18px 22px;
  color: var(--text-secondary);
}
.article-content li { margin-bottom: 8px; font-size: 0.93rem; }
.article-content code {
  background: var(--bg);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 0.85em;
  font-family: 'SF Mono', 'Fira Code', monospace;
  border: 1px solid var(--border);
}

/* ===== Footer ===== */
footer {
  background: var(--text);
  color: rgba(255,255,255,0.6);
  padding: 48px 0 32px;
}
.footer-links { margin-bottom: 18px; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.footer-links a {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.footer-links a:hover { color: #fff; background: rgba(255,255,255,0.08); text-decoration: none; }
footer p { font-size: 0.8rem; color: rgba(255,255,255,0.4); }

/* ===== Page Back Link ===== */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 20px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.back-link:hover { color: var(--primary); background: rgba(99,102,241,0.06); }

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .header-inner { padding: 0 16px; height: 56px; }
  .logo { font-size: 1.1rem; }
  header nav a { padding: 6px 10px; font-size: 0.85rem; }
  .hero { padding: 56px 0 64px; }
  .hero h1 { font-size: 1.75rem; }
  .hero p { font-size: 0.95rem; }
  .tools-section, .features, .about-section { padding: 48px 0; }
  .tools-grid { grid-template-columns: 1fr; gap: 14px; }
  .features-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .feature-item { padding: 20px 14px; }
  .qr-generator { grid-template-columns: 1fr; padding: 24px; gap: 28px; }
  .article-content { padding: 28px 22px; border-radius: var(--radius-lg); }
  .article-content h1 { font-size: 1.35rem; }
  main > .container > h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
  .features-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .qr-actions { flex-direction: column; width: 100%; }
  .action-btn { width: 100%; text-align: center; }
}
