/* =============================================
   Diuz 独立网站 - 合并样式表
   包含：全局变量 + 开屏动画 + 首页网格
   ============================================= */

/* ============================================
   一、全局变量与主题色（修改这里即可换肤）
   ============================================ */

:root {
    /* ===== 主配色方案（绿色渐变系）===== */
    --diuz-primary: #10b981;
    --diuz-primary-dark: #0da271;
    --diuz-primary-light: #6ee7b7;
    --diuz-secondary: #0da271;
    --diuz-accent: #f59e0b;
    --diuz-success: #10b981;
    --diuz-danger: #ef4444;
    --diuz-warning: #f59e0b;

    /* ===== 背景与文字 ===== */
    --diuz-bg-body: #f1f5f9;
    --diuz-bg-card: #ffffff;
    --diuz-text-primary: #1e293b;
    --diuz-text-secondary: #64748b;
    --diuz-border-color: #e2e8f0;

    /* ===== 圆角与阴影 ===== */
    --diuz-radius-sm: 8px;
    --diuz-radius-md: 12px;
    --diuz-radius-lg: 16px;
    --diuz-shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --diuz-shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --diuz-shadow-lg: 0 8px 32px rgba(0,0,0,0.12);

    /* ===== 过渡动画 ===== */
    --diuz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* ===== 字体 ===== */
    --diuz-font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    --diuz-font-mono: "JetBrains Mono", "Fira Code", Consolas, Monaco, monospace;

    /* ===== 小狗配色（来自 splash.css）===== */
    --dog-primary: #FF9966;
    --dog-light:   #FFCC99;
    --dog-dark:    #CC6633;
    --dog-accent:  #663300;
}

/* ============================================
   二、全局基础样式重置
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--diuz-font-sans) !important;
    background: var(--diuz-bg-body) !important;
    color: var(--diuz-text-primary) !important;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* 屏幕阅读器专用隐藏类（仅对辅助技术可见） */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 图片懒加载样式 */
