/* ============================================
   每日书话 - 深色主题样式
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #0f0f1a;
    --bg-card: #1a1a2e;
    --bg-hover: #22223a;
    --text: #e8e8f0;
    --text-muted: #9090a8;
    --text-dim: #606080;
    --accent: #f0c040;
    --accent-dim: #c8a030;
    --border: #2a2a4e;
    --shadow: rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --radius-sm: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Serif SC", "Source Han Serif SC", serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: #fff;
}

/* --- Navigation --- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

.nav-logo:hover {
    color: var(--accent);
}

.nav-links {
    display: flex;
    gap: 8px;
}

.nav-links a {
    color: var(--text-muted);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    transition: all 0.2s;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg-card);
}

.nav-links a.active {
    color: var(--accent);
    background: rgba(240, 192, 64, 0.1);
}

/* --- Main Content --- */
.main {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px 80px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Page Header --- */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 15px;
}

/* --- Cards --- */
.cards {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 32px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.card-book::before {
    background: linear-gradient(180deg, #6366f1, #818cf8);
}

.card-quote::before {
    background: linear-gradient(180deg, var(--accent), #f59e0b);
}

.card-story::before {
    background: linear-gradient(180deg, #d35400, #e74c3c);
}

.card:hover {
    border-color: rgba(240, 192, 64, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--shadow);
}

.card-badge {
    font-size: 13px;
    color: var(--accent);
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 600;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.4;
}

.card-author {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.card-content {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 16px;
}

.card-content p {
    margin-bottom: 8px;
}

.card-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--accent);
    transition: all 0.2s;
}

.card-link:hover {
    color: #fff;
    transform: translateX(4px);
}

/* --- Quote Card --- */
.quote-text {
    font-size: 20px;
    font-style: italic;
    color: var(--text);
    line-height: 1.6;
    margin: 8px 0 4px;
    padding: 0;
    border: none;
    quotes: "“" "”" "‘" "’";
}

.quote-text::before { content: "“"; }
.quote-text::after { content: "”"; }

.quote-source {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.empty-state p {
    margin-bottom: 8px;
}

/* --- Previous Section --- */
.prev-section {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.prev-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.prev-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
    color: var(--text);
}

.prev-item:hover {
    border-color: var(--accent-dim);
    background: var(--bg-hover);
}

.prev-icon {
    font-size: 16px;
}

.prev-text {
    font-size: 14px;
    color: var(--text-muted);
}

/* --- Pagination --- */
.pagination {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 16px;
}

.paginate-link {
    padding: 10px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--text-muted);
    transition: all 0.2s;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.paginate-link:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: rgba(240, 192, 64, 0.05);
}

.paginate-prev { margin-right: auto; }
.paginate-next { margin-left: auto; }

/* --- Detail Page --- */
.detail {
    animation: fadeIn 0.5s ease;
}

.detail-cover {
    margin-bottom: 24px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-card);
}

.cover-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 280px;
    object-fit: cover;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    flex-wrap: wrap;
}

.detail-type {
    color: var(--accent);
    font-weight: 600;
}

.detail-date {
    color: var(--text-dim);
}

.download-btn {
    margin-left: auto;
    padding: 6px 14px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
}

.download-btn:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: rgba(240, 192, 64, 0.05);
}

.detail-title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 8px;
}

