/* ========== 背景样式 ========== */
.features-bg,
.application-bg {
    background-image: url("https://www.vissonic.com/template/pc/skin/products/paperless/pending.jpg");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.glass-bg {
    padding-bottom: 4rem;
    padding-top: 4rem;
}

.glass-bg h2 {
    text-align: center;
    color: #ffffff !important;
}

/* ========== 容器与网格布局 ========== */
.dashboard-wrapper {
    height: calc(100vh - 300px);
}

/* 桌面 & iPad 横屏网格 */
.dashboard-grid {
    height: 100%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(3, minmax(160px, 1fr));
    gap: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* ========== 卡片核心样式 ========== */
.card-ui {
    position: relative; /* 为图标绝对定位提供参考 */
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(25px);
    border-radius: 18px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s, background 0.2s;
    border: 1px solid rgba(138, 138, 138, 0.2);
    min-width: 0; /* 解决flex溢出问题 */
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.card-ui:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, .12);
}

/* 卡片内层容器 */
.card-ui > div {
    height: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    padding-bottom: 40px; /* 为底部图标预留空间 */
    box-sizing: border-box;
}

/* 图标样式（底部右侧） */
.card-ui .card-icon {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 35px;
    height: 35px;
    opacity: 0.6;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 0; /* 重置默认边距 */
    transition: all 0.2s ease; /* 平滑过渡 */
}

/* 卡片悬浮时图标高亮（修复语法错误） */
.card-ui:hover .card-icon {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1); /* 修复括号错误+合理的背景值 */
    transform: scale(1.05); /* 轻微放大，增强交互感 */
}

/* 卡片文字样式 */
.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-top: 6px;
    margin-bottom: 8px;
    color: #ffffff;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

.card-desc {
    font-size: 13px;
    opacity: 1;
    margin-top: 2px;
    color: #f5f5f7;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
}

/* ========== 特殊卡片样式 ========== */
.hero, .todo, .weather, .map {
    /* 预留的特殊卡片背景/边框样式 */
}


/* ========== 卡片网格占位（桌面 & iPad 横屏） ========== */
.hero     { grid-column: 1/3; grid-row: 1/3;
    background-image: url("https://www.vissonic.com/template/pc/skin/products/paperless/paperless_gif.webp");
    width: 100%;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;}
.todo     { grid-column: 3/5; }
.music    { grid-column: 5/6; }
.ai       { grid-column: 6/7; }
.weather  { grid-column: 3/5; }
.bili     { grid-column: 5/6; }
.douyin   { grid-column: 6/7; }
.map      { grid-column: 1/3; }
.wechat   { grid-column: 3/4; }
.setting  { grid-column: 4/5; }
.file     { grid-column: 5/6; }
.video    { grid-column: 6/7; }

.card-ui.hero:hover {
    /* 保留位移效果 */
    transform: translateY(-2px);
    background-image: url("https://www.vissonic.com/template/pc/skin/products/paperless/paperless_gif.webp");
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    background-color: transparent;
}
/* ========== 媒体查询 - iPad 竖屏 (768px - 1024px) ========== */
@media (max-width: 1024px) and (min-width: 768px) {
    .dashboard-wrapper {
        height: auto;
        min-height: calc(100vh - 200px);
    }
    
    .dashboard-grid {
        grid-template-rows: repeat(3, minmax(140px, 1fr));
        gap: 14px;
    }
    
    .card-ui {
        padding: 14px;
    }
}

