/* 5 Driving Modes Showcase */
.modes-section {
    padding: 6rem 0;
    background: var(--surface-light);
    overflow: hidden;
    position: relative;
    /* 为外侧悬浮按钮定锚 */
}

.modes-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 4rem;
    padding: 0 1.5rem;
}

.modes-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.modes-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Tabs Navigation */
.modes-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.mode-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 2rem;
    background: var(--surface-card);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mode-tab:hover {
    background: var(--surface-hover);
    transform: translateY(-2px);
}

.mode-tab.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

/* Modes Display Area */
.modes-display {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    background: #000;
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    color: white;
    /* 补丁：解决某些浏览器圆角失效问题 */
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
    display: grid;
    /* 使容器高度适应子内容 */
}

.mode-content {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    transform: scale(1.02);
    display: flex;
    flex-direction: column;
    pointer-events: none;
    background: #ffffff;
    /* 底部文字区的底色 */
}

.mode-content::after {
    display: none;
    /* 彻底移除图片遮罩渐变，把原始像素 100% 留给用户 */
}

.mode-content.active {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
    z-index: 1;
}

/* Simulated gradients/backgrounds removed for actual images */

/* Apple 风格底部独立文字卡片布局（紧凑左右双栏版） */
.mode-info {
    width: 100%;
    position: relative;
    z-index: 2;
    padding: 1.5rem 2.5rem;
    color: #1d1d1f;
    /* 核心改版：转用 Grid 切割为两栏 */
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "badge features"
        "name  features"
        "desc  features";
    column-gap: 3rem;
    align-items: center;
}

.mode-badge {
    grid-area: badge;
    display: inline-block;
    padding: 0.25rem 0.65rem;
    background: rgba(0, 122, 255, 0.1);
    /* Apple 经典安全蓝 */
    color: #007aff;
    font-weight: 600;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    margin-bottom: 0.4rem;
    border: 1px solid rgba(0, 122, 255, 0.15);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    align-self: end;
    justify-self: start;
}

.mode-name {
    grid-area: name;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    letter-spacing: -0.01em;
    color: #1d1d1f;
}

.mode-desc {
    grid-area: desc;
    font-size: 1rem;
    color: #86868b;
    line-height: 1.4;
    margin-bottom: 0;
    align-self: start;
}

/* Feature tags inside mode */
.mode-features {
    grid-area: features;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.8rem;
    border-left: 1px solid rgba(0, 0, 0, 0.06);
    padding-left: 2.5rem;
    height: 100%;
}

.mode-feat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333336;
}

.mode-feat i {
    color: #34c759;
    /* Apple 成功绿 */
    font-size: 1.1rem;
}

/* Visual Placeholder Elements representing UI */
.ui-mockup {
    position: relative;
    z-index: 0;
    opacity: 1;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    /* 微妙的分割线 */
}

.mode-content.active .ui-mockup {
    transform: none;
    /* 如果在上侧独立展示，无需特殊的呼吸放大，保持纯净 */
}

.mode-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    /* 强力的毛玻璃与清晰的边框 */
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0;
}

/* 针对部分暗黑模式可能需要的文本颜色适配，强制使用高对比度颜色 */
.mode-control i {
    color: #1d1d1f;
}

.modes-section:hover .mode-control {
    opacity: 1;
}

.mode-control:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12), 0 2px 5px rgba(0, 0, 0, 0.08);
}

.mode-control:active {
    transform: translateY(-50%) scale(0.95);
}

/* 将按钮放置在外层容器两侧 */
.mode-control.prev {
    left: 0.5rem;
}

.mode-control.next {
    right: 0.5rem;
}

@media (min-width: 1100px) {
    .mode-control.prev {
        left: 0;
    }

    .mode-control.next {
        right: 0;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .modes-display {
        aspect-ratio: 4/3;
        margin: 0 1rem;
    }

    .mode-content {
        padding: 1.5rem;
    }

    .mode-name {
        font-size: 1.75rem;
    }
}