/*
Theme Name: RailKnow
Description: RailKnow 铁路信息站主题（Typecho），导航与页脚全部后台可配
Version: 1.0.0
*/
:root {
  --navy: #12305e;
  --navy-2: #0d2347;
  --gold: #c9a24b;
  --ink: #2c3338;
  --muted: #6b7684;
  --line: #e3e7ec;
  --bg: #f4f6f9;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif; font-size: 15px; line-height: 1.8; color: var(--ink); background: var(--bg); }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- 头部 ---------- */
.site-header { position: relative; z-index: 100; background: #fff; border-bottom: 1px solid var(--line); }
.header-bar { display: flex; align-items: center; gap: 32px; height: 72px; }
.site-brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-logo { display: flex; align-items: center; font-size: 24px; font-weight: 800; color: var(--navy); letter-spacing: .5px; white-space: nowrap; }
.site-logo-img { display: block; width: auto; max-width: 240px; object-fit: contain; }
.site-tag { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main-nav { margin-left: auto; }
.main-nav .menu { display: flex; gap: 30px; list-style: none; }
.main-nav a { display: block; padding: 8px 0; font-size: 15px; color: var(--ink); border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--navy); border-color: var(--gold); }
.main-nav .current > a { color: var(--navy); border-color: var(--gold); }
.nav-toggle { display: none; background: none; border: 0; width: 44px; height: 44px; flex-direction: column; align-items: center; justify-content: center; gap: 6px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); transition: transform .25s ease; }
.nav-toggle.is-active span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }

