/* ========== 全站公共样式 ========== */

:root {
    --color-theme: #FFFA00;
    /* 次要主题：结构线、标题与黄底衬字 */
    --color-theme-secondary: #000000;
    --line-ins: rgba(0, 0, 0, 0.12);
    /* 多色横幅等装饰用，非「纯 #FFFA00」填充 */
    --color-theme-deep: #d4c800;
    --color-theme-hover: #ebe300;
    --color-theme-ink: #000000;
    --color-theme-text-end: #000000;
    --color-feature-title: #000000;
    /* 正文：略浅于纯黑，保证可读 */
    --color-body: rgba(0, 0, 0, 0.72);
    /* 纯主题黄区域：纯色，无亮→暗渐变 */
    --gradient-theme: #FFFA00;
    --gradient-theme-reverse: #ebe300;
    --gradient-theme-h: #FFFA00;
    /* 大标题字色（ins 极简） */
    --gradient-theme-title: #000000;
    --shadow-theme: 0 4px 12px rgba(212, 200, 0, 0.35);
    --shadow-theme-hover: 0 6px 20px rgba(212, 200, 0, 0.45);
    --shadow-theme-strong: 0 6px 30px rgba(212, 200, 0, 0.5);
    --shadow-tool: 0 6px 20px rgba(212, 200, 0, 0.4);
    --shadow-ins: 0 1px 0 rgba(0, 0, 0, 0.06);
    /* 页面底：与首页一致纯白画布；卡片仍为白 */
    --color-canvas: #ffffff;
    --color-card: #ffffff;
    /* 首页「浮岛」卡片阴影（枢纽页 .feature-card 等复用） */
    --shadow-card-float:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 18px 46px rgba(0, 0, 0, 0.09),
        0 6px 16px rgba(0, 0, 0, 0.05);
    --shadow-card-float-hover:
        0 1px 0 rgba(255, 255, 255, 0.92) inset,
        0 24px 56px rgba(0, 0, 0, 0.11),
        0 8px 22px rgba(0, 0, 0, 0.06);
}

/* 全局重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
}

/* 基础页面样式 */
body {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background-color: var(--color-canvas);
    color: var(--color-body);
    line-height: 1.6;
    overflow-x: hidden;
}

/* 返回主页按钮 - 统一样式 */
.back-btn {
    display: inline-block;
    padding: 9px 18px;
    background-color: var(--color-theme-secondary);
    color: #fff !important;
    text-decoration: none !important;
    margin-bottom: 20px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-ins);
}

.back-btn:hover {
    background-color: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* 容器样式 */
.container {
    background: var(--color-card);
    padding: 35px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: var(--shadow-card-float);
}

/* 全站统一页脚：白底卡片、细边框与阴影、居中 #888 字（子目录与根页共用） */
footer.site-footer {
    display: block;
    text-align: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin-top: 48px;
    margin-bottom: 0;
    margin-left: auto;
    margin-right: auto;
    padding: 22px 24px;
    color: #888888;
    font-size: 0.9rem;
    line-height: 1.65;
    font-weight: 400;
    background: var(--color-card);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: var(--shadow-card-float);
}

footer.site-footer p {
    margin: 0;
    color: inherit;
    font-weight: 400;
}

@media (max-width: 767.98px) {
    footer.site-footer {
        padding: 18px 16px;
        font-size: 0.85rem;
        margin-top: 36px;
    }
}

/* Toast 提示样式 */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--color-theme-secondary);
    color: #fff;
    padding: 12px 24px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10000;
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s, transform 0.3s;
    font-size: 14px;
    max-width: 300px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    background-color: #27ae60;
}

.toast.error {
    background-color: #e74c3c;
}

.toast.info {
    background-color: #3498db;
}

/* ============================================
   通用布局与卡片样式（首页 & 工具页共享）
   ============================================ */

/* 通用内容区块容器（与首页一致：外层透明，卡片各自浮岛） */
.section {
    margin-bottom: 30px;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
}

/* 通用区块标题 */
.section-title {
    color: var(--gradient-theme-title);
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line-ins);
    font-size: 1.5rem;
    font-weight: 600;
}

/* 通用功能列表布局 */
.features {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 768px) {
    .features {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 通用功能卡片样式（与首页 tips-card 同级的浮岛阴影） */
.feature-card,
.tips-card {
    border: 1px solid rgba(0, 0, 0, 0.07);
    padding: 22px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: var(--color-card);
    box-shadow: var(--shadow-card-float);
    position: relative;
    overflow: hidden;
}

.feature-card::before,
.tips-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--color-theme);
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.feature-card:hover::before,
.tips-card:hover::before {
    transform: scaleX(1);
}

.feature-card:hover,
.tips-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-card-float-hover);
}

