/* style.css - 增强版RSS阅读器样式（修复Windows显示问题） */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 防止水平滚动 */
html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

:root {
    /* 浅色模式变量 */
    --bg-primary: #f5f5f5;
    --bg-secondary: white;
    --bg-tertiary: #f7f7f7;
    --bg-header: #cee3f8;
    --text-primary: #222;
    --text-secondary: #555;
    --text-muted: #888;
    --text-light: #999;
    --border-primary: #e5e5e5;
    --border-secondary: #ddd;
    --border-header: #5f99cf;
    --link-color: #369;
    --link-visited: #551A8B;
    --accent-primary: #ff4500;
    --accent-secondary: #0079d3;
    --success-color: #5cb85c;
    --shadow: rgba(0, 0, 0, 0.1);
    --overlay: rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] {
    /* 深色模式变量 */
    --bg-primary: #1a1a1b;
    --bg-secondary: #272729;
    --bg-tertiary: #343536;
    --bg-header: #1e3a5f;
    --text-primary: #d7dadc;
    --text-secondary: #a5a7a9;
    --text-muted: #818384;
    --text-light: #6f7173;
    --border-primary: #343536;
    --border-secondary: #404041;
    --border-header: #2d5aa0;
    --link-color: #7bb6ff;
    --link-visited: #cc7fd8;
    --accent-primary: #ff6b35;
    --accent-secondary: #0dd3ff;
    --success-color: #46d160;
    --shadow: rgba(0, 0, 0, 0.3);
    --overlay: rgba(0, 0, 0, 0.7);
}

body {
    font-family: -webkit-system-font, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif; /* 修改：优化Windows字体显示 */
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.4;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* 修改：添加Windows字体渲染优化 */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* 修改：Windows系统特定字体优化 */
@media screen and (-ms-high-contrast: active), (-ms-high-contrast: none) {
    body {
        font-family: "Segoe UI", Tahoma, Arial, sans-serif;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--bg-secondary);
    min-height: 100vh;
    transition: background-color 0.3s ease;
    width: 100%;
    overflow-x: hidden;
}

/* 头部 - 修改：优化Windows显示 */
.header {
    background-color: var(--bg-header);
    border-bottom: 1px solid var(--border-header);
    padding: 12px 16px; /* 修改：增加内边距 */
    display: flex;
    flex-direction: column; /* 修改：改为列布局避免Windows上的挤压 */
    gap: 8px; /* 修改：添加间距 */
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
    overflow-x: hidden;
}

.header h1 {
    color: var(--text-primary);
    font-size: 24px;
    font-weight: normal;
    margin-bottom: 4px; /* 修改：添加下边距 */
}

/* 修改：优化头部主要区域布局 */
.header-main {
    display: flex;
    justify-content: space-between;
    align-items: flex-start; /* 修改：改为顶部对齐 */
    margin-bottom: 8px; /* 修改：减少下边距 */
    flex-wrap: wrap; /* 修改：允许换行 */
    gap: 8px; /* 修改：添加间距 */
}

/* 修改：优化统计信息显示 */
.header-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px; /* 修改：增加间距 */
    min-width: 0; /* 修改：防止溢出 */
    flex-shrink: 0; /* 修改：防止收缩 */
}

/* 修改：优化统计信息行布局 */
.stats-line {
    display: flex;
    gap: 12px; /* 修改：增加间距 */
    font-size: 12px;
    flex-wrap: wrap;
    align-items: center; /* 修改：垂直居中对齐 */
    justify-content: flex-end; /* 修改：右对齐 */
}

/* 修改：优化统计项目样式 */
.stat-item {
    padding: 3px 8px; /* 修改：增加内边距 */
    border-radius: 4px; /* 修改：增加圆角 */
    transition: all 0.2s ease;
    white-space: nowrap; /* 修改：防止换行 */
    font-weight: 500; /* 修改：增加字重 */
    min-width: fit-content; /* 修改：最小宽度适应内容 */
}

.stat-item.unread {
    background-color: var(--accent-primary);
    color: white;
    font-weight: bold;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* 修改：添加阴影 */
}

.stat-item.read {
    background-color: var(--success-color);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* 修改：添加阴影 */
}

