/**
 * Danye v2.0 视觉升级与新功能样式
 * 资讯门户版 / 暗色模式 / 阅读进度条 / 专题聚合 / 文章格式徽章
 */

/* ============ 暗色模式变量 ============ */
html[data-theme="dark"] {
    --primary-light: rgba(37, 99, 235, 0.15);
    --bg: #0f172a;
    --white: #1e293b;
    --text: #e2e8f0;
    --gray: #94a3b8;
    --muted: #64748b;
    --border: rgba(255, 255, 255, 0.08);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
}
html[data-theme="dark"] body { background: var(--bg); color: var(--text); }
html[data-theme="dark"] #danye-header {
    background: rgba(15, 23, 42, 0.85);
    border-bottom-color: var(--border);
}
html[data-theme="dark"] .danye-main,
html[data-theme="dark"] .widget,
html[data-theme="dark"] .danye-feed-card,
html[data-theme="dark"] .danye-topic-card,
html[data-theme="dark"] .single-content,
html[data-theme="dark"] .post-card,
html[data-theme="dark"] .danye-list-item {
    background: var(--white);
    color: var(--text);
}
html[data-theme="dark"] pre,
html[data-theme="dark"] code { background: #0b1220; color: #e2e8f0; }
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select {
    background: #0b1220; color: var(--text); border-color: var(--border);
}
html[data-theme="dark"] a { color: #7ea6ff; }
html[data-theme="dark"] .header-menu a,
html[data-theme="dark"] .single-title { color: var(--text); }
html[data-theme="dark"] #danye-footer { background: #0b1220; }

/* 平滑主题过渡 */
body, #danye-header, .danye-main, .widget, .danye-feed-card, .single-content {
    transition: background-color .3s ease, color .3s ease, border-color .3s ease;
}

/* ============ 头部玻璃拟态微升级 ============ */
#danye-header {
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    backdrop-filter: saturate(160%) blur(12px);
}

/* ============ 暗色模式切换按钮 ============ */
.danye-dark-toggle {
    position: fixed;
    right: 22px;
    bottom: 92px;
    z-index: 990;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--white);
    color: var(--text);
    box-shadow: var(--shadow);
    font-size: 13px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}
.danye-dark-toggle:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0,0,0,.16); }
.danye-dark-toggle .danye-dark-ico { font-size: 15px; line-height: 1; }

/* ============ 阅读进度条 ============ */
.danye-reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1200;
    background: transparent;
    pointer-events: none;
}
.danye-reading-progress > span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--primary), #22d3ee);
    box-shadow: 0 0 8px rgba(37, 99, 235, .5);
    transition: width .1s linear;
}

/* ============ 资讯门户版 ============ */
.danye-portal { padding: 24px 0 40px; }

