/*!
 * vapepolicies.com 全站样式表
 * 手写静态资源（与 ar-styles.css 同类），不参与站点生成；update_site.py 通过 <link> 引用。
 * 页面级差异用 <body class="page-*"> 限定，避免重复内联。
 */

/* ==========================================================================
   1. 设计令牌
   ========================================================================== */
:root {
  color-scheme: light;

  /* Brand：深墨蓝。原 #3b82f6 对白底只有 3.68:1，不能用于文字；
     #1d4ed8 为 6.3:1，同时去掉「Tailwind 默认蓝」的模板感。 */
  --primary: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-soft: #eff6ff;
  --brand-ink: #0b1220;

  /* 语义色与 STATUS_COLORS（生成器内联徽章配色）保持一致 */
  --success: #15803d;
  --warning: #854d0e;
  --danger: #b91c1c;

  /* 冷灰阶：统一到蓝灰，去掉偏暖的 Tailwind gray */
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #667085;   /* 5.0:1，页脚小字仍可读 */
  --gray-500: #5b6675;   /* 5.6:1 */
  --gray-600: #475467;
  --gray-700: #344054;
  --gray-800: #1d2939;
  --gray-900: #101828;

  --canvas: #f6f8fc;
  --surface: #ffffff;
  --line: #e4e9f0;

  /* 8pt 间距网格 */
  --space-1: 4px;  --space-2: 8px;  --space-3: 12px; --space-4: 16px;
  --space-5: 20px; --space-6: 24px; --space-8: 32px; --space-10: 40px;
  --space-12: 48px; --space-16: 64px;

  /* 排版体系：系统字体栈 + 中文回退，不依赖外部字体请求 */
  --font-sans: system-ui, -apple-system, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --fs-display: clamp(1.75rem, 3vw, 2.5rem);
  --lh-display: 1.15;
  --fs-headline: clamp(1.375rem, 2.2vw, 1.875rem);
  --lh-headline: 1.25;
  --fs-title: clamp(1.0625rem, 1.3vw, 1.1875rem);
  --lh-title: 1.35;
  --fs-label: 0.8125rem;

  /* 形状 / 高度 / 动效 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06);
  --shadow-2: 0 4px 8px -2px rgba(16, 24, 40, 0.08), 0 12px 28px -8px rgba(16, 24, 40, 0.12);
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-short: 150ms;
  --dur-medium: 250ms;
}

/* ==========================================================================
   2. 基础
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  line-height: 1.65;
  color: var(--gray-800);
  background: var(--canvas);           /* 纯色画布，去掉廉价的双色渐变 */
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; }

/* main 默认内容宽；文档类页面收窄，便于长文阅读 */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: clamp(1.25rem, 3vw, 2rem) clamp(1rem, 3vw, 1.5rem);
}
body.page-about main,
body.page-privacy main,
body.page-article main { max-width: 800px; }
body.page-news main { max-width: 1200px; }

/* ==========================================================================
   3. 头部
   ========================================================================== */
header {
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }

.logo-icon {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  flex: 0 0 auto;
}

.logo-title,
.logo-text h1 { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }

.logo-tagline,
.logo-text p { font-size: 0.75rem; color: var(--gray-500); }

.header-right { display: flex; align-items: center; gap: 1.5rem; }

.main-nav { display: flex; align-items: center; gap: 1.5rem; }

.nav-link {
  color: var(--gray-600);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.nav-link:hover { color: var(--primary); }
.nav-link.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 语言切换 */
.lang-dropdown { position: relative; }

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--gray-700);
}
.lang-toggle .lang-current img { width: 1rem; }

.lang-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
  z-index: 200;
}
.lang-dropdown.open .lang-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.lang-menu-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: var(--gray-700);
  font-size: 0.875rem;
}
.lang-menu-item:hover { background: var(--gray-100); }
.lang-menu-item.active { background: var(--primary); color: white; }

/* 移动端汉堡按钮 */
.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 0 0 auto;
}
.menu-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--gray-700);
  border-radius: 1px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
