/* ==========================================================================
   CHOWCHOW HOME — 1:1 Reference Header & Pure Background Soft Pink Cloud System
   ========================================================================== */

:root {
    /* 1:1 Reference Color Palette */
    --header-bg: #faecee;           /* Soft Cream Blush Header Background */
    --header-brand: #803348;        /* Deep Rose Maroon Brand Color */
    --header-text: #5a454d;         /* Muted Dark Rose Link Text */
    --active-badge-bg: #f3c6d3;     /* Active Tab Highlight Rectangle */
    --active-badge-text: #803348;
    
    --bg-base: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.94); /* 柔和半透明卡片，让背后的浅粉云雾在卡片下方呈现 */
    --card-badge-bg: #f7d6e0;
    --card-badge-text: #803348;
    
    --text-main: #2b1f27;
    --text-muted: #6f5c66;
    --text-light: #9e8a94;
    
    --border-color: #f1dfa3;
    --border-card: rgba(243, 198, 211, 0.5);
    --pink-hover: #ff7597;
    
    --font-serif: "Playfair Display", Georgia, "Times New Roman", serif;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --radius-sm: 6px;
    --radius-md: 18px;
    --radius-pill: 9999px;
    
    --shadow-card: 0 10px 30px -10px rgba(128, 51, 72, 0.08);
    --shadow-float: 0 16px 36px -8px rgba(255, 117, 151, 0.22);
    
    --transition-fast: 0.18s ease;
    --transition-smooth: 0.35s ease;
}

/* Base Reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #ffffff;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    position: relative;
    min-height: 100vh;
}

/* 1:1 EXACT HEADER FROM REFERENCE IMAGE (独立置顶 z-index: 20，绝不被云雾覆盖) */
.header-wrapper {
    position: relative;
    z-index: 20;
    width: 100%;
    background-color: var(--header-bg);
    border-bottom: 1px solid rgba(243, 198, 211, 0.6);
}

.header-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--header-brand);
    text-decoration: none;
    text-transform: uppercase;
    transition: opacity var(--transition-fast);
}

.brand:hover {
    opacity: 0.88;
}

nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-item {
    color: var(--header-text);
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition-fast);
}

.nav-item:hover {
    color: var(--header-brand);
}

.nav-item.active {
    background-color: var(--active-badge-bg);
    color: var(--active-badge-text);
    font-weight: 700;
}

.search-btn {
    background: none;
    border: none;
    color: var(--header-brand);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity var(--transition-fast);
}

.search-btn:hover {
    opacity: 1;
}

/* 主内容包裹层（云雾限制在 Header 与 Footer 之间） */
.main-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* 动效 Canvas：纯正背景层 (z-index: 1)，绝不覆盖任何卡片与文字内容 */
#fog-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
    filter: blur(22px);
    transform: scale(1.04);
}

/* Shell Container for Main Content (z-index: 2，完全覆盖在云雾 Canvas 上方) */
.shell {
    position: relative;
    z-index: 2;
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 36px;
}

/* Hero Section */
.hero-section {
    padding: 60px 0 40px;
    text-align: center;
}

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 16px;
    background: var(--card-badge-bg);
    color: var(--header-brand);
    border-radius: var(--radius-pill);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 18px;
}

.hero-title {
    font-family: var(--font-serif);
    font-size: clamp(2.6rem, 5.2vw, 3.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 16px;
    color: var(--text-main);
}

.text-rose {
    color: var(--header-brand);
}

.hero-intro {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 580px;
    margin: 0 auto;
    line-height: 1.65;
}

/* Cards Grid */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 40px 0 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.section-title {
    font-family: var(--font-serif);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-main);
}

.filter-bar {
    display: flex;
    gap: 8px;
}

.filter-btn {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-card);
    padding: 6px 16px;
    border-radius: var(--radius-pill);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.filter-btn:hover {
    color: var(--header-brand);
    border-color: var(--active-badge-bg);
}

.filter-btn.active {
    background: var(--header-brand);
    color: white;
    border-color: var(--header-brand);
    box-shadow: 0 4px 14px rgba(128, 51, 72, 0.3);
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-bottom: 70px;
}

.card-item {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 28px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 280px;
    box-shadow: var(--shadow-card);
    transition: all var(--transition-smooth);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(12px);
}

.card-item:hover {
    transform: translateY(-8px);
    border-color: var(--active-badge-bg);
    box-shadow: var(--shadow-float);
}

.card-badge {
    align-self: flex-start;
    padding: 4px 14px;
    background: var(--card-badge-bg);
    color: var(--card-badge-text);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.card-title {
    font-family: var(--font-serif);
    font-size: 1.32rem;
    font-weight: 700;
    line-height: 1.32;
    margin-bottom: 12px;
    color: var(--text-main);
    transition: color var(--transition-fast);
}

.card-item:hover .card-title {
    color: var(--header-brand);
}

.card-desc {
    font-size: 0.94rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 20px;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid rgba(243, 198, 211, 0.4);
    font-size: 0.82rem;
    color: var(--text-light);
}

.card-link {
    color: var(--header-brand);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: transform var(--transition-fast);
}

.card-item:hover .card-link {
    transform: translateX(4px);
}

/* About Section */
.about-section {
    padding: 60px 0;
    border-top: 1px solid rgba(243, 198, 211, 0.5);
}

.about-box {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--radius-md);
    padding: 40px;
    box-shadow: var(--shadow-card);
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 36px;
    align-items: center;
    backdrop-filter: blur(12px);
}

.about-author h3 {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--header-brand);
}

.author-tag {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
}

.about-text {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 16px;
}

.topic-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.topic-tag {
    padding: 6px 14px;
    background: var(--card-badge-bg);
    color: var(--card-badge-text);
    border-radius: var(--radius-pill);
    font-size: 0.8rem;
    font-weight: 600;
}

/* Footer (独立置底 z-index: 20，绝不被云雾覆盖) */
footer {
    position: relative;
    z-index: 20;
    background: #ffffff;
    padding: 40px 36px 60px;
    max-width: 1140px;
    margin: 0 auto;
    border-top: 1px solid rgba(243, 198, 211, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.86rem;
    color: var(--text-muted);
}

.footer-nav {
    display: flex;
    gap: 20px;
}

.footer-nav a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-nav a:hover {
    color: var(--header-brand);
}

/* Reader Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(43, 31, 39, 0.4);
    backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    position: relative;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    background: white;
    border-radius: var(--radius-md);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.12);
    padding: 40px;
    overflow-y: auto;
    border: 1px solid var(--border-card);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--card-badge-bg);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--header-brand);
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.modal-close:hover {
    transform: rotate(90deg);
}

.modal-header h2 {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-weight: 700;
    margin: 10px 0 14px;
    color: var(--text-main);
}

.modal-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.modal-body {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.75;
}

.modal-body p { margin-bottom: 18px; }
.modal-body h4 { margin: 22px 0 10px; color: var(--header-brand); font-family: var(--font-serif); }

/* Responsive */
@media (max-width: 900px) {
    .cards-grid { grid-template-columns: repeat(2, 1fr); }
    .about-box { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 600px) {
    .header-container { flex-direction: column; gap: 16px; }
    nav { gap: 12px; flex-wrap: wrap; justify-content: center; }
    .cards-grid { grid-template-columns: 1fr; }
    .hero-title { font-size: 2.3rem; }
    .modal-card { padding: 24px; }
}