.feature-title {
    margin-bottom: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-feature-title);
    line-height: 1.3;
}

.feature-card p,
.tips-card p {
    font-size: 0.95rem;
    color: #5a6c7d;
    line-height: 1.6;
    margin-bottom: 6px;
}

/* 通用工具按钮 */
.tool-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 0.95rem;
    text-decoration: none !important;
    margin-top: 14px;
    color: var(--color-theme-ink) !important;
    font-weight: 600;
    background: var(--gradient-theme);
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.tool-btn::after {
    content: '→';
    transition: transform 0.3s ease;
}

.tool-btn:hover::after {
    transform: translateX(4px);
}

.tool-btn:hover {
    background: var(--gradient-theme-reverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-tool);
}

/* ============================================
   通用页面布局样式
   ============================================ */

/* 标准页面容器 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 25px 20px;
    background: transparent;
    min-height: 100vh;
}

/* 标准页面标题样式（局部旧页；枢纽页请用 .section-header） */
.page-title {
    color: var(--gradient-theme-title);
    margin-bottom: 3px;
    font-size: 2rem;
    font-weight: 700;
    background: none;
    -webkit-background-clip: unset;
    -webkit-text-fill-color: unset;
    background-clip: unset;
    letter-spacing: -0.5px;
    text-align: center;
}

/* ============================================
   页面头部布局样式
   ============================================ */

/* 页面头部布局（顶黄线仅在根首页 home.css 的 header，子页不显示） */
.page-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    position: relative;
    padding-top: 0;
}

.header-top {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 0;
}

/* 增强版返回按钮样式（支持渐变背景） */
.back-btn.gradient {
    background: var(--gradient-theme);
    color: var(--color-theme-ink) !important;
    box-shadow: var(--shadow-theme);
    margin-bottom: 0 !important;
}

.back-btn.gradient:hover {
    background: var(--gradient-theme-reverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-theme-hover);
}

/* 通用渐变返回按钮样式（用于工具页面） */
.page-header .back-btn {
    background: var(--gradient-theme);
    color: var(--color-theme-ink) !important;
    box-shadow: var(--shadow-theme);
    flex-shrink: 0;
    font-size: 0.95rem;
    padding: 9px 18px;
    margin-bottom: 0 !important;
}

.page-header .back-btn:hover {
    background: var(--gradient-theme-reverse);
    transform: translateY(-2px);
    box-shadow: var(--shadow-theme-hover);
}

/* 子页窄屏：页边距、页头间距与返回按钮（原各页内联合并） */
@media (max-width: 767.98px) {
    .page-container {
        padding: 15px 12px;
    }

    .page-container .page-header {
        margin-bottom: 18px;
    }

    .page-container .header-top {
        margin-bottom: 0;
    }

    .page-container .page-header .back-btn {
        font-size: 0.85rem;
        padding: 7px 14px;
    }

    .page-container .converter,
    .page-container .generator,
    .page-container .app-panel {
        padding: 20px 18px;
    }
}

/* 与首页一致的区块标题：居中主标题 + 黄下划线 + 灰色导语 + 黑粗内链（子目录页 .page-header 内复用） */
.section-header {
    text-align: center;
    margin-bottom: 0;
    padding: 14px 16px 6px;
    background: transparent;
    border: none;
    box-shadow: none;
    width: 100%;
}

.section-header--page {
    padding-top: 10px;
    margin-bottom: 4px;
}

/* 首页等：区块内标题与下方卡片网格的间距 */
.section > .section-header:first-child {
    margin-bottom: 18px;
}

.section-header h1,
.section-header h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: #000000;
    margin: 0 0 0 0;
    padding: 0 0 12px 0;
    position: relative;
    display: inline-block;
    max-width: 100%;
    line-height: 1.25;
    letter-spacing: -0.3px;
    text-align: center;
}

.section-header h1::after,
.section-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 52px;
    height: 4px;
    background: var(--color-theme);
}

.section-header p {
    color: #666666;
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.65;
    margin: 14px auto 0;
    max-width: 42rem;
}

.section-header p a,
.home-hub-link {
    margin-left: 0.35em;
    color: #000000;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.section-header p a:hover,
.home-hub-link:hover {
    color: var(--color-theme-secondary);
    text-decoration: underline;
}

/* 同系列工具页内二级导航（决策三页互链等） */
.page-header .header-top {
    justify-content: space-between;
    align-items: center;
}

.page-header .header-top .app-subnav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px 14px;
    margin: 0 0 0 12px;
    padding: 0;
    list-style: none;
}