img.loading {
    opacity: 0.3;
    transition: opacity 0.3s ease;
    background: linear-gradient(90deg, var(--diuz-bg-body) 25%, #e2e8f0 50%, var(--diuz-bg-body) 75%);
    background-size: 200% 100%;
    animation: image-loading 1.5s ease-in-out infinite;
}

img.loaded {
    opacity: 1;
    transition: opacity 0.5s ease;
}

img.error {
    opacity: 0.7;
    filter: grayscale(80%);
}

@keyframes image-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* 暗色模式下的图片样式 */
@media (prefers-color-scheme: dark) {
    img.loading {
        background: linear-gradient(90deg, #1e293b 25%, #334155 50%, #1e293b 75%);
    }
}

/* 图片优化：响应式图片与WebP支持 */
img {
    max-width: 100%;
    height: auto;
    /* 防止图片拉伸 */
    object-fit: cover;
}

/* 为支持WebP的浏览器提供优化 */
@supports (background: url('image.webp')) {
    .webp-optimized {
        background-image: url('image.webp');
    }
}

/* 图片懒加载：低质量图片占位符 (LQIP) 技术 */
.lqip {
    filter: blur(10px);
    transition: filter 0.5s ease;
}
.lqip.loaded {
    filter: blur(0);
}

/* 图片纵横比保持容器 */
.aspect-ratio-box {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 比例 */
    height: 0;
    overflow: hidden;
}
.aspect-ratio-box img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 打印时隐藏不必要的图片 */
@media print {
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    .no-print {
        display: none !important;
    }
}


a {
    color: var(--diuz-primary);
    transition: var(--diuz-transition);
}

a:hover {
    color: var(--diuz-primary-dark) !important;
}

/* ============================================
   三、开屏欢迎动画样式 (Splash Screen)
   ============================================ */

/* ---- 全屏遮罩层 ---- */
.splash-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-container.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

/* ---- 粒子容器 ---- */
.particles-container {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    overflow: hidden; pointer-events: none;
}
.particle {
    position: absolute; border-radius: 50%; pointer-events: none;
    will-change: transform, opacity;
}

/* ---- 欢迎文字区域 ---- */
.welcome-text-container {
    position: relative; z-index: 10; text-align: center;
    padding: 20px; display: flex; flex-direction: column; align-items: center;
}

.typewriter-text {
    color: #fff; font-size: clamp(24px,5vw,48px); font-weight: 800;
    letter-spacing: 2px; margin: 0; min-height: 1.2em;
    text-shadow: 0 0 30px rgba(16,185,129,0.6), 0 0 60px rgba(110,231,183,0.4);
}
.typewriter-text::after { content:'|'; animation:blink-cursor .7s step-end infinite; color:#6ee7b7; margin-left:2px; }
.typewriter-text.done::after { display:none; }

@keyframes blink-cursor { 0%,100%{opacity:1} 50%{opacity:0} }

/* ---- 进度条 ---- */
.splash-progress { width:200px; height:3px; background:rgba(255,255,255,0.15); border-radius:3px; margin-top:30px; overflow:hidden; }
.splash-progress-bar { height:100%; width:0%; background:linear-gradient(90deg,#10b981,#6ee7b7); border-radius:3px; transition:width .1s linear; }

/* ========== 粒子动画关键帧 ========== */
@keyframes particle-explode-1{0%{transform:translate(0,0) scale(1);opacity:1}100%{transform:translate(var(--tx),var(--ty)) scale(0);opacity:0}}
@keyframes particle-ring{0%{transform:translate(0,0) scale(.5);opacity:1}100%{transform:translate(var(--tx),var(--ty)) scale(1.5);opacity:0}}
@keyframes particle-rise{0%{transform:translate(0,0) scale(1) rotate(0);opacity:1}100%{transform:translate(calc(var(--tx)*.3),-200px) scale(0) rotate(360deg);opacity:0}}
@keyframes twinkle{0%,100%{opacity:.2;transform:scale(.8)}50%{opacity:1;transform:scale(1.2)}}
@keyframes bg-pulse{0%,100%{opacity:.03;transform:scale(1)}50%{opacity:.08;transform:scale(1.05)}}

.splash-container::before,.splash-container::after{
    content:''; position:absolute; border-radius:50%;
    background:radial-gradient(circle,rgba(16,185,129,.15) 0%,transparent 70%);
    animation:bg-pulse 3s ease-in-out infinite; pointer-events:none;
}
.splash-container::before{width:600px;height:600px;top:-200px;right:-200px}
.splash-container::after{width:400px;height:400px;bottom:-100px;left:-100px;background:radial-gradient(circle,rgba(110,231,183,.12) 0%,transparent 70%)}


/* =============================================
   ★★★ 图标+Emoji 可爱小狗 ★★★
   使用：Font Awesome 图标 + Unicode Emoji
   ============================================= */

/* ---- 小狗容器（共用）---- */
.dog-character {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    
    /* 性能优化 */
    transform: translateZ(0);
    backface-visibility: hidden;
    will-change: transform, opacity;
    
    /* 加载淡入 */
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.34,1.56,0.64,1);
}
.dog-character.loaded { opacity: 1; }

/* ---- 主视觉：Emoji 狗狗 ---- */
.dog-emoji {
    font-size: 80px;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.25));
    /* 防止点击选中 */
    user-select: none;
    -webkit-user-select: none;
}

/* ---- 装饰：FA 狗爪印 ---- */
.dog-paw-icon {
    font-size: 18px;
    color: var(--dog-primary);
    position: absolute;
    bottom: -8px;
    animation: paw-bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 2px 4px rgba(204,102,51,0.3));
}
.dog-paw-icon.paw-left  { left: 10%; animation-delay: 0s; transform: rotate(-20deg); }
.dog-paw-icon.paw-right { right: 10%; animation-delay: 0.3s; transform: rotate(20deg); }

@keyframes paw-bounce {
    0%, 100% { transform: translateY(0) rotate(-20deg) scale(1); }
    50%      { transform: translateY(-6px) rotate(-15deg) scale(1.15); }
}
.dog-paw-icon.paw-right {
    animation-name: paw-bounce-right;
}
@keyframes paw-bounce-right {
    0%, 100% { transform: translateY(0) rotate(20deg) scale(1); }
    50%      { transform: translateY(-6px) rotate(15deg) scale(1.15); }
}

/* ---- 装饰：骨头（开屏专用）---- */
.dog-bone {
    font-size: 22px;
    color: var(--dog-light);
    position: absolute;
    top: -12px;
    right: -16px;
    animation: bone-float 3s ease-in-out infinite;
    transform: rotate(25deg);
    filter: drop-shadow(0 2px 4px rgba(255,204,153,0.4));
}

@keyframes bone-float {
    0%, 100% { transform: rotate(25deg) translateY(0); }
    50%      { transform: rotate(35deg) translateY(-5px); }
}

/* ---- 装饰：爱心徽章（首页专用）---- */
.dog-love-badge {
    font-size: 14px;
    color: #ef4444;
    position: absolute;
    top: -6px;
    right: -8px;
    animation: heart-beat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 1px 3px rgba(239,68,68,0.4));
}