/* ========== 媒体查询 - 手机端竖屏 (<=767px) ========== */
@media (max-width: 767px) {
    /* 全局容器修复 */
    .glass-bg {
        padding: 12px 0;
    }
    
    .dashboard-wrapper {
        height: auto;
        padding: 0 12px;
        min-height: auto;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
        padding-left: 0px;
        padding-right: 0px;
    
    }
    
    /* 网格布局调整 */
    .dashboard-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: auto;
        gap: 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 卡片通用调整 */
    .card-ui {
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }
    
    .card-ui > div {
        padding-bottom: 30px; /* 移动端图标预留空间 */
    }
    
    /* 图标适配 */
    .card-ui .card-icon {
        width: 28px; /* 修复你之前100%宽度的错误 */
        height: 28px;
        bottom: 8px;
        right: 8px;
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    /* 文字适配 */
    .card-title {
        font-size: 14px;
        font-weight: 600;
    }
    
    .card-desc {
        font-size: 12px;
        -webkit-line-clamp: 2; /* 移动端少显示一行 */
        display: none;
    }
    
    /* 手机端卡片位置重置 */
    .hero, .todo, .music, .ai, .weather, .bili, .douyin, 
    .map, .wechat, .setting, .file, .video {
        grid-column: auto !important;
        grid-row: auto !important;
        min-height: auto;
    }
    
    /* 特殊卡片布局 */
    .hero {
        grid-column: 1/4 !important;
        min-height: 140px;
        flex-direction: row;
        align-items: center;
        padding: 20px;
    }
    
    .todo, .music, .ai {
        grid-column: span 1 !important;
        padding: 16px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .weather {
        grid-column: 1/4 !important;
        min-height: 100px;
        flex-direction: row;
        align-items: center;
        padding: 16px 20px;
    }
    
    .bili, .douyin, .map {
        grid-column: span 1 !important;
        min-height: 140px;
        padding: 16px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    .wechat {
        grid-column: 1/4 !important;
        min-height: 100px;
        flex-direction: row;
        align-items: center;
        padding: 16px 20px;
    }
    
    .setting, .file, .video {
        grid-column: span 1 !important;
        min-height: 140px;
        padding: 16px;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    
    /* 特殊卡片图标调整 */
    .hero .card-icon {
        font-size: 32px;
        margin-right: 16px;
        margin-bottom: 0;
    }
    
    .weather .card-icon, .wechat .card-icon {
        font-size: 24px;
        margin-right: 16px;
        margin-bottom: 0;
    }
    
    .todo .card-icon, .music .card-icon, .ai .card-icon,
    .bili .card-icon, .douyin .card-icon, .map .card-icon,
    .setting .card-icon, .file .card-icon, .video .card-icon {
        font-size: 24px;
        margin-left: auto;
        margin-right: auto;
    }
    
    /* 特殊卡片文字调整 */
    .hero .card-title {
        font-size: 18px;
        margin-bottom: 4px;
    }
    
    .weather .card-title, .wechat .card-title {
        font-size: 15px;
    }
    
    .todo .card-title, .map .card-title {
        font-size: 16px;
        font-weight: 700;
    }
    
    .hero .card-desc {
        font-size: 14px;
    }
    
    .todo .card-desc, .map .card-desc {
        margin-top: 8px;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* ========== 媒体查询 - 小屏幕手机 (<=374px) ========== */
@media (max-width: 374px) {
    .dashboard-grid {
        gap: 10px;
    }
    
    .card-ui > div {
        padding-bottom: 25px;
    }
    
    .card-ui .card-icon {
        width: 24px;
        height: 24px;
        bottom: 6px;
        right: 6px;
        font-size: 20px;
    }
    
    .hero {
        min-height: 120px;
        padding: 16px;
    }
    
    .todo, .music, .ai, .bili, .douyin, .map,
    .setting, .file, .video {
        padding: 0px;
    }
    
    .weather, .wechat {
        min-height: 90px;
        padding: 14px 16px;
    }
    
    .hero .card-icon {
        font-size: 28px;
        margin-right: 12px;
    }
    
    .weather .card-icon, .wechat .card-icon {
        font-size: 22px;
        margin-right: 12px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .hero .card-title {
        font-size: 16px;
    }
    
    .todo .card-title, .map .card-title {
        font-size: 15px;
    }
}

/* ========== Home-Case 图片画廊 ========== */
.expand-gallery {
    display: flex;
    width: 100%;
    height: 350px;
    gap: 12px;
    overflow: hidden;
}

.gallery-item {
    position: relative;
    flex: 1;
    min-width: 60px;
    height: 100%;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transform: translateZ(0);
    will-change: flex-grow;
    transition: flex-grow 0.5s ease-in-out;
}

.gallery-item:hover {
    flex-grow: 4;
}

.gallery-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: filter 0.4s ease, transform 0.4s ease;
    will-change: filter, transform;
    filter: blur(0px);
    transform: scale(1.0);
}

.expand-gallery:hover .gallery-img {
    filter: blur(4px) brightness(0.6);
    transform: scale(1.0);
}

.expand-gallery .gallery-item:hover .gallery-img {
    filter: blur(0px) brightness(1);
    transform: scale(1.0);
}

.gallery-item .content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    white-space: normal;
    box-sizing: border-box;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    transition-delay: 0.15s;
    will-change: opacity, transform;
    width: 100%;
    max-width: 100%;
}

.gallery-item:hover .content {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.gallery-item h3 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.gallery-item p {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    line-height: 1.5;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.gallery-item .skeleton-container,
.gallery-item .skeleton-wrapper {
    display: block;
    width: 100%;
    height: 100%;
    position: relative;
    text-decoration: none;
    margin: 0;
    padding: 0;
}

/* 画廊移动端适配 */
@media (max-width: 768px) {
    .expand-gallery {
        flex-direction: column;
        height: auto;
    }
    
    .gallery-item {
        width: 100%;
        height: 240px;
        flex: none;
        margin-bottom: 10px;
        min-width: 0;
    }
    
    .expand-gallery:hover .gallery-img,
    .expand-gallery .gallery-item:hover .gallery-img {
        filter: none !important;
        transform: none !important;
        brightness: 1 !important;
    }
    
    .gallery-item .content {
        opacity: 1;
        transform: translateY(0);
        transition-delay: 0s;
    }
}