/* === Global Reset & Tokens === */
:root {
  --color-primary: #1a3a6b;
  --color-accent: #c8321a;
  --color-accent-light: #e8441a;
  --color-bg: #f4f6fa;
  --color-surface: #ffffff;
  --color-text: #1a1a2e;
  --color-text-muted: #5a6178;
  --color-border: #dde2ee;
  --color-nav-bg: #0f2a4a;
  --color-nav-text: #e8edf5;
  --font-sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --radius: 6px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07);
  --shadow-md: 0 4px 16px rgba(0,0,0,.10);
  --max-w: 1200px;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* === Typography === */
h1,h2,h3,h4,h5,h6 { line-height: 1.3; color: var(--color-primary); font-weight: 700; }
h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.35rem); }
a { color: var(--color-accent); text-decoration: none; transition: color .2s; }
a:hover { color: var(--color-accent-light); }
img { max-width: 100%; height: auto; display: block; }

/* === Layout === */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 1.25rem; }
.page-wrapper { min-height: 100dvh; display: flex; flex-direction: column; }
.page-wrapper > main { flex: 1; }

/* === Header / Nav === */
.site-header {
  background: var(--color-nav-bg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
.site-nav { display: flex; align-items: center; gap: 0; height: 64px; }
.nav-logo { display: flex; align-items: center; gap: .5rem; margin-right: auto; }
.nav-logo img { height: 36px; width: auto; }
.nav-logo-text { color: var(--color-nav-text); font-weight: 700; font-size: 1.1rem; letter-spacing: .5px; }
.nav-links { display: flex; align-items: center; gap: 0; list-style: none; }
.nav-links a {
  display: block; padding: .6rem 1.1rem;
  color: var(--color-nav-text); font-size: .95rem;
  transition: background .2s, color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] {
  background: rgba(255,255,255,.12);
  color: #fff;
}
.nav-toggle { display: none; background: none; border: none; cursor: pointer; padding: .5rem; margin-left: .5rem; }
.nav-toggle svg { width: 24px; height: 24px; fill: var(--color-nav-text); }

/* === Mobile Nav === */
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-direction: column; align-items: flex-start;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--color-nav-bg);
    padding: .5rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,.3);
  }
  .nav-links.open { display: flex; }
  .nav-links a { width: 100%; padding: .75rem 1.5rem; }
}

