/* ============================================================
   danews 资讯门户响应式主题
   主题目录：zb_users/theme/dazanews/
   主色：#2563eb  背景：#f3f5fa  文字：#1f2937
   ============================================================ */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eaf2ff;
    --bg: #f3f5fa;
    --title: #111827;
    --text: #1f2937;
    --border: #eef1f5;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: var(--bg);
}
a { color: inherit; text-decoration: none; transition: color .2s, background .2s, border-color .2s, box-shadow .2s, transform .2s; }
a:hover { color: var(--primary); }
ul { list-style: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font-family: inherit; font-size: 14px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 16px; }

/* ---------- 头部 ---------- */
.site-header {
    background: #fff;
    border-bottom: 1px solid #edf0f4;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    min-height: 66px;
}
.site-logo {
    font-size: 21px;
    font-weight: 800;
    color: #111827;
    white-space: nowrap;
    letter-spacing: .5px;
}
.site-logo::before {
    content: "";
    display: inline-block;
    width: 8px; height: 20px;
    margin-right: 8px;
    border-radius: 4px;
    background: linear-gradient(180deg, #2563eb, #22d3ee);
    vertical-align: -3px;
}
.site-logo:hover { color: #2563eb; }

.site-nav { flex: 1; min-width: 0; }
.nav-list { display: flex; align-items: center; gap: 6px; }
.nav-list .navbar-item, .nav-list li { list-style: none; }
.nav-list .navbar-item a, .nav-list li a {
    display: block;
    padding: 9px 17px;
    border-radius: 10px;
    color: #374151;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
}
.nav-list .navbar-item a:hover, .nav-list li a:hover { color: #2563eb; background: #eaf2ff; }
.nav-list li.active a, .nav-list .navbar-item.active a { color: #2563eb; background: #eaf2ff; font-weight: 600; }

.header-search { margin-left: auto; }
.header-search form { display: flex; border: 1px solid #e2e6ec; border-radius: 999px; overflow: hidden; background: #f7f8fa; }
.header-search input {
    width: 180px; border: none; outline: none; padding: 9px 14px; background: transparent;
}
.header-search button {
    padding: 0 18px; background: #2563eb; color: #fff; font-size: 14px; font-weight: 500;
}
.header-search button:hover { background: #1d4ed8; }

.nav-toggle { display: none; flex-direction: column; gap: 5px; padding: 8px; }
.nav-toggle span { width: 22px; height: 2px; background: #374151; border-radius: 2px; }

/* ---------- 广告位 ---------- */
.ad-slot { margin: 16px 0; }
.ad-slot img { margin: 0 auto; }
.ad-top { max-width: 1200px; margin: 16px auto; padding: 0 16px; }

/* ---------- 主体布局 ---------- */
.site-main { padding: 22px 0 8px; }
.content-wrap {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* ---------- 焦点轮播 ---------- */
.focus-carousel {
    position: relative;
    border-radius: 18px;
    overflow: hidden;
    margin-bottom: 24px;
    background: linear-gradient(135deg, #e9eef5, #dde6f0);
}
.focus-viewport { position: relative; aspect-ratio: 16 / 8; }
.focus-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .6s ease; }
.focus-slide.active { opacity: 1; z-index: 1; }
.focus-slide a { display: block; height: 100%; }
.focus-slide img { width: 100%; height: 100%; object-fit: cover; background: #e9eef5; }
.focus-caption {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 42px 26px 22px;
    background: linear-gradient(to top, rgba(15, 23, 42, .82), rgba(15, 23, 42, 0));
    color: #fff;
}
.focus-caption h2 { font-size: 20px; margin-bottom: 6px; font-weight: 700; }
.focus-caption p { font-size: 13px; opacity: .85; max-width: 720px; }
.focus-dots { position: absolute; right: 18px; bottom: 14px; z-index: 2; display: flex; gap: 8px; }
.focus-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(255,255,255,.5); }
.focus-dot.active { background: #fff; }

/* ---------- 文章列表卡片 ---------- */
.post-list { display: flex; flex-direction: column; gap: 16px; }
.post-card {
    display: flex; gap: 18px;
    background: #fff; border-radius: 16px; padding: 16px;
    border: 1px solid #eef1f5;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
    transition: transform .2s, box-shadow .2s;
}
.post-card:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37, 99, 235, .14); }
.post-thumb {
    flex: 0 0 240px;
    width: 240px; height: 150px;
    border-radius: 12px; overflow: hidden;
    background: #e9eef5;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-title { font-size: 17px; line-height: 1.5; margin-bottom: 8px; font-weight: 600; }
.post-title a { color: #111827; }
.post-title a:hover { color: #2563eb; }
.post-desc {
    font-size: 13.5px; color: #6b7280; flex: 1;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-meta { display: flex; align-items: center; gap: 14px; margin-top: 10px; font-size: 12.5px; color: #9ca3af; }
.meta-cat { color: #2563eb; background: #eaf2ff; padding: 3px 11px; border-radius: 999px; font-weight: 500; }
.meta-cat:hover { color: #fff; background: #2563eb; }

/* ---------- 分页 ---------- */
.pagination { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.page-link {
    min-width: 38px; height: 38px; padding: 0 12px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid #e5e9f0; border-radius: 10px; font-size: 14px;
}
.page-link:hover { border-color: #2563eb; color: #2563eb; }
.page-link.current, .page-link.active, .page-link.now-page { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ---------- 侧栏 ---------- */
.site-sidebar { display: flex; flex-direction: column; gap: 16px; }
.side-block, .related-block {
    background: #fff; border: 1px solid #eef1f5; border-radius: 16px; padding: 18px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.side-title {
    font-size: 16px; font-weight: 700; color: #111827;
    padding-bottom: 12px; margin-bottom: 14px;
    border-bottom: 1px solid #eef1f5; position: relative;
}
.side-title::before {
    content: ""; position: absolute; left: 0; bottom: -1px;
    width: 34px; height: 3px; background: linear-gradient(90deg, #2563eb, #22d3ee); border-radius: 2px;
}
.hot-list { display: flex; flex-direction: column; gap: 16px; }
.hot-item { display: flex; gap: 10px; }
.hot-rank {
    flex: 0 0 20px; height: 20px; margin-top: 5px;
    text-align: center; line-height: 20px; font-size: 12px; font-weight: 700;
    color: #9ca3af; background: #f1f3f7; border-radius: 6px;
}
.hot-item:nth-child(1) .hot-rank,
.hot-item:nth-child(2) .hot-rank,
.hot-item:nth-child(3) .hot-rank { color: #fff; background: linear-gradient(135deg, #2563eb, #22d3ee); }
.hot-link { display: flex; gap: 10px; min-width: 0; }
.hot-thumb { width: 84px; height: 62px; object-fit: cover; border-radius: 10px; flex: 0 0 84px; background: #e9eef5; }
.hot-body { display: flex; flex-direction: column; min-width: 0; }
.hot-name {
    font-size: 13.5px; color: #1f2937; line-height: 1.5; font-weight: 500;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hot-link:hover .hot-name { color: #2563eb; }
.hot-meta { font-size: 12px; color: #9ca3af; margin-top: 4px; }

.weekly-list { display: flex; flex-direction: column; gap: 13px; }
.weekly-item { display: flex; gap: 10px; align-items: flex-start; }
.weekly-rank {
    flex: 0 0 20px; height: 20px; margin-top: 3px;
    text-align: center; line-height: 20px; font-size: 12px; font-weight: 700;
    color: #9ca3af; background: #f1f3f7; border-radius: 6px;
}
.weekly-item:nth-child(1) .weekly-rank,
.weekly-item:nth-child(2) .weekly-rank,
.weekly-item:nth-child(3) .weekly-rank { color: #fff; background: linear-gradient(135deg, #2563eb, #22d3ee); }
.weekly-link { display: flex; flex-direction: column; min-width: 0; }
.weekly-name {
    font-size: 13.5px; color: #1f2937; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.weekly-link:hover .weekly-name { color: #2563eb; }
.weekly-meta { font-size: 12px; color: #9ca3af; margin-top: 3px; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
    font-size: 12.5px; color: #374151; background: #f3f5f8;
    padding: 5px 12px; border-radius: 999px;
}
.tag-chip:hover { color: var(--primary); background: var(--primary-soft); }

.friend-list { display: flex; flex-wrap: wrap; gap: 8px; }
.friend-list ul { display: contents; list-style: none; }
.friend-list li { list-style: none; }
.friend-list a {
    display: inline-block; font-size: 12.5px; color: #374151;
    background: #f3f5f8; padding: 6px 13px; border-radius: 999px; line-height: 1.5;
}
.friend-list a:hover { color: var(--primary); background: var(--primary-soft); }

/* ---------- 文章详情 ---------- */
.post-detail {
    background: #fff; border: 1px solid #eef1f5; border-radius: 18px; padding: 30px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06);
}
.breadcrumb { font-size: 13px; color: #9ca3af; margin-bottom: 18px; }
.breadcrumb a { color: #6b7280; }
.breadcrumb a:hover { color: #2563eb; }
.crumb-sep { margin: 0 8px; }
.crumb-current { color: #374151; }

.detail-title { font-size: 27px; line-height: 1.4; color: #111827; margin-bottom: 14px; font-weight: 800; }
.detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; font-size: 13px; color: #9ca3af; }
.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-link {
    font-size: 12.5px; color: #6b7280; background: #f3f5f8;
    padding: 4px 12px; border-radius: 999px;
}
.tag-link:hover { color: #2563eb; background: #eaf2ff; }

.detail-content { margin: 26px 0; font-size: 15.5px; line-height: 1.95; color: #374151; }
.detail-content p { margin-bottom: 16px; }
.detail-content h2, .detail-content h3 { margin: 24px 0 12px; color: #111827; }
.detail-content img { display: block; margin: 12px auto; border-radius: 12px; cursor: zoom-in; }
.detail-content table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 14px; }
.detail-content th, .detail-content td { border: 1px solid #e5e9f0; padding: 10px 12px; }
.detail-content th { background: #f7f9fc; }
.detail-content a { color: #2563eb; }

/* ---------- 图片灯箱 ---------- */
.img-lightbox {
    position: fixed; inset: 0; z-index: 999;
    display: flex; align-items: center; justify-content: center;
    padding: 24px; background: rgba(15, 23, 42, .88);
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.img-lightbox.show { opacity: 1; visibility: visible; }
.img-lightbox img { max-width: 100%; max-height: 90vh; border-radius: 12px; object-fit: contain; box-shadow: 0 20px 60px rgba(0, 0, 0, .4); }
.img-lightbox .lightbox-close {
    position: absolute; top: 16px; right: 22px; color: #fff; font-size: 28px; line-height: 1; cursor: pointer;
}

/* ---------- 上下篇 ---------- */
.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #eef1f5; }
.post-nav-item { background: #f7f9fc; border-radius: 12px; padding: 14px 16px; }
.post-nav-label { display: block; font-size: 12px; color: #9ca3af; margin-bottom: 6px; }
.post-nav-item a { font-size: 14px; color: #374151; }
.post-nav-item a:hover { color: #2563eb; }
.post-nav-item.next { text-align: right; }
.post-nav-item.disabled { color: #9ca3af; }

/* ---------- 相关推荐 ---------- */
.related-list { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.related-item a { display: flex; gap: 10px; align-items: center; }
.related-item img { width: 76px; height: 56px; object-fit: cover; border-radius: 10px; flex: 0 0 76px; background: #e9eef5; }
.related-item span { font-size: 13px; line-height: 1.5; color: #374151; }
.related-item a:hover span { color: #2563eb; }

/* ---------- 评论 ---------- */
.comment-block { margin-top: 16px; background: #fff; border: 1px solid #eef1f5; border-radius: 18px; padding: 22px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.comment-list { display: flex; flex-direction: column; gap: 18px; margin-bottom: 22px; }
.comment-item { display: flex; gap: 12px; }
.comment-avatar {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 50%;
    background: #2563eb; color: #fff; display: flex; align-items: center; justify-content: center;
    font-weight: 700;
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: 12px; font-size: 13px; color: #9ca3af; margin-bottom: 4px; }
.comment-author { font-weight: 600; color: #374151; }
.comment-content { font-size: 14px; color: #374151; }

.comment-form { margin-top: 20px; }
.form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.form-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.comment-form input, .comment-form textarea, .error-search input {
    width: 100%; border: 1px solid #e5e9f0; border-radius: 10px; padding: 10px 12px; background: #f7f9fc; outline: none;
}
.comment-form input:focus, .comment-form textarea:focus, .error-search input:focus { border-color: #2563eb; background: #fff; }
.comment-form textarea { resize: vertical; margin-bottom: 12px; }
.verify-row { align-items: center; }
.verify-img { height: 38px; width: auto; border-radius: 10px; cursor: pointer; object-fit: cover; }

.btn-primary {
    display: inline-flex; align-items: center; justify-content: center;
    background: #2563eb; color: #fff; border-radius: 10px; padding: 10px 22px; font-size: 14px; font-weight: 500;
}
.btn-primary:hover { background: #1d4ed8; color: #fff; }

/* ---------- 归档页头部 ---------- */
.archive-header { background: #fff; border: 1px solid #eef1f5; border-radius: 16px; padding: 22px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(16, 24, 40, .06); }
.archive-title { font-size: 21px; color: #111827; font-weight: 700; }
.archive-desc { font-size: 13.5px; color: #6b7280; margin-top: 8px; }

/* ---------- 404 ---------- */
.error-page { background: #fff; border: 1px solid #eef1f5; border-radius: 18px; padding: 60px 24px; text-align: center; }
.error-code { font-size: 56px; font-weight: 800; color: #2563eb; letter-spacing: 4px; }
.error-title { font-size: 20px; margin: 12px 0 8px; }
.error-desc { color: #6b7280; font-size: 14px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-top: 26px; }
.error-search { display: flex; gap: 8px; }
.error-search button { background: #2563eb; color: #fff; border-radius: 10px; padding: 0 18px; }

/* ---------- 页脚 ---------- */
.site-footer { background: #0f172a; color: #cbd5e1; margin-top: 32px; padding: 28px 0; border-top: 3px solid #2563eb; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.footer-copy p { font-size: 13px; margin-bottom: 6px; }
.footer-copy a:hover { color: #fff; }
.footer-icp a { color: #9ca3af; }

/* ---------- 返回顶部 ---------- */
.back-top {
    position: fixed; right: 24px; bottom: 24px; z-index: 90;
    width: 42px; height: 42px; border-radius: 50%;
    background: #2563eb; color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpath d='M12 19V5M5 12l7-7 7 7'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: center;
    opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.back-top.show { opacity: 1; visibility: visible; }

.empty-tip { background: #fff; border: 1px dashed #e5e9f0; border-radius: 16px; padding: 40px; text-align: center; color: #9ca3af; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    .content-wrap { grid-template-columns: 1fr; }
    .site-sidebar { order: 2; }
}
@media (max-width: 768px) {
    .header-inner { flex-wrap: wrap; gap: 12px; padding: 10px 16px; }
    .site-nav { display: none; order: 3; width: 100%; }
    .site-nav.open { display: block; }
    .nav-list { flex-direction: column; gap: 2px; }
    .header-search { margin-left: 0; flex: 1; }
    .header-search input { width: 100%; }
    .nav-toggle { display: flex; margin-left: auto; }

    .focus-viewport { aspect-ratio: 16 / 11; }
    .focus-caption h2 { font-size: 16px; }
    .focus-caption p { display: none; }

    .post-card { flex-direction: column; }
    .post-thumb { flex: none; width: 100%; height: 180px; }
    .detail-title { font-size: 20px; }
    .post-nav { grid-template-columns: 1fr; }
    .post-nav-item.next { text-align: left; }
    .form-row-3 { grid-template-columns: 1fr; }
    .related-list { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
    .post-detail { padding: 18px; }
    .detail-title { font-size: 18px; }
    .post-meta { flex-wrap: wrap; gap: 8px; }
}
