/* === 案例页面特有样式 === */

/* === 定义边框半径变量 === */
:root {
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --transition: all 0.3s ease;
    --primary: #e74c3c;
    --dark: #333;
    --white: #fff;
}

/* === 板块2: Banner === */
.cases-banner {
    height: 385px;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    position: relative;
    background: #fffcf5;
}

.banner-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
}

.banner-left {
    flex: 1;
}

.banner-left h1 {
    line-height: 1.2;
    color: var(--dark);
    margin-bottom: 0;
}

.banner-line {
    display: block;
    margin-bottom: 5px;
    font-family: 'PingFang SC', sans-serif;
}

.banner-line:nth-child(1),
.banner-line:nth-child(2) {
    font-size: 50px;
    font-weight: 400;
}

.banner-line:nth-child(3) {
    font-size: 18px;
    font-weight: 400;
    margin-top: 10px;
}

.plus-symbol {
    color: var(--primary);
    font-size: 50px;
    font-weight: 700;
    position: relative;
    top: 2px;
    text-shadow: 2px 2px 4px rgba(253, 61, 2, 0.2);
    display: inline-block;
    transform: scale(1.1);
    margin-left: 5px;
}

.banner-right {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto auto;
    gap: 20px 40px;
    padding-left: 60px;
    text-align: right;
    align-items: flex-end;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}

.stat-number {
    font-family: 'PingFang SC', sans-serif;
    font-weight: 400;
    line-height: 0.9;
    color: var(--dark);
}

.stat-number .main-number {
    font-size: 80px;
}

.stat-number .plus,
.stat-number .percent {
    font-size: 50px;
    color: var(--dark);
    margin-left: 2px;
}

.stat-text {
    font-family: 'PingFang SC', sans-serif;
    font-size: 15px;
    color: var(--dark);
    margin-top: 8px;
}

/* === 板块3: 案例列表 === */
.cases-list {
    padding: 10px 0 100px;
    background-color: #fffcf5;
}

.cases-header {
    margin-bottom: 50px;
    display: none;
}

.cases-header h2 {
    font-size: 2.5rem;
    color: var(--dark);
    margin-bottom: 15px;
}

/* 案例网格布局 */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 650px;
    gap: 30px;
    margin-bottom: 60px;
}

/* 所有行的统一高度 - 标签页面使用这个 */
.cases-grid .row-1,
.cases-grid .row-2,
.cases-grid .row-3,
.cases-grid .row-4 {
    grid-auto-rows: 525px;
}

/* 第一排布局 */
.row-1 {
    display: contents;
}

.large-case {
    grid-column: 1 / 7;
    grid-row: 1;
}

.right-top {
    grid-column: 7 / 13;
    grid-row: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 30px;
}

.case-item-small {
    grid-row: 1;
    height: 100%;
}

.case-item-small:nth-child(1) {
    grid-column: 1;
}

.case-item-small:nth-child(2) {
    grid-column: 2;
}

.promo-box {
    grid-column: 1 / 3;
    grid-row: 2;
    background-color: #f9f2e2;
    border-radius: var(--border-radius-sm);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
    min-height: 300px;
}

.promo-line {
    font-family: 'PingFang SC', sans-serif;
    font-size: 36px;
    line-height: 1.3;
    color:#666;
    margin-bottom: 10px;
    font-weight: 300;
}

.promo-line:last-child {
    margin-bottom: 0;
}

/* 艺术引号样式 */
.artistic-quote {
    position: absolute;
    right: 30px;
    bottom: 30px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.artistic-quote svg {
    width: 100%;
    height: 100%;
    fill: rgba(0, 0, 0, 0.15);
    filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.1));
}

/* 第二、三、四排布局 */
.row-2, .row-3, .row-4 {
    display: contents;
}

.case-item-normal {
    grid-column: span 4;
    height: 100%;
}

/* === 关键修复：所有案例项通用样式 === */

/* 确保所有类型的案例项都有相对定位 */
.case-item-normal,
.case-item-small,
.large-case {
    position: relative;
}

