/* 网络安全科普宣传网站 全局样式 */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #1565c0;
  --primary-dark: #0d47a1;
  --accent: #00bfa5;
  --warn: #e53935;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #263238;
  --muted: #607d8b;
  --radius: 12px;
  --shadow: 0 4px 16px rgba(21, 101, 192, .08);
}
html { scroll-behavior: smooth; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* 顶部导航 */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary));
  box-shadow: 0 2px 10px rgba(0,0,0,.15);
}
.navbar-inner {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.logo { display: flex; align-items: center; gap: 10px; color: #fff; font-size: 20px; font-weight: 700; }
.logo svg { width: 34px; height: 34px; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a {
  color: rgba(255,255,255,.85); padding: 8px 16px; border-radius: 8px;
  font-size: 15px; transition: all .25s;
}
.nav-links a:hover { background: rgba(255,255,255,.15); color: #fff; }
.nav-links a.active { background: #fff; color: var(--primary-dark); font-weight: 600; }
.menu-toggle { display: none; background: none; border: none; color: #fff; font-size: 26px; cursor: pointer; }

/* 页首横幅 */
.hero {
  background: linear-gradient(135deg, #0d47a1 0%, #1565c0 55%, #00bfa5 130%);
  color: #fff; padding: 88px 20px 96px; text-align: center; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.12), transparent 40%),
              radial-gradient(circle at 15% 85%, rgba(0,191,165,.25), transparent 45%);
}
.hero h1 { font-size: 42px; letter-spacing: 2px; position: relative; }
.hero p { font-size: 18px; opacity: .92; margin: 18px auto 30px; max-width: 720px; position: relative; }
.btn {
  display: inline-block; padding: 12px 34px; border-radius: 30px; font-size: 16px;
  background: #fff; color: var(--primary-dark); font-weight: 600; transition: all .25s; position: relative;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.2); }
.btn-outline { background: transparent; color: #fff; border: 2px solid #fff; margin-left: 12px; }

/* 页面小横幅（子页面） */
.page-banner {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff; padding: 56px 20px; text-align: center;
}
.page-banner h1 { font-size: 32px; letter-spacing: 2px; }
.page-banner p { opacity: .9; margin-top: 10px; }

/* 主体容器 */
.container { max-width: 1180px; margin: 0 auto; padding: 48px 20px; }
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { font-size: 28px; color: var(--primary-dark); }
.section-title h2::after {
  content: ""; display: block; width: 56px; height: 4px; border-radius: 2px;
  background: var(--accent); margin: 12px auto 0;
}
.section-title p { color: var(--muted); margin-top: 10px; }

/* 卡片网格 */
.grid { display: grid; gap: 24px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  background: var(--card); border-radius: var(--radius); padding: 28px;
  box-shadow: var(--shadow); transition: transform .25s, box-shadow .25s;
}
.card:hover { transform: translateY(-6px); box-shadow: 0 12px 28px rgba(21,101,192,.16); }
.card .icon {
  width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--accent)); margin-bottom: 16px;
}
.card .icon svg { width: 30px; height: 30px; }
.card h3 { font-size: 19px; color: var(--primary-dark); margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 14.5px; }

/* 数据统计条 */
.stats { background: var(--primary-dark); color: #fff; padding: 44px 20px; }
.stats-inner { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; text-align: center; }
.stats .num { font-size: 38px; font-weight: 700; color: var(--accent); }
.stats .label { font-size: 14px; opacity: .85; margin-top: 4px; }

/* 列表/文章 */
.article-card { display: flex; gap: 20px; align-items: flex-start; }
.article-card .badge {
  flex: 0 0 86px; text-align: center; background: #e3f2fd; color: var(--primary-dark);
  border-radius: 10px; padding: 10px 6px; font-weight: 700;
}
.article-card .badge small { display: block; font-weight: 400; color: var(--muted); }
.tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 20px; background: #e0f2f1; color: #00796b; margin-right: 6px; }
.tag.red { background: #ffebee; color: var(--warn); }
.tag.blue { background: #e3f2fd; color: var(--primary-dark); }

/* 步骤/要点列表 */
.tip-list { list-style: none; }
.tip-list li { padding: 10px 0 10px 34px; position: relative; border-bottom: 1px dashed #dfe7ee; }
.tip-list li::before {
  content: "✓"; position: absolute; left: 4px; top: 10px; width: 22px; height: 22px;
  background: var(--accent); color: #fff; border-radius: 50%; font-size: 13px;
  display: flex; align-items: center; justify-content: center;
}

/* 测验 */
.quiz-box { max-width: 820px; margin: 0 auto; }
.question {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 30px; margin-bottom: 22px;
}
.question h3 { font-size: 17px; margin-bottom: 14px; color: var(--text); }
.question h3 .qno { color: var(--primary); margin-right: 6px; }
.options label {
  display: block; padding: 12px 16px; border: 1.5px solid #e0e7ef; border-radius: 10px;
  margin-bottom: 10px; cursor: pointer; transition: all .2s; font-size: 15px;
}
.options label:hover { border-color: var(--primary); background: #f5f9ff; }
.options input { margin-right: 10px; accent-color: var(--primary); }
.options label.correct { border-color: #43a047; background: #e8f5e9; }
.options label.wrong { border-color: var(--warn); background: #ffebee; }
.quiz-submit { text-align: center; margin: 30px 0; }
.quiz-submit button {
  padding: 14px 52px; font-size: 17px; border: none; border-radius: 30px; cursor: pointer;
  background: linear-gradient(90deg, var(--primary), var(--accent)); color: #fff; font-weight: 600;
}
.quiz-result {
  display: none; text-align: center; background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 36px; margin-top: 10px;
}
.quiz-result .score { font-size: 52px; font-weight: 800; color: var(--primary); }
.quiz-result .level { font-size: 20px; margin: 8px 0 14px; color: var(--accent); font-weight: 700; }

/* 时间线（案例） */
.timeline { position: relative; padding-left: 34px; }
.timeline::before { content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px; width: 3px; background: #bbdefb; border-radius: 2px; }
.timeline-item { position: relative; margin-bottom: 26px; }
.timeline-item::before {
  content: ""; position: absolute; left: -32px; top: 6px; width: 15px; height: 15px;
  border-radius: 50%; background: var(--primary); border: 3px solid #e3f2fd;
}
.timeline-item h4 { color: var(--primary-dark); font-size: 17px; }

/* 页脚 */
.footer { background: #102a43; color: rgba(255,255,255,.75); padding: 40px 20px 24px; margin-top: 40px; }
.footer-inner { max-width: 1180px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; }
.footer h4 { color: #fff; margin-bottom: 14px; font-size: 16px; }
.footer ul { list-style: none; font-size: 14px; }
.footer li { margin-bottom: 8px; }
.footer a:hover { color: var(--accent); }
.copyright { text-align: center; margin-top: 30px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.12); font-size: 13px; opacity: .6; }

/* 响应式 */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .stats-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 30px; }
  .nav-links {
    display: none; position: absolute; top: 64px; right: 0; left: 0;
    background: var(--primary-dark); flex-direction: column; padding: 12px;
  }
  .nav-links.open { display: flex; }
  .menu-toggle { display: block; }
  .article-card { flex-direction: column; }
}