/* ---------- 轮播 ---------- */
.hero { position: relative; height: 480px; overflow: hidden; background: var(--navy-2); }
.hero-track, .hero-slide { width: 100%; height: 100%; }
.hero-track { display: flex; transition: transform .5s ease; }
.hero-slide { position: relative; flex-shrink: 0; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; }
.hero-slide::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,28,54,.15) 0%, rgba(8,18,36,.65) 100%); }
.hero-caption { position: absolute; left: 0; right: 0; bottom: 56px; z-index: 2; text-align: center; padding: 0 24px; }
.hero-caption h2 { color: #fff; font-size: 34px; font-weight: 700; margin-bottom: 10px; text-shadow: 0 2px 12px rgba(0,0,0,.4); }
.hero-caption p { color: rgba(255,255,255,.9); font-size: 16px; margin-bottom: 20px; }
.hero-btn { display: inline-block; padding: 12px 30px; background: var(--gold); color: #fff; font-size: 14px; letter-spacing: 1px; border-radius: 4px; }
.hero-btn:hover { background: #b88f38; }
.hero-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 48px; height: 48px; border: 0; border-radius: 50%; background: rgba(11,28,54,.45); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.hero-arrow:hover { background: rgba(201,162,75,.85); }
.hero-prev { left: 20px; }
.hero-next { right: 20px; }
.hero-dots { position: absolute; bottom: 22px; left: 0; right: 0; z-index: 3; display: flex; justify-content: center; gap: 10px; }
.hero-dot { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.45); cursor: pointer; }
.hero-dot.is-active { background: var(--gold); }

/* ---------- 统计条 ---------- */
.stat-bar { background: var(--navy); padding: 38px 0; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; text-align: center; }
.stat-item strong { display: block; font-size: 38px; font-weight: 700; color: var(--gold); line-height: 1.2; }
.stat-item span { display: block; margin-top: 6px; font-size: 14px; letter-spacing: 2px; color: #fff; opacity: .85; }

/* ---------- 简介区 ---------- */
.section { padding: 60px 0; }
.intro-section { background: #fff; }
.intro-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.intro-copy h2 { font-size: 28px; color: var(--navy); margin-bottom: 16px; }
.intro-copy p { color: var(--muted); font-size: 16px; line-height: 2; }

/* ---------- 分类入口 ---------- */
.entry-section { padding-bottom: 60px; }
.entry-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.entry-card { position: relative; padding: 40px; background: var(--navy); color: #fff; border-radius: 8px; overflow: hidden; transition: transform .25s ease, box-shadow .25s ease; }
.entry-card:hover { transform: translateY(-6px); box-shadow: 0 16px 34px rgba(18,48,94,.22); }
.entry-card::after { content: ''; position: absolute; right: -60px; top: -60px; width: 180px; height: 180px; border: 2px solid rgba(201,162,75,.35); border-radius: 50%; }
.entry-card h3 { margin: 0 0 10px; font-size: 24px; color: #fff; }
.entry-card p { margin: 0 0 22px; font-size: 15px; opacity: .85; line-height: 1.8; }
.entry-btn { display: inline-block; padding: 10px 26px; border: 1px solid var(--gold); color: var(--gold); font-size: 14px; border-radius: 4px; letter-spacing: 1px; }
.entry-btn:hover { background: var(--gold); color: #fff; }

/* ---------- 文章列表 ---------- */
.list-section { background: #fff; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.section-head h2 { font-size: 24px; color: var(--navy); padding-left: 14px; border-left: 4px solid var(--gold); }
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 22px; transition: box-shadow .2s, transform .25s ease; }
.post-card:hover { box-shadow: 0 10px 26px rgba(18,48,94,.1); transform: translateY(-5px); }
.post-card h2 { margin: 0 0 8px; font-size: 18px; line-height: 1.5; }
.post-card h2 a:hover { color: var(--navy); }
.post-meta { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.post-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.8; }
.pagination { margin-top: 40px; text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pagination a, .pagination .current { display: inline-block; min-width: 38px; padding: 7px 12px; background: #fff; border: 1px solid var(--line); border-radius: 4px; color: var(--ink); font-size: 14px; }
.pagination a:hover { border-color: var(--gold); color: var(--navy); }
.pagination .current { background: var(--navy); border-color: var(--navy); color: #fff; }
.empty-tip { padding: 40px 0; text-align: center; color: var(--muted); }

/* ---------- 归档/内页 ---------- */
.page-wrap { padding: 48px 0 72px; }
.archive-head h1 { margin: 0 0 30px; font-size: 28px; color: var(--navy); padding-left: 14px; border-left: 4px solid var(--gold); }
.entry-wrap { padding: 48px 0 72px; }
.entry { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 40px 44px; }
.entry-head { margin-bottom: 28px; }
.entry-head h1 { margin: 0 0 10px; font-size: 32px; color: var(--navy); line-height: 1.35; }
.entry-meta { font-size: 14px; color: var(--muted); }
.entry-content { font-size: 16px; line-height: 2; }
.entry-content h2, .entry-content h3, .entry-content h4 { color: var(--navy); margin: 1.6em 0 .6em; }
.entry-content img { border-radius: 6px; }
.entry-content a { text-decoration: underline; }
.entry-content blockquote { margin: 24px 0; padding: 16px 24px; border-left: 4px solid var(--gold); background: #f8f9fb; color: var(--muted); }
.entry-content table { border-collapse: collapse; width: 100%; margin: 24px 0; }
.entry-content th, .entry-content td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.entry-copyright { margin-top: 34px; padding: 16px 20px; border: 1px dashed var(--line); border-left: 3px solid var(--gold); border-radius: 4px; background: #f7f8fa; }
.entry-copyright p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.8; }
.entry-nav { display: flex; justify-content: space-between; gap: 20px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; }
.entry-nav a { color: var(--navy); }
.entry-nav a:hover { color: var(--gold); }

/* ---------- 404 ---------- */
.error-wrap { padding: 110px 0 130px; text-align: center; }
.err-code { font-size: 96px; font-weight: 800; color: var(--navy); line-height: 1; margin-bottom: 14px; }
.error-wrap h1 { color: var(--navy); margin: 0 0 10px; }
.error-wrap p { color: var(--muted); margin-bottom: 28px; }

/* ---------- 赞助板块 ---------- */
.donate-section { background: linear-gradient(135deg, #14335f 0%, #0d2347 100%); padding: 44px 0; border-top: 1px solid rgba(201,162,75,.35); }
.donate-inner { display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap; }
.donate-copy h3 { margin: 0 0 8px; font-size: 24px; color: #fff; letter-spacing: .5px; }
.donate-copy p { margin: 0; font-size: 14px; line-height: 1.9; color: rgba(255,255,255,.78); }
.donate-action { display: flex; align-items: center; gap: 18px; }
.donate-qr { width: 110px; height: 110px; padding: 6px; object-fit: contain; background: #fff; border-radius: 6px; }
.donate-btn { display: inline-block; padding: 12px 30px; background: var(--gold); color: #fff; font-size: 15px; letter-spacing: 1px; border-radius: 4px; white-space: nowrap; }
.donate-btn:hover { background: #b88f38; }

/* ---------- 页脚 ---------- */
.site-footer { background: var(--navy-2); color: #c7d0dd; }
.footer-lang { display: flex; align-items: center; gap: 10px; padding: 18px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-lang .fl-label { color: var(--gold); font-size: 13px; letter-spacing: 2px; }
.lang-select { padding: 6px 12px; font-size: 13px; color: #dfe6ef; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.18); border-radius: 4px; outline: none; }
.lang-select option { background: #0d2347; color: #fff; }
.footer-logo { padding: 22px 0 0; }
.footer-logo a { display: inline-block; }
.footer-logo img { display: block; width: auto; max-width: 240px; object-fit: contain; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 40px; padding: 48px 0 40px; }
.footer-custom { padding: 44px 0 36px; }
.footer-custom h2, .footer-custom h3, .footer-custom h4 { margin: 0 0 12px; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.footer-custom p { margin: 0 0 10px; font-size: 14px; line-height: 1.9; color: #9aa7b8; }
.footer-custom a { color: #c7d0dd; }
.footer-custom a:hover { color: var(--gold); }
.footer-custom ul { margin: 0; padding: 0; list-style: none; }
.footer-custom li { margin: 6px 0; font-size: 14px; color: #c7d0dd; }
.fc-col h4 { margin: 0 0 16px; color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.fc-col a { display: block; padding: 5px 0; font-size: 14px; color: #c7d0dd; }
.fc-col a:hover { color: var(--gold); }
.fc-col .fc-brand { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.fc-col p { margin: 0 0 14px; font-size: 14px; line-height: 1.9; color: #9aa7b8; }
.fc-col .fc-text { display: block; padding: 5px 0; font-size: 14px; color: #9aa7b8; }
.footer-links { border-top: 1px solid rgba(255,255,255,.08); padding: 22px 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 20px; }
.footer-links .fl-label { color: var(--gold); font-size: 13px; letter-spacing: 2px; flex-shrink: 0; }
.footer-links a { font-size: 13px; color: #c7d0dd; margin-right: 18px; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0 26px; text-align: center; }
.footer-bottom .copyright { font-size: 13px; color: #8b97a8; }
.footer-extra { border-top: 1px solid rgba(255,255,255,.08); padding: 20px 0 26px; text-align: center; font-size: 13px; color: #8b97a8; }
.footer-extra a { color: #c7d0dd; }
.footer-extra a:hover { color: #fff; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .header-bar { height: 62px; }
  .site-tag { display: none; }
  .nav-toggle { display: flex; margin-left: auto; }
  .main-nav { position: absolute; top: 100%; left: 0; right: 0; z-index: 200; background: #fff; border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: none; box-shadow: 0 16px 30px rgba(11,28,54,.16); }
  .main-nav.is-open { display: block; }
  .main-nav .menu { flex-direction: column; gap: 0; padding: 10px 24px 16px; }
  .main-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .main-nav li:last-child a { border-bottom: 0; }
  .hero { height: 380px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 30px; }
}
@media (max-width: 640px) {
  .hero { height: 320px; }
  .hero-caption h2 { font-size: 24px; }
  .hero-caption p { font-size: 14px; }
  .hero-btn { min-height: 44px; display: inline-flex; align-items: center; }
  .hero-arrow { width: 44px; height: 44px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .stat-item strong { font-size: 30px; }
  .section { padding: 44px 0; }
  .entry-grid { grid-template-columns: 1fr; gap: 16px; }
  .entry-card { padding: 28px 22px; }
  .post-grid { grid-template-columns: 1fr; }
  .entry { padding: 24px 18px; }
  .entry-head h1 { font-size: 26px; }
  .footer-cols { grid-template-columns: 1fr; gap: 26px; padding: 34px 0 28px; }
  .footer-bottom { text-align: center; }
  .entry-nav { flex-direction: column; gap: 8px; }
  .donate-section { padding: 32px 0; }
  .donate-inner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .donate-copy h3 { font-size: 20px; }
  .donate-copy p { font-size: 13px; }
  .donate-action { width: 100%; justify-content: flex-start; }
  .donate-btn { padding: 11px 24px; font-size: 14px; }
  .donate-qr { width: 96px; height: 96px; }
  .footer-lang { padding: 14px 0; }
}
@media (max-width: 400px) {
  .hero { height: 260px; }
  .hero-caption h2 { font-size: 20px; }
  .stat-item strong { font-size: 26px; }
}
