/* 通报新闻 - 全站样式（内网自托管，无外部依赖） */
:root {
  --primary: #1a5fb4;
  --primary-dark: #144d92;
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #22262b;
  --text-light: #6b7280;
  --border: #e2e6ec;
  --danger: #c9302c;
  --ok: #2e7d32;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 15px;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* 顶栏 */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.site-header .inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.site-header .logo { font-size: 20px; font-weight: 700; color: var(--text); }
.site-header .logo .dot { color: var(--primary); }
.site-header nav a {
  margin-left: 18px;
  color: var(--text-light);
  font-size: 14px;
}
.site-header nav a:hover { color: var(--primary); text-decoration: none; }

/* 主体 */
.container { max-width: 960px; margin: 24px auto 60px; padding: 0 20px; }
.page-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }

/* 搜索与筛选 */
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 18px; }
.filter-bar input[type=text] {
  flex: 1;
  min-width: 200px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
}
.filter-bar .btn { white-space: nowrap; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill {
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-light);
  font-size: 13px;
}
.pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pill:hover { text-decoration: none; border-color: var(--primary); }

/* 按钮 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; 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); border-color: var(--primary-dark); color: #fff; }
.btn-danger { color: var(--danger); }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { padding: 4px 10px; font-size: 13px; }

/* 新闻卡片列表 */
.news-list { display: flex; flex-direction: column; gap: 14px; }
.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  display: flex;
  gap: 16px;
  box-shadow: var(--shadow);
}
.news-card.has-cover { cursor: pointer; }
.news-card .cover {
  width: 160px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: #eef1f5;
}
.news-card .body { flex: 1; min-width: 0; }
.news-card .title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.news-card .title a { color: var(--text); }
.news-card .title a:hover { color: var(--primary); text-decoration: none; }
.news-card .meta { font-size: 13px; color: var(--text-light); margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 12px; }
.news-card .summary { color: var(--text-light); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tag {
  display: inline-block;
  background: #eef3fb;
  color: var(--primary);
  border-radius: 4px;
  padding: 1px 8px;
  font-size: 12px;
  margin-right: 8px;
}
.badge-top {
  display: inline-block;
  background: #fdecea;
  color: var(--danger);
  border: 1px solid #f5c6c2;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
}

/* 详情页 */
.article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.article h1 { font-size: 24px; margin-bottom: 12px; line-height: 1.4; }
.article .meta { color: var(--text-light); font-size: 14px; margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.article .content p { margin-bottom: 12px; }
.article .gallery { display: flex; flex-direction: column; gap: 14px; margin-top: 20px; }
.article .gallery img { border: 1px solid var(--border); border-radius: 6px; display: block; }
.back { display: inline-block; margin-bottom: 16px; font-size: 14px; }

/* 分页 */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  padding: 0 6px;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
.pagination .current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 提示消息 */
.flash { margin-bottom: 16px; padding: 10px 14px; border-radius: 6px; font-size: 14px; }
.flash.ok { background: #e8f5e9; color: var(--ok); border: 1px solid #c8e6c9; }
.flash.error { background: #fdecea; color: var(--danger); border: 1px solid #f5c6c2; }

/* 表单 */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  box-shadow: var(--shadow);
  max-width: 820px;
}
.form-card label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 14px; }
.form-card .hint { font-size: 12px; color: var(--text-light); margin-top: 4px; font-weight: 400; }
.form-card input[type=text], .form-card input[type=password], .form-card input[type=datetime-local],
.form-card input[type=number], .form-card select, .form-card textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}
.form-card textarea { resize: vertical; min-height: 220px; }
.form-card .row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-card .row > div { flex: 1; min-width: 220px; }
.form-card .actions { margin-top: 22px; display: flex; gap: 10px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-weight: 400; }
.checkbox-line input { width: auto; }

/* 图片管理 */
.image-grid { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; }
.image-item {
  width: 150px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  position: relative;
}
.image-item img { width: 150px; height: 110px; object-fit: cover; display: block; }
.image-item .ops { padding: 6px 8px; font-size: 12px; display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.image-item .ops label { font-weight: 400; display: flex; align-items: center; gap: 4px; margin: 0; }
.image-item .ops input { width: auto; }
.cover-badge { position: absolute; top: 6px; left: 6px; background: var(--primary); color: #fff; font-size: 11px; padding: 1px 7px; border-radius: 4px; }
.preview-bar { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.preview-bar img { width: 90px; height: 66px; object-fit: cover; border: 1px solid var(--border); border-radius: 5px; }

/* 后台表格 */
.table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table-card table { width: 100%; border-collapse: collapse; }
.table-card th, .table-card td { padding: 11px 14px; text-align: left; font-size: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table-card th { background: #fafbfc; color: var(--text-light); font-weight: 600; white-space: nowrap; }
.table-card tr:last-child td { border-bottom: none; }
.table-card .title-cell { max-width: 380px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-card .ops-cell { white-space: nowrap; }
.table-card form { display: inline; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.toolbar form { display: flex; gap: 8px; flex: 1; max-width: 420px; }
.toolbar input[type=text] { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.empty { text-align: center; color: var(--text-light); padding: 40px 0; }
.login-wrap { max-width: 360px; margin: 80px auto; }
.login-wrap h1 { font-size: 20px; margin-bottom: 18px; text-align: center; }

/* 页脚 */
.site-footer { text-align: center; color: var(--text-light); font-size: 13px; padding: 20px 0 40px; }

/* ============ 账户 / 收藏 ============ */

/* 导航里的“我的” */
.nav-me { font-weight: 600; color: var(--primary) !important; }

/* 收藏按钮 */
.fav-btn { min-width: 84px; }
.fav-btn.on { background: #fff8e1; border-color: #f0c000; color: #b8860b; }
.fav-btn.on:hover { border-color: #f0c000; color: #b8860b; }

/* 关注社团更新：置顶提示条（闪烁） */
@keyframes pulseAlert {
  0%   { box-shadow: 0 0 0 0 rgba(26, 95, 180, .55); }
  70%  { box-shadow: 0 0 0 12px rgba(26, 95, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(26, 95, 180, 0); }
}
.watched-alert {
  background: linear-gradient(135deg, #eaf2fd, #dbe8fb);
  border: 1px solid #bcd4f4;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 18px;
  animation: pulseAlert 1.6s infinite;
}
.watched-title { font-weight: 700; color: var(--primary); margin-bottom: 6px; }
.watched-items { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.watched-item { color: var(--text); }
.watched-item:hover { color: var(--primary); }

/* 关注更新新闻卡片：闪烁 */
@keyframes cardFlash {
  0%, 100% { background: #fff; }
  50%      { background: #fff7d6; }
}
.news-card.pulse {
  border-color: #f0c000;
  box-shadow: 0 0 0 3px rgba(240, 192, 0, .25);
  animation: cardFlash 1.4s ease-in-out 3;
}
.badge-updated {
  display: inline-block;
  background: #fff4c2;
  color: #8a6d00;
  border: 1px solid #f0c000;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 12px;
  margin-right: 8px;
}

/* 我的页面 */
.my-layout { display: flex; flex-direction: column; gap: 16px; }
.my-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}
.my-avatar {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.my-name { font-size: 20px; font-weight: 700; }
.my-tag {
  display: inline-block;
  margin-top: 4px;
  background: #e8f0fe;
  color: var(--primary);
  border: 1px solid #c5d8f5;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px;
}
.auth-card { max-width: 480px; }
.my-favs-title { margin-bottom: 10px; font-size: 16px; }
.fav-list { display: flex; flex-direction: column; gap: 10px; }
.fav-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.fav-body { flex: 1; min-width: 0; }
.fav-title { font-weight: 600; color: var(--text); }
.fav-title:hover { color: var(--primary); text-decoration: none; }
.fav-meta { font-size: 13px; color: var(--text-light); margin-top: 4px; display: flex; flex-wrap: wrap; gap: 12px; }