@keyframes heart-beat {
    0%, 100% { transform: scale(1); }
    15%     { transform: scale(1.3); }
    30%     { transform: scale(1); }
    45%     { transform: scale(1.2); }
    60%     { transform: scale(1); }
}

/* ---- 小狗容器定位 ---- */
.splash-dog-container {
    position: relative;
    z-index: 9999;
    margin-bottom: 16px;
}

.homepage-dog-container {
    text-align: center;
    margin: 0 auto 16px;
}

/* =============================================
   开屏狗狗动画（活泼可爱）
   ============================================= */
.splash-dog {
    animation:
        dog-bounce 3s ease-in-out infinite,
        dog-wiggle 4s ease-in-out infinite,
        emoji-pop 5s ease-in-out infinite;
}

.splash-dog .dog-paw-icon {
    animation-duration: 0.65s !important;
}

.splash-dog .dog-bone {
    animation: bone-spin 2s linear infinite;
}

@keyframes dog-bounce {
    0%, 100% { transform: translateY(0) translateZ(0); }
    35%      { transform: translateY(-12px) translateZ(0); }
    70%      { transform: translateY(-4px) translateZ(0); }
}

@keyframes dog-wiggle {
    0%, 100% { transform: rotate(0deg); }
    25%     { transform: rotate(-8deg); }
    75%     { transform: rotate(8deg); }
}

@keyframes emoji-pop {
    0%, 85%, 100% { transform: scale(1); }
    90%, 95%     { transform: scale(1.15); }
}

@keyframes bone-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* =============================================
   首页静态狗狗（悬停互动）
   ============================================= */