/* 案例项通用样式 */
.case-item-link {
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
    display: block;
    text-decoration: none;
    color: inherit;
    background: #f8f9fa;
    /* 关键修复：防止子元素溢出造成缝隙 */
    isolation: isolate;
}

/* 图片样式 */
.case-item-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s ease;
    display: block;
    /* 关键修复：确保图片覆盖整个区域，不留缝隙 */
    position: relative;
    z-index: 1;
    /* 防止放大时露出背景 */
    transform: scale(1.01);
}

/* 悬停效果 - 整体向上移动 */
.case-item-link:hover {
    transform: translateY(-8px); /* 增加上移距离 */
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

/* 图片放大效果 */
.case-item-link:hover img {
    transform: scale(1.08);
}

/* === 关键修复：案例覆盖层 - 简化定位 === */
.case-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 25px;
    opacity: 1;
    transition: all 0.4s ease;
    box-sizing: border-box;
    border-radius: var(--border-radius-sm);
    pointer-events: none;
    overflow: hidden;
    z-index: 2;
    /* 关键修复：确保渐变蒙版覆盖整个区域 */
    min-height: 100%;
    /* 增加底部内边距以容纳描述 */
    padding-bottom: 35px;
}

/* 修复蒙版圆角问题 */
.case-overlay:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: inherit;
    border-radius: var(--border-radius-sm);
    z-index: -1;
}