.page-header .app-subnav a {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-body);
    text-decoration: none;
    padding: 4px 2px;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.page-header .app-subnav a:hover {
    color: var(--color-theme-secondary);
    border-bottom-color: var(--color-theme-deep);
}

@media (max-width: 767.98px) {
    /* 顶栏：返回上一级 + 返回主页 并排，避免纵向堆叠占高 */
    .page-header .header-top {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
    }

    .page-header .header-top .app-subnav {
        flex: 1 1 100%;
        margin: 10px 0 0 0;
        justify-content: flex-start;
    }

    .page-header .app-subnav a {
        font-size: 0.85rem;
    }
}

/* 通用白色卡片容器（工具页 / 问卷 / 游戏主区等） */
.page-container .converter,
.page-container .generator,
.page-container .app-panel {
    background: var(--color-card);
    padding: 25px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: var(--shadow-card-float);
    margin-top: 0;
}

/* ============================================
   返回顶部按钮样式
   ============================================ */

.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 70px;
    width: 50px;
    height: 50px;
    background: var(--gradient-theme);
    color: var(--color-theme-ink);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 20px rgba(212, 200, 0, 0.4);
    transition: all 0.3s ease;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    pointer-events: none;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: var(--gradient-theme-reverse);
    transform: translateY(-5px);
    box-shadow: var(--shadow-theme-strong);
}

.back-to-top:active {
    transform: translateY(-2px);
}

/* ============================================
   卡片图标和标题样式（工具页面通用）
   ============================================ */

/* 卡片图标和标题容器 */
.card-icon-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

/* 合集卡片内标题：与通用 .feature-title 区分，避免与图标行重复下边距 */
.card-icon-title .feature-title {
    margin: 0;
    display: inline-block;
}

/* 实验与工具总览等页面的导语 */
.hub-intro {
    color: #5a6c7d;
    line-height: 1.65;
    margin: 0 0 1.5rem 0;
}

/* 专题与实践列表页导语 */
.articles-lead {
    color: #5a6c7d;
    line-height: 1.65;
    margin: 0 auto 1.5rem;
    text-align: center;
    max-width: 42rem;
}

/* 卡片图标（内联 SVG 或 sprite <use>，不依赖 emoji 字体） */
.card-icon {
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(0, 0, 0, 0.78);
    line-height: 0;
}

.card-icon > svg {
    width: 100%;
    height: 100%;
    display: block;
    overflow: visible;
}

/* 特色标签 */
.feature-tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    font-weight: 600;
    background: linear-gradient(135deg, #a8e6cf 0%, #88d8a3 100%);
    color: #00b894;
}

/* 移动端优化 */
@media (max-width: 767.98px) {
    .page-container {
        padding: 15px 12px;
    }
    
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 3px;
        white-space: normal;
        max-width: 60%;
        text-align: center;
    }
    
    .back-btn {
        margin-bottom: 15px;
        padding: 7px 14px;
        font-size: 0.85rem;
    }
    
    .page-header {
        margin-bottom: 20px;
        align-items: center;
    }
    
    .page-header .back-btn {
        font-size: 0.85rem;
        padding: 7px 14px;
    }
    
    .page-header h1,
    .page-header h2 {
        text-align: center;
    }

    .section-header h1,
    .section-header h2 {
        font-size: 1.45rem;
        padding-bottom: 10px;
    }

    .section-header h1::after,
    .section-header h2::after {
        width: 44px;
        height: 3px;
    }

    .section-header p {
        font-size: 0.9rem;
        margin-top: 12px;
    }
    
    .back-to-top {
        width: 45px;
        height: 45px;
        bottom: 20px;
        right: 70px;
        font-size: 20px;
    }
    
    .page-container .converter,
    .page-container .generator,
    .page-container .app-panel {
        padding: 20px 18px;
    }

    .feature-card,
    .tips-card {
        padding: 18px;
    }

    .feature-card p,
    .tips-card p {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 4px;
    }
    
    .card-icon {
        width: 2rem;
        height: 2rem;
    }
    
    .card-icon-title {
        gap: 8px;
    }
    
    .feature-title {
        font-size: 1.1rem;
    }
}

/* ins 风：全局直角（覆盖各子页局部圆角与内联样式） */
*, *::before, *::after {
    border-radius: 0 !important;
}

