/* quake.5l5l.net — real-time earthquake tracker theme */
:root {
    --bg: #ffffff;
    --bg-soft: #f4f7fb;
    --text: #1f2933;
    --muted: #64748b;
    --brand: #0f5ea8;
    --brand-dark: #0b4379;
    --accent: #d6452a;
    --border: #e2e8f0;
    --card: #ffffff;
    --radius: 12px;
    --shadow: 0 1px 3px rgba(15, 94, 168, .10);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
                 "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

a { color: var(--brand-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

.skip-link {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
    top: 0; z-index: 100;
}
.skip-link:focus {
    width: auto; height: auto; padding: 8px 16px; margin: 0;
    clip: auto; white-space: normal;
    inset-inline-start: 8px; top: 8px;
    background: var(--brand); color: #fff;
}

/* ---- header ---- */
.site-header {
    background: var(--bg-soft);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.header-inner {
    display: flex; align-items: center; gap: 16px;
    flex-wrap: wrap; padding: 12px 20px;
}
.brand {
    font-size: 20px; font-weight: 700; color: var(--brand);
    white-space: nowrap;
}
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; }
.nav-links a {
    color: var(--text); font-size: 15px;
    min-height: 32px; min-width: 32px;
    display: inline-flex; align-items: center; justify-content: center;
}
.nav-links a:hover { color: var(--brand); }

.search-box { display: flex; gap: 6px; flex: 1 1 220px; min-width: 180px; }
.search-box input {
    flex: 1; padding: 7px 12px; border: 1px solid var(--border);
    border-radius: 999px; font-size: 14px; background: #fff; color: var(--text);
}
.search-box button {
    padding: 7px 16px; border: 0; border-radius: 999px;
    background: var(--brand); color: #fff; cursor: pointer; font-size: 14px;
}
.search-box button:hover { background: var(--brand-dark); }

.lang-switch select {
    padding: 6px 10px; border: 1px solid var(--border);
    border-radius: 8px; background: #fff; color: var(--text); font-size: 14px;
}

/* ---- hero ---- */
.hero {
    background: linear-gradient(135deg, #eef4fb 0%, #e3edf7 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 28px; margin: 24px 0;
    text-align: center;
}
.hero h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 38px); color: var(--brand-dark); }
.hero p { margin: 4px 0; color: var(--muted); }
.hero-meta { font-weight: 600; color: var(--brand); }

.hero-stats {
    display: flex; flex-wrap: wrap; gap: 18px;
    justify-content: center; margin-top: 18px;
}
.stat {
    background: #fff; border: 1px solid var(--border);
    border-radius: var(--radius); padding: 12px 22px;
    min-width: 110px;
}
.stat strong {
    display: block; font-size: 26px; color: var(--accent); line-height: 1.2;
}
.stat span { font-size: 13px; color: var(--muted); }

/* ---- sections ---- */
.section { margin: 32px 0; }
.section h1 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 6px; }
.section h2 { font-size: clamp(19px, 2.4vw, 24px); margin-bottom: 14px; }
.lead { color: var(--muted); margin-top: 0; }

/* ---- grid ---- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 18px;
}
@media (max-width: 640px) {
    .grid { grid-template-columns: 1fr; }
    /* 小屏避免粘性头部占用宝贵空间（停留时长杀手） */
    .site-header { position: static; }
    .header-inner { padding: 10px 14px; }
    .nav-links { gap: 8px 14px; }
}

.card {
    display: block; background: var(--card);
    border: 1px solid var(--border); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
    transition: transform .15s ease, box-shadow .15s ease;
    color: var(--text);
}
.card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(15,94,168,.14); text-decoration: none; }
.card-body { padding: 12px 14px; }
.card-body h2, .card-body h3 { margin: 0 0 6px; font-size: 16px; line-height: 1.35; }
.card-meta { margin: 0; font-size: 13px; color: var(--muted); }
.card-meta span:not(:last-child)::after { content: " · "; }
.mag { font-weight: 700; color: var(--accent); }
.card-time { margin: 6px 0 0; font-size: 12px; color: var(--muted); }

