/* ============================================
   SimpleNews 简约资讯主题 - 主样式
   ============================================ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.7;
    color: var(--sn-text);
    background: var(--sn-bg);
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s, color 0.3s;
}

a { color: var(--sn-link); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--sn-link_hover); text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4, h5, h6 { margin: 0; font-weight: 600; line-height: 1.4; color: var(--sn-title); }

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

/* ============================================
   页头
   ============================================ */
.site-header {
    background: var(--sn-header_bg);
    border-bottom: 1px solid var(--sn-border);
    position: sticky;
    top: 0;
    z-index: 999;
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.site-logo { display: flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--sn-header_text, var(--sn-title)); text-decoration: none; }
.site-logo:hover { text-decoration: none; opacity: 0.85; }
.logo-icon { width: 28px; height: 28px; }
.logo-image { height: 36px; width: auto; }
.logo-text { color: var(--sn-header_text, var(--sn-title)); }
.header-nav { display: flex; align-items: center; }
.nav-menu { display: flex; list-style: none; margin: 0; padding: 0; gap: 24px; }
.nav-menu a { color: var(--sn-header_text, var(--sn-text_secondary)); font-size: 14px; font-weight: 500; padding: 8px 0; }
.nav-menu a:hover, .nav-menu .current-menu-item a { color: var(--sn-header_text, var(--sn-text_secondary)); opacity: 0.75; text-decoration: none; border-bottom: 2px solid currentColor; }

/* ============================================
   主体布局
   ============================================ */
.site-content { padding: 24px 0; }
.site-content .container { display: flex; gap: 24px; }
.content-area { flex: 1; min-width: 0; }
.sidebar { width: 300px; flex-shrink: 0; }
body.sidebar-left .site-content .container { flex-direction: row-reverse; }

/* ============================================
   文章列表 —— 无外框、虚线分割
   ============================================ */
.post-list {
    background: transparent;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.post-list .post-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--sn-border);
    transition: background 0.15s;
}

.post-list .post-row:last-child { border-bottom: none; }
.post-list .post-row:hover { background: transparent; }
.post-list .post-row:hover .post-title a { color: var(--sn-primary); }

/* 过期状态 */
.post-list .post-row.post-expired { opacity: 0.6; }
.post-list .post-row.post-expired .post-title a { color: var(--sn-text_secondary); }
.post-list .post-row.post-expired .post-title a:hover { color: var(--sn-text_secondary); text-decoration: line-through; }

/* 分类 */
.post-category { flex-shrink: 0; }
.post-category a {
    display: inline-block;
    padding: 2px 8px;
    background: var(--sn-category_bg);
    color: var(--sn-category_text);
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
}
.post-category a:hover { opacity: 0.8; }

/* 标题 */
.post-title { font-size: 15px; font-weight: 600; color: var(--sn-title); flex: 1; min-width: 0; }
.post-title a {
    color: var(--sn-title);
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.post-title a:hover { color: var(--sn-primary); text-decoration: none; }

/* 高亮标记覆盖标题颜色 */
.post-row.highlight .post-title a { color: var(--sn-flag_highlight_text); }

/* 文章标记 */
.post-flags { display: flex; gap: 6px; flex-shrink: 0; }
.post-flag {
    display: inline-block;
    padding: 1px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    line-height: 1.6;
}
.flag-sticky { background: var(--sn-flag_sticky_bg); color: var(--sn-flag_sticky_text); }
.flag-highlight { background: var(--sn-flag_highlight_bg); color: var(--sn-flag_highlight_text); }
.flag-recommend { background: var(--sn-flag_recommend_bg); color: var(--sn-flag_recommend_text); }

/* 时间、作者、倒计时、浏览量 */
.post-time, .post-author, .post-countdown, .post-views {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--sn-text_secondary);
    white-space: nowrap;
}
.post-time a, .post-author a { color: var(--sn-text_secondary); }
.post-time a:hover, .post-author a:hover { color: var(--sn-primary); text-decoration: none; }

.post-author { display: inline-flex; align-items: center; gap: 4px; }
.post-author img { border-radius: 50%; }

/* 倒计时 */
.post-countdown {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 8px;
    background: var(--sn-countdown_bg);
    color: var(--sn-countdown_text);
    border-radius: 3px;
}
.post-countdown.expired {
    background: var(--sn-border);
    color: var(--sn-text_secondary);
    font-weight: 500;
}
.countdown-label { font-size: 11px; }
.countdown-text { font-weight: 600; }

/* 浏览量 */
.post-views { font-size: 12px; color: var(--sn-text_secondary); }

/* ============================================
   分页
   ============================================ */
.pagination { margin-top: 24px; text-align: center; }
.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border: 1px solid var(--sn-border);
    border-radius: 4px;
    color: var(--sn-text);
    text-decoration: none;
    font-size: 13px;
}
.pagination .page-numbers:hover,
.pagination .current {
    background: var(--sn-pagination_active_bg);
    border-color: var(--sn-pagination_active_bg);
    color: #fff;
    text-decoration: none;
}

/* ============================================
   侧边栏小工具
   ============================================ */