body.nav-open .menu-toggle-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
body.nav-open .menu-toggle-bar:nth-child(2) { opacity: 0; }
body.nav-open .menu-toggle-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* 键盘焦点：鼠标点击不显示描边，Tab 导航时给出清晰焦点环 */
a:focus-visible,
button:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.country-card-link:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--radius-md); }
.search-input:focus-visible,
.news-search-input:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; border-color: var(--primary); }

/* ==========================================================================
   4. 面包屑与页脚
   ========================================================================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
  font-size: 0.875rem;
  color: var(--gray-500);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--primary); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-separator { color: var(--gray-400); }
.breadcrumb-current { color: var(--gray-600); }

footer { background: white; border-top: 1px solid var(--gray-200); margin-top: 3rem; }
.footer-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-text { font-size: 0.875rem; color: var(--gray-500); }
.footer-source { font-size: 0.75rem; color: var(--gray-400); }
.footer-source a { color: var(--gray-400); text-decoration: none; }
.footer-source a:hover { color: var(--primary); text-decoration: underline; }

/* ==========================================================================
   5. 首页：统计条 / 搜索 / 国家卡片
   ========================================================================== */
.stats-bar { background: white; border-bottom: 1px solid var(--gray-200); }
.stats-content {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 1rem;
}
.stat-item { text-align: center; padding: 0.75rem; border-radius: var(--radius-sm); background: var(--gray-50); }
.stat-value { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.stat-label { font-size: 0.75rem; color: var(--gray-500); }

.search-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 2rem;
}
.search-row { display: flex; gap: 1rem; flex-wrap: wrap; }
.search-input-wrapper { flex: 1; min-width: 250px; position: relative; }
.search-input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.search-icon { position: absolute; left: 0.75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); }
.filter-select {
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  background: white;
  cursor: pointer;
  min-width: 140px;
}

.section-title { font-size: 1.25rem; font-weight: 600; color: var(--gray-900); margin-bottom: 1rem; }

.country-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; align-items: stretch; }
.country-card-link { display: flex; text-decoration: none; color: inherit; height: 100%; }
.country-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-1);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
  border-left: 4px solid transparent;
  cursor: pointer;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.country-card-link:hover .country-card { transform: translateY(-2px); box-shadow: var(--shadow-2); border-left-color: var(--primary); }

.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; gap: 0.5rem; }
.country-info { display: flex; align-items: center; gap: 0.75rem; min-width: 0; }
.country-flag {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.875rem;
  box-shadow: 0 0 0 1px var(--gray-200);
}
.country-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.country-name { font-size: 1.125rem; font-weight: 600; color: var(--gray-900); }
.country-region { font-size: 0.75rem; color: var(--gray-500); }

.status-badge { padding: 0.25rem 0.75rem; border-radius: 9999px; font-size: 0.75rem; font-weight: 500; white-space: nowrap; }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; font-size: 0.875rem; margin-top: auto; }
.card-item { display: flex; align-items: center; gap: 0.5rem; }
.card-item-label { color: var(--gray-500); }
.card-item-value { font-weight: 500; color: var(--gray-900); display: inline-flex; align-items: center; }
/* 允许/禁止图标用 CSS 绘制（Unicode 勾叉），避免每张卡片内联 SVG 撑大 HTML */
.card-item-value.check::before { content: "\2713"; }
.card-item-value.cross::before { content: "\2715"; }
.card-item-value.check::before,
.card-item-value.cross::before {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1;
}
.card-item .check { color: var(--success); }
.card-item .cross { color: var(--danger); }

.tags { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.75rem; min-height: 28px; }
.tag { padding: 0.25rem 0.5rem; background: var(--gray-100); border-radius: 0.25rem; font-size: 0.75rem; color: var(--gray-600); }

.no-results { text-align: center; padding: 4rem 2rem; }
.hidden { display: none !important; }

/* ==========================================================================
   6. 国家详情页
   ========================================================================== */
