/* ===== Variables ===== */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2234;
  --bg-card-hover: #222d44;
  --border: rgba(255, 255, 255, 0.08);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --gradient-start: #6366f1;
  --gradient-end: #a855f7;
  --success: #22c55e;
  --warning: #f59e0b;
  --radius: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  --transition: 0.25s ease;
  --font: 'Noto Sans SC', system-ui, sans-serif;
  --nav-height: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden {
  display: none !important;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-primary);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
}

.nav-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: var(--nav-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.logo-icon {
  font-size: 1.5rem;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.15);
}

.nav-search {
  display: flex;
  margin-left: auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.nav-search input {
  background: transparent;
  border: none;
  padding: 10px 16px;
  color: var(--text-primary);
  width: 200px;
  font-family: inherit;
  outline: none;
}

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

.nav-search button {
  background: transparent;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 1rem;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  padding: 100px 0 80px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(99, 102, 241, 0.2), transparent),
    radial-gradient(ellipse 60% 40% at 80% 50%, rgba(168, 85, 247, 0.12), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
}

.hero-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 100px;
  color: var(--accent-light);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.15;
  margin-bottom: 20px;
}

.hero-desc {
  color: var(--text-secondary);
  font-size: 1.125rem;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 56px;
}

.hero-stats {
  display: flex;
  gap: 48px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat strong {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--accent-light);
}

.stat span {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ===== Sections ===== */
section {
  padding: 64px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 32px;
}

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

.section-header .section-title {
  margin-bottom: 0;
}

.view-all {
  color: var(--accent-light);
  font-weight: 500;
  transition: var(--transition);
}

.view-all:hover {
  color: var(--text-primary);
}

/* ===== Categories ===== */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  transition: var(--transition);
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.cat-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 12px;
}

.category-card h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.category-card p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Guide Cards ===== */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.guide-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.guide-card:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: var(--shadow);
}

.guide-card-cover {
  height: 180px;
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}

.guide-card-cover .cover-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.guide-card:hover .cover-bg {
  transform: scale(1.05);
}

.guide-card-cover .cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 14, 23, 0.7) 0%, transparent 60%);
  pointer-events: none;
}

.guide-card-cover .cover-gradient {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.guide-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent-light);
}

.guide-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.guide-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  line-height: 1.4;
}

.guide-card-body p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.guide-card-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.guide-card-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Latest List ===== */
.latest-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.latest-item {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: var(--transition);
}

.latest-item:hover {
  border-color: rgba(99, 102, 241, 0.3);
  background: var(--bg-card-hover);
}

.latest-thumb {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  flex-shrink: 0;
  background: var(--bg-secondary);
  overflow: hidden;
}

.latest-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.latest-info {
  flex: 1;
  min-width: 0;
}

.latest-info h4 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.latest-info p {
  color: var(--text-muted);
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.latest-date {
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* ===== Guides Page ===== */
.guides-page {
  padding: 48px 0 80px;
}

.page-header {
  margin-bottom: 40px;
}

.page-header h1 {
  font-size: 2.25rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.page-header p {
  color: var(--text-secondary);
}

.guides-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

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

.filter-tab {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 100px;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  color: var(--text-primary);
  border-color: rgba(99, 102, 241, 0.3);
}

.filter-tab.active {
  background: rgba(99, 102, 241, 0.2);
  border-color: var(--accent);
  color: var(--accent-light);
}

.sort-box {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.sort-box select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
}

.result-count {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
}

.empty-icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
}

/* ===== Guide Detail ===== */
.guide-detail-page {
  padding-bottom: 64px;
}

.guide-hero {
  padding: 100px 0 70px;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.guide-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.guide-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
}

.guide-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to top,
    var(--bg-primary) 0%,
    rgba(10, 14, 23, 0.92) 40%,
    rgba(10, 14, 23, 0.75) 100%
  );
}

.guide-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.guide-hero-content {
  position: relative;
}

.guide-hero .breadcrumb {
  display: flex;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.guide-hero .breadcrumb a:hover {
  color: var(--accent-light);
}

.guide-hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  margin-bottom: 16px;
}

.guide-hero-desc {
  color: var(--text-secondary);
  font-size: 1.1rem;
  max-width: 640px;
  margin-bottom: 24px;
}

.guide-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tag {
  padding: 4px 12px;
  background: rgba(99, 102, 241, 0.15);
  border-radius: 6px;
  font-size: 0.8rem;
  color: var(--accent-light);
}

.guide-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.guide-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 40px;
  align-items: start;
  padding-top: 40px;
}

.guide-sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-height: calc(100vh - var(--nav-height) - 48px);
  overflow-y: auto;
}

.guide-sidebar h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.chapter-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chapter-nav a {
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.chapter-nav a:hover,
.chapter-nav a.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-light);
}

.guide-content {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
}

.guide-content section {
  padding: 0;
  margin-bottom: 56px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.guide-content section:last-child {
  margin-bottom: 0;
}

.guide-content h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}

.guide-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 28px 0 14px;
  color: var(--accent-light);
}

.guide-content h4 {
  font-size: 1rem;
  font-weight: 600;
  margin: 20px 0 10px;
  color: var(--text-primary);
}

.guide-content p {
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.8;
}

.guide-content ul,
.guide-content ol {
  color: var(--text-secondary);
  margin: 0 0 16px 24px;
  line-height: 1.8;
}

.guide-content li {
  margin-bottom: 8px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 24px;
  font-size: 0.9rem;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--border);
}

.data-table th {
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-light);
  font-weight: 600;
}

.data-table td {
  color: var(--text-secondary);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 768px) {
  .data-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

.tip-box {
  background: rgba(34, 197, 94, 0.1);
  border-left: 4px solid var(--success);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}

.tip-box strong {
  color: var(--success);
  display: block;
  margin-bottom: 6px;
}

.tip-box p {
  margin: 0;
  color: var(--text-secondary);
}

.warn-box {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
}

.warn-box strong {
  color: var(--warning);
  display: block;
  margin-bottom: 6px;
}

.warn-box p {
  margin: 0;
}

.related-guides {
  padding: 64px 0;
  border-top: 1px solid var(--border);
}

/* ===== Footer ===== */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  margin-top: auto;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding: 56px 24px 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 12px;
  max-width: 280px;
}

.footer-links h4 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.footer-links a {
  display: block;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 10px;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--accent-light);
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 20px 0;
  text-align: center;
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .guide-layout {
    grid-template-columns: 1fr;
  }

  .guide-sidebar {
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

@media (max-width: 768px) {
  .nav-links,
  .nav-search {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
  }

  .mobile-menu-btn {
    display: block;
    margin-left: auto;
  }

  .hero {
    padding: 60px 0 48px;
  }

  .hero-stats {
    gap: 32px;
  }

  .guide-content {
    padding: 28px 24px;
  }

  .guides-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
}