/* === Footer === */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,.75);
  padding: 2.5rem 0 1.5rem;
  margin-top: 4rem;
}
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2.5rem; }
.footer-brand p { font-size: .9rem; line-height: 1.8; margin-top: .75rem; max-width: 320px; }
.footer-col h4 { color: #fff; font-size: .95rem; margin-bottom: .75rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .4rem; }
.footer-col ul a { color: rgba(255,255,255,.65); font-size: .9rem; }
.footer-col ul a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.15);
  margin-top: 2rem; padding-top: 1rem;
  font-size: .85rem; text-align: center;
  color: rgba(255,255,255,.45);
}
@media (max-width: 768px) {
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* === Buttons === */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .55rem 1.4rem; border-radius: var(--radius);
  font-size: .95rem; font-weight: 600; cursor: pointer;
  border: none; transition: background .2s, transform .1s;
}
.btn-primary { background: var(--color-accent); color: #fff; }
.btn-primary:hover { background: var(--color-accent-light); color: #fff; }
.btn-outline { border: 2px solid var(--color-accent); color: var(--color-accent); background: transparent; }
.btn-outline:hover { background: var(--color-accent); color: #fff; }
.btn:active { transform: translateY(1px); }

/* === Section spacing === */
.section { padding: 3rem 0; }
.section-title { font-size: clamp(1.3rem, 3vw, 1.7rem); color: var(--color-primary); margin-bottom: 1.5rem; position: relative; }
.section-title::after {
  content: ''; display: block; width: 48px; height: 3px;
  background: var(--color-accent); border-radius: 2px; margin-top: .4rem;
}

/* === Cards === */
.card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.card-body { padding: 1.25rem; }
.card-meta { font-size: .82rem; color: var(--color-text-muted); margin-bottom: .4rem; }
.card-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .5rem; color: var(--color-primary); line-height: 1.4; }
.card-title a { color: inherit; }
.card-title a:hover { color: var(--color-accent); }
.card-excerpt { font-size: .88rem; color: var(--color-text-muted); line-height: 1.65; }
.card-footer { padding: .75rem 1.25rem; border-top: 1px solid var(--color-border); }

/* === Article Grid === */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.article-list { display: flex; flex-direction: column; gap: 1rem; }
.article-list-item { display: flex; gap: 1rem; padding: 1rem; background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow .2s; }
.article-list-item:hover { box-shadow: var(--shadow-md); }
.article-list-item img { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.article-list-item .item-body { flex: 1; }
.article-list-item .item-meta { font-size: .8rem; color: var(--color-text-muted); margin-bottom: .3rem; }
.article-list-item .item-title { font-size: .95rem; font-weight: 700; color: var(--color-primary); line-height: 1.4; margin-bottom: .3rem; }
.article-list-item .item-title a { color: inherit; }
.article-list-item .item-title a:hover { color: var(--color-accent); }
.article-list-item .item-excerpt { font-size: .85rem; color: var(--color-text-muted); }
@media (max-width: 1024px) { .article-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 640px) {
  .article-grid { grid-template-columns: 1fr; }
  .article-list-item { flex-direction: column; }
  .article-list-item img { width: 100%; height: 160px; }
}

/* === Article Page === */
.article-layout { display: grid; grid-template-columns: 1fr 300px; gap: 2.5rem; padding: 2.5rem 0; }
.article-main {}
.article-hero-img { width: 100%; border-radius: var(--radius); margin-bottom: 1.5rem; }
.article-header { margin-bottom: 1.5rem; }
.article-breadcrumb { font-size: .82rem; color: var(--color-text-muted); margin-bottom: .75rem; }
.article-breadcrumb a { color: var(--color-text-muted); }
.article-breadcrumb a:hover { color: var(--color-accent); }
.article-breadcrumb span { margin: 0 .3rem; }
.article-title { font-size: clamp(1.5rem, 4vw, 2rem); margin-bottom: .75rem; }
.article-meta-bar { font-size: .85rem; color: var(--color-text-muted); display: flex; gap: 1rem; flex-wrap: wrap; border-bottom: 1px solid var(--color-border); padding-bottom: 1rem; margin-bottom: 1.5rem; }
.article-content { font-size: 1rem; line-height: 1.85; color: #2d2d2d; }
.article-content h2 { font-size: 1.35rem; margin: 2rem 0 .75rem; color: var(--color-primary); padding-top: 1rem; border-top: 1px solid var(--color-border); }
.article-content h3 { font-size: 1.1rem; margin: 1.5rem 0 .5rem; color: var(--color-primary); }
.article-content p { margin-bottom: 1rem; }
.article-content ul, .article-content ol { margin: .75rem 0 1rem 1.5rem; }
.article-content li { margin-bottom: .35rem; }
.article-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.article-content strong { color: var(--color-primary); }
.article-content .highlight-box { background: #eef3ff; border-left: 4px solid var(--color-primary); padding: 1rem 1.25rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 1.5rem 0; font-size: .95rem; }
.article-sidebar aside { position: sticky; top: 80px; }
.sidebar-widget { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.25rem; margin-bottom: 1.5rem; }
.sidebar-widget h3 { font-size: .95rem; color: var(--color-primary); margin-bottom: 1rem; padding-bottom: .5rem; border-bottom: 2px solid var(--color-accent); }
.sidebar-widget ul { list-style: none; }
.sidebar-widget ul li { margin-bottom: .65rem; padding-bottom: .65rem; border-bottom: 1px solid var(--color-border); }
.sidebar-widget ul li:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.sidebar-widget ul li a { font-size: .9rem; color: var(--color-text); display: flex; gap: .5rem; align-items: flex-start; }
.sidebar-widget ul li a:hover { color: var(--color-accent); }
.sidebar-widget ul li a::before { content: '\203A'; color: var(--color-accent); font-weight: 700; flex-shrink: 0; }
@media (max-width: 900px) { .article-layout { grid-template-columns: 1fr; } .article-sidebar { order: -1; } .article-sidebar aside { position: static; } }

/* === Category Page === */
.page-header { background: var(--color-primary); color: #fff; padding: 3rem 0; text-align: center; }
.page-header h1 { color: #fff; margin-bottom: .5rem; }
.page-header p { color: rgba(255,255,255,.75); font-size: .95rem; }

/* === Homepage Hero === */
.hero-section { position: relative; overflow: hidden; background: var(--color-primary); }
.hero-section img { width: 100%; height: 420px; object-fit: cover; opacity: .35; }
.hero-content { position: absolute; inset: 0; display: flex; align-items: center; }
.hero-text { max-width: 640px; padding: 0 1.25rem; }
.hero-text h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 2.8rem); margin-bottom: 1rem; text-shadow: 0 2px 8px rgba(0,0,0,.3); }
.hero-text p { color: rgba(255,255,255,.88); font-size: 1.05rem; margin-bottom: 1.5rem; }
.hero-buttons { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-buttons .btn-primary { background: var(--color-accent); }
.hero-buttons .btn-outline { border-color: rgba(255,255,255,.6); color: #fff; }
.hero-buttons .btn-outline:hover { background: rgba(255,255,255,.15); }

/* === Homepage Sections === */
.home-trust { background: #fff; padding: 1.5rem 0; border-bottom: 1px solid var(--color-border); }
.trust-stats { display: flex; justify-content: center; gap: 3rem; flex-wrap: wrap; }
.trust-stat { text-align: center; }
.trust-stat .stat-num { font-size: 1.8rem; font-weight: 800; color: var(--color-accent); }
.trust-stat .stat-label { font-size: .82rem; color: var(--color-text-muted); }

.home-categories { padding: 3rem 0; }
.cat-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1.25rem; }
.cat-card { background: var(--color-surface); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 1.5rem; text-align: center; transition: box-shadow .2s, transform .2s; border-top: 3px solid var(--color-accent); }
.cat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.cat-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.cat-card p { font-size: .82rem; color: var(--color-text-muted); }
@media (max-width: 900px) { .cat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 480px) { .cat-grid { grid-template-columns: 1fr; } }

.home-articles { padding: 3rem 0; background: var(--color-bg); }

/* === About / Info sections === */
.info-grid { display: grid; grid-template-columns: repeat(2,1fr); gap: 2rem; }
.info-card { background: var(--color-surface); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow-sm); }
.info-card h3 { margin-bottom: 1rem; }
@media (max-width: 640px) { .info-grid { grid-template-columns: 1fr; } }

/* === FAQ === */
.faq-item { background: var(--color-surface); border-radius: var(--radius); margin-bottom: 1rem; box-shadow: var(--shadow-sm); overflow: hidden; }
.faq-q { width: 100%; text-align: left; padding: 1rem 1.25rem; background: none; border: none; cursor: pointer; font-size: .95rem; font-weight: 700; color: var(--color-primary); display: flex; justify-content: space-between; align-items: center; }
.faq-q::after { content: '+'; font-size: 1.2rem; color: var(--color-accent); }
.faq-q.open::after { content: '-'; }
.faq-a { display: none; padding: 0 1.25rem 1rem; font-size: .9rem; color: var(--color-text-muted); line-height: 1.7; }
.faq-a.open { display: block; }

/* === Utility === */
.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-1 { gap: 1rem; }
.gap-2 { gap: 2rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 1.5rem; }
@media (max-width: 640px) { .grid-2 { grid-template-columns: 1fr; } }

/* === Pre-footer CTA === */
.cta-section { background: var(--color-primary); color: #fff; padding: 3.5rem 0; text-align: center; }
.cta-section h2 { color: #fff; margin-bottom: .75rem; }
.cta-section p { color: rgba(255,255,255,.75); margin-bottom: 1.5rem; font-size: .95rem; }
