/* ============================================================
   LiveBBS 首页样式（同时被专栏列表页 / 新页面模板引用）
   公共基础样式见 common.css，本文件只保留首页覆盖项与首页专属组件
   ============================================================ */

/* ---- 首页顶栏覆盖：更窄的右内边距 + 盒模型/过渡 ---- */
.topbar {
    padding-left: 24px;
    padding-right: 10px;
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
    box-sizing: border-box;
}

.topbar-links {
    padding-right: 0;
}

/* ---- 首页链接胶囊：带过渡与阴影 ---- */
a {
    transition: background 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 4px rgba(26, 111, 191, 0.3);
}

/* ---- 首页页脚覆盖：更紧凑的间距 ---- */
.footer {
    gap: 2px;
}

.footer a {
    padding: 0 !important;
    margin: 0 2px !important;
}

/* ---- 标题卡片 ---- */
.title {
    position: static;
    width: 600px;
    padding: 48px 0 32px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(224, 244, 252, 0.6));
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(26, 58, 92, 0.2);
    backdrop-filter: blur(26px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
    margin: 25vh auto 0 auto;
}

.title:hover {
    box-shadow: 0 12px 40px rgba(26, 58, 92, 0.3);
    backdrop-filter: blur(30px) saturate(160%);
}

.title_img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.title_text {
    font-family: 'Smileysans', Arial, sans-serif;
    font-size: 2.5rem;
    background: linear-gradient(90deg, #1a6fbf, #4a9eff, #1a3a5c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-align: center;
    margin-top: 15px;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    user-select: none;
}

/* ---- 页脚随机语录（打字机，结构由 a.js 生成） ---- */
#footer-quote {
    display: block;
    width: 100%;
    white-space: pre-wrap;
    text-align: center;
}

.footer-quote-wrap {
    display: block;
    width: 100%;
    white-space: normal;
    text-align: center;
}

.footer-quote-text {
    display: inline-block;
    max-width: 90%;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    text-align: center;
}

.footer-quote-cursor {
    display: inline-block;
    vertical-align: baseline;
    width: 0.6ch;
    margin-left: 0.3ch;
    color: #0b63d6;
}

.footer-cursor-blink {
    animation: footerCursorFade 1.2s ease-in-out infinite;
}

@keyframes footerCursorFade {
    0% { opacity: 0; }
    50% { opacity: 1; }
    100% { opacity: 0; }
}

/* ---- 卡片容器 ---- */
.sections {
    margin-top: 32px;
    padding: 0 40px 32px 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

@media (max-width: 899px) {
    .sections {
        margin-top: 220px;
        padding: 0 20px 24px 20px;
        position: static;
    }
    .section-card {
        position: static !important;
        width: 100% !important;
        margin-bottom: 18px;
    }
}

@media (max-width: 600px) {
    .sections {
        margin-top: 160px;
        padding: 0 16px 16px 16px;
    }
    .section-card {
        margin-bottom: 12px;
    }
}

@media (min-width: 900px) {
    .sections {
        position: relative;
    }
    .section-card {
        position: absolute;
        width: calc(50% - 16px);
        margin-bottom: 0;
        transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease;
        display: grid !important;
        grid-template-columns: 110px 1fr !important;
        align-items: start !important;
    }
    .section-card.no-img {
        display: grid !important;
        padding-left: 22px;
        grid-template-columns: 1fr !important;
    }
    .section-card.no-img .section-info {
        padding-left: 0;
    }
    .section-card.no-img .section-info {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .section-card.no-img .section-title,
    .section-card.no-img .section-subtitle,
    .section-card.no-img .section-link {
        width: 100%;
        box-sizing: border-box;
    }
    .section-card.no-img .section-link {
        display: inline-flex;
        white-space: nowrap;
        width: auto;
        min-width: 100px;
    }
}

.section-card {
    display: grid;
    grid-template-columns: 110px 1fr;
    align-items: start;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.85), rgba(224, 244, 252, 0.75));
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(26, 58, 92, 0.15);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    border: 2px solid rgba(255, 255, 255, 0.6);
    padding: 16px 22px;
    min-height: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: box-shadow 0.3s ease, backdrop-filter 0.3s ease, -webkit-backdrop-filter 0.3s ease;
}

.section-card:hover {
    box-shadow: 0 8px 32px rgba(26, 58, 92, 0.25);
    backdrop-filter: blur(18px) saturate(160%);
}

.section-card.no-img {
    display: block;
    padding-left: 22px;
}

.section-card.no-img .section-info {
    padding-left: 0;
}

/* 锚点跳转时的闪烁高亮（由 a.js 触发） */
.section-flash {
    animation: sectionFlashAnim 0.8s 1;
}

@keyframes sectionFlashAnim {
    0% { box-shadow: 0 0 0 0 #fff, 0 0 0 0 #2196f3; }
    20% { box-shadow: 0 0 8px 2px #2196f3, 0 0 0 0 #fff; }
    50% { box-shadow: 0 0 0 0 #fff, 0 0 8px 2px #2196f3; }
    80% { box-shadow: 0 0 8px 2px #2196f3, 0 0 0 0 #fff; }
    100% { box-shadow: 0 0 0 0 #fff, 0 0 0 0 #2196f3; }
}

.section-img {
    width: 150px;
    height: 95px;
    object-fit: cover;
    border-radius: 12px;
    background: linear-gradient(135deg, #e8f4fc, #1a3a5c);
    display: block;
    margin-right: 18px;
}
/*---- 卡片信息区 ---- */
.section-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 0 18px 0 55px;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}
/*---- 标题 ---- */
.section-title {
    font-size: 1.25rem;
    font-weight: bold;
    background: linear-gradient(90deg, #1a6fbf, #1a3a5c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 6px;
    font-family: 'Smileysans', Arial, sans-serif;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}
/*---- 仅在大屏显示，移动端隐藏 ---- */
/*---- 内容介绍 ---- */
.section-subtitle {
    font-size: 1rem;
    color: #2c5a8c;
    margin-bottom: 8px;
    font-family: Arial, sans-serif;
    word-break: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    line-clamp: 4;
    overflow: hidden;
}
/* ---- 卡片链接胶囊 ---- */
.section-link {
    margin-top: 0;
    padding: 4px 18px;
    font-size: 15px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4a9eff, #66b5ff);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 3px 8px rgba(26, 111, 191, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 1px;
    min-width: 60px;
    max-width: none;
    white-space: nowrap;
    transition: background 0.2s, box-shadow 0.2s;
}

.section-link:hover {
    background: linear-gradient(135deg, #3a8eef, #0d5fa0);
    box-shadow: 0 4px 12px rgba(26, 111, 191, 0.4);
}

.section-link img,
.section-link svg {
    margin-right: 5px;
    margin-bottom: -0.5px;
    vertical-align: -1px;
}

@media (max-width: 700px) {
    .title {
        width: 90vw;
        min-height: 140px;
        padding: 24px 0 18px 0;
    }
    .title_img {
        width: 90vw;
        height: 140px;
    }
    .section-subtitle {
        display: none;
    }
    /* 原版在此宽度下对胶囊链接实际生效的属性（其余已被基础规则覆盖） */
    .section-link {
        box-sizing: border-box;
        text-align: center;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* ---- 语录文字渐变（表情符号用 .no-gradient 排除） ---- */
.gradient-text {
    display: inline;
    background: linear-gradient(90deg, #4a9eff, #1a6fbf, #1a3a5c);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
    background-repeat: no-repeat;
}

.no-gradient {
    display: inline;
    background: none !important;
    -webkit-text-fill-color: initial !important;
    color: inherit !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
}