/* === 关键修复：案例标签样式 === */
.case-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    max-width: 100%;
    pointer-events: auto;
    position: relative;
    z-index: 10;
    /* 关键修复：为整体放大效果做准备 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0) scale(1);
    transform-origin: bottom left;
}

/* 案例标签按钮样式 */
.case-tag {
    background-color: transparent;
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid var(--white);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

.case-tag:hover {
    background-color: var(--white);
    color: var(--dark);
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 标题样式 */
.case-overlay h3 {
    color: var(--white);
    font-size: 26px;
    margin-bottom: 12px;
    font-weight: 400;
    width: 100%;
    pointer-events: none;
    position: relative;
    z-index: 9;
    line-height: 1.3;
    /* 关键修复：为整体放大效果做准备 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0) scale(1);
    transform-origin: bottom left;
}

/* === 关键修复：描述样式 - 默认显示 === */
.case-desc {
    color: rgba(255, 255, 255, 0.9); /* 提高对比度 */
    font-size: 14px;
    line-height: 1.5;
    width: 100%;
    pointer-events: none;
    position: relative;
    z-index: 2;
    margin-top: 0;
    display: block !important;
    opacity: 1;
    max-height: 100px;
    overflow: visible;
    /* 关键修复：为整体放大效果做准备 */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform: translateY(0) scale(1);
    transform-origin: bottom left;
    visibility: visible;
    margin-top: 5px;
}

/* === 关键修复：悬停动画效果 - 整体放大 === */

/* 悬停时蒙版变深 */
.case-item-link:hover .case-overlay {
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.95) 100%);
    padding-bottom: 40px;
}

/* 悬停时标签整体放大效果 */
.case-item-link:hover .case-tags {
    transform: translateY(-15px) scale(1.05); /* 向上移动并放大 */
    margin-bottom: 10px;
}

/* 悬停时标题整体放大效果 */
.case-item-link:hover .case-overlay h3 {
    transform: translateY(-15px) scale(1.05); /* 向上移动并放大 */
    margin-bottom: 10px;
}

/* 悬停时描述整体放大效果 */
.case-item-link:hover .case-desc {
    transform: translateY(-15px) scale(1.05); /* 向上移动并放大 */
    color: rgba(255, 255, 255, 1);
    margin-top: 10px;
    max-height: 120px;
}

/* 翻页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 50px;
}

.page-number {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--white);
    color: var(--dark);
    border: 1px solid #eee;
}

.page-number:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.page-number.active {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* === 响应式设计 - 移动优先优化 === */

/* 超大桌面：1200px+ 保持默认样式 */

/* 中等桌面：1200px以下 */
@media (max-width: 1200px) {
    .banner-left h1 .banner-line:nth-child(1),
    .banner-left h1 .banner-line:nth-child(2) {
        font-size: 40px;
    }
    
    .plus-symbol {
        font-size: 40px;
    }
    
    .stat-number .main-number {
        font-size: 60px;
    }
    
    .stat-number .plus,
    .stat-number .percent {
        font-size: 40px;
    }
    
    .cases-grid {
        grid-template-columns: repeat(6, 1fr);
        grid-auto-rows: 550px;
    }
    
    .cases-grid .row-1,
    .cases-grid .row-2,
    .cases-grid .row-3,
    .cases-grid .row-4 {
        grid-auto-rows: 450px;
    }
    
    .large-case {
        grid-column: 1 / 7;
        grid-row: 1;
    }
    
    .right-top {
        grid-column: 1 / 7;
        grid-row: 2;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: 1fr 1fr;
    }
    
    .case-item-normal {
        grid-column: span 3;
    }
    
    .promo-line {
        font-size: 32px;
    }
    
    /* 响应式悬停效果调整 */
    .case-item-link:hover {
        transform: translateY(-6px);
    }
    
    .case-item-link:hover .case-tags,
    .case-item-link:hover .case-overlay h3,
    .case-item-link:hover .case-desc {
        transform: translateY(-12px) scale(1.04);
    }
    
    .case-desc {
        max-height: 100px;
    }
}

/* 平板横屏/小桌面：992px以下 */
@media (max-width: 992px) {
    .cases-banner {
        height: 35vh;
        min-height: 250px;
    }
    
    .banner-container {
        flex-direction: column;
        text-align: left;
        align-items: flex-start;
    }
    
    .banner-left {
        margin-bottom: 40px;
    }
    
    .banner-right {
        padding-left: 0;
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
        width: 100%;
        align-items: flex-start;
    }
    
    .stat-item {
        align-items: flex-start;
    }
    
    .cases-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 500px;
    }
    
    .cases-grid .row-1,
    .cases-grid .row-2,
    .cases-grid .row-3,
    .cases-grid .row-4 {
        grid-auto-rows: 400px;
    }
    
    .large-case {
        grid-column: 1 / 3;
        grid-row: 1;
    }
    
    .right-top {
        grid-column: 1 / 3;
        grid-row: 2;
    }
    
    .case-item-normal {
        grid-column: span 1;
    }
    
    .case-item-normal:nth-child(odd) {
        grid-column: 1;
    }
    
    .case-item-normal:nth-child(even) {
        grid-column: 2;
    }
    
    .case-item-normal:only-child {
        grid-column: 1 / 3;
    }
    
    .promo-line {
        font-size: 28px;
    }
    
    .artistic-quote {
        width: 60px;
        height: 60px;
        right: 20px;
        bottom: 20px;
    }
    
    .page-number {
        width: 50px;
        height: 50px;
    }
    
    /* 响应式调整描述显示 */
    .case-desc {
        font-size: 13px;
        line-height: 1.4;
        max-height: 80px;
    }
    
    /* 响应式悬停效果调整 */
    .case-item-link:hover {
        transform: translateY(-5px);
    }
    
    .case-item-link:hover .case-tags,
    .case-item-link:hover .case-overlay h3,
    .case-item-link:hover .case-desc {
        transform: translateY(-10px) scale(1.03);
    }
}