/* ---- chips ---- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 32px; min-width: 32px;
    padding: 4px 14px; font-size: 14px;
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: 999px; color: var(--text);
}
.chip:hover { background: #e3edf7; border-color: var(--brand); text-decoration: none; }
.chip.active {
    background: var(--brand); border-color: var(--brand); color: #fff;
}
.chip.active em { color: #e8f1fb; }
.chip em { font-style: normal; color: var(--muted); font-size: 12px; margin-left: 4px; }

/* ---- buttons ---- */
.btn {
    display: inline-block; padding: 8px 18px; border-radius: 999px;
    background: var(--brand); color: #fff; font-size: 14px; border: 0;
    cursor: pointer;
}
.btn:hover { background: var(--brand-dark); text-decoration: none; }

.pager { display: flex; gap: 14px; align-items: center; margin-top: 24px; }
.pager span { color: var(--muted); font-size: 14px; }

.more { text-align: center; margin-top: 20px; }

/* ---- earthquake detail ---- */
.crumbs { font-size: 13px; color: var(--muted); margin: 20px 0 10px; }
.crumbs a {
    color: var(--muted);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 6px 4px; min-height: 32px; min-width: 32px;
}
.earthquake h1 { font-size: clamp(24px, 3.5vw, 34px); margin: 0 0 18px; }
.earthquake-facts {
    background: var(--bg-soft); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 16px 18px; margin: 18px 0;
}
.earthquake-facts p { margin: 0 0 10px; font-size: 15px; }
.earthquake-facts strong { color: var(--text); }
.earthquake-section { margin: 28px 0; }
.earthquake-section h2 {
    font-size: 20px; margin-bottom: 12px;
    padding-bottom: 6px; border-bottom: 2px solid var(--border);
}
.source-link a {
    color: var(--brand-dark);
    display: inline-flex; align-items: center; justify-content: center;
    padding: 4px 4px; min-height: 32px; min-width: 32px;
}

/* ---- empty / footer ---- */
.empty { color: var(--muted); font-size: 16px; }
.empty-page { text-align: center; padding: 60px 0; }

.site-footer {
    background: var(--bg-soft); border-top: 1px solid var(--border);
    margin-top: 48px; padding: 28px 0; font-size: 14px; color: var(--muted);
}
.site-footer p { margin: 4px 0; }
.footer-links a {
    color: var(--muted);
    min-height: 32px; min-width: 32px; display: inline-flex;
    align-items: center; justify-content: center;
    padding: 2px 4px;
}
.copy { margin-top: 10px; font-size: 13px; }

/* RTL (Arabic) */
[dir="rtl"] .card-meta span:not(:last-child)::after { content: ""; }
[dir="rtl"] .header-inner { direction: rtl; }

/* ---- AdSense 广告位 ----
   关键：按广告位类型用 min-height 预留【真实广告高度】，
   杜绝 Core Web Vitals 的 CLS 布局抖动（直接影响 SEO 排名与广告可见性）。
   固定 height 会被 Google 返回的 iframe 高度覆盖而产生增长抖动，故只用 min-height。
   移动端 auto+full-width-responsive 横幅更高（实测 ~390px），单独加高预留。 */
.ad-slot { margin: 18px 0; text-align: center; }
.ad-slot .ad-label {
    font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 6px;
}
ins.adsbygoogle { display: block; width: 100%; background: transparent; }
.ad-top, .ad-bottom { min-height: 320px; }
.ad-top ins.adsbygoogle, .ad-bottom ins.adsbygoogle { min-height: 300px; }
.ad-in-article { min-height: 240px; }
.ad-in-article ins.adsbygoogle { min-height: 220px; }
/* 信息流广告跨整行网格（否则会挤成单列卡片） */
.ad-in-feed { grid-column: 1 / -1; min-height: 300px; }
.ad-in-feed ins.adsbygoogle { min-height: 280px; }
/* 未填充：仅视觉隐藏、保留预留高度，杜绝塌陷抖动（CLS 友好） */
ins.adsbygoogle.ad-unfilled { opacity: 0; pointer-events: none; }
@media (max-width: 640px) {
  .ad-top, .ad-bottom { min-height: 400px; }
  .ad-top ins.adsbygoogle, .ad-bottom ins.adsbygoogle { min-height: 390px; }
}
[dir="rtl"] .ad-label { text-align: right; }

