/* ============================================
   LRKK Family - lrkk.love
   设计风格：极简现代 · 内容优先
   灵感来源：lixiaolai.com
   字体：Newsreader (衬线) + Inter (无衬线)
   配色：中性灰 · 白色 · 墨绿强调
   ============================================ */


/* ========== CSS 变量 ========== */
:root {
    --bg: #FAFAF8;
    --bg-alt: #F0EFEC;
    --text: #1A1A1A;
    --text-secondary: #6B6B6B;
    --text-muted: #9C9C9C;
    --accent: #2D5A3D;
    --accent-light: rgba(45, 90, 61, 0.08);
    --border: rgba(0, 0, 0, 0.06);
    --border-hover: rgba(0, 0, 0, 0.12);
    --card-bg: #FFFFFF;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.06);
    --font-serif: 'Newsreader', 'Noto Serif SC', Georgia, serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --max-width: 960px;
    --nav-height: 56px;
    --footer-bg: #1A1A1A;
    --footer-text: rgba(255, 255, 255, 0.6);
}

/* ========== 暗黑模式 ========== */
[data-theme="dark"] {
    --bg: #1A1A1A;
    --bg-alt: #222222;
    --text: #E8E8E8;
    --text-secondary: #9C9C9C;
    --text-muted: #6B6B6B;
    --accent: #4CAF50;
    --accent-light: rgba(76, 175, 80, 0.12);
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --card-bg: #252525;
    --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
    --footer-bg: #0D0D0D;
    --footer-text: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .navbar {
    background: rgba(26, 26, 26, 0.92);
}

[data-theme="dark"] .reader-content img {
    opacity: 0.85;
}

[data-theme="dark"] .reader-content code {
    background: #333;
    color: #e8e8e8;
}

[data-theme="dark"] .reader-content pre {
    background: #2a2a2a;
    border-color: rgba(255,255,255,0.08);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.7;
    font-weight: 400;
}

::selection {
    background: var(--accent);
    color: white;
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

/* ========== 导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(250, 250, 248, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    height: var(--nav-height);
    transition: box-shadow 0.3s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: var(--nav-height);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px;
}

.nav-logo {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    letter-spacing: 0.5px;
}

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

.nav-link {
    font-family: var(--font-sans);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 400;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text);
}

/* ========== Hero 区域 ========== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 100px 0 60px;
    background: var(--bg);
}

.hero-content {
    max-width: 640px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: 3.5rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 4px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.hero-title-sub {
    font-weight: 300;
    color: var(--text-secondary);
    font-size: 2.5rem;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 300;
    letter-spacing: 2px;
    font-family: var(--font-sans);
}

.hero-values {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.hero-value-tag {
    display: inline-block;
    padding: 6px 16px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-weight: 400;
    transition: all 0.2s ease;
    cursor: default;
}

.hero-value-tag:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

/* ========== Section 通用 ========== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 48px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.8rem;
    font-weight: 400;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.section-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 300;
    font-family: var(--font-sans);
}

/* ========== 读书架 ========== */
.bookshelf-section {
    background: var(--bg-alt);
}

.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.book-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 24px 20px;
    text-align: center;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
}

.book-emoji {
    font-size: 2.5rem;
    margin-bottom: 12px;
    display: block;
}

.book-title {
    font-family: var(--font-serif);
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.4;
}

.book-author {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 400;
    margin-bottom: 8px;
}

.book-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    font-weight: 300;
}

.book-tag {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.7rem;
    font-family: var(--font-sans);
    margin-top: 10px;
    font-weight: 400;
}

/* ========== 五大价值 ========== */
.values-section {
    background: var(--bg);
}

.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.value-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 32px 24px;
    text-align: center;
    transition: all 0.25s ease;
    border: 1px solid var(--border);
    box-shadow: var(--card-shadow);
}

.value-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--border-hover);
}

.value-icon {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.value-title {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 8px;
}

.value-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    font-weight: 300;
}

/* ========== 关于区域 ========== */
.about-section {
    background: var(--bg-alt);
}

.about-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.about-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
    font-weight: 300;
}

.about-quote {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--accent);
    font-style: italic;
    line-height: 1.8;
    padding: 28px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin: 28px 0;
    font-weight: 400;
}

