/* ============================================================
   article.css — Shared styles for xunxi.io/article pages
   Depends on global.css being loaded first
   ============================================================ */

/* ─── Article Container ─────────────────────────────── */
.article-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  animation: fadeIn 0.8s ease backwards;
}

/* ─── Breadcrumb ────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumb a:hover {
  color: var(--gold-primary);
}

.breadcrumb .sep {
  color: var(--border-color);
  font-size: 11px;
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ─── Article Header ────────────────────────────────── */
.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-color);
}

.article-header h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  margin-bottom: 20px;
  letter-spacing: 1px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

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

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

.article-tag {
  display: inline-block;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 500;
  color: var(--gold-primary);
  background: var(--gold-faint);
  border: 1px solid rgba(232, 200, 74, 0.15);
  border-radius: 20px;
  text-decoration: none;
  transition: all 0.2s;
  letter-spacing: 0.5px;
}

.article-tag:hover {
  background: rgba(232, 200, 74, 0.2);
  border-color: var(--gold-primary);
}

/* ─── Article Body ──────────────────────────────────── */
.article-body {
  font-size: 16px;
  line-height: 1.9;
  color: var(--text-primary);
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 48px 0 20px;
  padding-left: 16px;
  border-left: 3px solid var(--gold-primary);
  letter-spacing: 1px;
}

.article-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 32px 0 14px;
  letter-spacing: 0.5px;
}

.article-body p {
  margin-bottom: 18px;
  color: var(--text-primary);
  opacity: 0.92;
}

.article-body ul,
.article-body ol {
  margin: 16px 0 24px 24px;
}

.article-body li {
  margin-bottom: 10px;
  color: var(--text-primary);
  opacity: 0.9;
}

.article-body li::marker {
  color: var(--gold-primary);
}

.article-body strong {
  color: var(--gold-primary);
  font-weight: 600;
}

.article-body a {
  color: var(--gold-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(232, 200, 74, 0.3);
  transition: all 0.2s;
}

.article-body a:hover {
  text-decoration-color: var(--gold-primary);
}

.article-body blockquote {
  margin: 24px 0;
  padding: 20px 24px;
  border-left: 3px solid var(--gold-primary);
  background: var(--surface-color);
  border-radius: 0 12px 12px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 24px 0;
  border: 1px solid var(--border-color);
}

/* ─── Highlight Box ─────────────────────────────────── */
.highlight-box {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px 28px;
  margin: 28px 0;
  position: relative;
  overflow: hidden;
}

.highlight-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.highlight-box.tip {
  border-color: rgba(63, 185, 80, 0.2);
}

.highlight-box.tip::before {
  background: linear-gradient(90deg, transparent, var(--accent-green), transparent);
}

.highlight-box.warning {
  border-color: rgba(255, 123, 114, 0.2);
}

.highlight-box.warning::before {
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
}

.highlight-box-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--gold-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.highlight-box.tip .highlight-box-title {
  color: var(--accent-green);
}

.highlight-box.warning .highlight-box-title {
  color: var(--accent-red);
}

/* ─── Word Table ────────────────────────────────────── */
.word-table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.word-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.word-table thead {
  background: var(--surface-color);
}

.word-table th {
  padding: 14px 18px;
  text-align: left;
  font-weight: 600;
  color: var(--gold-primary);
  font-size: 13px;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border-color);
}

.word-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: top;
}

.word-table tbody tr {
  transition: background 0.2s;
}

.word-table tbody tr:hover {
  background: var(--surface-color);
}

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

.word-table .word-en {
  font-weight: 600;
  color: var(--gold-primary);
  font-family: 'Inter', sans-serif;
}

.word-table .word-phonetic {
  color: var(--text-secondary);
  font-size: 13px;
}

/* ─── Study Plan Timeline ───────────────────────────── */
.plan-timeline {
  position: relative;
  padding-left: 32px;
  margin: 28px 0;
}

.plan-timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--gold-primary), var(--border-color));
  border-radius: 2px;
}

.plan-phase {
  position: relative;
  margin-bottom: 28px;
  padding: 20px 24px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  transition: all 0.3s;
}