/* 焦点大图幻灯 */
.danye-slider {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    background: var(--white);
}
.danye-slider-track { display: flex; transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.danye-slide {
    position: relative;
    flex: 0 0 100%;
    display: block;
    height: 400px;
    overflow: hidden;
    text-decoration: none;
}
.danye-slide-img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease; }
.danye-slider:hover .danye-slide-img { transform: scale(1.05); }
.danye-slide-mask {
    position: absolute; inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,.72) 0%, rgba(0,0,0,.15) 45%, transparent 70%);
}
.danye-slide-caption { position: absolute; left: 28px; right: 28px; bottom: 26px; }
.danye-slide-cat {
    display: inline-block;
    padding: 3px 12px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: var(--primary);
    color: #fff;
    font-size: 12px;
}
.danye-slide-title {
    display: block;
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.4;
    text-shadow: 0 2px 12px rgba(0,0,0,.4);
}
.danye-slider-dots { position: absolute; right: 28px; bottom: 20px; display: flex; gap: 8px; z-index: 3; }
.danye-slider-dots button {
    width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%;
    background: rgba(255,255,255,.5); cursor: pointer; transition: all .3s ease;
}
.danye-slider-dots button.is-active { width: 22px; border-radius: 6px; background: #fff; }
.danye-slider-arrow {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 42px; height: 42px; border: 0; border-radius: 50%;
    background: rgba(0,0,0,.35); color: #fff; font-size: 24px; line-height: 1;
    cursor: pointer; opacity: 0; transition: opacity .3s ease, background .2s ease; z-index: 3;
}
.danye-slider:hover .danye-slider-arrow { opacity: 1; }
.danye-slider-arrow:hover { background: var(--primary); }
.danye-slider-prev { left: 18px; }
.danye-slider-next { right: 18px; }

/* 门户主体两栏 */
.danye-portal-body { display: grid; grid-template-columns: 1fr 320px; gap: 30px; align-items: start; }
.danye-portal-side { min-width: 0; }

/* 分类信息流 */
.danye-feed-block { margin-bottom: 34px; }
.danye-feed-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 16px; padding-left: 12px;
    border-left: 4px solid var(--primary);
}
.danye-feed-title { font-size: 20px; font-weight: 700; margin: 0; color: var(--text); }
.danye-feed-more { color: var(--gray); font-size: 13px; text-decoration: none; }
.danye-feed-more:hover { color: var(--primary); }
.danye-feed-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.danye-feed-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 18px rgba(0,0,0,.05);
    transition: transform .25s ease, box-shadow .25s ease;
}
.danye-feed-card:hover { transform: translateY(-4px); box-shadow: 0 16px 36px rgba(0,0,0,.12); }
.danye-feed-thumb { position: relative; display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--primary-light); }
.danye-feed-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.danye-feed-card:hover .danye-feed-thumb img { transform: scale(1.06); }
.danye-feed-thumb-ph {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 40px; font-weight: 700; color: var(--primary); opacity: .35;
}
.danye-feed-info { padding: 12px 14px 14px; }
.danye-feed-post-title { font-size: 15px; line-height: 1.5; margin: 0 0 8px; }
.danye-feed-post-title a { color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.danye-feed-post-title a:hover { color: var(--primary); }
.danye-feed-meta { display: flex; gap: 12px; font-size: 12px; color: var(--muted); }

/* 热门排行 */
.danye-ranking-list { list-style: none; margin: 0; padding: 0; counter-reset: none; }
.danye-ranking-item { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.danye-ranking-item:last-child { border-bottom: 0; }
.danye-ranking-num {
    flex: 0 0 22px; height: 22px; border-radius: 6px; text-align: center; line-height: 22px;
    font-size: 12px; font-weight: 700; color: #fff; background: var(--muted);
}
.danye-ranking-num.is-top { background: linear-gradient(135deg, #f97316, #ef4444); }
.danye-ranking-link { display: flex; flex-direction: column; gap: 3px; min-width: 0; text-decoration: none; }
.danye-ranking-post-title { color: var(--text); font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.danye-ranking-link:hover .danye-ranking-post-title { color: var(--primary); }
.danye-ranking-views { font-size: 11px; color: var(--muted); }

/* ============ 文章格式 / 置顶徽章 ============ */
.danye-format-badge, .danye-sticky-badge {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 2px 9px; border-radius: 999px;
    font-size: 12px; line-height: 1.6; font-weight: 600;
}
.danye-sticky-badge { background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; }
.danye-format-badge { background: rgba(0,0,0,.55); color: #fff; }
.danye-feed-thumb .danye-format-badge,
.danye-feed-thumb .danye-sticky-badge { position: absolute; top: 8px; left: 8px; z-index: 2; }
.danye-feed-thumb .danye-sticky-badge { right: 8px; left: auto; }
.single-badges { display: flex; gap: 8px; margin-bottom: 12px; }

/* ============ 专题聚合 ============ */
.danye-page-fullwidth { width: 100%; }
.danye-topics-intro { color: var(--gray); margin-bottom: 22px; line-height: 1.8; }
.danye-topics-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.danye-topic-card {
    display: flex; flex-direction: column;
    border-radius: var(--radius); overflow: hidden; text-decoration: none;
    background: var(--white); box-shadow: 0 4px 18px rgba(0,0,0,.05);
    transition: transform .25s ease, box-shadow .25s ease;
}
.danye-topic-card:hover { transform: translateY(-5px); box-shadow: 0 18px 40px rgba(0,0,0,.13); }
.danye-topic-cover {
    position: relative; display: block; height: 120px;
    background-size: cover; background-position: center;
    background-color: var(--primary-light);
}
.danye-topic-cover::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(37,99,235,.35), rgba(34,211,238,.25)); }
.danye-topic-cover-ph {
    position: absolute; inset: 0; z-index: 1; display: flex; align-items: center; justify-content: center;
    font-size: 42px; font-weight: 800; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.25);
}
.danye-topic-info { padding: 14px 16px; }
.danye-topic-name { display: block; font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.danye-topic-count { font-size: 12px; color: var(--muted); }

/* ============ 响应式 ============ */
@media (max-width: 992px) {
    .danye-portal-body { grid-template-columns: 1fr; }
    .danye-feed-grid { grid-template-columns: repeat(2, 1fr); }
    .danye-slide { height: 300px; }
    .danye-slide-title { font-size: 19px; }
}
@media (max-width: 560px) {
    .danye-feed-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .danye-slide { height: 210px; }
    .danye-slide-title { font-size: 15px; }
    .danye-slide-caption { left: 16px; right: 16px; bottom: 16px; }
    .danye-dark-toggle { bottom: 78px; right: 14px; padding: 8px 11px; }
}

/* ============ 页面模板去底框（增强覆盖）=========== */
main .page-content,
main .danye-page-single,
main .danye-page-fullwidth,
main .danye-fullwidth-content,
main .danye-template-tags,
main .danye-template-archives,
main .danye-template-links {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}