.stat-item.today {
    background-color: var(--accent-secondary);
    color: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* 修改：添加阴影 */
}

/* 修改：优化页面统计信息 */
.page-stats {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right; /* 修改：右对齐 */
    white-space: nowrap; /* 修改：防止换行 */
    margin-top: 2px; /* 修改：添加上边距 */
}

/* 深色模式切换按钮 */
.theme-toggle {
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: 20px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
    box-shadow: 0 2px 8px var(--shadow);
    max-width: calc(100vw - 30px);
    word-wrap: break-word;
}

.theme-toggle:hover {
    background: var(--bg-secondary);
    box-shadow: 0 4px 12px var(--shadow);
}

.theme-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.theme-toggle.active .theme-icon {
    transform: rotate(180deg);
}

/* 分页导航 */
.pagination {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.top-pagination {
    border-bottom: none;
}

.bottom-pagination {
    border-top: none;
    margin-top: 20px;
}

.pagination-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn {
    padding: 4px 8px;
    text-decoration: none;
    border: 1px solid var(--border-secondary);
    background-color: var(--bg-tertiary);
    color: var(--link-color);
    font-size: 11px;
    border-radius: 2px;
    cursor: pointer;
    display: inline-block;
    transition: all 0.2s ease;
}

.btn:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.btn-nav {
    font-weight: bold;
}

.btn-mark-read {
    background-color: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.btn-mark-read:hover {
    background-color: #e03d00;
    transform: translateY(-1px);
}

.page-info {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 10px;
}

/* 文章列表 */
.articles {
    background-color: var(--bg-secondary);
    transition: background-color 0.3s ease;
}

.article {
    border-bottom: 1px solid var(--border-primary);
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    position: relative;
    transition: all 0.2s ease;
}

.article.read {
    opacity: 0.6;
}

.article:hover {
    background-color: var(--bg-tertiary);
}

.article-rank {
    font-size: 12px;
    color: var(--text-light);
    min-width: 30px;
    text-align: right;
    padding-top: 2px;
}

.article-content {
    flex: 1;
}

.article-title {
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.article-title a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.article-title a:visited {
    color: var(--link-visited);
}

.article-title a:hover {
    text-decoration: underline;
}

.article.read .article-title a {
    color: var(--text-muted);
}

.article-meta {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.article-meta .source {
    font-weight: bold;
    color: var(--text-secondary);
}

.article-meta .date {
    margin-left: 8px;
}

.article-meta .read-status {
    margin-left: 8px;
    color: var(--text-light);
    font-style: italic;
}

.article-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    margin-top: 5px;
}

.article.read .article-description {
    color: var(--text-light);
}

/* 自定义模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: var(--overlay);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: var(--bg-secondary);
    margin: 15% auto;
    padding: 0;
    border: 1px solid var(--border-secondary);
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 32px var(--shadow);
    animation: slideIn 0.3s ease;
    overflow: hidden;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    background-color: var(--bg-tertiary);
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-icon {
    font-size: 20px;
    color: var(--accent-primary);
}

.modal-title {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    margin: 0;
}

.modal-body {
    padding: 20px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.modal-footer {
    background-color: var(--bg-tertiary);
    padding: 16px 20px;
    border-top: 1px solid var(--border-primary);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 80px;
}

.modal-btn-primary {
    background-color: var(--accent-primary);
    color: white;
}

.modal-btn-primary:hover {
    background-color: #e03d00;
    transform: translateY(-1px);
}

.modal-btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}

.modal-btn-secondary:hover {
    background-color: var(--bg-tertiary);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateY(-50px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 表单 */
.mark-read-form {
    margin: 0;
}

/* 消息提示 */
.message {
    padding: 10px 15px;
    margin: 0;
    border-left: 4px solid;
    font-size: 14px;
    transition: all 0.3s ease;
}

.message.success {
    background-color: rgba(92, 184, 92, 0.1);
    border-color: var(--success-color);
    color: var(--success-color);
}

.message.error {
    background-color: rgba(217, 83, 79, 0.1);
    border-color: #d9534f;
    color: #d9534f;
}

/* 空状态 */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-primary);
    margin: 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.empty h3 {
    margin-bottom: 10px;
    color: var(--text-secondary);
    font-size: 18px;
}

.empty p {
    font-size: 14px;
    line-height: 1.5;
}

/* 单个标记按钮 */
.btn-mark-single {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 8px;
    background-color: var(--accent-secondary);
    color: white;
    border-color: var(--accent-secondary);
}

.btn-mark-single:hover {
    background-color: #0056b3;
}

/* 标星按钮 */
.btn-star {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 8px;
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border-secondary);
    transition: all 0.2s ease;
}

.btn-star:hover {
    background-color: #ffd700;
    color: #000;
    border-color: #ffd700;
    transform: scale(1.1);
}

.btn-star.starred {
    background-color: #ffd700;
    color: #000;
    border-color: #ffd700;
}

.btn-star.starred:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
    border-color: var(--border-secondary);
}