/* ---- GDPR 同意横幅 ---- */
.consent-banner {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    background: rgba(31,41,51,.96); color: #fff;
    box-shadow: 0 -2px 12px rgba(0,0,0,.18);
}
.consent-inner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 16px; flex-wrap: wrap; padding: 14px 0;
}
.consent-text { margin: 0; font-size: 14px; line-height: 1.5; flex: 1 1 320px; color: #f3f4f6; }
.consent-text a { color: #bfdbf3; text-decoration: underline; }
.consent-actions { display: flex; gap: 10px; flex: 0 0 auto; }
.consent-actions .btn { padding: 9px 20px; border-radius: 8px; font-size: 14px; }
.consent-actions .btn-accept { background: var(--brand); color: #fff; }
.consent-actions .btn-reject { background: transparent; border: 1px solid rgba(255,255,255,.55); color: #fff; }
.consent-actions .btn:hover { opacity: .9; text-decoration: none; }
@media (max-width: 600px) {
    .consent-inner { flex-direction: column; align-items: stretch; }
    .consent-actions { justify-content: flex-end; }
}
/* GDPR 拒绝后隐藏全部广告位：hidden 属性需强制 display:none，
   否则 ins.adsbygoogle{display:block} 会覆盖 UA 的 [hidden] 规则导致空位可见 */
.ad-slot[hidden], ins.adsbygoogle[hidden] { display: none !important; }

/* ---- 地震地图（OSM iframe） ---- */
.quake-map { margin: 18px 0; }
.quake-map iframe {
    display: block; width: 100%; border: 1px solid var(--border);
    border-radius: var(--radius); background: #e8edf3;
}

/* ---- 深色模式（国际大站标准，跟随系统） ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1720;
    --bg-soft: #16202c;
    --text: #e5edf5;
    --muted: #94a3b8;
    --brand: #4da3e8;
    --brand-dark: #7cc0f5;
    --accent: #ff7a5c;
    --border: #263342;
    --card: #16202c;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
  }
  body { background: var(--bg); color: var(--text); }
  a { color: var(--brand-dark); }
  .site-header { background: var(--bg-soft); }
  .search-box input, .lang-switch select {
    background: #0f1720; color: var(--text); border-color: var(--border);
  }
  .hero {
    background: linear-gradient(135deg, #12202f 0%, #16283a 100%);
    border-color: var(--border);
  }
  .hero h1 { color: #9cc8f0; }
  .stat { background: #0f1720; border-color: var(--border); }
  .card { background: var(--card); }
  .card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.5); }
  .chip { background: #0f1720; border-color: var(--border); }
  .chip:hover { background: #1a2a3a; border-color: var(--brand); }
  .earthquake-facts { background: #0f1720; border-color: var(--border); }
  .quake-map iframe { border-color: var(--border); background: #0f1720; }
  .site-footer { background: var(--bg-soft); border-color: var(--border); }
  .consent-banner { background: rgba(10,15,22,.97); }
}/* ========== 触控目标无障碍加固（2026-11-01 严格验收修复） ==========
   WCAG 2.5.5 Target Size：正文内联链接点击区域 ≥32px。
   覆盖：合规页正文外部链接、详情页国家链接、关于页数据源链接。 */
.legal-page a,
.earthquake-facts a,
.earthquake-section a {
    display: inline-block;
    padding: 6px 2px;
    min-height: 32px;
    min-width: 32px;
    line-height: 1.3;
    vertical-align: baseline;
}
/* 深色模式下同样生效（继承即可，无需重复定义） */