/* ========== Footer ========== */
.footer {
    background: var(--text);
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.footer-text {
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.5px;
}

.footer-subtext {
    font-size: 0.75rem;
    opacity: 0.4;
    font-family: var(--font-sans);
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-title-sub {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        letter-spacing: 1px;
    }

    .section {
        padding: 48px 0;
    }

    .section-title {
        font-size: 1.4rem;
    }

    .bookshelf {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 16px;
    }

    .book-card {
        padding: 16px 12px;
    }

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

    .nav-links {
        gap: 12px;
    }

    .nav-link {
        font-size: 0.78rem;
    }

    .about-quote {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .hero-title-sub {
        font-size: 1.4rem;
    }

    .bookshelf {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .container {
        padding: 0 16px;
    }
}

/* ========== 动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.book-card {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.book-card:nth-child(1) { animation-delay: 0.05s; }
.book-card:nth-child(2) { animation-delay: 0.1s; }
.book-card:nth-child(3) { animation-delay: 0.15s; }
.book-card:nth-child(4) { animation-delay: 0.2s; }
.book-card:nth-child(5) { animation-delay: 0.25s; }
.book-card:nth-child(6) { animation-delay: 0.3s; }
.book-card:nth-child(7) { animation-delay: 0.35s; }
.book-card:nth-child(8) { animation-delay: 0.4s; }

/* ========== 书籍详情弹窗 ========== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 26, 0.5);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 12px;
    max-width: 440px;
    width: 100%;
    padding: 40px 36px 32px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    font-size: 1.6rem;
    color: var(--text-muted);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
    font-family: var(--font-sans);
    line-height: 1;
}

.modal-close:hover {
    background: var(--accent-light);
    color: var(--text);
}

.modal-body {
    text-align: center;
}

.modal-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 12px;
}

.modal-title {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.modal-author {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    margin-bottom: 16px;
}

.modal-detail {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.7;
    text-align: left;
    margin-bottom: 24px;
    font-weight: 300;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.modal-link {
    display: inline-block;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    border-radius: 100px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-link:hover {
    background: #1E3D29;
    transform: translateY(-1px);
}

.modal-repo-link {
    background: transparent !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--border) !important;
}

.modal-repo-link:hover {
    background: var(--accent-light) !important;
    color: var(--text) !important;
    border-color: var(--border-hover) !important;
    box-shadow: none !important;
}

.modal-read-btn {
    display: inline-block;
    padding: 10px 24px;
    background: var(--text);
    color: #fff;
    border: none;
    border-radius: 100px;
    font-size: 0.85rem;
    font-family: var(--font-sans);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-read-btn:hover {
    background: #333;
    transform: translateY(-1px);
}

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

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-overlay.active {
    animation: modalFadeIn 0.2s ease;
}

.modal-content {
    animation: modalSlideUp 0.25s ease;
}

@media (max-width: 480px) {
    .modal-content {
        padding: 32px 20px 24px;
    }

    .modal-emoji {
        font-size: 2.8rem;
    }

    .modal-title {
        font-size: 1.2rem;
    }
}

/* ========== 滚动渐入效果 ========== */
.fade-in {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   阅读器样式
   ============================================ */

.reader-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg);
    z-index: 3000;
}

.reader-overlay.active {
    display: flex;
}

.reader-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100vh;
    max-width: 960px;
    margin: 0 auto;
    background: var(--card-bg);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.04);
}

.reader-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.reader-back {
    background: none;
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.reader-back:hover {
    background: var(--accent-light);
    border-color: var(--border-hover);
}

.reader-title {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text);
}

.reader-controls {
    display: flex;
    gap: 8px;
}

.reader-font-btn {
    width: 32px;
    height: 32px;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: none;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans);
    font-weight: 500;
    transition: all 0.2s ease;
}

.reader-font-btn:hover {
    background: var(--accent-light);
}

/* 阅读器主体布局 */
.reader-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* 目录 */
.reader-toc {
    width: 220px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    padding: 16px 0;
    overflow-y: auto;
    background: var(--bg);
}