.detail-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 1.5rem;
}
.detail-title { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.detail-flag {
  width: 60px;
  height: 60px;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 1.25rem;
  box-shadow: 0 0 0 1px var(--gray-200);
}
.detail-flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-title-text h1 { font-size: 1.875rem; font-weight: 700; color: var(--gray-900); }
.detail-badges { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.5rem; }
.detail-updated { font-size: 0.8125rem; color: var(--gray-500); }

.detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1rem; }
.detail-stat { text-align: center; padding: 1rem; background: var(--gray-50); border-radius: var(--radius-sm); }
.detail-stat-icon { font-size: 1.5rem; margin-bottom: 0.25rem; }
.detail-stat-label { font-size: 0.75rem; color: var(--gray-500); margin-bottom: 0.25rem; }
.detail-stat-value { font-weight: 600; color: var(--gray-900); }

.detail-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 1.5rem;
}
.detail-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.detail-section h2::before {
  content: "";
  width: 4px;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 2px;
  flex: 0 0 auto;
}
.detail-list { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.detail-tag { padding: 0.5rem 1rem; background: var(--gray-100); border-radius: var(--radius-sm); font-size: 0.875rem; color: var(--gray-700); }
.detail-tag.primary { background: #dbeafe; color: #1e40af; }
.detail-tag.success { background: #dcfce7; color: #166534; }
.detail-tag.danger { background: #fee2e2; color: #991b1b; }

.detail-notes {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--gray-700);
  line-height: 1.7;
}

.detail-block { margin-bottom: 1.25rem; }
.detail-block:last-of-type { margin-bottom: 0; }
.detail-block h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 0.5rem;
  padding-left: 0.625rem;
  border-left: 3px solid var(--primary);
}
.detail-block-text {
  font-size: 0.9375rem;
  color: var(--gray-700);
  line-height: 1.8;
  white-space: pre-line;
  word-break: break-word;
  background: var(--gray-50);
  padding: 0.875rem 1rem;
  border-radius: var(--radius-sm);
}

/* 锚点目录：桌面为 sticky 侧栏，≤1024px 变为顶部横向 chips */
.detail-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.detail-content { min-width: 0; }

.detail-toc {
  position: sticky;
  top: 88px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem;
  box-shadow: var(--shadow-1);
  font-size: 0.875rem;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}
.detail-toc-title {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gray-500);
  margin-bottom: 0.5rem;
}
.detail-toc ul { list-style: none; }
.detail-toc a {
  display: block;
  padding: 0.375rem 0.5rem;
  border-radius: 0.375rem;
  border-left: 2px solid transparent;
  color: var(--gray-700);
  text-decoration: none;
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.detail-toc a:hover { background: var(--gray-50); color: var(--primary); }
.detail-toc a.is-active { background: #eff6ff; border-left-color: var(--primary); color: var(--primary); font-weight: 600; }
.detail-toc-sub { margin-left: 0.5rem; padding-left: 0.5rem; border-left: 1px solid var(--gray-200); margin-top: 0.125rem; }
.detail-toc-sub a { font-size: 0.8125rem; color: var(--gray-600); padding: 0.25rem 0.5rem; }

/* 锚点跳转时给 sticky header 留出空间 */
.detail-section[id], .detail-block[id] { scroll-margin-top: 88px; }

.states-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.states-box { padding: 1rem; border-radius: var(--radius-sm); }
.states-box.legal { background: #f0fdf4; border: 1px solid #bbf7d0; }
.states-box.banned { background: #fef2f2; border: 1px solid #fecaca; }
.states-box h3 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.5rem; }
.states-box.legal h3 { color: #166534; }
.states-box.banned h3 { color: #991b1b; }
.states-box.legal h3::before { content: "\2713"; font-weight: 700; line-height: 1; }
.states-box.banned h3::before { content: "\2715"; font-weight: 700; line-height: 1; }

/* ==========================================================================
   7. 关于我们 / 隐私政策
   ========================================================================== */
.about-header,
.privacy-header { text-align: center; margin-bottom: 3rem; }
.about-header h1,
.privacy-header h1 { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.5rem; }
.about-header p,
.privacy-header p { color: var(--gray-500); font-size: 1rem; }

.about-section,
.privacy-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 1.5rem;
}
.about-section h2,
.privacy-section h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.about-section h2::before,
.privacy-section h2::before {
  content: "";
  width: 4px;
  height: 1.25rem;
  background: var(--primary);
  border-radius: 2px;
  flex: 0 0 auto;
}
.about-section p,
.privacy-section p { color: var(--gray-600); line-height: 1.8; margin-bottom: 1rem; }
.about-section p:last-child,
.privacy-section p:last-child { margin-bottom: 0; }
.privacy-section ul { margin: 1rem 0; padding-left: 1.5rem; color: var(--gray-600); }
.privacy-section li { margin-bottom: 0.5rem; line-height: 1.6; }

.highlight-box {
  background: #eff6ff;
  border-left: 4px solid var(--primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0;
}
.highlight-box p { color: var(--gray-700); margin: 0; }

.contact-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
  margin-top: 1rem;
}
.contact-box h3 { font-size: 1.125rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.5rem; }
.contact-box p { color: var(--gray-600); margin-bottom: 1rem; }
.contact-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
  transition: background 0.2s var(--ease);
}
.contact-btn:hover { background: var(--primary-dark); }

.eeat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.eeat-card { background: var(--gray-50); border-radius: var(--radius-md); padding: 1.25rem; text-align: center; }
.eeat-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.eeat-card h4 { font-size: 0.875rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.25rem; }
.eeat-card p { font-size: 0.75rem; color: var(--gray-500); margin: 0; }

/* ==========================================================================
   8. 新闻列表
   ========================================================================== */
.news-header { text-align: center; margin-bottom: 2rem; }
.news-header h1 { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 0.5rem; }
.news-header p { color: var(--gray-500); font-size: 1rem; }

.news-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.news-filter {
  min-height: 40px;
  padding: 0.5rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: 9999px;
  background: #fff;
  color: var(--gray-600);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s var(--ease), color 0.15s var(--ease), border-color 0.15s var(--ease);
}
.news-filter:hover { border-color: var(--primary); color: var(--primary); }
.news-filter.is-active { background: var(--primary); border-color: var(--primary); color: #fff; }

.news-search { max-width: 600px; margin: 0 auto 1.5rem; display: flex; gap: 0.5rem; }
.news-search-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 1rem;
}
.news-search-input:focus { outline: none; border-color: var(--primary); }
.news-search-btn {
  padding: 0.75rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1rem;
}
.news-search-btn:hover { background: var(--primary-dark); }

.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }
.news-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-1);
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-2); }
.news-card-link { text-decoration: none; color: inherit; display: block; }
.news-card-image { display: block; width: 100%; height: 200px; object-fit: cover; background-color: var(--gray-200); }
.news-card-content { padding: 1.5rem; }
.news-card-meta { display: flex; gap: 1rem; margin-bottom: 0.75rem; font-size: 0.875rem; }
.news-card-category { color: var(--primary); font-weight: 500; }
.news-card-date { color: var(--gray-500); }
.news-card-title { font-size: 1.25rem; font-weight: 600; color: var(--gray-900); margin-bottom: 0.75rem; line-height: 1.4; }
.news-card-summary {
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-readmore { color: var(--primary); font-weight: 500; }

.rss-subscribe { text-align: center; margin-bottom: 2rem; }
.rss-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: #f97316;
  color: white;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.rss-btn:hover { background: #ea580c; }

/* ==========================================================================
   9. 新闻详情
   ========================================================================== */
.article-header { text-align: center; margin-bottom: 2rem; }
.article-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 9999px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
}
.article-title { font-size: 2rem; font-weight: 700; color: var(--gray-900); margin-bottom: 1rem; line-height: 1.3; }
.article-meta { color: var(--gray-500); font-size: 0.875rem; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.article-source { margin-top: 1rem; }
.article-source a { color: var(--primary); }
.article-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-top: 1rem; }
.article-tag { padding: 0.25rem 0.75rem; background: var(--gray-100); border-radius: 9999px; font-size: 0.875rem; color: var(--gray-600); }

.article-content {
  background: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 2rem;
}
.article-content h1 { font-size: 1.75rem; font-weight: 700; margin: 2rem 0 1rem; color: var(--gray-900); }
.article-content h2 { font-size: 1.5rem; font-weight: 600; margin: 1.75rem 0 0.875rem; color: var(--gray-900); }
.article-content h3 { font-size: 1.25rem; font-weight: 600; margin: 1.5rem 0 0.75rem; color: var(--gray-900); }
.article-content p { margin-bottom: 1rem; line-height: 1.8; }
.article-content ul, .article-content ol { margin: 1rem 0; padding-left: 1.5rem; }
.article-content li { margin-bottom: 0.5rem; }
.article-content a { color: var(--primary); text-decoration: none; }
.article-content a:hover { text-decoration: underline; }
.article-content blockquote { border-left: 4px solid var(--primary); padding-left: 1rem; margin: 1.5rem 0; color: var(--gray-600); font-style: italic; }
.article-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 1.5rem 0; }
.article-content pre { background: var(--gray-50); padding: 1rem; border-radius: var(--radius-sm); overflow-x: auto; margin: 1.5rem 0; }
.article-content code { font-family: monospace; font-size: 0.875rem; }
.article-content table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; }
.article-content th, .article-content td { padding: 0.75rem; border: 1px solid var(--gray-200); text-align: left; }
.article-content th { background: var(--gray-50); font-weight: 600; }