.detail-author {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 24px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.detail-quote {
    font-size: 24px;
    font-style: italic;
    color: var(--accent);
    line-height: 1.5;
    margin: 16px 0 8px;
    padding: 20px 24px;
    border-left: 3px solid var(--accent);
    background: rgba(240, 192, 64, 0.05);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    quotes: "“" "”";
}

.detail-quote::before { content: "“"; }
.detail-quote::after { content: "”"; }

.detail-source {
    color: var(--text-muted);
    font-size: 14px;
    text-align: right;
    margin-bottom: 32px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.detail-body {
    font-size: 16px;
    line-height: 1.9;
    color: var(--text);
}

/* --- Story Detail --- */
.detail-story {
    font-size: 17px;
    line-height: 2;
    max-width: 640px;
    margin: 0 auto;
}

.detail-story p {
    margin-bottom: 20px;
    text-indent: 2em;
}

.detail-story-author {
    text-align: right;
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.detail-story-source {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(211, 84, 0, 0.1);
    color: #d35400;
    border-radius: 20px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    margin-bottom: 16px;
}

.detail-body p {
    margin-bottom: 16px;
}

.detail-body h2, .detail-body h3 {
    margin-top: 28px;
    margin-bottom: 12px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.detail-body blockquote {
    border-left: 3px solid var(--border);
    padding: 8px 16px;
    margin: 16px 0;
    color: var(--text-muted);
    font-style: italic;
}

.detail-body ul, .detail-body ol {
    padding-left: 20px;
    margin-bottom: 16px;
}

.detail-body li {
    margin-bottom: 6px;
}

.detail-body strong {
    color: var(--accent);
}

/* --- Archive Timeline --- */
.timeline {
    position: relative;
    padding-left: 32px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
}

.timeline-dot {
    position: absolute;
    left: -26px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 3px solid var(--bg);
}

.timeline-date {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.timeline-date a {
    color: var(--text);
}

.timeline-date a:hover {
    color: var(--accent);
}

.timeline-articles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.timeline-article {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

.timeline-article:hover {
    border-color: var(--accent-dim);
    background: var(--bg-hover);
}

.timeline-icon { font-size: 14px; }
.timeline-title { font-size: 14px; color: var(--text-muted); }

.timeline-badge {
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 8px;
    font-weight: 500;
    white-space: nowrap;
}
.timeline-badge.current {
    background: var(--gold);
    color: var(--bg);
}
.timeline-badge.archived {
    background: #2a2a3a;
    color: #666;
}

/* --- About Page --- */
.about-page {
    display: flex;
    justify-content: center;
}

.about-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px;
    border: 1px solid var(--border);
    max-width: 560px;
    width: 100%;
}

.about-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
}

.about-tagline {
    text-align: center;
    color: var(--accent);
    font-size: 15px;
    margin-bottom: 32px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.about-body {
    color: var(--text-muted);
    line-height: 1.8;
}

.about-body p {
    margin-bottom: 16px;
}

.about-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

.about-col h3 {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.about-col p {
    font-size: 14px;
    color: var(--text-dim);
}

.about-motto {
    color: var(--accent) !important;
    font-style: italic;
    text-align: center;
    padding: 16px;
    border-top: 1px solid var(--border);
    margin-top: 16px;
}

.about-note {
    text-align: center;
    font-size: 13px;
    color: var(--text-dim) !important;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 32px 20px;
    text-align: center;
}

.footer-inner {
    max-width: 720px;
    margin: 0 auto;
}

.footer p {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 4px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.footer-sub {
    color: var(--text-dim);
    opacity: 0.6;
}

/* --- Generate Button --- */
.gen-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: transparent;
    color: var(--text-dim);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
    cursor: pointer;
    transition: all 0.3s;
}

.gen-btn:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
    background: rgba(240, 192, 64, 0.05);
}

.gen-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.gen-status {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    font-family: -apple-system, BlinkMacSystemFont, sans-serif;
}

.gen-loading { color: var(--accent); }
.gen-success { color: #4ade80; }
.gen-warn { color: var(--accent); }
.gen-error { color: #ef4444; }

/* --- Responsive --- */
@media (max-width: 600px) {
    .main {
        padding: 24px 16px 60px;
    }

    .page-title {
        font-size: 22px;
    }

    .card {
        padding: 24px;
    }

    .card-title {
        font-size: 18px;
    }

    .detail-title {
        font-size: 24px;
    }

    .detail-quote {
        font-size: 20px;
        padding: 16px 20px;
    }

    .about-columns {
        grid-template-columns: 1fr;
    }

    .about-card {
        padding: 24px;
    }
}