.toc-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0 20px 10px;
    font-family: var(--font-sans);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.toc-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 6px 20px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.15s ease;
    border-left: 2px solid transparent;
    line-height: 1.4;
}

.toc-item:hover {
    background: var(--accent-light);
    color: var(--text);
}

.toc-item.active {
    color: var(--accent);
    border-left-color: var(--accent);
    background: var(--accent-light);
    font-weight: 500;
}

/* 阅读主区域 */
.reader-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.reader-content {
    flex: 1;
    padding: 36px 44px;
    overflow-y: auto;
    line-height: 1.9;
    font-size: 1rem;
    color: var(--text);
}

/* 底部导航 */
.reader-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 24px;
    background: var(--bg);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.reader-nav-btn {
    padding: 6px 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-sans);
    transition: all 0.2s ease;
}

.reader-nav-btn:hover {
    background: var(--accent-light);
    border-color: var(--border-hover);
    color: var(--text);
}

.reader-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reader-nav-btn:disabled:hover {
    background: none;
    border-color: var(--border);
}

.reader-progress {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-weight: 400;
}

.reader-loading {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-family: var(--font-sans);
    font-size: 0.85rem;
}

/* Markdown 渲染样式 */
.reader-content h1 {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 500;
    color: var(--text);
    margin: 36px 0 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
}

.reader-content h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text);
    margin: 28px 0 12px;
}

.reader-content h3 {
    font-family: var(--font-serif);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    margin: 20px 0 10px;
}

.reader-content p {
    margin-bottom: 14px;
    text-align: justify;
}

.reader-content blockquote {
    border-left: 3px solid var(--accent);
    padding: 10px 18px;
    margin: 16px 0;
    background: var(--bg);
    border-radius: 0 6px 6px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.reader-content blockquote p {
    margin-bottom: 0;
}

.reader-content ul, .reader-content ol {
    margin: 10px 0 14px;
    padding-left: 22px;
}

.reader-content li {
    margin-bottom: 6px;
}

.reader-content strong {
    font-weight: 600;
    color: var(--text);
}

.reader-content em {
    font-style: italic;
}

.reader-content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.reader-content a:hover {
    color: #1E3D29;
}

.reader-content code {
    background: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.88em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.reader-content pre {
    background: var(--bg-alt);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
    border: 1px solid var(--border);
}

.reader-content pre code {
    background: none;
    padding: 0;
    font-size: 0.82rem;
}

.reader-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 28px 0;
}

.reader-content img {
    max-width: 100%;
    border-radius: 6px;
    margin: 16px 0;
}

.reader-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.reader-content th, .reader-content td {
    padding: 8px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.reader-content th {
    background: var(--bg);
    font-weight: 500;
}

/* 字体大小切换 */
.reader-content.font-lg {
    font-size: 1.1rem;
}

.reader-content.font-sm {
    font-size: 0.9rem;
}

/* 阅读器响应式 */
@media (max-width: 768px) {
    .reader-toc {
        display: none;
    }

    .reader-content {
        padding: 20px;
        font-size: 0.95rem;
    }

    .reader-header {
        padding: 10px 16px;
    }

    .reader-title {
        font-size: 0.85rem;
    }
}

/* ========== 主题切换按钮 ========== */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

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

/* ========== 阅读进度标签 ========== */
.book-progress {
    display: inline-block;
    padding: 2px 8px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 0.65rem;
    font-family: var(--font-sans);
    margin-top: 8px;
    font-weight: 500;
}

/* ========== 阅读进度条 ========== */
.reader-progress-bar {
    width: 100%;
    height: 3px;
    background: var(--border);
    position: relative;
    flex-shrink: 0;
}

.reader-progress-bar-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
    border-radius: 0 2px 2px 0;
}

/* ========== 阅读统计 ========== */
.reader-stats {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: var(--font-sans);
}

.reader-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========== 赫蹏（heti）适配 ========== */
.reader-content.heti {
    max-width: 680px;
    margin: 0 auto;
}

.reader-content.heti p {
    text-align: justify;
}

/* ========== Footer 暗黑适配 ========== */
[data-theme="dark"] .footer {
    background: var(--footer-bg);
    color: var(--footer-text);
}
