/* ==========================================================================
   Design System - Ultra Clean Minimalist Theme (De-cluttered Edition)
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@400;500;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
  --bg-dark: #0b0e14;
  --bg-nav: rgba(11, 14, 20, 0.9);
  --bg-card: #121722;
  --bg-card-hover: #161e2d;
  --bg-input: #101520;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-emerald: #34d399;
  --accent-amber: #fbbf24;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-full: 9999px;

  --shadow-card-hover: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
  --transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* ==========================================================================
   Top Navigation
   ========================================================================== */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-nav);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
}

.nav-container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-mark {
  width: 28px;
  height: 28px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
}

.nav-title {
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

.nav-stats {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link-item {
  color: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition);
}

.nav-link-item:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
}

.nav-link-item.active {
  color: #ffffff;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.2);
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.stat-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.775rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
}

.stat-star {
  color: var(--accent-amber);
}

/* ==========================================================================
   Clean Hero & Search Section
   ========================================================================== */
.hero-section {
  padding: 48px 0 28px;
}

.hero-container {
  max-width: 640px;
  text-align: center;
}

.hero-title {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 10px;
}

.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #cbd5e1 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  font-weight: 400;
}

/* Search Wrapper */
.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 28px;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-wrapper input {
  width: 100%;
  padding: 13px 90px 13px 44px;
  font-size: 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: var(--transition);
  outline: none;
}

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

.search-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
  background: #141b29;
}

.search-shortcut {
  position: absolute;
  right: 14px;
  font-size: 0.7rem;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
  font-family: monospace;
}

.clear-btn {
  position: absolute;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  color: var(--text-secondary);
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Category Navigation (Centered Pills) */
.categories {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
}

.cat-btn {
  padding: 6px 14px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.cat-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.cat-btn.active {
  background: rgba(56, 189, 248, 0.1);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
}

.fav-tab.active {
  background: rgba(251, 191, 36, 0.1);
  border-color: rgba(251, 191, 36, 0.3);
  color: var(--accent-amber);
}

/* ==========================================================================
   Resource Cards Grid (Clean & Spacious)
   ========================================================================== */
.grid-section {
  min-height: 400px;
  margin-bottom: 64px;
}

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

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(56, 189, 248, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card-hover);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.card-icon-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  flex-shrink: 0;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.card-badge {
  font-size: 0.675rem;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  color: var(--accent-cyan);
  font-weight: 600;
  white-space: nowrap;
}

.card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
  flex-grow: 1;
}

.card-limit {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.775rem;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
  border: 1px solid rgba(56, 189, 248, 0.1);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.card-limit-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-cyan);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.btn-visit {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.btn-visit:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-fav {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
  padding: 2px 6px;
}

.btn-fav:hover, .btn-fav.active {
  color: var(--accent-amber);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-icon {
  margin-bottom: 12px;
  color: var(--text-muted);
}

.empty-state h3 {
  font-size: 1.05rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

/* ==========================================================================
   Documentation Table Styling
   ========================================================================== */
.table-wrapper {
  overflow-x: auto;
  margin-bottom: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-card);
}

.doc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.doc-table th {
  background: #161e2d;
  color: var(--text-primary);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.doc-table td {
  padding: 12px 16px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-subtle);
  line-height: 1.5;
}

.doc-table tr:last-child td {
  border-bottom: none;
}

.doc-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.badge-tag {
  display: inline-block;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-winner {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.badge-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ==========================================================================
   Starter Spotlight Section: 萬事起頭難，讓 AI 來幫你
   ========================================================================== */
.starter-section {
  margin-bottom: 44px;
}

.starter-banner {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.03) 0%, rgba(129, 140, 248, 0.03) 100%);
  border: 1px solid rgba(56, 189, 248, 0.15);
  border-radius: var(--radius-md);
  padding: 32px 28px;
}

.starter-header {
  text-align: center;
  margin-bottom: 24px;
}

.starter-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  margin-bottom: 10px;
}

.starter-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.starter-header p {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.starter-steps {
  display: flex;
  align-items: center;
  gap: 16px;
}

.step-card {
  flex: 1;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
  transition: var(--transition);
}

.step-card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(56, 189, 248, 0.25);
}

.step-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent-cyan);
  line-height: 1;
  background: rgba(56, 189, 248, 0.1);
  padding: 6px 10px;
  border-radius: 6px;
}

.step-body h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.step-body p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin-bottom: 8px;
}

.step-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  color: var(--accent-cyan);
}

.step-tag {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.step-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  opacity: 0.4;
}

/* Responsive */
@media (max-width: 768px) {
  .hero-title {
    font-size: 1.75rem;
  }
  .starter-steps {
    flex-direction: column;
  }
  .step-arrow {
    transform: rotate(90deg);
  }
  .cards-grid {
    grid-template-columns: 1fr;
  }
  .footer-content {
    flex-direction: column;
    gap: 6px;
    text-align: center;
  }
}
