@charset "UTF-8";

/* ===== CSS Variables ===== */
:root {
  --bg-primary: #faf9f5;
  --bg-secondary: #f0efe9;
  --bg-card: #ffffff;
  --text-primary: #141413;
  --text-secondary: #6b6a65;
  --text-muted: #9e9d98;
  --border: #e8e6dc;
  --border-light: #f0efe9;
  --accent-orange: #d97757;
  --accent-blue: #6a9bcc;
  --accent-green: #788c5d;
  --accent-yellow: #d4a853;
  --shadow-sm: 0 1px 2px rgba(20, 20, 19, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 20, 19, 0.06);
  --shadow-lg: 0 12px 40px rgba(20, 20, 19, 0.08);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 150ms cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 300ms cubic-bezier(0.16, 1, 0.3, 1);
  --font-heading: "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --font-body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --max-width: 1400px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

h1 { font-size: clamp(2rem, 4vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.2rem, 2vw, 1.6rem); }

p {
  color: var(--text-secondary);
  max-width: 65ch;
}

/* ===== Navigation ===== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 249, 245, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-orange);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

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

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== Hero Section ===== */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 80px 24px 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 16px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-green);
  border-radius: 50%;
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero h1 {
  max-width: 700px;
  margin: 0 auto 16px;
  color: var(--text-primary);
}

.hero h1 em {
  font-style: normal;
  color: var(--accent-orange);
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--text-muted);
  margin: 0 auto 40px;
  max-width: 520px;
}

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

.hero-stat {
  text-align: center;
}

.hero-stat-number {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== Product Cards Grid ===== */
.products-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px 80px;
}

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

.section-header h2 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

.section-header p {
  margin: 0 auto;
  font-size: 1.05rem;
}

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

.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-smooth);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-smooth);
}

.product-card:hover {
  border-color: var(--card-color);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.product-card:hover::before {
  transform: scaleX(1);
}

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

.product-card-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: var(--card-color);
  color: white;
  flex-shrink: 0;
}

.product-card-badge {
  font-size: 0.75rem;
  padding: 4px 12px;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.product-card h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.product-card-tagline {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.product-card-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

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

.product-card-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.product-card-arrow {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.product-card:hover .product-card-arrow {
  background: var(--card-color);
  color: white;
}

/* ===== Article List Page ===== */
.article-page {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

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

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  transition: color var(--transition-fast);
}

.article-back:hover {
  color: var(--text-primary);
}

.article-page-cover {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
}

.article-page-icon {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  flex-shrink: 0;
}

.article-page-info h1 {
  font-size: 1.8rem;
  margin-bottom: 6px;
}

.article-page-info p {
  font-size: 0.95rem;
  margin-bottom: 12px;
}

.article-page-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--bg-secondary);
  color: var(--text-muted);
}

/* Article filter bar */
.article-filters {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}

.filter-btn:hover {
  border-color: var(--text-muted);
}

.filter-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.article-count {
  margin-left: auto;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Article list items */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.article-item {
  background: var(--bg-card);
  padding: 20px 24px;
  cursor: pointer;
  transition: background var(--transition-fast);
  display: flex;
  align-items: center;
  gap: 16px;
}

.article-item:hover {
  background: var(--bg-secondary);
}

.article-item-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.article-item-content {
  flex: 1;
  min-width: 0;
}

.article-item-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.article-item-summary {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.article-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.article-item-difficulty {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 100px;
  font-weight: 500;
}

.difficulty-beginner {
  background: #ecfdf5;
  color: #059669;
}

.difficulty-intermediate {
  background: #fef3c7;
  color: #d97706;
}

.difficulty-advanced {
  background: #fce4ec;
  color: #c62828;
}

.article-item-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== Article Detail Page ===== */
.article-detail {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.article-detail-header {
  margin-bottom: 40px;
}

.article-detail-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-detail-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-detail h1 {
  font-size: 2rem;
  margin-bottom: 12px;
  line-height: 1.3;
}

.article-detail-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.article-detail-content {
  font-size: 1.05rem;
  line-height: 1.85;
  color: var(--text-secondary);
}

.article-detail-content h2 {
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.article-detail-content h2:first-child {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.article-detail-content h3 {
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-top: 32px;
  margin-bottom: 12px;
}

.article-detail-content p {
  margin-bottom: 16px;
}

.article-detail-content ul,
.article-detail-content ol {
  margin: 0 0 16px 0;
  padding-left: 24px;
}

.article-detail-content li {
  margin-bottom: 6px;
  color: var(--text-secondary);
}

.article-detail-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.article-detail-content em {
  font-style: italic;
  color: var(--accent-orange);
}

.article-detail-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--bg-secondary);
  border-left: 4px solid var(--accent-orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 1rem;
  color: var(--text-secondary);
}

.article-detail-content blockquote strong {
  color: var(--accent-orange);
}

.article-detail-content code {
  font-family: "JetBrains Mono", "Fira Code", "Cascadia Code", monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  background: var(--bg-secondary);
  border-radius: 4px;
  color: var(--accent-orange);
}

.article-detail-content pre {
  margin: 20px 0;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-size: 0.88rem;
  line-height: 1.6;
}

.article-detail-content pre code {
  background: none;
  padding: 0;
  color: var(--text-primary);
}

.article-detail-content table {
  width: 100%;
  margin: 20px 0;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.article-detail-content th {
  text-align: left;
  padding: 10px 16px;
  background: var(--bg-secondary);
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 2px solid var(--border);
}

.article-detail-content td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-secondary);
}

.article-detail-content tr:hover td {
  background: var(--bg-secondary);
}

.article-detail-content hr {
  margin: 32px 0;
  border: none;
  border-top: 1px solid var(--border);
}

/* Article navigation */
.article-nav {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.article-nav a {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  transition: all var(--transition-fast);
  flex: 1;
}

.article-nav a:hover {
  border-color: var(--accent-orange);
  background: var(--bg-secondary);
}

.article-nav-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.article-nav-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== Footer ===== */
.footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  background: var(--bg-secondary);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-brand {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

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

.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-legal {
  text-align: center;
  margin-top: 16px;
}

.footer-copy {
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: none;
  margin: 0;
}

.footer-beian {
  margin: 4px 0 0 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: none;
}

.footer-beian a {
  color: var(--text-muted);
  transition: color var(--transition-fast);
}

.footer-beian a:hover {
  color: var(--text-secondary);
}

/* ===== Loading & Empty States ===== */
.loading-skeleton {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border) 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center;
  padding: 60px 24px;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  color: var(--text-primary);
  margin-bottom: 8px;
}

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

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .nav-brand span {
    display: none;
  }

  .hero {
    padding: 48px 16px 40px;
  }

  .hero-stats {
    gap: 24px;
  }

  .hero-stat-number {
    font-size: 1.5rem;
  }

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

  .article-page-cover {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .article-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }

  .article-item-meta {
    width: 100%;
    justify-content: space-between;
  }

  .article-detail h1 {
    font-size: 1.5rem;
  }

  .article-detail-content h2 {
    font-size: 1.3rem;
  }

  .article-nav {
    flex-direction: column;
  }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