/* Toast 消息样式 */
.toast {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 10001;
    padding: 12px 20px;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 4px 12px var(--shadow);
    transform: translateX(100%);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 300px;
    word-wrap: break-word;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-success {
    background-color: #4caf50;
}

.toast-error {
    background-color: #f44336;
}

.toast-info {
    background-color: #2196f3;
}

.toast-warning {
    background-color: #ff9800;
}

/* 修改：优化订阅源导航 */
.source-nav {
    border-top: 1px solid var(--border-header);
    padding: 10px 0 8px 0;
    width: 100%;
    overflow: hidden; /* 防止垂直溢出 */
    position: relative;
}

/* 修改：优化订阅源标签容器 */
.source-tabs {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 16px 8px 16px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    /* 隐藏滚动条但保持功能 */
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.source-tabs::-webkit-scrollbar {
    display: none;
}

/* 添加渐变遮罩效果指示可滚动 */
.source-nav::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 8px;
    width: 20px;
    background: linear-gradient(to right, transparent, var(--bg-header));
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.source-nav.has-overflow::after {
    opacity: 1;
}

/* 修改：优化单个订阅源标签 */
.source-tab {
    padding: 6px 12px;
    background-color: var(--bg-tertiary);
    color: var(--link-color);
    text-decoration: none;
    font-size: 12px;
    border: 1px solid var(--border-secondary);
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
    min-height: 32px;
    max-width: 200px; /* 添加最大宽度防止过长 */
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-overflow: ellipsis;
    overflow: hidden;
}

.source-tab:hover {
    background-color: var(--bg-secondary);
    border-color: var(--border-header);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.source-tab.active {
    background-color: var(--bg-secondary);
    border-color: var(--accent-primary);
    font-weight: bold;
    color: var(--accent-primary);
    position: relative;
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 源标识优化 */
.source-badge {
    background-color: var(--link-color);
    color: white;
    padding: 1px 4px;
    border-radius: 2px;
    font-size: 10px;
    font-weight: bold;
}

/* 底部操作区 */
.footer {
    background-color: var(--bg-tertiary);
    border-top: 1px solid var(--border-secondary);
    padding: 10px 15px;
    text-align: center;
    transition: all 0.3s ease;
}

.footer-stats {
    font-size: 11px;
    color: var(--text-muted);
}

.footer-stats > span {
    margin: 0 5px;
}

.today-highlight {
    color: var(--accent-secondary);
    font-weight: bold;
}

.starred-highlight {
    color: #ffd700;
    font-weight: bold;
}

/* 标星文章样式 */
.starred-article {
    border-left: 3px solid #ffd700;
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, transparent 100%);
}

.star-indicator {
    font-size: 16px;
    color: #ffd700;
}

/* Telegram按钮 */
.btn-telegram {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 8px;
    background-color: #0088cc;
    color: white;
    border-color: #0088cc;
    transition: all 0.2s ease;
}

.btn-telegram:hover {
    background-color: #006bb3;
    transform: scale(1.1);
}

.footer-actions {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-sm {
    font-size: 10px;
    padding: 3px 6px;
}

/* 悬浮标记按钮 */
.floating-mark-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
    max-width: calc(100vw - 40px);
}

.btn-floating {
    background-color: var(--accent-primary);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: 0 4px 12px var(--shadow);
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-floating:hover {
    background-color: #e03d00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px var(--shadow);
}

.btn-floating:active {
    transform: translateY(0);
}

/* 分页控件在底部的特殊样式 */
.bottom-pagination {
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.bottom-pagination .pagination-controls {
    justify-content: center;
}

/* 底部标记按钮居中 */
.bottom-mark-form {
    margin: 0 auto;
    display: flex;
    justify-content: center;
}

.bottom-mark-form .btn-mark-read {
    font-size: 12px;
    padding: 6px 12px;
}

/* 修改：Windows系统响应式设计优化 */
@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    /* 修改：移动端头部优化 */
    .header {
        flex-direction: column;
        gap: 8px; /* 修改：增加间距 */
        text-align: center;
        padding: 12px; /* 修改：增加内边距 */
        width: 100%;
    }
    
    .header-main {
        flex-direction: column;
        gap: 10px; /* 修改：增加间距 */
        text-align: center;
        width: 100%;
        align-items: center; /* 修改：居中对齐 */
    }
    
    .header-stats {
        align-items: center;
        text-align: center;
        width: 100%;
    }
    
    /* 修改：移动端统计信息优化 */
    .stats-line {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px; /* 修改：增加间距 */
        width: 100%;
    }
    
    /* 修改：移动端统计项目优化 */
    .stat-item {
        padding: 4px 10px; /* 修改：增加内边距 */
        font-size: 11px; /* 修改：稍微增加字体 */
        border-radius: 6px; /* 修改：增加圆角 */
        min-width: 60px; /* 修改：设置最小宽度 */
        text-align: center; /* 修改：文字居中 */
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        text-align: center;
        padding: 8px;
        width: 100%;
    }
    
    .pagination-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .mark-read-form {
        width: 100%;
        display: flex;
        justify-content: center;
        margin: 0;
    }
    
    .article {
        padding: 8px 10px;
        flex-direction: column;
        gap: 5px;
        width: 100%;
    }
    
    .article-rank {
        text-align: left;
        min-width: auto;
    }
    
    /* 修改：移动端订阅源导航优化 */
    .source-nav {
        padding: 8px 0;
        margin: 0;
        position: relative;
    }
    
    /* 移动端滚动指示器 */
    .source-nav::before {
        content: '← 滑动查看更多源 →';
        position: absolute;
        top: -2px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        color: var(--text-light);
        opacity: 0.7;
        white-space: nowrap;
        pointer-events: none;
        z-index: 2;
    }
    
    .source-tabs {
        gap: 8px;
        padding: 20px 12px 8px 12px; /* 为顶部提示留出空间 */
        margin-top: 0;
    }
    
    .source-tab {
        font-size: 11px;
        padding: 8px 12px;
        min-height: 40px; /* 增加触摸友好的高度 */
        min-width: 80px; /* 设置最小宽度 */
        max-width: 150px; /* 限制最大宽度 */
        border-radius: 6px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        font-weight: 600;
    }
    
    .source-tab.active {
        transform: scale(1.02); /* 活跃状态轻微放大 */
        box-shadow: 0 3px 8px rgba(0,0,0,0.2);
    }
    
    .bottom-pagination {
        padding: 8px;
    }
    
    .floating-mark-btn {
        bottom: 15px;
        right: 15px;
        max-width: calc(100vw - 30px);
    }
    
    .btn-floating {
        padding: 8px 12px;
        font-size: 11px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .footer {
        padding: 8px;
        width: 100%;
    }
    
    .footer-stats {
        font-size: 10px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .footer-actions {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-actions .btn-sm {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .theme-toggle {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 11px;
        max-width: calc(100vw - 20px);
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        max-width: calc(100vw - 20px);
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-btn {
        width: 100%;
    }
    
    .toast {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: calc(100vw - 20px);
        margin: 0 auto;
    }
}

/* iPhone Pro 及类似设备优化 */
@media (max-width: 428px) {
    .source-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding: 0 10px 5px 10px;
    }
    
    .source-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .source-tab {
        text-align: center;
        border-radius: 3px;
        min-width: 80px;
        flex-shrink: 0;
    }
    
    .article-meta {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .btn-mark-single,
    .btn-star,
    .btn-telegram {
        font-size: 9px;
        padding: 1px 4px;
        margin-left: 4px;
    }
    
    .header {
        padding: 8px;
    }
    
    .pagination {
        padding: 6px;
    }
    
    .footer {
        padding: 6px;
    }
    
    .theme-toggle {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
        font-size: 10px;
    }
    
    .floating-mark-btn {
        bottom: 10px;
        right: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .btn-floating {
        padding: 6px 10px;
        font-size: 10px;
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* 小屏幕源切换优化 */
@media (max-width: 480px) {
    .source-nav {
        position: relative;
        overflow: hidden;
    }
    
    .source-nav::before {
        font-size: 9px;
        padding: 2px 8px;
        background: var(--bg-tertiary);
        border-radius: 10px;
        border: 1px solid var(--border-secondary);
    }
    
    .source-tabs {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        gap: 6px;
        padding: 22px 8px 8px 8px;
        scroll-snap-type: x mandatory; /* 添加滚动捕捉 */
    }
    
    .source-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .source-tab {
        text-align: center;
        border-radius: 8px;
        min-width: 85px;
        max-width: 140px;
        flex-shrink: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        scroll-snap-align: start; /* 滚动捕捉对齐 */
        font-size: 10px;
        padding: 10px 8px;
        min-height: 42px;
        font-weight: 700;
    }
    
    /* 修改：去掉渐变背景，与桌面端保持一致 */
    .source-tab.active {
        background-color: var(--bg-secondary);
        border-color: var(--accent-primary);
        color: var(--accent-primary);
        font-weight: bold;
        box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    }
}

/* 加载和过渡效果 */
.articles {
    transition: opacity 0.3s ease;
}

.articles.loading {
    opacity: 0.7;
}

/* 改进按钮组合 */
.pagination {
    align-items: stretch;
}

.mark-read-form {
    display: flex;
    align-items: center;
}

/* 暗黑模式过渡动画 */
* {
    transition: background-color 0.3s ease, 
                color 0.3s ease, 
                border-color 0.3s ease,
                box-shadow 0.3s ease;
}

/* 通用防溢出规则 */
.article-title,
.article-description,
.header h1,
.modal-title,
.modal-body p {
    word-wrap: break-word;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 确保所有文本元素不会溢出 */
* {
    max-width: 100%;
    box-sizing: border-box;
}

/* 防止表格和预格式化文本溢出 */
table, pre, code {
    max-width: 100%;
    overflow-x: auto;
}

/* 图片响应式 */
img {
    max-width: 100%;
    height: auto;
}

/* 修复iOS Safari的问题 */
@supports (-webkit-touch-callout: none) {
    .container {
        -webkit-overflow-scrolling: touch;
    }
    
    body {
        -webkit-text-size-adjust: 100%;
    }
}

/* 修改：Windows系统特定优化 */
@media screen and (-webkit-min-device-pixel-ratio: 1.25), 
       screen and (min-resolution: 120dpi) {
    /* 高DPI屏幕优化 */
    .header-stats {
        font-size: 13px; /* 修改：高DPI下字体稍大 */
    }
    
    .stat-item {
        padding: 4px 10px; /* 修改：增加内边距 */
    }
    
    .source-tab {
        padding: 7px 14px; /* 修改：增加内边距 */
        font-size: 13px; /* 修改：增加字体大小 */
    }
}

/* 修改：Windows Edge浏览器特定优化 */
@supports (-ms-ime-align: auto) {
    .header {
        padding: 14px 18px; /* 修改：Edge浏览器增加内边距 */
    }
    
    .stats-line {
        gap: 14px; /* 修改：增加间距 */
    }
    
    .source-tabs {
        gap: 6px; /* 修改：增加间距 */
        padding: 0 18px 10px 18px; /* 修改：增加内边距 */
    }
}

/* 桌面端滚动条样式 */
@media (min-width: 769px) {
    ::-webkit-scrollbar {
        width: 8px;
    }

    ::-webkit-scrollbar-track {
        background: var(--bg-tertiary);
    }

    ::-webkit-scrollbar-thumb {
        background: var(--text-muted);
        border-radius: 4px;
    }

    ::-webkit-scrollbar-thumb:hover {
        background: var(--text-secondary);
    }

    /* Firefox滚动条 */
    html {
        scrollbar-width: thin;
        scrollbar-color: var(--text-muted) var(--bg-tertiary);
    }
}