* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif; color: #2b2b2b; background: #f5f6f8; line-height: 1.7; font-size: 15px; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* 头部 */
.site-header { background: #fff; box-shadow: 0 1px 0 rgba(0,0,0,.06); position: sticky; top: 0; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; flex-direction: column; line-height: 1.2; }
.logo strong { color: #c0392b; font-size: 20px; }
.logo span { font-size: 12px; color: #888; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; }
.main-nav a { padding: 8px 12px; border-radius: 6px; font-size: 14px; color: #444; transition: .2s; }
.main-nav a:hover { background: #fdecea; color: #c0392b; }

/* 布局 */
.main-wrap { padding: 22px 16px; }
.content-layout { display: grid; grid-template-columns: 1fr 310px; gap: 22px; align-items: start; }
.content-area, .sidebar .widget { background: #fff; border-radius: 10px; }
.content-area { padding: 24px; }

.section-head { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #eee; }
.section-title { font-size: 22px; color: #c0392b; }
.section-sub { font-size: 13px; color: #999; margin-top: 4px; }

/* 文章卡片 */
.post-card { padding: 16px 0; border-bottom: 1px solid #f0f0f0; }
.post-card:last-of-type { border-bottom: none; }
.post-title { font-size: 18px; font-weight: 600; line-height: 1.5; }
.post-title a:hover { color: #c0392b; }
.post-excerpt { color: #777; font-size: 14px; margin-top: 6px; }
.post-meta { display: flex; gap: 14px; align-items: center; margin-top: 8px; font-size: 12px; color: #999; }
.source-tag { padding: 1px 8px; border-radius: 10px; background: #eef2f7; color: #5a6b80; }
.source-auto { background: #fdecea; color: #c0392b; }
.source-import { background: #eaf4ec; color: #2e7d32; }

/* 侧栏 */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.widget { padding: 18px; }
.widget-title { font-size: 16px; margin-bottom: 12px; padding-left: 10px; border-left: 3px solid #c0392b; }
.kw-card { background: linear-gradient(135deg, #c0392b, #e05a47); color: #fff; }
.kw-card .widget-title { border-left-color: #fff; }
.kw-card p { font-size: 13px; opacity: .92; }
.rank-list, .simple-list { list-style: none; }
.rank-list li { display: flex; gap: 8px; align-items: flex-start; padding: 7px 0; font-size: 14px; border-bottom: 1px dashed #f0f0f0; }
.rank-list li:last-child { border-bottom: none; }
.rank-no { flex: none; width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 4px; background: #e6e8ec; color: #888; font-size: 12px; }
.rank-no.top { background: #c0392b; color: #fff; }
.rank-list a { display: block; }
.rank-list a:hover { color: #c0392b; }
.simple-list li { padding: 7px 0; font-size: 14px; border-bottom: 1px dashed #f0f0f0; }
.simple-list li:last-child { border-bottom: none; }
.simple-list time { float: right; color: #aaa; font-size: 12px; }
.simple-list a:hover { color: #c0392b; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-cloud a { font-size: 13px; padding: 3px 10px; border-radius: 12px; background: #f4f5f7; color: #666; }
.tag-cloud a:hover { background: #fdecea; color: #c0392b; }

/* 文章详情 */
.breadcrumb { font-size: 13px; color: #999; margin-bottom: 14px; }
.breadcrumb a:hover { color: #c0392b; }
.article-title { font-size: 26px; line-height: 1.4; margin-bottom: 12px; }
.article-meta { display: flex; gap: 16px; font-size: 13px; color: #999; padding-bottom: 16px; border-bottom: 1px solid #eee; flex-wrap: wrap; }
.article-body { padding: 20px 0; font-size: 16px; }
.article-body p { margin-bottom: 16px; }
.article-body a { color: #c0392b; border-bottom: 1px solid #f0c4bd; }
.in-article-img { margin: 22px 0; text-align: center; }
.in-article-img img { margin: 0 auto; border-radius: 8px; }
.in-article-img figcaption { font-size: 13px; color: #999; margin-top: 8px; }
.article-tags { display: flex; gap: 8px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid #eee; font-size: 13px; }
.article-tags a { padding: 2px 10px; border-radius: 12px; background: #f4f5f7; color: #666; }
.article-tags a:hover { background: #fdecea; color: #c0392b; }
.prev-next { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; font-size: 14px; flex-wrap: wrap; }
.prev-next a { color: #555; max-width: 48%; }
.prev-next a:hover { color: #c0392b; }
.related-box { margin-top: 10px; padding: 18px; background: #fafafa; border-radius: 8px; }
.related-box h3 { font-size: 16px; margin-bottom: 10px; }
.related-box ul { list-style: none; columns: 2; gap: 20px; }
.related-box li { font-size: 14px; padding: 5px 0; break-inside: avoid; }
.related-box a:hover { color: #c0392b; }

/* 分页 */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination a, .pagination .current { min-width: 36px; padding: 6px 10px; text-align: center; border-radius: 6px; background: #f4f5f7; font-size: 14px; }
.pagination a:hover { background: #fdecea; color: #c0392b; }
.pagination .current { background: #c0392b; color: #fff; }

/* 底部 */
.site-footer { background: #2b2b2b; color: #bbb; padding: 28px 0; margin-top: 30px; font-size: 13px; }
.friend-links { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.friend-links span { color: #888; }
.friend-links a:hover { color: #e05a47; }
.disclaimer { color: #888; margin-bottom: 8px; }
.copyright a:hover { color: #e05a47; }

/* 404 */
.error-box { text-align: center; padding: 70px 20px; background: #fff; border-radius: 10px; }
.error-code { font-size: 72px; font-weight: 700; color: #c0392b; }
.error-box h1 { font-size: 22px; margin: 10px 0; }
.error-box p { color: #888; margin-bottom: 22px; }
.btn-primary { display: inline-block; padding: 10px 28px; background: #c0392b; color: #fff; border-radius: 8px; }
.btn-primary:hover { background: #a93226; }
.empty-box { padding: 40px; text-align: center; color: #999; }

/* 后台 */
.admin-body { background: #f0f2f5; }
.admin-layout { display: flex; min-height: 100vh; }
.admin-side { width: 210px; background: #232931; color: #cfd6e0; flex: none; }
.admin-side .brand { padding: 20px; font-size: 17px; color: #fff; border-bottom: 1px solid #333b47; }
.admin-side a { display: block; padding: 12px 20px; font-size: 14px; border-left: 3px solid transparent; }
.admin-side a:hover, .admin-side a.active { background: #1c2128; color: #fff; border-left-color: #e05a47; }
.admin-main { flex: 1; min-width: 0; }
.admin-top { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 22px; box-shadow: 0 1px 4px rgba(0,0,0,.05); }
.admin-content { padding: 22px; }
.panel { background: #fff; border-radius: 8px; padding: 22px; margin-bottom: 18px; }
.panel h2 { font-size: 17px; margin-bottom: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: #555; margin-bottom: 5px; }
.form-row input[type=text], .form-row input[type=password], .form-row input[type=number], .form-row textarea, .form-row select {
  width: 100%; padding: 9px 11px; border: 1px solid #d9dde3; border-radius: 6px; font-size: 14px; font-family: inherit; background: #fff; }
.form-row textarea { min-height: 120px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.btn { display: inline-block; padding: 9px 20px; border: none; border-radius: 6px; background: #c0392b; color: #fff; font-size: 14px; cursor: pointer; }
.btn:hover { background: #a93226; }
.btn.gray { background: #6c757d; }
.btn.small { padding: 4px 12px; font-size: 13px; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f2; text-align: left; vertical-align: top; }
.data-table th { background: #fafbfc; color: #666; font-weight: 600; }
.data-table .thumb { width: 90px; border-radius: 6px; }
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card { background: #fff; border-radius: 8px; padding: 20px; }
.stat-card .num { font-size: 28px; font-weight: 700; color: #c0392b; }
.stat-card .lbl { font-size: 13px; color: #888; }
.alert { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.alert.ok { background: #eaf4ec; color: #2e7d32; }
.alert.err { background: #fdecea; color: #c0392b; }
.login-box { max-width: 380px; margin: 90px auto; }
.login-box .panel { padding: 30px; }
.login-box h2 { text-align: center; color: #c0392b; }
.help-text { font-size: 12px; color: #999; margin-top: 4px; }

/* 响应式 */
@media (max-width: 960px) {
  .content-layout { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .admin-side { width: 64px; }
  .admin-side .brand, .admin-side a { font-size: 12px; padding: 12px 8px; text-align: center; white-space: nowrap; overflow: hidden; }
}
@media (max-width: 640px) {
  .header-inner { flex-direction: column; height: auto; padding: 10px 0; gap: 6px; }
  .main-nav { justify-content: center; }
  .main-nav a { padding: 6px 8px; font-size: 13px; }
  .content-area { padding: 16px; }
  .article-title { font-size: 21px; }
  .related-box ul { columns: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-cards { grid-template-columns: 1fr; }
  .prev-next a { max-width: 100%; }
}