.plan-phase:hover {
  border-color: var(--border-focus);
  transform: translateX(4px);
}

.plan-phase::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 24px;
  width: 12px;
  height: 12px;
  background: var(--gold-primary);
  border-radius: 50%;
  border: 2px solid var(--bg-color);
  box-shadow: 0 0 0 3px var(--gold-faint);
}

.plan-phase-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.plan-phase-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.plan-phase-desc {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ─── Stats Cards Row ───────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 16px;
  margin: 28px 0;
}

.stat-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s;
}

.stat-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-2px);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  color: var(--gold-primary);
  font-family: 'Inter', sans-serif;
  line-height: 1;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 8px;
  letter-spacing: 1px;
}

/* ─── CTA Section ───────────────────────────────────── */
.cta-section {
  margin: 60px 0 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.cta-section-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  text-align: center;
  letter-spacing: 2px;
}

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

.cta-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 24px;
  text-align: center;
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.cta-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  transition: all 0.3s;
}

.cta-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.cta-card:hover::before {
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.cta-card-icon {
  font-size: 36px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-highlight);
  border-radius: 50%;
  border: 1px solid var(--border-color);
  transition: all 0.3s;
}

.cta-card:hover .cta-card-icon {
  transform: scale(1.1);
  background: var(--gold-faint);
  border-color: var(--border-focus);
}

.cta-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: 1px;
}

.cta-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.cta-card-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-primary);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-top: auto;
  opacity: 0;
  transform: translateY(8px);
  transition: all 0.3s;
}

.cta-card:hover .cta-card-action {
  opacity: 1;
  transform: translateY(0);
}

/* ─── Related Articles ──────────────────────────────── */
.related-articles {
  margin: 48px 0;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.related-articles-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  letter-spacing: 2px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
}

.related-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 24px 20px;
  text-decoration: none;
  transition: all 0.3s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-4px);
  box-shadow: var(--shadow-sm);
}

.related-card-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.related-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.related-card-excerpt {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ─── Article Footer ────────────────────────────────── */
.article-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 13px;
  letter-spacing: 1px;
  border-top: 1px solid var(--border-color);
}

.article-footer a {
  color: var(--gold-primary);
  text-decoration: none;
}

.article-footer a:hover {
  text-decoration: underline;
}

/* ─── Article List Page (index) ─────────────────────── */
.article-list-header {
  text-align: center;
  padding: 60px 20px 40px;
}

.article-list-header h1 {
  font-size: clamp(2rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: 2px;
}

.article-list-header p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.8;
}

.article-list-categories {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  padding: 0 20px;
}

.category-btn {
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  letter-spacing: 0.5px;
}

.category-btn:hover,
.category-btn.active {
  color: var(--gold-primary);
  border-color: var(--gold-primary);
  background: var(--gold-faint);
}

.article-list {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.article-list-card {
  display: flex;
  gap: 24px;
  padding: 28px;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  text-decoration: none;
  transition: all 0.35s;
  animation: fadeIn 0.6s ease backwards;
}

.article-list-card:hover {
  border-color: var(--border-focus);
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.article-list-card-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-highlight);
  border-radius: 14px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

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

.article-list-card-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 4px;
}

.article-list-card-title {
  font-family: 'Noto Serif SC', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.article-list-card-excerpt {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 10px;
}

.article-list-card-date {
  font-size: 12px;
  color: var(--text-secondary);
  opacity: 0.7;
}

/* ─── Responsive ────────────────────────────────────── */
@media (max-width: 640px) {
  .article-container {
    padding: 24px 16px 60px;
  }

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

  .article-body {
    font-size: 15px;
  }

  .article-body h2 {
    font-size: 1.25rem;
  }

  .cta-cards {
    grid-template-columns: 1fr;
  }

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

  .article-list-card {
    flex-direction: column;
    gap: 16px;
    padding: 20px;
  }

  .article-list-card-icon {
    width: 48px;
    height: 48px;
    font-size: 26px;
  }

  .plan-timeline {
    padding-left: 24px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}
