/* ============================================
   每日冷知识 - 完整样式表
   ============================================ */

/* --- 浅色模式变量 --- */
:root {
    --bg: #fcf8f3;
    --bg-end: #f5ede4;
    --surface: #ffffff;
    --text: #2d3436;
    --text-soft: #636e72;
    --text-muted: #b2bec3;
    --border: rgba(0, 0, 0, 0.06);
    --category-bg: #fce4ec;
    --category-text: #c62828;

    --font-serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-readable: 640px;
}

/* --- 暗色模式变量 --- */
[data-theme="dark"] {
    --bg: #1a1a2e;
    --bg-end: #16213e;
    --surface: #1e2746;
    --text: #e8e8e8;
    --text-soft: #b0b8c8;
    --text-muted: #6b7280;
    --border: rgba(255, 255, 255, 0.06);
    --category-bg: #3d1f2e;
    --category-text: #f0a0b0;
}

/* --- 重置 & 基础 --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: linear-gradient(160deg, var(--bg) 0%, var(--bg-end) 100%);
    line-height: 1.7;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    transition: background 0.3s, color 0.3s;
}

.page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ============================================
   顶部
   ============================================ */
.site-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--border);
    transition: border-color 0.3s;
}

.header-inner {
    max-width: var(--max-readable);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: 0.5px;
    transition: color 0.3s;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.header-weather {
    font-weight: 400;
}

.header-sep {
    display: none;
    opacity: 0.3;
}

.header-date {
    font-weight: 400;
    white-space: nowrap;
}

/* --- 主题切换按钮 --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    color: var(--text-soft);
    flex-shrink: 0;
}

.theme-toggle:hover {
    border-color: var(--text-muted);
    transform: rotate(15deg);
}

/* ============================================
   主内容区
   ============================================ */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem 2rem;
}

/* ============================================
   冷知识卡片
   ============================================ */
.fact-card {
    max-width: var(--max-readable);
    width: 100%;
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}

.card-category {
    display: inline-block;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    padding: 3px 14px;
    border-radius: 999px;
    background: var(--category-bg);
    color: var(--category-text);
    margin-bottom: 1.5rem;
    transition: background 0.3s, color 0.3s;
}

.card-title {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    font-weight: 700;
    line-height: 1.45;
    color: var(--text);
    margin-bottom: 1.5rem;
    letter-spacing: 1px;
    transition: color 0.3s;
}

.card-body {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 2vw, 1.125rem);
    line-height: 2;
    color: var(--text-soft);
    transition: color 0.3s;
}

/* 底部元信息 */
.card-meta {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: border-color 0.3s;
}

.meta-dot {
    opacity: 0.4;
}





/* ============================================
   空状态
   ============================================ */
.empty-state {
    text-align: center;
    max-width: 400px;
}

.empty-icon {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
}

.empty-state h2 {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text);
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin-bottom: 1.25rem;
}

.back-home {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--text-soft);
    text-decoration: none;
    padding: 0.4rem 1rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    transition: all 0.25s;
}

.back-home:hover {
    background: var(--surface);
    color: var(--text);
}

/* ============================================
   底部
   ============================================ */
.site-footer {
    text-align: center;
    padding: 1.5rem 2rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    transition: border-color 0.3s;
}

.site-footer > p {
    opacity: 0.6;
}

.footer-beian {
    margin-top: 0.5rem;
    opacity: 0.5;
}

.footer-beian a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.75rem;
}

.footer-beian a:hover {
    text-decoration: underline;
}

.footer-source {
    margin-top: 0.3rem;
    opacity: 0.5;
    font-size: 0.75rem;
}

.footer-source a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-source a:hover {
    text-decoration: underline;
}

/* --- 卡片底部来源链接 --- */
.card-meta a.meta-source {
    color: var(--text-muted);
    text-decoration: none;
}

.card-meta a.meta-source:hover {
    color: var(--text-soft);
    text-decoration: underline;
}

/* ============================================
   响应式
   ============================================ */

/* 手机 */
@media (max-width: 600px) {
    .site-header {
        padding: 0.75rem 1.25rem;
    }

    .site-logo {
        font-size: 0.85rem;
    }

    .header-right {
        gap: 0.5rem;
    }

    .header-info {
        font-size: 0.72rem;
        gap: 0.35rem;
    }

    .header-date {
        white-space: normal;
    }

    .theme-toggle {
        width: 30px;
        height: 30px;
        font-size: 0.95rem;
    }

    .main-content {
        padding: 2rem 1.25rem 1.5rem;
        align-items: flex-start;
        padding-top: 2.5rem;
    }

    .card-category {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .card-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }

    .card-body {
        font-size: 0.95rem;
        line-height: 1.9;
    }

    .card-meta {
        margin-top: 2rem;
        padding-top: 1.25rem;
        font-size: 0.75rem;
    }

    .site-footer {
        padding: 1rem 1.25rem;
    }
}

/* 平板 */
@media (min-width: 601px) and (max-width: 900px) {
    .main-content {
        padding: 3rem 2.5rem 2rem;
    }
}
