/* 纯文资讯主题 - 基础重置 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "PingFang SC", "Microsoft YaHei", sans-serif; line-height: 1.6; color: #334155; background: #f4f5f7; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; vertical-align: middle; }
ul, ol { list-style: none; }

/* 布局 */
.container { max-width: 1400px; margin: 0 auto; padding: 0 16px; }
.main-layout { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 12px 0; }
.content-area { min-width: 0; }
.sidebar-area { display: flex; flex-direction: column; gap: 12px; }

@media (min-width: 1200px) {
  .main-layout { grid-template-columns: 1fr 320px; }
}

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; border-bottom: 1px solid #e2e8f0; background: rgba(255,255,255,0.95); backdrop-filter: blur(8px); }
.header-inner { display: flex; align-items: center; height: 56px; gap: 12px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo img { height: 32px; }
.logo span { font-size: 18px; font-weight: 700; color: #0f172a; }

/* 导航 */
.nav-wrapper { position: relative; }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #e2e8f0; border-radius: 6px; color: #475569; background: transparent; cursor: pointer; margin-left: auto; }
.nav-toggle:hover { background: #f8fafc; }
.nav-toggle svg { width: 20px; height: 20px; }

.main-nav { position: fixed; left: 0; top: 56px; z-index: 50; height: calc(100vh - 56px); width: 260px; max-width: 75vw; overflow-y: auto; border-right: 1px solid #e2e8f0; background: #fff; transition: transform 0.2s; transform: translateX(-100%); }
.main-nav.open { transform: translateX(0); }
.nav-overlay { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.5); display: none; }
.nav-overlay.show { display: block; }

.main-nav ul { padding: 8px 12px; }
.main-nav > ul { display: flex; flex-direction: column; }
.main-nav li { }

.main-nav a { display: block; padding: 8px 12px; border-radius: 6px; font-size: 14px; color: #475569; white-space: nowrap; }
.main-nav a:hover { background: #f1f5f9; color: #0f172a; }

/* 子菜单 */
.submenu-parent { position: relative; }
.submenu-trigger { display: flex; align-items: center; width: 100%; }
.submenu-trigger a { flex: 1; }
.submenu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border: none; background: transparent; cursor: pointer; border-radius: 6px; color: #94a3b8; }
.submenu-toggle:hover { background: #f1f5f9; }
.submenu-toggle svg { width: 14px; height: 14px; transition: transform 0.2s; }
.submenu-toggle.open svg { transform: rotate(180deg); }
.submenu { padding-left: 16px; display: none; }
.submenu.open { display: block; }

/* Desktop nav */
@media (min-width: 1024px) {
  .nav-toggle { display: none; }
  .nav-overlay { display: none !important; }
  .main-nav { position: static; height: auto; width: auto; max-width: none; transform: none; overflow: visible; border: none; background: transparent; }
  .main-nav > ul { flex-direction: row; align-items: center; gap: 4px; padding: 0; }
  .submenu { position: absolute; top: 100%; left: 0; min-width: 160px; padding: 4px; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
  .submenu-toggle svg { transform: none; }
  .header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
}

/* 搜索 */
.search-btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid #e2e8f0; border-radius: 6px; color: #475569; background: transparent; cursor: pointer; }
.search-btn:hover { background: #f8fafc; }
.search-btn svg { width: 16px; height: 16px; }
.mobile-search { display: inline-flex; }
.desktop-search { display: none; }
@media (min-width: 1024px) {
  .mobile-search { display: none; }
  .desktop-search { display: inline-flex; }
}

.search-panel { position: absolute; left: 0; top: 100%; z-index: 40; width: 100%; border-top: 1px solid #e2e8f0; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.05); display: none; }
.search-panel.show { display: block; }
.search-panel-inner { padding: 12px 16px; }
.search-form { display: flex; gap: 8px; }
.search-form input { flex: 1; height: 40px; padding: 0 12px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 14px; outline: none; }
.search-form input:focus { border-color: #94a3b8; }
.search-form button { height: 40px; min-width: 80px; border: none; border-radius: 6px; background: #0f172a; color: #fff; font-size: 14px; font-weight: 500; cursor: pointer; flex-shrink: 0; }
.search-form button:hover { background: #1e293b; }

/* 首页分类卡片网格 */
.cat-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 768px) { .cat-grid { grid-template-columns: repeat(2, 1fr); } }

.cat-card { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); overflow: hidden; }
.cat-card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.cat-card-header h2 { font-size: 14px; font-weight: 600; color: #0f172a; }
.cat-card-header .more { font-size: 12px; color: #94a3b8; }
.cat-card-header .more:hover { color: #475569; }

.cat-card-body { padding: 4px 12px; }
.cat-card-body li { }
.cat-card-body li a { display: flex; align-items: center; gap: 8px; padding: 8px 6px; font-size: 14px; color: #475569; border-radius: 6px; border-bottom: 1px dashed #f1f5f9; transition: background 0.15s; }
.cat-card-body li a:hover { background: #f8fafc; color: #0f172a; }
.cat-card-body li:last-child a { border-bottom: none; }
.cat-list-dot { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid #94a3b8; flex-shrink: 0; }
.cat-list-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cat-card-footer { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border-top: 1px solid #f1f5f9; font-size: 12px; color: #94a3b8; }

/* 侧栏组件 */
.widget { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.widget-title { font-size: 14px; font-weight: 600; color: #0f172a; margin-bottom: 8px; }

/* 标签 */
.tag-list { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-list a { padding: 3px 10px; border-radius: 4px; background: #f1f5f9; font-size: 13px; color: #475569; }
.tag-list a:hover { background: #e2e8f0; color: #0f172a; }

/* 热门文章 */
.hot-list li { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 6px; transition: background 0.15s; }
.hot-list li:hover { background: #f8fafc; }
.hot-list .rank { width: 18px; text-align: center; font-size: 13px; font-weight: 600; flex-shrink: 0; }
.hot-list .rank.top { color: #ef4444; }
.hot-list a { flex: 1; font-size: 14px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hot-list a:hover { color: #0f172a; }

/* 热评 */
.comment-list { position: relative; }
.comment-list li { position: relative; padding: 6px 6px 6px 18px; border-radius: 6px; transition: background 0.15s; }
.comment-list li:hover { background: #f8fafc; }
.comment-list .c-dot { position: absolute; left: -7px; top: 10px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid #cbd5e1; background: #fff; }
.comment-list .c-time { font-size: 11px; color: #94a3b8; }
.comment-list a { display: block; font-size: 13px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.comment-list a:hover { color: #0f172a; }
.comment-list::before { content: ''; position: absolute; left: -3px; top: 0; bottom: 8px; width: 1px; background: #e2e8f0; }

/* 文章页 */
.article-header { margin-bottom: 16px; }
.article-title { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1.4; margin-bottom: 12px; }
.article-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #94a3b8; }
.article-meta span { display: flex; align-items: center; gap: 4px; }
.article-content { font-size: 16px; line-height: 1.85; color: #334155; word-break: break-word; }
.article-content p { margin-bottom: 16px; }
.article-content img { max-width: 100%; border-radius: 6px; margin: 12px 0; }
.article-content h2, .article-content h3 { margin: 20px 0 12px; color: #0f172a; }
.article-content blockquote { border-left: 3px solid #e2e8f0; padding: 8px 16px; margin: 16px 0; color: #64748b; background: #f8fafc; border-radius: 0 6px 6px 0; }
.article-content a { color: #2563eb; text-decoration: underline; }

.article-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.article-tags a { padding: 3px 10px; border-radius: 4px; background: #f1f5f9; font-size: 13px; color: #64748b; }
.article-tags a:hover { background: #e2e8f0; }

/* 分页 */
.pagebar { display: flex; justify-content: center; gap: 4px; padding: 20px 0; }
.pagebar a, .pagebar span { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; color: #475569; background: #fff; }
.pagebar a:hover { background: #f8fafc; color: #0f172a; }
.pagebar span.current { background: #0f172a; color: #fff; border-color: #0f172a; }
.pagebar span.disabled { color: #cbd5e1; background: #f8fafc; }

/* 评论区 */
.comments-section { margin-top: 30px; padding-top: 20px; border-top: 1px solid #e2e8f0; }
.comments-title { font-size: 16px; font-weight: 600; margin-bottom: 16px; color: #0f172a; }
.comment-item { padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.comment-item:last-child { border-bottom: none; }
.comment-author { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.comment-author img { width: 28px; height: 28px; border-radius: 50%; }
.comment-author strong { font-size: 14px; color: #0f172a; }
.comment-time { font-size: 12px; color: #94a3b8; margin-left: auto; }
.comment-body { font-size: 14px; color: #475569; line-height: 1.7; padding-left: 36px; }
.comment-body p { margin-bottom: 4px; }

/* 评论表单 */
.comment-form { margin-top: 20px; }
.comment-form textarea { width: 100%; min-height: 100px; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; resize: vertical; outline: none; }
.comment-form textarea:focus { border-color: #94a3b8; }
.comment-form .form-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.comment-form input[type="text"] { flex: 1; min-width: 120px; height: 38px; padding: 0 10px; border: 1px solid #e2e8f0; border-radius: 6px; font-size: 14px; outline: none; }
.comment-form input[type="text"]:focus { border-color: #94a3b8; }
.comment-form input[type="submit"] { height: 38px; padding: 0 20px; border: none; border-radius: 6px; background: #0f172a; color: #fff; font-size: 14px; cursor: pointer; }
.comment-form input[type="submit"]:hover { background: #1e293b; }

/* Footer */
.site-footer { border-top: 1px solid #e2e8f0; background: #fff; margin-top: 32px; }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px; text-align: center; font-size: 12px; color: #94a3b8; }
.footer-links { display: flex; gap: 16px; }
.footer-links a:hover { color: #475569; }
@media (min-width: 640px) {
  .footer-inner { flex-direction: row; justify-content: space-between; text-align: left; }
}

/* 回到顶部 */
.back-to-top { position: fixed; bottom: 48px; right: 16px; z-index: 70; width: 40px; height: 36px; border: 1px solid #e2e8f0; border-radius: 6px; background: rgba(255,255,255,0.95); color: #64748b; font-size: 16px; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.1); display: none; align-items: center; justify-content: center; }
.back-to-top.show { display: flex; }
.back-to-top:hover { background: #f1f5f9; }

/* 错误页 */
.error-page { text-align: center; padding: 80px 20px; }
.error-page h1 { font-size: 72px; font-weight: 700; color: #e2e8f0; }
.error-page p { font-size: 18px; color: #94a3b8; margin: 12px 0 24px; }
.error-page a { display: inline-block; padding: 10px 24px; border-radius: 6px; background: #0f172a; color: #fff; font-size: 14px; }
.error-page a:hover { background: #1e293b; }

/* 面包屑 */
.breadcrumb { font-size: 13px; color: #94a3b8; margin-bottom: 12px; }
.breadcrumb ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.breadcrumb li { display: flex; align-items: center; }
.breadcrumb li + li::before { content: '/'; margin: 0 6px; color: #cbd5e1; }
.breadcrumb a { color: #64748b; }
.breadcrumb a:hover { color: #0f172a; }
.breadcrumb [aria-current="page"] { color: #0f172a; font-weight: 500; }

/* 首页副标题 */
.site-subtitle { font-size: 15px; color: #94a3b8; margin-bottom: 16px; text-align: center; }

/* 列表页文章项 */
.list-article { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 12px; display: flex; gap: 16px; align-items: flex-start; }
.list-article-img { width: 160px; height: 100px; border-radius: 6px; object-fit: cover; flex-shrink: 0; }
.list-article-info { flex: 1; min-width: 0; }
.list-article-info h2 { font-size: 16px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; }
.list-article-info h2 a { color: #0f172a; }
.list-article-info h2 a:hover { color: #475569; }
.list-article-info .summary { font-size: 13px; color: #94a3b8; line-height: 1.5; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.list-article-info .meta { font-size: 12px; color: #cbd5e1; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.list-article-info .meta a { color: #94a3b8; }
.list-article-info .meta a:hover { color: #475569; }
.list-article-info .meta time { color: #94a3b8; }

/* 搜索页 */
.search-header { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 16px; margin-bottom: 16px; }
.search-header h1 { font-size: 18px; font-weight: 600; color: #0f172a; }
.search-header .keyword { color: #ef4444; }