.social-share {
  background: white;
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-1);
  margin-bottom: 2rem;
  text-align: center;
}
.social-share h3 { font-size: 1rem; font-weight: 600; color: var(--gray-700); margin-bottom: 1rem; }
.share-buttons { display: flex; justify-content: center; gap: 1rem; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 500;
  transition: background 0.2s var(--ease);
}
.share-twitter { background: #000; color: white; }
.share-twitter:hover { background: #333; }
.share-linkedin { background: #0a66c2; color: white; }
.share-linkedin:hover { background: #0842a0; }

/* ==========================================================================
   10. 响应式（移动端头部抽屉 + 各页压缩）
   ========================================================================== */
@media (max-width: 1024px) {
  /* 目录收为顶部横向 chips，只保留一级，避免 20+ 项挤满屏幕 */
  .detail-layout { grid-template-columns: 1fr; }
  .detail-toc { position: static; max-height: none; overflow: visible; padding: 0.75rem; }
  .detail-toc-sub { display: none; }
  .detail-toc-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
  }
  .detail-toc-list > li { flex: 0 0 auto; }
  .detail-toc-list > li > a {
    white-space: nowrap;
    border: 1px solid var(--gray-200);
    border-radius: 9999px;
  }
  .detail-toc-list > li > a.is-active { border-color: var(--primary); }
}

@media (max-width: 768px) {
  /* 头部：单行 + 抽屉 */
  .header-content {
    position: relative;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    min-height: 56px;
  }
  .logo { flex: 1 1 auto; min-width: 0; gap: 0.5rem; }
  .logo-icon { width: 32px; height: 32px; }
  .logo-title, .logo-text h1 { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-tagline, .logo-text p { display: none; }
  .menu-toggle { display: flex; }

  .header-right {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem 1rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 16px 24px -16px rgba(15, 23, 42, 0.24);
    max-height: calc(100vh - 56px);
    overflow-y: auto;
    z-index: 150;
  }
  .header-right.is-open { display: flex; }

  .main-nav { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }
  .nav-link { padding: 0.875rem 0.25rem; border-bottom: 1px solid var(--gray-100); }
  .nav-link.active { border-bottom-color: var(--gray-100); color: var(--primary); }

  body.nav-open { overflow: hidden; }

  .lang-dropdown { width: 100%; }
  .lang-toggle { width: 100%; min-height: 44px; justify-content: space-between; margin-top: 0.75rem; }
  .lang-menu {
    position: static;
    display: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
    max-height: 45vh;
    overflow-y: auto;
  }
  .lang-dropdown.open .lang-menu { display: block; transform: none; }

  /* 首页 */
  .stats-content { grid-template-columns: repeat(3, 1fr); }
  .search-row { flex-direction: column; }
  .country-grid { grid-template-columns: 1fr; }
  .country-card { padding: 1rem; }

  /* 详情页 */
  .detail-header { padding: 1.25rem; }
  .detail-stats { grid-template-columns: repeat(2, 1fr); }
  .detail-title { flex-direction: column; text-align: center; }
  .detail-badges { justify-content: center; }
  .detail-section { padding: 1.25rem; }

  /* 关于 / 隐私 */
  .about-header h1, .privacy-header h1 { font-size: 1.5rem; }
  .about-section, .privacy-section { padding: 1.5rem; }
  .eeat-grid { grid-template-columns: repeat(2, 1fr); }
  .eeat-card { padding: 1rem; }

  /* 新闻 */
  .news-grid { grid-template-columns: 1fr; }
  .news-header h1, .article-title { font-size: 1.5rem; }
  .article-content { padding: 1.5rem; }
  .share-buttons { flex-direction: column; }
}

/* ==========================================================================
   11. 细节打磨（原生控件、长表格、超小屏）
   ========================================================================== */
/* 隐藏 WebKit 原生搜索清除按钮，避免与自定义输入框样式冲突 */
.news-search-input::-webkit-search-cancel-button,
.news-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; }

@media (max-width: 768px) {
  /* 正文里的宽表格改为横向滚动，不撑破页面 */
  .article-content table { display: block; overflow-x: auto; white-space: nowrap; }
  /* 触控目标补到 44px */
  .news-filter { min-height: 44px; }
}

/* 超小屏（320–400px）：两列信息降为单列，避免文字被挤成竖排 */
@media (max-width: 400px) {
  main { padding: 1.25rem 0.75rem; }
  .header-content { padding: 0.5rem 0.75rem; }
  .logo-title, .logo-text h1 { font-size: 0.9375rem; }
  .stats-content { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat-item { padding: 0.5rem; }
  .stat-value { font-size: 1.25rem; }
  .card-grid { grid-template-columns: 1fr; }
  .detail-stats { grid-template-columns: 1fr; }
  .news-filters { justify-content: flex-start; }
}

/* ==========================================================================
   12. 设计系统升级：图标 / 排版 / 质感 / 响应式
   放在末尾做覆盖层，保证与前面各页面级规则解耦
   ========================================================================== */

/* --- 12.1 统一图标：与文字基线对齐，尺寸按容器分级 --- */
.icon {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.2em;
  width: 20px;
  height: 20px;
}
.search-icon { display: flex; align-items: center; pointer-events: none; }
.search-icon .icon { width: 18px; height: 18px; }
.no-results-icon { display: flex; justify-content: center; margin-bottom: var(--space-4); color: var(--gray-400); }
.no-results-icon .icon { width: 48px; height: 48px; stroke-width: 1.4; }
.detail-stat-icon { display: flex; justify-content: center; color: var(--primary); }
.detail-stat-icon .icon { width: 22px; height: 22px; }
.eeat-card .icon { width: 30px; height: 30px; color: var(--primary); margin: 0 auto var(--space-2); }
.article-date { display: inline-flex; align-items: center; gap: var(--space-1); }
.article-date .icon { width: 16px; height: 16px; }
.news-card-readmore { display: inline-flex; align-items: center; gap: var(--space-2); }
.news-card-readmore .icon { width: 16px; height: 16px; transition: transform var(--dur-short) var(--ease); }
.news-card-link:hover .news-card-readmore .icon { transform: translateX(3px); }
.news-search-btn { display: inline-flex; align-items: center; justify-content: center; }
.news-search-btn .icon, .rss-btn .icon, .contact-btn .icon { width: 18px; height: 18px; }
/* 国旗 emoji 各平台尺寸不一，用固定盒子收敛 */
.lang-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 1.5rem; font-size: 1.125rem; line-height: 1; }

/* --- 12.2 头部质感：轻毛玻璃 + 一条细分隔线，替代原来的硬阴影 --- */
header {
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.header-content { padding: clamp(0.75rem, 1.6vw, 1rem) clamp(1rem, 3vw, 1.5rem); }
.logo-title, .logo-text h1 { letter-spacing: -0.02em; }

/* --- 12.3 排版层级：流式字号只在桌面展开，移动端沿用既有 1.5rem --- */
@media (min-width: 769px) {
  .news-header h1, .about-header h1, .privacy-header h1, .article-title {
    font-size: var(--fs-display);
    line-height: var(--lh-display);
    font-weight: 700;
    letter-spacing: -0.025em;
  }
  .section-title, .detail-section h2, .about-section h2, .privacy-section h2 {
    font-size: var(--fs-headline);
    line-height: var(--lh-headline);
    font-weight: 650;
    letter-spacing: -0.015em;
  }
  .detail-title-text h1 {
    font-size: var(--fs-headline);
    line-height: var(--lh-headline);
    letter-spacing: -0.02em;
  }
  .country-name { font-size: var(--fs-title); line-height: var(--lh-title); font-weight: 650; letter-spacing: -0.01em; }
}

/* 密集标签统一到 13px；徽章加字重，状态色才有分量 */
.stat-label, .country-region, .status-badge, .card-item-label,
.detail-stat-label, .tag, .news-card-date, .footer-source { font-size: var(--fs-label); }
.status-badge { font-weight: 600; letter-spacing: 0.01em; }
.section-title, h1, h2, h3 { letter-spacing: -0.015em; }

/* 合规长文：限制行宽 + 长词换行，避免超宽屏一行 120 字 */
.detail-notes, .detail-block-text, .article-content p { max-width: 72ch; }
.detail-block-text, .article-content p { overflow-wrap: anywhere; }
.detail-block-text { line-height: 1.8; }

/* --- 12.4 组件质感：去掉装饰渐变，统一圆角与品牌色 --- */
.country-flag, .detail-flag { background: var(--primary); }
.contact-box { background: var(--primary-soft); }
.detail-notes, .highlight-box { background: var(--primary-soft); }
.rss-btn { background: var(--primary-dark); }
.rss-btn:hover { background: var(--brand-ink); }
.detail-section, .search-section, .article-content, .news-card,
.social-share, .about-section, .privacy-section, .detail-header { border-radius: var(--radius-lg); }
.detail-section { padding: clamp(1.25rem, 2vw, 1.5rem); }

.country-card-link:hover .country-card { box-shadow: var(--shadow-2); border-left-color: var(--primary); }
.country-card-link:active .country-card { transform: scale(0.995); box-shadow: var(--shadow-1); }
.news-filter, .news-search-btn, .contact-btn, .rss-btn, .share-btn, .lang-toggle, .menu-toggle {
  transition: transform var(--dur-short) var(--ease), background var(--dur-short) var(--ease),
              box-shadow var(--dur-medium) var(--ease), border-color var(--dur-short) var(--ease);
}
.news-filter:active, .news-search-btn:active, .contact-btn:active,
.rss-btn:active, .share-btn:active, .lang-toggle:active, .menu-toggle:active { transform: scale(0.97); }

/* --- 12.5 触控目标与网格边界 --- */
.search-input, .filter-select, .news-search-input, .news-search-btn,
.rss-btn, .share-btn, .contact-btn, .lang-toggle { min-height: 44px; }
.lang-menu-item { min-height: 40px; }

@media (min-width: 769px) {
  /* min(100%, …) 防止小视口下固定最小列宽撑破容器 */
  .country-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
    gap: clamp(0.875rem, 1.4vw, 1.25rem);
  }
}
.states-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