/* 平板竖屏：768px以下 - 移动端重要断点 */
@media (max-width: 768px) {
    .container {
        padding: 0 20px;
    }
    
    .cases-banner {
        height: auto;
        min-height: 200px;
        padding: 40px 0;
    }
    
    .banner-left h1 .banner-line:nth-child(1),
    .banner-left h1 .banner-line:nth-child(2) {
        font-size: 32px;
    }
    
    .plus-symbol {
        font-size: 32px;
    }
    
    .banner-left h1 .banner-line:nth-child(3) {
        font-size: 16px;
    }
    
    .stat-number .main-number {
        font-size: 50px;
    }
    
    .stat-number .plus,
    .stat-number .percent {
        font-size: 32px;
    }
    
    .stat-text {
        font-size: 14px;
    }
    
    .cases-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: 400px;
        gap: 20px;
    }
    
    .cases-grid .row-1,
    .cases-grid .row-2,
    .cases-grid .row-3,
    .cases-grid .row-4 {
        grid-auto-rows: 350px;
    }
    
    .large-case,
    .right-top,
    .case-item-normal {
        grid-column: 1 / 2;
    }
    
    .right-top {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
        gap: 20px;
    }
    
    .case-item-small:nth-child(1),
    .case-item-small:nth-child(2) {
        grid-column: 1;
        grid-row: auto;
        height: 350px;
    }
    
    .promo-box {
        min-height: 250px;
        padding: 30px 20px;
    }
    
    .promo-line {
        font-size: 22px;
        line-height: 1.4;
    }
    
    .artistic-quote {
        width: 50px;
        height: 50px;
        right: 15px;
        bottom: 15px;
    }
    
    .page-number {
        width: 44px;
        height: 44px;
        font-size: 0.8rem;
    }
    
    .case-overlay {
        padding: 20px;
        padding-bottom: 25px;
    }
    
    .case-overlay h3 {
        font-size: 22px;
        margin-bottom: 8px;
    }
    
    .case-desc {
        font-size: 13px;
        max-height: 70px;
        line-height: 1.4;
    }
    
    .case-tag {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
    
    /* 移动端悬停效果简化 */
    .case-item-link:hover {
        transform: translateY(-4px);
    }
    
    .case-item-link:hover .case-tags,
    .case-item-link:hover .case-overlay h3,
    .case-item-link:hover .case-desc {
        transform: translateY(-8px) scale(1.02);
    }
    
    /* 移动端图片悬停效果减弱 */
    .case-item-link:hover img {
        transform: scale(1.05);
    }
}

/* 手机：576px以下 - 小屏手机优化 */
@media (max-width: 576px) {
    .container {
        padding: 0 15px;
    }
    
    .cases-banner {
        padding: 30px 0;
        min-height: 180px;
    }
    
    .banner-left h1 .banner-line:nth-child(1),
    .banner-left h1 .banner-line:nth-child(2) {
        font-size: 26px;
        line-height: 1.3;
    }
    
    .plus-symbol {
        font-size: 26px;
        margin-left: 3px;
    }
    
    .banner-left h1 .banner-line:nth-child(3) {
        font-size: 14px;
        margin-top: 8px;
    }
    
    .banner-right {
        grid-template-columns: repeat(3, 1fr);
        gap: 15px;
        margin-top: 20px;
    }
    
    .stat-number .main-number {
        font-size: 40px;
    }
    
    .stat-number .plus,
    .stat-number .percent {
        font-size: 26px;
    }
    
    .stat-text {
        font-size: 12px;
        margin-top: 5px;
    }
    
    .cases-grid {
        grid-auto-rows: 350px;
        gap: 15px;
    }
    
    .cases-grid .row-1,
    .cases-grid .row-2,
    .cases-grid .row-3,
    .cases-grid .row-4 {
        grid-auto-rows: 300px;
    }
    
    .case-item-small:nth-child(1),
    .case-item-small:nth-child(2) {
        height: 300px;
    }
    
    .promo-box {
        min-height: 200px;
        padding: 25px 15px;
    }
    
    .promo-line {
        font-size: 18px;
        margin-bottom: 8px;
    }
    
    .artistic-quote {
        width: 40px;
        height: 40px;
        right: 10px;
        bottom: 10px;
    }
    
    .page-number {
        width: 40px;
        height: 40px;
        font-size: 0.75rem;
    }
    
    .case-overlay {
        padding: 15px;
        padding-bottom: 20px;
    }
    
    .case-overlay h3 {
        font-size: 18px;
        margin-bottom: 6px;
    }
    
    .case-tag {
        font-size: 0.7rem;
        padding: 2px 8px;
    }
    
    .case-desc {
        font-size: 12px;
        max-height: 60px;
        line-height: 1.4;
    }
    
    /* 小屏手机悬停效果进一步简化 */
    .case-item-link:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    }
    
    .case-item-link:hover .case-tags,
    .case-item-link:hover .case-overlay h3,
    .case-item-link:hover .case-desc {
        transform: translateY(-5px) scale(1.01);
    }
    
    .case-item-link:hover img {
        transform: scale(1.03);
    }
}

