/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

:root {
  --primary: #1D4ED8;
  --primary-hover: #1E40AF;
  --text-primary: #1A1A1A;
  --text-secondary: #666;
  --text-muted: #767676;
  --bg-white: #FFFFFF;
  --bg-light: #F8FAFC;
  --border: #D0D8E0;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --transition: 0.3s ease;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--bg-white);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
}
.site-nav {
  display: flex;
  gap: 20px;
}
.site-nav a {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}
.site-nav a:hover { color: var(--primary); }

/* Main */
main { flex: 1; padding: 0 24px; }

/* Hero */
.hero {
  text-align: center;
  padding: 64px 0 48px;
}
.hero-title {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}
.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
}
.hero-badge {
  font-size: 0.85rem;
  color: var(--primary);
  background: #EEF2FF;
  padding: 4px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 20px;
  font-weight: 500;
}
.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
/* Override max-width for hero on wider layout */
.hero-actions .btn-primary,
.hero-actions .btn-secondary {
  min-width: 140px;
}
@media (max-width: 480px) {
  .hero { padding: 48px 0 32px; }
  .hero-title { font-size: 1.6rem; }
}

/* Section */
.section { margin-bottom: 48px; }
.section-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 12px 32px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: scale(0.97); }

.btn-secondary {
  display: inline-block;
  padding: 12px 32px;
  background: var(--bg-white);
  color: var(--text-primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-secondary:active { transform: scale(0.97); }

.btn-small {
  display: inline-block;
  padding: 8px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.btn-small:hover { background: var(--primary-hover); }

/* Featured Card */
.featured-card {
  padding: 32px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-light);
  text-align: center;
}
.featured-badge {
  font-size: 0.85rem;
  color: var(--primary);
  background: #EEF2FF;
  padding: 4px 14px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 16px;
  font-weight: 500;
}
.featured-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.featured-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* Tools Grid */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}
@media (max-width: 480px) {
  .tools-grid { grid-template-columns: 1fr; }
}

.tool-card {
  padding: 24px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  position: relative;
}
.tool-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(29,78,216,0.1);
}
.tool-card.hotspot {
  border-color: var(--primary);
  background: #F8FAFF;
}
.tool-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.7rem;
  color: var(--primary);
  background: #EEF2FF;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
}
.tool-icon { font-size: 2rem; }
.tool-name {
  font-size: 1rem;
  font-weight: 600;
}
.tool-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Tool List (homepage compact style) */
.tool-list { display: flex; flex-direction: column; gap: 8px; }
.tool-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: inherit;
  transition: all 0.2s ease;
}
.tool-list-item:hover {
  border-color: var(--primary);
  background: #F8FAFF;
}
.tool-list-icon { font-size: 1.3rem; width: 28px; text-align: center; }
.tool-list-name {
  font-size: 0.9rem;
  font-weight: 600;
  min-width: 80px;
}
.tool-list-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex: 1;
}
.tool-list-badge {
  font-size: 0.7rem;
  color: var(--primary);
  background: #EEF2FF;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  white-space: nowrap;
}

/* Tool Page Layout */
.tool-page {
  padding: 32px 0;
}
.tool-page h1 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.tool-page .tool-desc {
  color: var(--text-secondary);
  margin-bottom: 24px;
}
.tool-page .back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  margin-bottom: 24px;
}
.tool-page .back-link:hover { color: var(--primary); }

/* Tool Inputs */
.tool-input-group { margin-bottom: 16px; }
.tool-input-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-primary);
}
.tool-textarea,
.tool-input {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
  background: var(--bg-white);
}
.tool-textarea:focus,
.tool-input:focus { border-color: var(--primary); }
.tool-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

/* Tool Results */
.tool-result {
  padding: 16px;
  background: var(--bg-light);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.8;
  min-height: 20px;
  word-break: break-all;
}
.tool-result-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Tool Color Preview */
.color-preview {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  margin-top: 12px;
}

/* Tool Row (side by side inputs) */
.tool-row {
  display: flex;
  gap: 12px;
  align-items: end;
}
.tool-row .tool-input-group { flex: 1; }

/* Copy Button */
.copy-btn {
  padding: 8px 16px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary); }
.copy-btn.copied { background: #D1FAE5; border-color: #34D399; color: #059669; }

/* Footer */
.site-footer {
  text-align: center;
  padding: 32px 24px;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Page Transition */
.page { display: none; }
.page.active { display: block; }
.page.active {
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
