/* 基础变量 */
:root {
    --bg-primary: #F7F3EB;
    --bg-card: #FFFFFF;
    --text-primary: #2D2D2D;
    --text-secondary: #666666;
    --accent: #C4785A;
    --accent-light: #E8D5C4;
    --border: #E5E0D5;
    --shadow: 0 2px 8px rgba(0,0,0,0.06);
    --radius: 12px;
}

/* 重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

/* 登录页面 */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
}

.login-card {
    background: var(--bg-card);
    padding: 3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 360px;
    width: 90%;
}

.login-card h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.login-card .subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card input {
    padding: 0.8rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.login-card input:focus {
    border-color: var(--accent);
}

.login-card button {
    padding: 0.8rem;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.login-card button:hover {
    background: #B06848;
}

.login-card .hint {
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* 主页面 */
.main-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* 头部 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.header h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.header .tagline {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-link {
    padding: 0.5rem 1rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background 0.2s;
}

.nav-link:hover {
    background: #B06848;
}

.header-stats {
    background: var(--accent-light);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

/* 筛选栏 */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

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

.search-box {
    display: flex;
    gap: 0.5rem;
}

.search-box input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.85rem;
    font-family: inherit;
    outline: none;
    width: 180px;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: var(--accent);
}

.search-box button {
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent);
    border-radius: 20px;
    background: transparent;
    color: var(--accent);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.search-box button:hover {
    background: var(--accent);
    color: white;
}

/* 排序 */
.sort-bar {
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.sort-btn {
    padding: 0.3rem 0.8rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
}

.sort-btn:hover {
    color: var(--accent);
}

.sort-btn.active {
    color: var(--accent);
    font-weight: 600;
}

/* 文章列表 */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 文章卡片 */
.article-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.article-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.8rem;
}

.article-card .title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    flex: 1;
    margin-right: 1rem;
}

.article-card .category-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    background: var(--accent-light);
    color: var(--accent);
    white-space: nowrap;
}

.article-card .meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.8rem;
}

.article-card .meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.article-card .summary {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-card .footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.8rem;
    border-top: 1px solid var(--border);
}

.article-card .likes {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--accent);
}

.article-card .read-more {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    transition: opacity 0.2s;
}

.article-card .read-more:hover {
    opacity: 0.7;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* 底部 */
.footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.footer .update-time {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

/* 响应式 */
@media (max-width: 640px) {
    .main-page {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .header-nav {
        width: 100%;
        justify-content: space-between;
    }

    .filter-bar {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        flex: 1;
        width: auto;
    }

    .article-card .card-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-card .title {
        margin-right: 0;
    }
}