/* 超小屏手机：400px以下 */
@media (max-width: 400px) {
    .banner-left h1 .banner-line:nth-child(1),
    .banner-left h1 .banner-line:nth-child(2) {
        font-size: 22px;
    }
    
    .plus-symbol {
        font-size: 22px;
    }
    
    .banner-left h1 .banner-line:nth-child(3) {
        font-size: 13px;
    }
    
    .stat-number .main-number {
        font-size: 35px;
    }
    
    .stat-number .plus,
    .stat-number .percent {
        font-size: 22px;
    }
    
    .stat-text {
        font-size: 11px;
    }
    
    .cases-grid {
        grid-auto-rows: 300px;
    }
    
    .cases-grid .row-1,
    .cases-grid .row-2,
    .cases-grid .row-3,
    .cases-grid .row-4 {
        grid-auto-rows: 250px;
    }
    
    .case-item-small:nth-child(1),
    .case-item-small:nth-child(2) {
        height: 250px;
    }
    
    .promo-line {
        font-size: 16px;
    }
    
    .case-overlay h3 {
        font-size: 16px;
    }
    
    .case-desc {
        font-size: 11px;
        max-height: 50px;
    }
}

/* === 兼容性修复 === */

/* 确保规则布局的排有正确的高度 */
.row-1, .row-2, .row-3, .row-4 {
    display: contents;
}

/* 确保所有案例类型都有相同的圆角处理 */
.case-item-normal .case-overlay,
.case-item-small .case-overlay,
.large-case .case-overlay {
    border-radius: var(--border-radius-sm);
}

/* 修复移动端触摸设备悬停问题 */
@media (hover: none) and (pointer: coarse) {
    /* 在触摸设备上，保持基础样式，移除悬停效果 */
    .case-item-link:hover {
        transform: none;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    }
    
    .case-item-link:hover .case-tags,
    .case-item-link:hover .case-overlay h3,
    .case-item-link:hover .case-desc {
        transform: none;
    }
    
    .case-item-link:hover img {
        transform: scale(1.01);
    }
}

/* 确保标签页面（taxonomy-case_tag.php）中的蒙版也有圆角 */
.tax-case_tag .case-overlay {
    border-radius: var(--border-radius-sm) !important;
}

/* 翻页链接样式修复 */
.pagination ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination ul li {
    margin: 0;
}

.pagination ul li a,
.pagination ul li span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--white);
    color: var(--dark);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    border: 1px solid #eee;
}

.pagination ul li a:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.pagination ul li span.current {
    background-color: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* 移动端翻页优化 */
@media (max-width: 768px) {
    .pagination ul {
        gap: 5px;
    }
    
    .pagination ul li a,
    .pagination ul li span {
        width: 40px;
        height: 40px;
        font-size: 0.85rem;
    }
}

/* === 关键修复：确保案例标签不阻止动画 === */
.case-tags {
    pointer-events: auto;
}

.case-overlay {
    pointer-events: none;
}

/* 确保标签的点击事件不影响悬停效果 */
.case-tag {
    pointer-events: auto;
}

/* 修复：移除可能影响悬停的绝对定位 */
.case-tags,
.case-overlay h3,
.case-desc {
    position: relative;
}

/* 确保悬停时所有元素都能正确移动 */
.case-item-link:hover .case-tags,
.case-item-link:hover .case-overlay h3,
.case-item-link:hover .case-desc {
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 焦点状态可访问性优化 */
.case-item-link:focus {
    outline: none;
    outline-offset: 0;
}

.case-item-link:focus .case-overlay {
    background: linear-gradient(to bottom, 
        rgba(0, 0, 0, 0) 0%, 
        rgba(0, 0, 0, 0.9) 100%);
}