/* ========== XX市实验小学智慧党建平台 全站样式 ========== */
:root {
  --red: #b01f24;
  --red-dark: #8e1518;
  --red-light: #d94a4f;
  --gold: #d4a24e;
  --gold-light: #f3e2bd;
  --bg: #f7f5f2;
  --text: #333;
  --text-light: #777;
  --border: #e5e0d8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; background: var(--bg); color: var(--text); font-size: 15px; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }

.container { width: min(1200px, 92%); margin: 0 auto; }

/* ---------- 顶部 ---------- */
.topbar { background: var(--red-dark); color: #f0dcbc; font-size: 13px; padding: 6px 0; }
.topbar .container { display: flex; justify-content: space-between; }
.topbar a { color: #f0dcbc; }

/* ---------- 页头 ---------- */
.header { background: linear-gradient(135deg, var(--red) 0%, var(--red-dark) 100%); color: #fff; padding: 26px 0; }
.header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.logo { display: flex; align-items: center; gap: 16px; }
.logo-icon { width: 62px; height: 62px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f6d98a, var(--gold)); display: flex; align-items: center; justify-content: center; font-size: 32px; color: var(--red-dark); box-shadow: 0 0 0 4px rgba(255,255,255,.25); }
.logo h1 { font-size: 26px; letter-spacing: 2px; }
.logo p { font-size: 12px; opacity: .85; letter-spacing: 4px; margin-top: 4px; }
.header-right { font-size: 13px; text-align: right; opacity: .9; }
.header-right a { background: var(--gold); color: var(--red-dark); padding: 6px 16px; border-radius: 4px; font-weight: bold; display: inline-block; margin-top: 6px; }

/* ---------- 导航 ---------- */
.nav { background: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
.nav ul { display: flex; flex-wrap: wrap; }
.nav li a { display: block; padding: 15px 26px; font-weight: bold; color: var(--red-dark); border-bottom: 3px solid transparent; transition: .2s; }
.nav li a:hover, .nav li a.active { background: var(--red); color: #fff; border-bottom-color: var(--gold); }

/* ---------- 轮播横幅 ---------- */
.banner { background: linear-gradient(120deg, #9e1b20, #c22a30 55%, #a52025); color: #fff; text-align: center; padding: 58px 20px; position: relative; overflow: hidden; }
.banner::before, .banner::after { content: "★"; position: absolute; font-size: 160px; color: rgba(255,255,255,.06); }
.banner::before { left: 4%; top: -30px; }
.banner::after { right: 4%; bottom: -60px; }
.banner h2 { font-size: 34px; letter-spacing: 6px; text-shadow: 0 2px 6px rgba(0,0,0,.3); }
.banner p { margin-top: 12px; letter-spacing: 2px; opacity: .9; }

/* ---------- 通用板块 ---------- */
.section { padding: 36px 0; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.section-title h3 { font-size: 22px; color: var(--red-dark); padding-left: 14px; border-left: 5px solid var(--gold); }
.section-title .more { font-size: 13px; color: var(--text-light); }
.section-title .more:hover { color: var(--red); }

.card { background: #fff; border-radius: 8px; padding: 22px; box-shadow: 0 2px 10px rgba(0,0,0,.05); border: 1px solid var(--border); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* 首页统计 */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: -30px; position: relative; z-index: 5; }
@media (max-width: 700px) { .stats { grid-template-columns: repeat(2, 1fr); margin-top: 16px; } }
.stat { background: #fff; border-radius: 8px; text-align: center; padding: 18px 10px; box-shadow: 0 4px 14px rgba(0,0,0,.08); border-top: 3px solid var(--gold); }
.stat b { display: block; font-size: 28px; color: var(--red); }
.stat span { font-size: 13px; color: var(--text-light); }

/* 栏目入口 */
.module-card { background: #fff; border-radius: 10px; padding: 28px 22px; text-align: center; border: 1px solid var(--border); transition: .25s; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.module-card:hover { transform: translateY(-6px); box-shadow: 0 10px 22px rgba(176,31,36,.15); border-color: var(--red-light); }
.module-card .icon { font-size: 42px; }
.module-card h4 { color: var(--red-dark); margin: 12px 0 8px; font-size: 17px; }
.module-card p { font-size: 13px; color: var(--text-light); line-height: 1.7; }

/* 新闻列表 */
.news-item { display: flex; justify-content: space-between; gap: 14px; padding: 11px 4px; border-bottom: 1px dashed var(--border); font-size: 14px; }
.news-item:hover a { color: var(--red); }
.news-item .date { color: var(--text-light); font-size: 13px; white-space: nowrap; }
.tag { display: inline-block; background: var(--gold-light); color: var(--red-dark); font-size: 12px; padding: 2px 8px; border-radius: 3px; margin-right: 6px; }

/* ---------- 面包屑 ---------- */
.crumb { background: #fff; border-bottom: 1px solid var(--border); padding: 12px 0; font-size: 13px; color: var(--text-light); }
.crumb a:hover { color: var(--red); }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; background: #fff; font-size: 14px; }
table.list th { background: var(--red); color: #fff; padding: 10px; text-align: left; white-space: nowrap; }
table.list td { padding: 10px; border-bottom: 1px solid var(--border); }
table.list tr:nth-child(even) { background: #fbf9f6; }
table.list tr:hover { background: var(--gold-light); }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-weight: bold; margin-bottom: 6px; color: var(--red-dark); font-size: 14px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--border); border-radius: 5px; font-size: 14px; font-family: inherit; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { outline: none; border-color: var(--red-light); box-shadow: 0 0 0 3px rgba(217,74,79,.12); }
.btn { display: inline-block; background: var(--red); color: #fff; border: none; padding: 10px 26px; border-radius: 5px; font-size: 15px; cursor: pointer; font-family: inherit; transition: .2s; }
.btn:hover { background: var(--red-dark); }
.btn-gold { background: var(--gold); color: var(--red-dark); }
.btn-gold:hover { background: #c08f3d; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-danger { background: #eef; color: var(--red); border: 1px solid var(--red-light); }
.btn-danger:hover { background: var(--red); color: #fff; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filter-bar a, .filter-bar button { font-size: 13px; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-family: inherit; }
.filter-bar a.on, .filter-bar button:hover { background: var(--red); color: #fff; border-color: var(--red); }
.filter-bar input[type=text] { padding: 7px 10px; border: 1px solid var(--border); border-radius: 4px; min-width: 200px; }

/* ---------- 归档 ---------- */
.archive-year { font-size: 18px; color: var(--red-dark); font-weight: bold; margin: 22px 0 10px; }
.archive-month { font-size: 15px; color: var(--gold); font-weight: bold; margin: 14px 0 6px; }

/* ---------- 时间线（活动） ---------- */
.timeline-item { display: flex; gap: 16px; background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 16px; margin-bottom: 14px; }
.timeline-item .date-box { min-width: 74px; text-align: center; background: var(--red); color: #fff; border-radius: 6px; padding: 8px 4px; align-self: flex-start; }
.date-box b { display: block; font-size: 22px; }
.date-box span { font-size: 12px; opacity: .85; }
.timeline-item h4 { color: var(--red-dark); margin-bottom: 6px; }
.timeline-item p { font-size: 13px; color: var(--text-light); line-height: 1.7; }
.photo-thumb { max-height: 110px; border-radius: 6px; margin-top: 8px; }

/* ---------- 学习专区 ---------- */
.topic-card { background: #fff; border-radius: 10px; overflow: hidden; border: 1px solid var(--border); transition: .25s; }
.topic-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(176,31,36,.15); }
.topic-cover { height: 110px; display: flex; align-items: center; justify-content: center; font-size: 40px; color: #fff; }
.topic-card .body { padding: 14px; }
.topic-card h4 { color: var(--red-dark); margin-bottom: 6px; }
.topic-card p { font-size: 13px; color: var(--text-light); line-height: 1.6; }
.hall-card { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: .2s; }
.hall-card:hover { border-color: var(--gold); box-shadow: 0 6px 16px rgba(0,0,0,.08); }
.hall-cover { height: 130px; display: flex; align-items: center; justify-content: center; font-size: 44px; }
.hall-card .body { padding: 12px 14px; }
.hall-card h4 { font-size: 15px; color: var(--text); }
.hall-card .loc { font-size: 12px; color: var(--text-light); margin: 4px 0; }
.audio-btn { font-size: 12px; background: var(--gold-light); color: var(--red-dark); border-radius: 12px; padding: 3px 10px; display: inline-block; }

/* ---------- 考试 ---------- */
.exam-q { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.exam-q .q-title { font-weight: bold; margin-bottom: 12px; line-height: 1.6; }
.exam-q .q-title .qtype { font-size: 12px; background: var(--red); color: #fff; padding: 2px 8px; border-radius: 3px; margin-right: 8px; font-weight: normal; }
.opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 5px; margin-bottom: 8px; cursor: pointer; transition: .15s; }
.opt:hover { border-color: var(--red-light); background: #fdf6f6; }
.score-board { text-align: center; padding: 36px 20px; }
.score-board .big { font-size: 56px; color: var(--red); font-weight: bold; }
.result-item { padding: 10px; border-bottom: 1px dashed var(--border); font-size: 14px; }
.result-item .ok { color: #2e7d32; }
.result-item .no { color: var(--red); }

/* ---------- 风采卡片 ---------- */
.star-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 22px; text-align: center; }
.avatar { width: 84px; height: 84px; border-radius: 50%; margin: 0 auto 12px; background: linear-gradient(135deg, var(--red), var(--red-light)); color: #fff; font-size: 34px; display: flex; align-items: center; justify-content: center; }
.star-card h4 { color: var(--red-dark); font-size: 17px; }
.star-card .title { color: var(--gold); font-size: 13px; margin: 6px 0 10px; }
.star-card p { font-size: 13px; color: var(--text-light); line-height: 1.8; text-align: left; }

/* ---------- 文库 ---------- */
.doc-item { display: flex; justify-content: space-between; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 13px 16px; margin-bottom: 10px; }
.doc-item .ico { font-size: 22px; margin-right: 12px; }
.doc-item .info { flex: 1; }
.doc-item .info h4 { font-size: 15px; }
.doc-item .info span { font-size: 12px; color: var(--text-light); }
.doc-item .ops a { font-size: 13px; color: var(--red); margin-left: 12px; }

/* ---------- 后台 ---------- */
.admin-wrap { display: flex; gap: 20px; padding: 24px 0; }
.admin-side { width: 210px; background: #fff; border-radius: 8px; border: 1px solid var(--border); padding: 14px 0; height: fit-content; }
.admin-side a { display: block; padding: 11px 20px; font-size: 14px; color: var(--text); border-left: 3px solid transparent; }
.admin-side a:hover, .admin-side a.active { background: #fdf6f6; color: var(--red); border-left-color: var(--red); font-weight: bold; }
.admin-main { flex: 1; min-width: 0; }
.admin-panel { background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 22px; margin-bottom: 20px; }
.admin-panel h3 { color: var(--red-dark); margin-bottom: 16px; font-size: 17px; }
@media (max-width: 800px) { .admin-wrap { flex-direction: column; } .admin-side { width: 100%; } }

/* ---------- 提示 ---------- */
.flash { background: #e8f5e9; border: 1px solid #a5d6a7; color: #2e7d32; padding: 10px 16px; border-radius: 5px; margin: 14px 0; font-size: 14px; }

/* ---------- 页脚 ---------- */
.footer { background: var(--red-dark); color: #e8d5b5; text-align: center; padding: 26px 16px; font-size: 13px; line-height: 2; margin-top: 30px; }
.footer a { color: var(--gold); }

/* ---------- 详情页 ---------- */
.detail-head { text-align: center; padding: 26px 0 18px; border-bottom: 2px solid var(--gold); margin-bottom: 22px; }
.detail-head h2 { color: var(--red-dark); font-size: 24px; margin-bottom: 10px; }
.detail-head .meta { font-size: 13px; color: var(--text-light); }
.detail-body { line-height: 2; font-size: 15px; white-space: pre-wrap; }
