/* ==========================================================================
   Global Custom Styles
   File: static/css/custom.css
   ========================================================================== */

/* --- 1. Typography & Base --- */
body {
    /* 全局统一：中英文字体无缝衔接，全部使用无衬线字体 (sans-serif) */
    font-family: 'Montserrat', 'Noto Sans SC', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    font-weight: 400;
    color: #333333;
    background-color: #fdfbf7; 
}

h1, h2, h3, .navbar-brand, .card-title {
    font-weight: 700;
}

.fw-semibold, .badge {
    font-weight: 600; 
}
/* 针对标题旁边的中文翻译/副标题专属样式 */
.zh-subtitle {
    font-family: 'Noto Sans SC', sans-serif !important; /* 强制锁定思源黑体 */
    font-weight: 500 !important;         
    color: #88929b;              
    vertical-align: middle;      
    margin-left: 0.25rem;
    letter-spacing: 1px;         
}
/* --- 2. Global Utilities --- */
.bg-china-red { 
    background-color: #c9372c !important; 
}
.text-china-red { 
    color: #c9372c !important; 
}

.img-placeholder {
    background-color: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-weight: 500;
}

/* 通用白底边框内容卡片 (广泛用于文章详情与侧边栏) */
.content-card {
    background-color: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

/* 带红/青色左侧高亮边框的段落标题 */
.section-title {
    border-left: 4px solid #c9372c;
    padding-left: 12px;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
}
.theme-solar .section-title { 
    border-color: #2a5252; 
}

/* --- 3. UI Interactions & Hover Effects --- */
.badge-hover {
    transition: all 0.2s ease-in-out;
}
.badge-hover:hover {
    background-color: #c9372c !important;
    color: #fff !important;
    border-color: #c9372c !important;
}

.hover-card { 
    transition: transform 0.2s, box-shadow 0.2s; position: relative;
}
.hover-card:hover { 
    transform: translateY(-3px); 
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.08) !important; 
}

.hover-list { 
    transition: background-color 0.2s; 
}
.hover-list:hover { 
    background-color: #fdf8eb; 
}

/* 列表页通用卡片悬停效果 */
.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .75rem 1.5rem rgba(0,0,0,.08)!important;
}

/* 传统节日横向大卡片悬停特效 */
.festival-list-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 1rem 2rem rgba(0,0,0,.1) !important;
}

/* 面包屑导航链接悬停变色 */
.hover-danger:hover {
    color: #c9372c !important;
    text-decoration: underline !important;
}

/* 侧边栏及其他列表项的悬停变色 */
.list-group-item-action {
    transition: all 0.2s ease-in-out;
}
.list-group-item-action:hover {
    background-color: #fdf8eb !important;
    color: #c9372c !important;
    padding-left: 1.5rem;
}

/* 下划线悬停特效 */
.hover-underline:hover {
    text-decoration: underline !important;
}

/* 快捷导航悬停特效 */
.custom-nav-item {
    transition: all 0.2s ease-in-out;
}
.custom-nav-item:hover {
    background-color: #ffe8e8 !important; /* 浅红色背景呼应主题 */
    color: #c82333 !important; /* 文字变红 */
    transform: translateX(5px); /* 悬停时整体微微右移 */
}

/* --- 4. Components: Solar Terms List (24节气列表专属) --- */
.solar-icon-side {
    background-color: #f5f0e6;
    border-right: 1px solid rgba(0,0,0,0.05);
}
.solar-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 2px solid #e2d7c3;
}

