/* ===== 新闻系统样式（前台 + 后台通用） ===== */
:root {
  --news-primary: #1a5fb4;
  --news-primary-dark: #15487f;
  --news-text: #1f2d3d;
  --news-muted: #5b6b7b;
  --news-border: #e3e9f0;
  --news-bg: #f5f8fc;
  --news-radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--news-text);
  background: var(--news-bg);
  line-height: 1.7;
}
a { color: var(--news-primary); text-decoration: none; }

/* 顶部导航 */
.news-top { background: #fff; border-bottom: 1px solid var(--news-border); position: sticky; top: 0; z-index: 20; }
.news-top-inner { max-width: 1080px; margin: 0 auto; padding: 14px 20px; display: flex; align-items: center; justify-content: space-between; }
.news-logo { font-weight: 800; font-size: 17px; color: var(--news-primary); }
.news-nav a { margin-left: 18px; color: var(--news-muted); font-size: 15px; }
.news-nav a.active, .news-nav a:hover { color: var(--news-primary); }

.news-main { max-width: 1080px; margin: 0 auto; padding: 32px 20px 56px; min-height: 60vh; }

/* 列表 */
.news-list-head { text-align: center; margin-bottom: 30px; }
.news-tag { display: inline-block; font-size: 12px; letter-spacing: 2px; color: var(--news-primary); background: rgba(26,95,180,.08); padding: 3px 12px; border-radius: 999px; }
.news-h1 { font-size: 30px; margin: 12px 0 6px; }
.news-sub { color: var(--news-muted); margin: 0; }
.news-empty { text-align: center; color: var(--news-muted); padding: 60px 0; }

.news-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.news-card { background: #fff; border: 1px solid var(--news-border); border-radius: var(--news-radius); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.news-card:hover { box-shadow: 0 8px 24px rgba(26,95,180,.14); transform: translateY(-2px); }
.news-cover { height: 160px; background: linear-gradient(135deg, #1a5fb4, #2f8fd6); background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; }
.news-cover-ph { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: 1px; opacity: .9; }
.news-card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.news-cat { align-self: flex-start; font-size: 12px; color: var(--news-primary); background: rgba(26,95,180,.08); padding: 2px 10px; border-radius: 999px; }
.news-card-title { font-size: 18px; margin: 0; color: var(--news-text); }
.news-card-excerpt { font-size: 14px; color: var(--news-muted); margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-date { font-size: 12px; color: #9aa7b4; margin-top: auto; }

/* 详情 */
.news-back { display: inline-block; margin-bottom: 18px; color: var(--news-muted); font-size: 14px; }
.news-article-head { border-bottom: 1px solid var(--news-border); padding-bottom: 18px; margin-bottom: 22px; }
.news-article-title { font-size: 28px; margin: 12px 0 10px; }
.news-article-meta { font-size: 13px; color: var(--news-muted); display: flex; gap: 18px; flex-wrap: wrap; }
.news-article-cover { height: 280px; border-radius: var(--news-radius); background-size: cover; background-position: center; background-color: #dfe8f3; margin-bottom: 24px; }
.news-article-body { font-size: 16px; color: #2b3947; }
.news-article-body img { max-width: 100%; height: auto; border-radius: 8px; }
.news-article-body h2, .news-article-body h3 { color: var(--news-primary-dark); margin-top: 28px; }
.news-article-body table { border-collapse: collapse; width: 100%; margin: 16px 0; }
.news-article-body th, .news-article-body td { border: 1px solid var(--news-border); padding: 8px 10px; text-align: left; }
.news-article-cta { margin-top: 36px; padding: 22px; background: #fff; border: 1px solid var(--news-border); border-radius: var(--news-radius); text-align: center; }
.news-article-cta p { margin: 0 0 12px; }

/* 按钮 */
.btn { display: inline-block; padding: 10px 22px; border-radius: 8px; font-size: 15px; cursor: pointer; border: 1px solid var(--news-border); background: #fff; color: var(--news-text); }
.btn-primary { background: var(--news-primary); border-color: var(--news-primary); color: #fff; }
.btn-primary:hover { background: var(--news-primary-dark); }

/* 页脚 */
.news-foot { background: #0f2540; color: #c7d4e2; padding: 28px 20px; text-align: center; font-size: 13px; }
.news-foot-inner p { margin: 4px 0; }

/* ===== 后台 ===== */
.admin-login { max-width: 380px; margin: 60px auto; background: #fff; padding: 32px; border-radius: var(--news-radius); border: 1px solid var(--news-border); }
.admin-login h1 { margin: 0 0 18px; font-size: 22px; }
.admin-form { display: flex; flex-direction: column; gap: 10px; }
.admin-form label { font-size: 14px; color: var(--news-muted); }
.admin-form input[type=text], .admin-form input[type=password], .admin-form input[type=url], .admin-form textarea, .admin-form select {
  padding: 10px 12px; border: 1px solid var(--news-border); border-radius: 8px; font-size: 15px; width: 100%; font-family: inherit;
}
.admin-error { color: #d64545; font-size: 14px; }
.admin-hint { font-size: 12px; color: #9aa7b4; margin-top: 14px; }

.admin-dash-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.admin-dash-head h1 { font-size: 24px; margin: 0; }
.admin-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--news-radius); overflow: hidden; }
.admin-table th, .admin-table td { padding: 12px 14px; border-bottom: 1px solid var(--news-border); text-align: left; font-size: 14px; }
.admin-table th { background: #eef3fa; color: var(--news-muted); }
.admin-table a { margin-right: 12px; }

/* 编辑表单 */
.admin-edit { background: #fff; padding: 24px; border-radius: var(--news-radius); border: 1px solid var(--news-border); }
.admin-edit .row { margin-bottom: 18px; }
.admin-edit label { display: block; font-size: 14px; color: var(--news-muted); margin-bottom: 6px; }
.admin-edit .hint { font-size: 12px; color: #9aa7b4; margin-top: 4px; }
.admin-edit .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* WYSIWYG */
.wysiwyg-bar { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; background: #eef3fa; border: 1px solid var(--news-border); border-bottom: none; border-radius: 8px 8px 0 0; }
.wysiwyg-bar button { padding: 5px 10px; border: 1px solid var(--news-border); background: #fff; border-radius: 6px; cursor: pointer; font-size: 13px; }
.wysiwyg-bar button:hover { background: #e3ebf5; }
#editor { min-height: 320px; border: 1px solid var(--news-border); border-radius: 0 0 8px 8px; padding: 16px; font-size: 15px; outline: none; background: #fff; }
#editor:empty:before { content: "在此输入正文（可加粗、标题、列表、链接、图片）…"; color: #aab4c0; }
.cover-preview { margin-top: 10px; }
.cover-preview img { max-width: 220px; border-radius: 8px; border: 1px solid var(--news-border); display: block; }
.admin-actions { margin-top: 22px; display: flex; gap: 12px; }

@media (max-width: 768px) {
  .news-grid { grid-template-columns: 1fr; }
  .admin-edit .grid2 { grid-template-columns: 1fr; }
}