.sidebar .widget {
    background: var(--sn-card_bg);
    border: 1px solid var(--sn-border);
    border-radius: 8px;
    margin-bottom: 16px;
    padding: 16px;
}
.sidebar .widget-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--sn-title);
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--sn-border);
}
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar ul li { padding: 6px 0; border-bottom: 1px dashed var(--sn-border); font-size: 13px; }
.sidebar ul li:last-child { border-bottom: none; }
.sidebar ul li a { color: var(--sn-text); }
.sidebar ul li a:hover { color: var(--sn-primary); text-decoration: none; }

/* ============================================
   单文章页
   ============================================ */
.single-post {
    background: var(--sn-card_bg);
    border: 1px solid var(--sn-border);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
}
.single-header { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--sn-border); }
.single-header .post-title { font-size: 22px; margin: 8px 0; }
.single-header .post-info-line {
    display: flex; align-items: center; gap: 20px;
    font-size: 13px; color: var(--sn-text_secondary); flex-wrap: wrap; margin-top: 8px;
}
.single-content { font-size: 15px; line-height: 1.9; color: var(--sn-text); }
.single-content p { margin-bottom: 16px; }
.single-content h2, .single-content h3 { margin: 24px 0 12px; color: var(--sn-title); }
.single-content img { border-radius: 6px; }
.single-content blockquote { border-left: 4px solid var(--sn-primary); padding-left: 16px; margin: 16px 0; color: var(--sn-text_secondary); }
.single-content pre, .single-content code { background: var(--sn-bg); border-radius: 4px; }
.single-content code { padding: 2px 6px; font-size: 13px; }
.single-content pre { padding: 16px; overflow-x: auto; }
.single-footer { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--sn-border); font-size: 13px; color: var(--sn-text_secondary); }
.single-footer .tags a { display: inline-block; padding: 2px 8px; margin: 0 4px 4px 0; background: var(--sn-category_bg); color: var(--sn-text); border-radius: 3px; font-size: 12px; }

.post-navigation { display: flex; gap: 16px; margin-bottom: 24px; }
.post-navigation > div { flex: 1; background: var(--sn-card_bg); border: 1px solid var(--sn-border); border-radius: 8px; padding: 14px 16px; font-size: 13px; }
.post-navigation a { color: var(--sn-text); }
.post-navigation a:hover { color: var(--sn-primary); text-decoration: none; }
.post-thumbnail { margin-bottom: 20px; }
.post-thumbnail img { border-radius: 8px; width: 100%; }

/* ============================================
   归档页
   ============================================ */
.archive-header { background: var(--sn-card_bg); border: 1px solid var(--sn-border); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; }
.archive-title { font-size: 18px; color: var(--sn-title); }

/* ============================================
   无内容
   ============================================ */
.no-content { background: var(--sn-card_bg); border: 1px solid var(--sn-border); border-radius: 8px; padding: 40px 20px; text-align: center; color: var(--sn-text_secondary); }

/* ============================================
   页脚
   ============================================ */
.site-footer {
    background: var(--sn-footer_bg);
    border-top: 1px solid var(--sn-border);
    padding: 20px 0;
    margin-top: 40px;
}
.footer-inner { text-align: center; font-size: 13px; color: var(--sn-footer_text, var(--sn-text_secondary)); }
.footer-copyright { margin-bottom: 8px; }
.footer-icp { margin-bottom: 8px; }
.footer-icp a { color: var(--sn-footer_text, var(--sn-text_secondary)); }
.footer-icp a:hover { opacity: 0.75; text-decoration: none; }
.footer-menu { list-style: none; margin: 8px 0 0; padding: 0; display: flex; justify-content: center; gap: 16px; }
.footer-menu a { color: var(--sn-footer_text, var(--sn-text_secondary)); font-size: 13px; }
.footer-menu a:hover { opacity: 0.75; text-decoration: none; }
.footer-stats { display: none; }

/* ============================================
   暗黑主题特殊处理
   ============================================ */
.theme-dark .post-list .post-row { border-bottom-color: #2d3748; }
.theme-dark .sidebar .widget,
.theme-dark .single-post,
.theme-dark .archive-header,
.theme-dark .no-content,
.theme-dark .post-navigation > div {
    background: #1f2937;
    border-color: #374151;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}
.theme-dark input[type="text"],
.theme-dark textarea,
.theme-dark .comment-form input,
.theme-dark .comment-form textarea {
    background: #374151; color: #e5e7eb; border-color: #4b5563;
}
.theme-dark .sidebar ul li { border-bottom-color: #374151; }

/* ============================================
   响应式
   ============================================ */
@media (max-width: 900px) {
    .site-content .container { flex-direction: column; }
    body.sidebar-left .site-content .container { flex-direction: column; }
    .sidebar { width: 100%; }
    .nav-menu { gap: 16px; }
}

@media (max-width: 600px) {
    .header-inner { height: 52px; }
    .site-logo { font-size: 18px; }
    .nav-menu { gap: 12px; font-size: 13px; }
    .nav-menu a { font-size: 13px; }

    /* 移动端文章列表：只显示标题 + 倒计时 */
    .post-list .post-row { padding: 12px 0; gap: 6px; }
    .post-list .post-row .post-category,
    .post-list .post-row .post-flags,
    .post-list .post-row .post-time,
    .post-list .post-row .post-author,
    .post-list .post-row .post-views { display: none; }
    .post-list .post-row .post-title { font-size: 15px; flex: 1; order: 1; }
    .post-list .post-row .post-countdown { order: 2; flex-shrink: 0; }

    .single-post { padding: 16px; }
    .single-header .post-title { font-size: 18px; }
}
