:root {
  --primary: #a51c1c;
  --primary-dark: #7d1414;
  --bg: #f5f4f2;
  --card: #ffffff;
  --text: #2b2b2b;
  --muted: #8a8a8a;
  --line: #e6e3de;
  --central: #c0392b;
  --provincial: #2471a3;
  --city: #1e8449;
  --other: #7f8c8d;
  --danger: #d63031;
  --warn: #e67e22;
  --ok: #1e8449;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,.07);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 3px solid var(--primary); position: sticky; top: 0; z-index: 50; }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 24px; padding: 10px 16px; }
.brand { display: flex; flex-direction: column; }
.brand-mark { font-size: 20px; font-weight: 700; color: var(--primary); letter-spacing: 2px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { padding: 6px 14px; border-radius: 6px; font-size: 14px; color: #555; }
.nav a.active, .nav a:hover { background: #f7eaea; color: var(--primary); }
.bell { position: relative; cursor: pointer; padding: 6px; }
.bell-icon { font-size: 18px; }
.bell-badge { position: absolute; top: -2px; right: -4px; background: var(--danger); color: #fff; font-size: 10px; border-radius: 8px; padding: 0 5px; min-width: 16px; text-align: center; }
.bell-drop { position: absolute; right: 0; top: 34px; width: 340px; max-height: 420px; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(0,0,0,.12); padding: 8px; }
.bell-item { padding: 8px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; border-radius: 6px; }
.bell-item:hover { background: #faf6f6; }
.bell-item .t { font-weight: 600; }
.bell-item .m { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.bell-head { display: flex; justify-content: space-between; padding: 4px 8px 8px; font-size: 12px; color: var(--muted); }

main { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 32px; border-top: 1px solid var(--line); background: #fff; }

/* 通用 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 14px; }
.muted { color: var(--muted); font-size: 12px; }
.btn { border: 1px solid var(--line); background: #fff; border-radius: 6px; padding: 7px 14px; font-size: 13px; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
input[type=text], input[type=number], input[type=date], select {
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font-size: 13px; background: #fff; font-family: inherit;
}
input:focus, select:focus { outline: 2px solid #e8c9c9; border-color: var(--primary); }

/* 徽章 */
.badge { display: inline-flex; align-items: center; border-radius: 4px; font-size: 11px; padding: 1px 7px; color: #fff; white-space: nowrap; }
.badge.central { background: var(--central); }
.badge.provincial { background: var(--provincial); }
.badge.city { background: var(--city); }
.badge.other { background: var(--other); }
.tag { display: inline-block; border: 1px solid var(--line); border-radius: 4px; font-size: 11px; padding: 1px 6px; color: #666; background: #fafafa; white-space: nowrap; }
.tag-new { background: #fdeeee; color: var(--primary); border-color: #f2c8c8; }
.tag-closing { background: #fdf3e7; color: var(--warn); border-color: #f5dcc0; }
.tag-closed { background: #f0f0f0; color: #999; border-color: #ddd; }

/* 截止倒计时 pill */
.deadline-pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 14px; font-size: 12px; font-weight: 600; padding: 2px 10px; white-space: nowrap; }
.dl-urgent { background: #fdecec; color: var(--danger); animation: pulse 1.6s infinite; }
.dl-soon { background: #fdf3e7; color: var(--warn); }
.dl-far { background: #eef3f7; color: var(--provincial); }
.dl-none { background: #f2f2f2; color: #999; }
.dl-closed { background: #efefef; color: #aaa; text-decoration: line-through; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }

/* 首页 */
.hero { background: linear-gradient(135deg, var(--primary), var(--primary-dark)); color: #fff; border-radius: var(--radius); padding: 30px 24px; margin-bottom: 18px; }
.hero h1 { font-size: 24px; margin-bottom: 6px; }
.hero p { font-size: 13px; opacity: .85; }
.hero-search { display: flex; gap: 8px; margin-top: 16px; }
.hero-search input { flex: 1; padding: 10px 14px; font-size: 14px; border: none; }
.home-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; margin-top: 16px; }
.area-group { margin-bottom: 10px; }
.area-name { font-size: 12px; color: var(--muted); margin: 6px 0 4px; }
.prov-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.prov-chip { border: 1px solid var(--line); background: #fff; border-radius: 14px; padding: 2px 12px; font-size: 12px; cursor: pointer; }
.prov-chip:hover { border-color: var(--primary); color: var(--primary); }
.mini-list { list-style: none; }
.mini-list li { padding: 8px 2px; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: 8px; cursor: pointer; font-size: 13px; }
.mini-list li:hover .t { color: var(--primary); }
.mini-list .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.industry-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.industry-card { border: 1px solid var(--line); background: #fff; border-radius: var(--radius); padding: 14px; cursor: pointer; text-align: center; }
.industry-card:hover { border-color: var(--primary); }
.industry-card .n { font-weight: 700; font-size: 14px; }
.industry-card .c { color: var(--muted); font-size: 12px; }

/* 列表页 */
/* 筛选条件：页面顶部横向面板 */
#filter-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 14px; align-items: end; }
#filter-form .filter-row:first-child { grid-column: span 2; }
.filters h3 { font-size: 14px; margin-bottom: 10px; }
.filter-row { margin-bottom: 0; }
.filter-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.filter-row select, .filter-row input { width: 100%; }
.filter-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; }
.check-row { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 10px; flex-wrap: wrap; }
.ann-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; display: flex; gap: 14px; box-shadow: var(--shadow); }
.ann-card.closed { opacity: .55; }
.ann-card:hover { border-color: #d8bcbc; }
.ann-main { flex: 1; min-width: 0; cursor: pointer; }
.ann-title { font-size: 15px; font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ann-title .txt:hover { color: var(--primary); }
.ann-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: #666; }
.ann-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; justify-content: center; min-width: 96px; }
.fav-btn { background: none; border: none; font-size: 16px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pager button { min-width: 32px; }
.pager button.cur { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 详情抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 90; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 94vw); background: #fff; z-index: 95; overflow-y: auto; padding: 24px; box-shadow: -6px 0 24px rgba(0,0,0,.12); }
.drawer h2 { font-size: 18px; margin-bottom: 10px; }
.drawer .close { position: absolute; top: 14px; right: 16px; font-size: 20px; background: none; border: none; }
.detail-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.kv-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 13px; }
.kv-table th, .kv-table td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.kv-table th { background: #faf7f4; width: 110px; font-weight: 600; }
.pos-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.pos-table th, .pos-table td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.pos-table th { background: #faf7f4; }
.content-text { white-space: pre-wrap; font-size: 13.5px; background: #faf9f8; border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin: 10px 0; max-height: 360px; overflow: auto; }
.ext-note { font-size: 12px; margin: 6px 0; }
.apply-btn { display: block; text-align: center; background: var(--primary); color: #fff; border-radius: 8px; padding: 12px; font-size: 15px; font-weight: 700; margin: 14px 0; }
.apply-btn:hover { background: var(--primary-dark); color: #fff; }
.source-note { font-size: 12px; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 10px; }
.attach-list { list-style: none; margin: 8px 0; }
.attach-list a { color: var(--provincial); font-size: 13px; }
.drawer-actions { display: flex; gap: 8px; margin-top: 10px; }

/* 订阅页 */
.sub-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; background: #fff; }
.sub-form { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sub-form .full { grid-column: 1 / -1; }
.sub-form label { font-size: 12px; color: var(--muted); display: block; margin-bottom: 3px; }
.sub-form input, .sub-form select { width: 100%; }
.notif-item { padding: 10px; border-bottom: 1px solid var(--line); font-size: 13px; cursor: pointer; }
.notif-item:hover { background: #faf6f6; }

/* 统计/后台 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-num { font-size: 26px; font-weight: 800; color: var(--primary); }
.bar-row { display: grid; grid-template-columns: 90px 1fr 48px; align-items: center; gap: 8px; font-size: 13px; margin-bottom: 5px; }
.bar { background: #f0e3e3; border-radius: 4px; height: 14px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--primary); }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.admin-table th, table.admin-table td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; }
table.admin-table th { background: #faf7f4; }
.status-pill { font-size: 11px; border-radius: 10px; padding: 1px 8px; }
.st-ok { background: #e8f6ee; color: var(--ok); }
.st-error { background: #fdecec; color: var(--danger); }
.st-other { background: #f0f0f0; color: #888; }

.toast { position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%); background: rgba(40,40,40,.92); color: #fff; padding: 9px 18px; border-radius: 8px; font-size: 13px; z-index: 200; }

@media (max-width: 900px) {
  #filter-form { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
  #filter-form .filter-row:first-child { grid-column: span 2; }
  .home-grid { grid-template-columns: 1fr; }
  .nav { overflow-x: auto; }
  .ann-side { min-width: 80px; }
  .brand-sub { display: none; }
}

/* 未登录预览：数据区半屏截断 + 底部渐变登录入口 */
.preview-wrap { position: relative; max-height: 50vh; overflow: hidden; }
.preview-veil { position: absolute; left: 0; right: 0; bottom: 0; height: 55%;
  background: linear-gradient(to bottom, rgba(255,255,255,0), var(--card) 62%);
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 22px; }

/* 登录浮层（预览模式下弹出的密码框） */
.login-modal-mask { position: fixed; inset: 0; background: rgba(20,20,20,.45);
  display: flex; align-items: center; justify-content: center; z-index: 300; }
.login-modal-card { width: 340px; max-width: calc(100vw - 32px); padding: 26px; }