.homepage-dog {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.homepage-dog:hover {
    transform: scale(1.15) rotate(-5deg) !important;
    filter: drop-shadow(0 12px 24px rgba(255,153,102,0.25));
}

.homepage-dog:active {
    transform: scale(0.95) !important;
}

/* 悬停时爪子加速 */
.homepage-dog:hover .dog-paw-icon {
    animation-duration: 0.3s !important;
}

/* 悬停时爱心跳动更快 */
.homepage-dog:hover .dog-love-badge {
    animation: heart-beat 0.6s ease-in-out infinite;
}

/* 点击效果：emoji 抖动 */
.homepage-dog:active .dog-emoji {
    animation: emoji-shake 0.4s ease;
}

@keyframes emoji-shake {
    0%, 100% { transform: translateX(0) rotate(0); }
    20%      { transform: translateX(-6px) rotate(-10deg); }
    40%      { transform: translateX(6px) rotate(10deg); }
    60%      { transform: translateX(-4px) rotate(-5deg); }
    80%      { transform: translateX(4px) rotate(5deg); }
}

/* =============================================
   响应式适配
   ============================================= */

@media (max-width: 768px) {
    .dog-emoji { font-size: 60px; }
    .dog-paw-icon { font-size: 14px; bottom: -6px; }
    .dog-bone { font-size: 17px; top: -8px; right: -12px; }
    .dog-love-badge { font-size: 11px; top: -4px; right: -6px; }
    .splash-dog { animation: dog-bounce 4s ease-in-out infinite, dog-wiggle 5s ease-in-out infinite; }
    .splash-dog .dog-bone { display: none; } /* 移动端隐藏骨头 */
}

@media (max-width: 480px) {
    .dog-emoji { font-size: 48px; }
    .dog-paw-icon { font-size: 12px; bottom: -4px; }
    .homepage-dog-container { margin-bottom: 10px; }
}

/* ---- 移动端适配（粒子/打字机）---- */
@media (max-width: 768px) {
    .typewriter-text { font-size:22px!important; letter-spacing:1px; }
    .splash-progress { width:150px; margin-top:20px; }
    .welcome-text-container { padding:15px; }
}

@media (max-width: 480px) {
    .typewriter-text { font-size:18px!important; letter-spacing:.5px; }
    .splash-container::before { width:300px;height:300px; }
    .splash-container::after { width:200px;height:200px; }
}


/* ============================================
   四、首页六宫格卡片网格样式 (Homepage Grid)
   ============================================ */

/* ---- 整体容器 ---- */
.homepage-grid-wrapper {
    min-height: 100vh;
    background: linear-gradient(180deg, #f1f5f9 0%, #e2e8f0 50%, #f1f5f9 100%);
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 确保内容区居中且允许滚动 */
body.diuz-custom-home,
html.diuz-custom-home {
    overflow-x: hidden;
    overflow-y: auto;
}

body.diuz-custom-home #primary,
body.diuz-custom-home .content-area,
body.diuz-custom-home main#main,
body.diuz-custom-home .site-main {
    width: 100%;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ---- 顶部导航栏（隐藏）---- */
.homepage-top-nav {
    display: none !important;
}

/* ---- 主标语区 ---- */
.hero-section {
    text-align: center;
    padding: 40px 20px 30px;
    animation: fadeInUp 0.7s ease 0.5s both;
}

.hero-title {
    font-size: clamp(28px, 5vw, 42px);
    font-weight: 900;
    color: var(--diuz-text-primary, #1e293b);
    margin-bottom: 10px;
}

.brand-highlight {
    background: linear-gradient(135deg, #10b981, #6ee7b7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 16px;
    color: var(--diuz-text-secondary, #64748b);
    margin: 0;
}

/* ---- 六宫格网格布局（默认：移动端 2×3）---- */
body.diuz-custom-home #explosion-grid.explosion-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(3, 1fr) !important;
    grid-auto-rows: 1fr; /* 确保行高一致 */
    gap: 14px;
    width: 100%;
    max-width: 560px;
    padding: 10px 16px; /* 左右留出间距 */
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* ---- 桌面端 3×2（>850px）---- */
@media screen and (min-width: 851px) {
    body.diuz-custom-home #explosion-grid.explosion-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        grid-template-rows: repeat(2, 1fr) !important;
        grid-auto-rows: 1fr;
        gap: 20px;
        max-width: 960px;
        padding: 10px 0; /* 桌面端恢复无左右内边距 */
    }
}

/* ---- 单个卡片 ---- */
.grid-card {
    position: relative;
    display: block;
    text-decoration: none !important;
    perspective: 1000px;
    animation: card-enter 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    animation-delay: var(--delay, 0s);
    opacity: 0;
    touch-action: manipulation; /* 改善移动端触摸行为，防止误触 */
    transform: translateZ(0);
    backface-visibility: hidden;
    contain: layout paint style; /* 性能优化：隔离渲染层 */
}

@keyframes card-enter {
    from { opacity: 0; transform: scale(0.8) translateY(30px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.card-inner {
    position: relative;
    background: var(--bg-card, #fff);
    border-radius: var(--diuz-radius-lg, 16px);
    padding: 28px 24px;
    min-height: 0; /* 允许网格控制高度 */
    height: 100%; /* 填充网格单元格 */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.06);
    box-shadow: var(--diuz-shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform, box-shadow;
    contain: content; /* 性能优化：限制子元素影响外部布局 */
}

/* 卡片悬停效果：爆炸式放大 + 发光 */
.grid-card:hover .card-inner {
    transform: translateY(-8px) scale(1.03);
    box-shadow:
        0 20px 40px rgba(0,0,0,0.12),
        0 0 60px color-mix(in srgb, var(--card-color, #10b981) 15%, transparent);
    border-color: var(--card-color, #10b981);
}

/* 触摸反馈：点击时缩放 */
.grid-card:active .card-inner {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
}

/* 触摸状态反馈（由 JavaScript 添加 .touching 类） */
.grid-card.touching .card-inner {
    transform: scale(0.98) !important;
    transition: transform 0.1s ease !important;
}

/* 键盘导航：焦点可见样式 */
.grid-card:focus-visible {
    outline: 3px solid var(--diuz-primary);
    outline-offset: 4px;
    border-radius: var(--diuz-radius-lg);
    z-index: 10;
}

/* 其他交互元素的键盘导航 */
.homepage-dog:focus-visible,
.diuz-back-to-top:focus-visible,
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--diuz-primary);
    outline-offset: 3px;
    border-radius: var(--diuz-radius-sm);
}

/* 焦点可见时的动画反馈 */
.grid-card:focus-visible .card-inner {
    transform: translateY(-4px);
    box-shadow: var(--diuz-shadow-md);
}

/* 移除默认焦点样式，使用:focus-visible */
.grid-card:focus:not(:focus-visible),
.homepage-dog:focus:not(:focus-visible) {
    outline: none;
}

/* 卡片图标 */
.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(110, 231, 183, 0.05));
    margin-bottom: 16px;
    transition: all 0.35s ease;
}

.grid-card:hover .card-icon {
    background: var(--card-gradient, linear-gradient(135deg, #10b981, #6ee7b7));
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 8px 25px color-mix(in srgb, var(--card-color, #10b981) 25%, transparent);
}

.grid-card:hover .card-icon svg {
    stroke: #fff;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* 卡片标题 */
.card-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--diuz-text-primary, #1e293b);
    margin: 0 0 8px 0;
    transition: color 0.25s ease;
}

.grid-card:hover .card-title {
    color: var(--card-color, #10b981);
}

/* 卡片描述 */
.card-desc {
    font-size: 13.5px;
    color: var(--diuz-text-secondary, #64748b);
    line-height: 1.55;
    margin: 0;
    flex-grow: 1;
}

/* 角标徽章 */
.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 10px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 20px;
    background: var(--card-color, #10b981);
    color: #fff;
    z-index: 2;
}

/* 卡片发光层（悬停时显示）*/
.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, color-mix(in srgb, var(--card-color, #10b981) 8%, transparent) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.grid-card:hover .card-glow {
    opacity: 1;
}

/* 卡片内部粒子效果容器 */
.card-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.card-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--card-color, #10b981);
    opacity: 0;
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* ---- 页脚（我们的自定义版权）---- */
body.diuz-custom-home .homepage-footer {
    text-align: center;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    background: transparent !important;
    z-index: 1;
}

/* 移除页脚周围所有可能的边框/阴影（覆盖父主题） */
body.diuz-custom-home .homepage-footer *,
body.diuz-custom-home .homepage-footer::before,
body.diuz-custom-home .homepage-footer::after {
    box-shadow: none !important;
    border: none !important;
    outline: none !important;
}

/* 确保页脚的父容器也没有边框阴影 */
body.diuz-custom-home main#main,
body.diuz-custom-home .site-main,
body.diuz-custom-home #primary.content-area {
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

body.diuz-custom-home .homepage-footer p {
    color: var(--diuz-text-secondary, #94a3b8);
    font-size: 13px;
    margin: 0;
}

/* 桌面端：将版权固定在屏幕底部 */
@media screen and (min-width: 851px) {
    body.diuz-custom-home .homepage-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 20px;
        background: linear-gradient(180deg, transparent 0%, rgba(241, 245, 249, 0.95) 30%);
        backdrop-filter: blur(8px);
        border-top: 1px solid rgba(226, 232, 240, 0.6);
        z-index: 100;
    }
    /* 为网格内容腾出空间，避免被页脚遮挡 */
    body.diuz-custom-home #explosion-grid.explosion-grid {
        margin-bottom: 100px;
        padding-bottom: 30px;
    }
}

/* 移动端：将版权固定在屏幕底部 */
@media screen and (max-width: 850px) {
    body.diuz-custom-home .homepage-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        padding: 16px;
        background: linear-gradient(180deg, transparent 0%, rgba(241, 245, 249, 0.95) 30%);
        backdrop-filter: blur(8px);
        border-top: 1px solid rgba(226, 232, 240, 0.6);
        z-index: 100;
    }
    /* 为网格内容腾出空间，避免被页脚遮挡 */
    body.diuz-custom-home #explosion-grid.explosion-grid {
        margin-bottom: 100px;
        padding-bottom: 20px;
    }
    /* 确保移动端网格行高一致 */
    body.diuz-custom-home #explosion-grid.explosion-grid {
        grid-auto-rows: 1fr;
    }
}

/* =============================================
   动画关键帧
   ============================================= */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* 点击爆炸粒子动画 */
@keyframes card-particle-burst {
    0% {
        transform: translate(var(--start-x), var(--start-y)) scale(0);
        opacity: 1;
    }
    100% {
        transform: translate(var(--end-x), var(--end-y)) scale(1.5);
        opacity: 0;
    }
}

/* ============================================
   五、返回顶部按钮 (Back to Top)
   ============================================ */

.diuz-back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--diuz-primary), var(--diuz-primary-light));
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 16px rgba(16,185,129,0.35);
    z-index: 999;
    transition: all 0.3s ease;
    opacity: 0;
}

.diuz-back-to-top.show {
    display: flex;
    opacity: 1;
}

.diuz-back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(16,185,129,0.5);
}

/* ============================================
   六、滚动条美化 (Scrollbar)
   ============================================ */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--diuz-primary), var(--diuz-primary-light));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--diuz-primary-dark);
}

/* ============================================
   七、选择高亮 (Selection)
   ============================================ */

::selection {
    background: var(--diuz-primary) !important;
    color: #fff !important;
}

::-moz-selection {
    background: var(--diuz-primary) !important;
    color: #fff !important;
}

/* ============================================
   八、暗色模式 (Dark Mode)
   ============================================ */

@media (prefers-color-scheme: dark) {
    :root {
        --diuz-bg-body: #0f172a;
        --diuz-bg-card: #1e293b;
        --diuz-text-primary: #f1f5f9;
        --diuz-text-secondary: #94a3b8;
        --diuz-border-color: #334155;
        --diuz-shadow-sm: 0 2px 8px rgba(0,0,0,0.2);
        --diuz-shadow-md: 0 4px 16px rgba(0,0,0,0.3);
        --diuz-shadow-lg: 0 8px 32px rgba(0,0,0,0.4);
    }
    
    /* 开屏背景调整为更深的颜色 */
    .splash-container {
        background: linear-gradient(135deg, #0a0f1c 0%, #151b2d 50%, #0a0f1c 100%);
    }
    
    /* 卡片内部背景 */
    .card-inner {
        background: var(--diuz-bg-card);
        border-color: var(--diuz-border-color);
        box-shadow: var(--diuz-shadow-sm);
    }
    
    /* 滚动条轨道 */
    ::-webkit-scrollbar-track {
        background: #1e293b;
    }
    
    /* 首页网格背景 */
    .homepage-grid-wrapper {
        background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    }
    
    /* 页脚背景 */
    body.diuz-custom-home .homepage-footer {
        background: linear-gradient(180deg, transparent 0%, rgba(15, 23, 42, 0.95) 30%);
        border-top-color: rgba(51, 65, 85, 0.6);
    }
    
    /* 返回顶部按钮阴影调整 */
    .diuz-back-to-top {
        box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
    }
    .diuz-back-to-top:hover {
        box-shadow: 0 6px 24px rgba(16, 185, 129, 0.5);
    }
}

/* ============================================
   九、打印样式 (Print Styles)
   ============================================ */

@media print {
    /* 重置打印边距 */
    @page {
        margin: 1.5cm;
    }
    
    /* 隐藏不必要的元素 */
    .splash-container,
    .diuz-back-to-top,
    .homepage-dog-container,
    .card-glow,
    .card-particles,
    .card-badge,
    .dog-paw-icon,
    .dog-bone,
    .dog-love-badge {
        display: none !important;
    }
    
    /* 基础样式优化 */
    body {
        background: #fff !important;
        color: #000 !important;
        font-family: "Times New Roman", Times, serif !important;
        font-size: 12pt !important;
        line-height: 1.5 !important;
    }
    
    /* 链接优化 */
    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
    
    /* 卡片打印优化 */
    .grid-card {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        opacity: 1 !important;
        animation: none !important;
    }
    
    .card-inner {
        background: #fff !important;
        border: none !important;
        box-shadow: none !important;
        padding: 12pt 10pt !important;
    }
    
    /* 网格布局调整 */
    #explosion-grid.explosion-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8pt !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* 标题优化 */
    .hero-title {
        font-size: 16pt !important;
        color: #000 !important;
    }
    
    .hero-subtitle {
        font-size: 12pt !important;
        color: #444 !important;
    }
    
    /* 页脚优化 */
    .homepage-footer {
        position: static !important;
        background: transparent !important;
        border-top: 1px solid #ddd !important;
        padding: 10pt 0 !important;
        margin-top: 20pt !important;
    }
    
    /* 防止分页符破坏内容 */
    .hero-section,
    #explosion-grid {
        page-break-before: auto;
        page-break-after: avoid;
    }
    
    /* 打印URL */
    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }
    
    /* 隐藏内部链接URL */
    a[href^="#"]:after {
        content: "";
    }
}