.solar-season-spring .solar-icon-side { background: linear-gradient(180deg, #eaf2e8 0%, #f4f8f3 100%); }
.solar-season-spring .solar-icon-circle { border-color: #9cb995; }

.solar-season-summer .solar-icon-side { background: linear-gradient(180deg, #fceee8 0%, #fcf6f3 100%); }
.solar-season-summer .solar-icon-circle { border-color: #e39a82; }

.solar-season-autumn .solar-icon-side { background: linear-gradient(180deg, #fcf4e6 0%, #fdf8f0 100%); }
.solar-season-autumn .solar-icon-circle { border-color: #deb887; }

.solar-season-winter .solar-icon-side { background: linear-gradient(180deg, #e8eff2 0%, #f3f7f8 100%); }
.solar-season-winter .solar-icon-circle { border-color: #8faec0; }

.current-solar-term {
    background-color: #f0fdf4 !important; 
    border: 2px solid #4ade80 !important; 
    transform: scale(1.02);
    z-index: 2;
    box-shadow: 0 10px 25px rgba(74, 222, 128, 0.2) !important;
}
.current-solar-term .solar-icon-side {
    background: linear-gradient(180deg, #dcfce7 0%, #f0fdf4 100%) !important;
}
.current-solar-term .solar-icon-circle {
    border-color: #22c55e !important;
    border-width: 3px;
}
.current-solar-term .card-title a {
    color: #166534 !important;
}

/* --- 5. Components: Single Page (文章详情页) --- */
.festival-hero-major {
    background-color: #8c1d18;
    background-image: url('/images/bg_clouds-1.webp');
    background-size: cover;
    background-position: center;
    padding: 5.5rem 0;
    position: relative;
}
.hero-intro-card-major {
    background-color: rgba(255, 255, 255, 0.94);
    border-radius: 16px;
    padding: 3.5rem;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.festival-icon-box-major {
    width: 84px;
    height: 84px;
    background-color: #fcf8e3;
    border: 2px solid #e6a23c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
    flex-shrink: 0;
}
.festival-hero-regular {
    background-color: #fcfaf5;
    border-bottom: 1px solid #eedece;
    padding: 3rem 0;
}
.festival-hero-solar {
    background: linear-gradient(135deg, #1c3838 0%, #2a5252 100%);
    color: #fff;
    padding: 3rem 0;
}

/* --- 6. Components: Calendar Hub (万年历) --- */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}
.cal-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    background-color: #f8f9fa;
    transition: all 0.2s;
    cursor: default;
}
.cal-cell:hover:not(.empty) {
    background-color: #e9ecef;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}
.cal-cell.empty {
    background-color: transparent;
}
.cal-cell.today {
    background-color: #ffe8e8;
    border: 1px solid #c82333;
}
.cal-gregorian {
    font-size: 1.25rem;
    font-weight: bold;
    color: #333;
    line-height: 1;
}
.cal-lunar {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 4px;
}
.cal-highlight {
    color: #c82333;
    font-weight: bold;
}
a.cal-lunar {
    transition: color 0.2s;
}
a.cal-lunar:hover {
    color: #a71d2a;
    text-decoration: underline !important;
}
/* ==========================================================================
   Navbar Contrast & Interaction Adjustments 
   (覆盖 Bootstrap 默认透明度，并自定义 hover 颜色)
   ========================================================================== */

/* 1. 默认未激活状态：提高亮度到 90%，增加细微阴影 */
.bg-china-red .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9); 
    font-weight: 500;
    transition: color 0.3s ease, text-shadow 0.3s ease; /* 增加平滑过渡效果 */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 
}

/* 2. 当前激活状态 (Active)：保持纯白，强调当前位置 */
.bg-china-red .navbar-nav .nav-link.active {
    color: #ffffff; 
    font-weight: 600; /* 激活状态字体稍微加粗一点点 */
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

/* 3. 鼠标悬停状态 (Hover) 和 获得焦点状态 (Focus)：变为淡黄色 */
.bg-china-red .navbar-nav .nav-link:hover,
.bg-china-red .navbar-nav .nav-link:focus {
    color: #FFEA75; /* 柔和的淡黄色，红黄搭配很传统 */
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3); /* 悬停时阴影稍微加深，增加浮现感 */
}
/* ==========================================================================
   Hero Section Calligraphy Background (透明图片水印方案)
   ========================================================================== */

.hero-calligraphy-img {
    position: absolute;
    bottom: 3%;           /* 因为基准变了，底部可以稍微多沉下去一点，避免和上方文字冲突 */
    right: 0;               /* 【关键修改】紧贴 container 的右边缘对齐 */
    width: 280px;           
    max-width: 45vw;        
    height: auto;           
    opacity: 0.25;          /* 你那张新年图比较细，可以把透明度适当调高一点，比如 0.15 到 0.2 */
    z-index: -1;            /* 设为 -1 确保它绝对在文字和卡片的下方 */
    pointer-events: none;   
    user-select: none;      
    transform: rotate(-1deg); 
    transition: opacity 0.2s ease-in-out;
}

/* 移动端适配 */
@media (max-width: 991px) {
    .hero-calligraphy-img {
        width: 220px;       
        bottom: 0;
        right: 0;           /* 移动端同样贴边 */
        opacity: 0.08;      
    }
}
/* 卡片标题链接悬停效果 */
.card-title-link {
    color: #212529; /* 默认深色 */
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.card-title-link:hover {
    color: #c9372c !important; /* 悬停时变成中国红 */
}
/* ==========================================================================
   Tag Pills (文章卡片底部的小书签链接) - 终极强制生效版
   ========================================================================== */

.tag-pill {
    display: inline-block !important; 
    padding: 0.35rem 0.65rem !important;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #495057 !important;        
    background-color: #f8f9fa !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 50rem !important;
    text-decoration: none !important; 
    transition: all 0.25s ease; 
}

/* 核心 Hover 悬停效果 */
.tag-pill:hover,
.tag-pill:focus {
    color: #c9372c !important;        
    background-color: #ffffff !important;
    border-color: #c9372c !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(201, 55, 44, 0.15) !important;
    text-decoration: none !important;
}

.tag-pill:active {
    transform: translateY(0) !important;
    box-shadow: none !important;
}

/* ==========================================================================
   Unified Background Textures (模块统一背景纹理呼应)
   ========================================================================== */

.bg-texture-diagonal {
    position: relative; /* 为内部的伪元素提供绝对定位基准 */
}

/* 伪元素：专门用来铺设纹理，绝不干扰原本的背景色 */
.bg-texture-diagonal::before {
    content: "";
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    /* 45度倾斜的半透明细线，线宽 1px，间距 8px */
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.03) 0px,
        rgba(255, 255, 255, 0.03) 1px,
        transparent 1px,
        transparent 8px
    );
    z-index: 0; 
    pointer-events: none; /* 【核心】鼠标点击直接穿透，绝不影响里面的卡片交互 */
}

/* 确保版块内的核心内容（Container）始终浮在纹理之上 */
.bg-texture-diagonal > .container {
    position: relative;
    z-index: 1; 
}
/* ==========================================================================
   Unified Background Textures (模块统一背景纹理呼应 - 古典纹理)
   ========================================================================== */

.bg-texture-traditional {
    position: relative; 
}

/* 方案 A：金钱叠交纹 (Interlocking Coins) */
.bg-texture-traditional::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* 使用两层径向渐变，错位交叠形成古典圆环网格 */
    background-image: 
        radial-gradient(transparent 10px, rgba(255, 255, 255, 0.04) 11px, rgba(255, 255, 255, 0.04) 12px, transparent 13%),
        radial-gradient(transparent 10px, rgba(255, 255, 255, 0.04) 11px, rgba(255, 255, 255, 0.04) 12px, transparent 13%);
    background-size: 28px 28px;
    background-position: 0 0, 14px 14px;
    z-index: 0; 
    pointer-events: none; 
}

.bg-texture-traditional > .container {
    position: relative;
    z-index: 1; 
}
/* ==========================================================================
   Light Background Traditional Texture (浅色纸张专用：金钱交叠暗纹)
   ========================================================================== */

.bg-texture-light {
    position: relative;
}

.bg-texture-light::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    /* 使用与你网站正文风格协调的暖褐色/墨灰色（#5c4b37），保持极低透明度 0.025，宛如宣纸天然压印 */
    background-image: 
        radial-gradient(transparent 10px, rgba(92, 75, 55, 0.04) 11px, rgba(92, 75, 55, 0.025) 12px, transparent 13%),
        radial-gradient(transparent 10px, rgba(92, 75, 55, 0.04) 11px, rgba(92, 75, 55, 0.025) 12px, transparent 13%);
    background-size: 28px 28px;
    background-position: 0 0, 14px 14px;
    z-index: 0; 
    pointer-events: none; /* 绝对防遮挡 */
}

/* 确保 Hero 内部的内容浮于纹理之上 */
.bg-texture-light > .container {
    position: relative;
    z-index: 1;
}