:root {
    --bg-color: #f0f2f5;
    --text-color: #333;
    --card-bg: #ffffff;
    --accent-color: #1890ff;
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --stats-bg: rgba(0, 0, 0, 0.1);
    --stats-color: #666;
    --border-color: #e0e0e0;
    /* 其他亮色主题变量 */
}

[data-theme="dark"] {
    --bg-color: #1f1f1f;
    --text-color: #e0e0e0;
    --card-bg: #2d2d2d;
    --accent-color: #4dabf7;
    --shadow: 0 4px 12px rgba(0,0,0,0.2);
    --stats-bg: rgba(255, 255, 255, 0.1);
    --stats-color: #bbb;
    --border-color: #444;
    /* 其他暗色主题变量 */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

header {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

h1 {
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--accent-color);
}

.subtitle {
    font-size: 1.1em;
    color: var(--text-color);
}

.search-bar {
    max-width: 600px;
    margin: 40px auto;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    font-size: 14px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    background-color: var(--card-bg);
    color: var(--text-color);
}

.search-bar input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.2);
}

.categories {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 50px;
}

.category {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 8px 16px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9em;
    box-shadow: var(--shadow);
}

.category:hover {
    background-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
}

.category.active {
    background-color: var(--accent-color);
    color: white;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.content-grid.loaded {
    opacity: 1;
}

.content-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    display: block;
    text-decoration: none;
    color: var(--text-color);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.column-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.column-logo {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    object-fit: cover;
    border-radius: 8px;
}

.column-title {
    margin: 0;
    font-size: 1.3em;
    font-weight: 600;
    color: var(--accent-color);
}

.column-author {
    color: var(--text-color);
    font-size: 0.85em;
    margin-top: 2px;
    opacity: 0.8;
}

.column-author::before {
    content: "@";
    color: var(--text-color);
    opacity: 0.5;
}

.column-ai-description {
    margin-bottom: 15px;
    font-size: 0.9em;
    line-height: 1.5;
}

.column-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.column-stats {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 8px;
}

.stat-item {
    background-color: var(--stats-bg);
    color: var(--stats-color);
    padding: 3px 5px;
    border-radius: 10px;
    font-size: 0.7em;
    white-space: nowrap;
}

.stat-number {
    font-weight: bold;
    margin-right: 2px;
}

footer {
    text-align: center;
    margin-top: 80px;
    padding: 20px 0;
    color: var(--text-color);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--accent-color);
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .theme-toggle {
        display: none; /* 保持主题切换按钮隐藏 */
    }

    .search-bar {
        width: 90%; /* 设置搜索栏宽度为容器的90% */
        margin-left: auto;
        margin-right: auto;
    }

    .search-bar input {
        width: 100%; /* 确保输入框填满搜索栏 */
        box-sizing: border-box; /* 确保padding不会增加总宽度 */
    }
}

/* 移动端样式 */
@media (max-width: 768px) {
    .mobile-header {
        display: block;
        position: fixed;
        top: 0;
        right: 0;
        padding: 10px;
        z-index: 1001;
    }

    .mobile-menu-toggle {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-color);
        cursor: pointer;
    }

    .mobile-dropdown {
        position: absolute;
        top: 100%;
        right: 0;
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 15px;
        display: none;
        min-width: 200px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .mobile-dropdown.show {
        display: block;
    }

    .theme-toggle-container {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .theme-checkbox {
        display: none;
    }

    .theme-label {
        position: relative;
        display: inline-block;
        width: 50px;
        height: 28px;
        background-color: #ccc;
        border-radius: 14px;
        transition: background-color 0.3s;
        cursor: pointer;
    }

    .theme-label:before {
        content: '';
        position: absolute;
        width: 24px;
        height: 24px;
        border-radius: 50%;
        top: 2px;
        left: 2px;
        background-color: white;
        transition: transform 0.3s;
    }

    .theme-checkbox:checked + .theme-label {
        background-color: #4dabf7;
    }

    .theme-checkbox:checked + .theme-label:before {
        transform: translateX(22px);
    }

    .mobile-sticky-header {
        position: fixed;
        top: -60px;
        left: 0;
        right: 0;
        height: 60px;
        background-color: var(--bg-color);
        display: flex;
        align-items: center;
        padding: 0 15px;
        transition: top 0.3s;
        z-index: 1000;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .mobile-sticky-search {
        flex-grow: 1;
        margin-right: 10px;
    }

    .mobile-sticky-search input {
        width: 100%;
        padding: 8px 12px;
        border: 1px solid var(--border-color);
        border-radius: 20px;
        font-size: 14px;
    }

    .mobile-sticky-menu-toggle {
        background: none;
        border: none;
        font-size: 24px;
        color: var(--text-color);
        cursor: pointer;
    }

    .mobile-sticky-dropdown {
        position: absolute;
        top: 60px;
        right: 0;
        background-color: var(--bg-color);
        border: 1px solid var(--border-color);
        border-radius: 4px;
        padding: 15px;
        display: none;
        min-width: 200px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }

    .mobile-sticky-dropdown.show {
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-header,
    .mobile-sticky-header {
        display: none;
    }
}

/* 移动端日期显示优化 */
@media (max-width: 768px) {
    .stat-item[data-date] .stat-number::before {
        content: attr(data-short-date);
    }
    .stat-item[data-date] .stat-number span {
        display: none;
    }
}

/* 默认样式（用于桌面端） */
.stat-item[data-date] .stat-number::before {
    content: none;
}

.stat-item[data-date] .stat-number span {
    display: inline;
}

/* 移动端样式 */
@media (max-width: 1024px), (max-device-width: 1024px) {
    .stat-item[data-date] .stat-number::before {
        content: attr(data-short-date);
    }

    .stat-item[data-date] .stat-number span {
        display: none;
    }
}

/* 针对某些可能报告更大屏幕尺寸的平板设备 */
@media (max-width: 1200px) and (orientation: portrait), 
       (max-device-width: 1200px) and (orientation: portrait) {
    .stat-item[data-date] .stat-number::before {
        content: attr(data-short-date);
    }

    .stat-item[data-date] .stat-number span {
        display: none;
    }
}
