/* ============ 前台公共样式（手机/桌面自适应） ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; border: 0; }
ul, ol { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 顶部欢迎条 ---------- */
.topbar { background: var(--primary-dark); color: #cfe3f5; font-size: 12.5px; }
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 32px; }
.topbar a:hover { color: #fff; }
.topbar .links a { margin-left: 14px; }

/* ---------- 页头 ---------- */
.masthead { background: #fff; position: relative; overflow: hidden; box-shadow: 0 1px 0 var(--border); }
.masthead .container { display: flex; align-items: center; gap: 16px; padding: 20px 16px; position: relative; }
.masthead .logo { width: 66px; height: 66px; flex: none; }
.masthead .site-title {
  font-size: 34px; font-weight: 800; letter-spacing: 2px;
  background: linear-gradient(90deg, var(--primary-dark), var(--primary-light));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.masthead .site-slogan { font-size: 13px; color: var(--text-light); letter-spacing: 4px; margin-top: 2px; }
.masthead .mast-side { margin-left: auto; display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: 300px; }
.masthead .mast-side .searchbox { margin-left: 0; width: 100%; }
.masthead .mast-side .searchbox input { flex: 1; width: auto; }
.masthead .hotline {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 8px;
  width: 100%; min-height: 36px; padding: 2px 12px; border-radius: 6px; background: var(--page-bg);
  font-size: 18px; font-weight: 800; letter-spacing: 1px; font-variant-numeric: tabular-nums; color: var(--primary-dark);
}
.masthead .hotline .ico { font-size: 1.05em; line-height: 1; }
.masthead .searchbox { margin-left: auto; display: flex; border: 2px solid var(--primary); border-radius: 6px; overflow: hidden; }
.masthead .searchbox input { border: 0; outline: 0; padding: 8px 12px; width: 220px; font-size: 13px; }
.masthead .searchbox button { background: var(--primary); color: #fff; border: 0; padding: 0 18px; cursor: pointer; font-size: 14px; }
.masthead .searchbox button:hover { background: var(--primary-dark); }

/* ---------- 目录栏（导航） ---------- */
.mainnav { background: linear-gradient(90deg, var(--nav-from), var(--nav-to)); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.mainnav > .container { display: flex; }
.mainnav .menu { display: flex; flex: 1; }
.mainnav .menu > li { position: relative; }
.mainnav .menu > li > a {
  display: block; color: #fff; font-size: 16px; font-weight: 500;
  padding: 0 26px; line-height: 48px; transition: background .2s;
}
.mainnav .menu > li > a:hover, .mainnav .menu > li.active > a { background: rgba(0,0,0,.18); }
.mainnav .menu > li.has-sub > a::after { content: " ▾"; font-size: 12px; opacity: .8; }
.mainnav .submenu {
  display: none; position: absolute; left: 0; top: 48px; min-width: 170px;
  background: #fff; border-radius: 0 0 8px 8px; box-shadow: 0 10px 26px rgba(0,0,0,.18);
  overflow: hidden; z-index: 99;
}
.mainnav .menu > li:hover .submenu { display: block; animation: fadeIn .18s ease; }
.mainnav .submenu a { display: block; padding: 10px 20px; font-size: 14px; color: var(--text); border-bottom: 1px solid var(--border); }
.mainnav .submenu a:hover { background: var(--page-bg); color: var(--primary); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.nav-toggle { display: none; color: #fff; background: none; border: 0; font-size: 22px; padding: 10px 16px; cursor: pointer; }

/* ---------- 滚动公告条 ---------- */
.ticker { background: #fff; border-bottom: 1px solid var(--border); }
.ticker .container { display: flex; align-items: center; height: 40px; gap: 10px; }
.ticker .tag { background: #c0392b; color: #fff; font-size: 12px; padding: 2px 10px; border-radius: 20px; flex: none; }
.ticker .roll { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker .roll a { display: inline-block; padding-left: 100%; color: var(--text); font-size: 14px; animation: roll 22s linear infinite; }
.ticker .roll a:hover { color: var(--primary); text-decoration: underline; }
@keyframes roll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ---------- 首页小窗口网格 ---------- */
.widgets { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-flow: row dense; gap: 14px; padding: 16px 0 8px; }
.widget { background: var(--card-bg); border-radius: 8px; overflow: hidden; box-shadow: 0 1px 4px rgba(16,42,67,.08); display: flex; flex-direction: column; background-size: cover; background-position: center; min-width: 0; }
.widget.w1 { grid-column: span 1; } .widget.w2 { grid-column: span 2; }
.widget.w3 { grid-column: span 3; } .widget.w4 { grid-column: span 4; }
.widget.h1 .w-body { min-height: 300px; } .widget.h2 .w-body { min-height: 460px; } .widget.h3 .w-body { min-height: 620px; }

.w-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 6px 0 14px; line-height: 44px; color: #fff; flex: none;
  background: linear-gradient(90deg, var(--titlebar-from, var(--primary)), var(--titlebar-to, var(--primary-light)));
}
.w-head h3 { font-size: 16.5px; font-weight: 700; letter-spacing: 1px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.w-head h3::before { content: ""; width: 4px; height: 16px; background: rgba(255,255,255,.85); border-radius: 2px; flex: none; }
.w-head .more { color: rgba(255,255,255,.92); font-size: 13px; margin-right: 6px; }
.w-head .more:hover { text-decoration: underline; }
.w-head.title-img { background-size: cover !important; background-position: center !important; text-shadow: 0 1px 3px rgba(0,0,0,.55); }
/* 浅色标题栏：自动切换深色文字保证可读 */
.w-head.light-head { color: #1a2430; }
.w-head.light-head h3 { color: #1a2430; text-shadow: none; }
.w-head.light-head .more { color: rgba(0,0,0,.62); }
.w-head.light-head h3::before { background: rgba(0,0,0,.5); }
.w-body { overflow: hidden; padding: 8px 14px; display: flex; flex-direction: column; flex: 1; }

/* 文章列表型窗口 */
.w-list { flex: 1; overflow: hidden; }
.w-list li { display: flex; align-items: center; gap: 8px; padding: 7px 2px; border-bottom: 1px dashed var(--border); }
.w-list li:last-child { border-bottom: 0; }
.w-list li .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--primary-light); flex: none; }
.w-list li a { flex: 1; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text); }
.w-list li a:hover { color: var(--primary); }
.w-list li .date { color: #9aa7b4; font-size: 12px; flex: none; }
.w-list li.top a::before { content: "置顶 "; color: #c0392b; font-size: 12px; }

/* 图文窗口 */
.w-images { flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding-top: 6px; overflow: hidden; }
.w-images a { position: relative; border-radius: 6px; overflow: hidden; background: var(--page-bg); }
.w-images img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 4/3; transition: transform .35s; display: block; }
.w-images a:hover img { transform: scale(1.06); }
.w-images .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 8px 5px;
  background: linear-gradient(transparent, rgba(0,0,0,.72)); color: #fff; font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 轮播窗口 */
.w-carousel { position: relative; flex: 1; overflow: hidden; }
.w-carousel .slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s; }
.w-carousel .slide.on { opacity: 1; }
.w-carousel img { width: 100%; height: 100%; object-fit: cover; }
.w-carousel .slide .cap {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 90px 10px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,.7)); color: #fff; font-size: 15px; font-weight: 500;
}
.w-carousel .dots { position: absolute; right: 12px; bottom: 10px; display: flex; gap: 6px; z-index: 2; }
.w-carousel .dots i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; }
.w-carousel .dots i.on { background: #fff; }

/* 办理进度窗口 */
.w-progress { flex: 1; overflow: hidden; }
.w-progress li { display: flex; align-items: center; gap: 8px; padding: 6.5px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.w-progress li:last-child { border-bottom: 0; }
.w-progress .who { color: var(--text-light); flex: none; }
.w-progress .what { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { flex: none; font-size: 12px; padding: 1px 9px; border-radius: 20px; color: #fff; }
.badge.pending { background: var(--badge-wait); }
.badge.processing { background: var(--badge-doing); }
.badge.done { background: var(--badge-done); }

/* 自定义HTML窗口 */
.w-custom { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; }

/* ---------- 友情链接 ---------- */
friendlinks { display: block; }
.flink { background: #fff; border-radius: 8px; margin-top: 10px; padding: 14px 18px; box-shadow: 0 1px 4px rgba(16,42,67,.08); }
.flink h4 { font-size: 15px; color: var(--primary); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.flink h4::before { content: "🔗"; font-size: 13px; }
.flink .links { display: flex; flex-wrap: wrap; gap: 10px; }
.flink .links a { font-size: 13.5px; color: var(--text-light); background: var(--page-bg); padding: 4px 14px; border-radius: 20px; transition: all .2s; }
.flink .links a:hover { background: var(--primary); color: #fff; }

/* ---------- 页脚 ---------- */
footer { background: linear-gradient(180deg, var(--primary-dark), #0a2540); color: #c9d9ea; margin-top: 20px; padding: 30px 0 0; }
[data-theme="national"] footer, [data-theme="newyear"] footer { background: linear-gradient(180deg, var(--primary-dark), #4a0d12); }
[data-theme="mourning"] footer { background: #1c1c1c; }
footer .cols { display: grid; grid-template-columns: 1.4fr 1fr 1.2fr; gap: 26px; padding-bottom: 22px; }
footer h5 { color: #fff; font-size: 15px; margin-bottom: 10px; }
footer p, footer li { font-size: 13px; line-height: 2; color: #b7c9dc; }
footer .icp { border-top: 1px solid rgba(255,255,255,.14); text-align: center; padding: 12px 0; font-size: 12.5px; color: #9db3c8; }

/* ============ 列表页 ============ */
.page-banner { background: linear-gradient(90deg, var(--primary-dark), var(--primary-light)); color: #fff; padding: 34px 0; }
.page-banner h1 { font-size: 26px; letter-spacing: 2px; }
.page-banner p { font-size: 13px; opacity: .85; margin-top: 4px; }
.crumb { font-size: 13px; color: var(--text-light); padding: 14px 0 4px; }
.crumb a:hover { color: var(--primary); }
.list-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 10px 0 24px; align-items: start; }
.list-wrap > *, .article-wrap > * { min-width: 0; }
.article-list { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(16,42,67,.08); overflow: hidden; }
.article-list li { border-bottom: 1px solid var(--border); }
.article-list li:last-child { border-bottom: 0; }
.article-list .item { display: flex; align-items: center; gap: 10px; padding: 13px 18px; transition: background .15s; }
.article-list .item:hover { background: var(--page-bg); }
.article-list .item .t { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-list .item:hover .t { color: var(--primary); }
.article-list .item .d { color: #9aa7b4; font-size: 13px; flex: none; }
.article-list .item.top .t::before { content: "[置顶] "; color: #c0392b; }
.pager { display: flex; justify-content: center; gap: 8px; padding: 18px 0; }
.pager button { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 14px; cursor: pointer; font-size: 13px; }
.pager button:disabled { opacity: .45; cursor: default; }
.pager button:not(:disabled):hover { border-color: var(--primary); color: var(--primary); }
.pager .pg { border: 1px solid var(--border); background: #fff; border-radius: 6px; padding: 6px 14px; font-size: 13px; color: var(--text); }
.pager .pg:hover { border-color: var(--primary); color: var(--primary); }
.pager .pg.off { opacity: .45; }
.pager .pgcur { padding: 6px 4px; font-size: 13px; color: var(--text-light); }

/* ---------- 栏目分类 ---------- */
.list-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 2px 10px; font-size: 13px; }
.list-tools .hint { color: var(--text-light); }
.cat-toggle { color: var(--primary); font-weight: 700; }
.cat-toggle:hover { color: var(--primary-dark); text-decoration: underline; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.cat-card { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(16,42,67,.08); overflow: hidden; }
.cat-card h4 {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; color: #fff; font-size: 15px; letter-spacing: 1px;
  background: linear-gradient(90deg, var(--titlebar-from), var(--titlebar-to));
}
.cat-card h4 em { font-style: normal; font-size: 12px; font-weight: 400; opacity: .85; }
.cat-card .article-list { box-shadow: none; border-radius: 0; }
.cat-card .article-list .item { padding: 11px 16px; }
.cat-card .article-list .item .t { font-size: 14px; }
.cat-card .article-list .empty { padding: 30px 0; }
.cat-card .pager { padding: 10px 0 12px; }
.sidebar .box { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(16,42,67,.08); margin-bottom: 16px; overflow: hidden; }
.sidebar .box h4 { font-size: 15px; color: #fff; padding: 0 14px; line-height: 42px; background: linear-gradient(90deg, var(--primary), var(--primary-light)); }
.sidebar .box ul { padding: 8px 14px; }
.sidebar .box li a { display: block; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar .box li:last-child a { border-bottom: 0; }
.sidebar .box li a:hover { color: var(--primary); }

/* ============ 文章页 ============ */
.article-wrap { display: grid; grid-template-columns: 1fr 300px; gap: 16px; padding: 10px 0 24px; align-items: start; }
.article-main { background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(16,42,67,.08); padding: 30px 36px; min-width: 0; }
.article-main h1 { font-size: 25px; line-height: 1.5; margin-bottom: 10px; }
.article-meta { color: #8a98a6; font-size: 13px; padding-bottom: 14px; border-bottom: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 16px; }
.article-extract { background: var(--page-bg); border-left: 4px solid var(--primary); border-radius: 6px; padding: 14px 18px; margin: 16px 0; font-size: 14px; }
.article-extract h4 { font-size: 14px; color: var(--primary); margin-bottom: 6px; }
.article-extract p { line-height: 2; }
.article-content { padding-top: 8px; font-size: 16px; line-height: 1.9; overflow-wrap: break-word; }
.article-content img, .article-content video { max-width: 100%; height: auto; border-radius: 6px; margin: 8px 0; }
.article-content table { border-collapse: collapse; margin: 12px 0; }
.article-content table td, .article-content table th { border: 1px solid var(--border); padding: 8px 12px; font-size: 14.5px; }
.article-content h3 { margin: 14px 0 8px; }
.article-nav { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--border); margin-top: 24px; padding-top: 14px; font-size: 14px; }
.article-nav > span { min-width: 0; }
.article-nav > span:last-child { flex: none; }
.article-nav a { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.article-nav a:hover { color: var(--primary); }

/* ============ 反馈页 ============ */
.fb-wrap { max-width: 860px; margin: 0 auto; padding: 10px 0 30px; }
.fb-types { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.fb-types button {
  flex: 1; min-width: 130px; border: 2px solid var(--border); background: #fff; border-radius: 10px;
  padding: 14px 8px; cursor: pointer; font-size: 16px; transition: all .15s;
}
.fb-types button .ico { display: block; font-size: 26px; margin-bottom: 4px; }
.fb-types button.on { border-color: var(--primary); background: var(--primary); color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(15,95,168,.35); }
.fb-form { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(16,42,67,.08); padding: 26px 30px; }
.fb-form .row { display: flex; gap: 14px; margin-bottom: 14px; }
.fb-form .field { flex: 1; }
.fb-form label { display: block; font-size: 13.5px; color: var(--text-light); margin-bottom: 5px; }
.fb-form label b { color: #c0392b; }
.fb-form input, .fb-form select, .fb-form textarea {
  width: 100%; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-size: 14px;
  font-family: inherit; outline: none; transition: border .15s;
}
.fb-form input:focus, .fb-form textarea:focus, .fb-form select:focus { border-color: var(--primary); }
.fb-form textarea { min-height: 130px; resize: vertical; }
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--primary-light)); color: #fff; border: 0;
  border-radius: 6px; padding: 11px 34px; font-size: 15px; cursor: pointer; letter-spacing: 2px;
}
.btn-primary:hover { opacity: .92; }
.fb-result { background: #fff; border-radius: 10px; padding: 30px; text-align: center; box-shadow: 0 1px 4px rgba(16,42,67,.08); }
.fb-result .code { font-size: 30px; font-weight: 800; color: var(--primary); letter-spacing: 2px; margin: 10px 0; }
.fb-steps { text-align: left; margin: 18px auto; max-width: 560px; }
.fb-steps li { position: relative; padding: 0 0 18px 26px; border-left: 2px solid var(--border); margin-left: 8px; }
.fb-steps li::before { content: ""; position: absolute; left: -7px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--border); }
.fb-steps li.ok::before { background: var(--badge-done); }
.fb-steps li.doing::before { background: var(--badge-doing); animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(37,99,235,.15); } }
.fb-steps .t { font-size: 13px; color: #9aa7b4; }
.fb-steps .n { font-size: 14.5px; }
.querybox { background: #fff; border-radius: 10px; padding: 22px 26px; margin-top: 16px; box-shadow: 0 1px 4px rgba(16,42,67,.08); }
.querybox .qrow { display: flex; gap: 10px; }
.querybox input { flex: 1; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; font-size: 14px; }

/* ---------- 空状态 / 加载 ---------- */
.empty { text-align: center; color: #9aa7b4; padding: 40px 0; font-size: 14px; }

/* ============ 响应式 ============ */
@media (max-width: 1020px) {
  .widgets { grid-template-columns: repeat(2, 1fr); }
  .widget.w3 { grid-column: span 2; } .widget.w4 { grid-column: span 2; }
  .list-wrap, .article-wrap { grid-template-columns: 1fr; }
  .masthead .mascot, [data-theme="national"] .masthead::after, [data-theme="newyear"] .masthead::after { display: none; }
}
@media (max-width: 768px) {
  .cat-grid { grid-template-columns: 1fr; }
  .topbar .container { justify-content: flex-end; }
  .topbar .container > span:first-child { display: none; }
  .topbar .links a { display: inline-block; line-height: 32px; margin-left: 16px; white-space: nowrap; }
  .masthead .container { flex-wrap: wrap; padding: 14px 16px; }
  .masthead .container > div { min-width: 0; }
  .masthead .site-title { font-size: 19px; letter-spacing: 1px; }
  .masthead .site-slogan { font-size: 12px; letter-spacing: 2px; }
  .masthead .logo { width: 48px; height: 48px; }
  .masthead .mast-side { width: 100%; margin: 10px 0 0; gap: 8px; }
  .masthead .searchbox { width: 100%; margin: 0; }
  .masthead .searchbox input { flex: 1; width: auto; }
  .nav-toggle { display: block; }
  .mainnav > .container { flex-direction: column; }
  .mainnav .menu { display: none; flex-direction: column; }
  .mainnav .menu.open { display: flex; }
  .mainnav .menu > li > a { padding: 0 20px; }
  .mainnav .submenu { display: block; position: static; box-shadow: none; border-radius: 0; background: rgba(0,0,0,.12); }
  .mainnav .submenu a { color: #e8f1fa; border-bottom-color: rgba(255,255,255,.12); }
  .widgets { grid-template-columns: 1fr; }
  .widget.w2, .widget.w3, .widget.w4 { grid-column: span 1; }
  .widget.h1 .w-body, .widget.h2 .w-body, .widget.h3 .w-body { flex: none; height: 320px; min-height: 0; }
  .w-list li { padding: 0 2px; }
  .w-list li a { padding: 9px 0; }
  .sidebar .box li a { padding: 10px 0; }
  .pager button { padding: 9px 16px; }
  .article-main { padding: 20px 18px; }
  .article-main h1 { font-size: 20px; }
  .article-content table { display: block; max-width: 100%; overflow-x: auto; }
  .fb-form .row { flex-direction: column; gap: 0; }
  footer .cols { grid-template-columns: 1fr; gap: 8px; }
  .flink .links a { font-size: 12.5px; }
}
