/* ==========================================================================
   Triangular Pomodoro Timer - Styles
   ========================================================================== */

/* --- 0. 全局重置与字体 --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

html,
body {
    overscroll-behavior: none;
    background-color: #f5f5f7;
    color: #1d1d1f;
}

/* --- 1. iOS 26 液态背景 (Fixed) --- */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, 0.8) 0%, transparent 40%),
        radial-gradient(circle at 85% 20%, rgba(220, 230, 255, 0.6) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(255, 240, 245, 0.6) 0%, transparent 50%),
        linear-gradient(180deg, #fbfbfd 0%, #f2f2f7 100%);
    z-index: -2;
}

/* ==========================================================================
   通用组件：一级卡片（毛玻璃）
   ========================================================================== */
.glass-card {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* --- 2. 导航栏 --- */
nav.sticky-nav,
.nav {
    position: sticky;
    top: 20px;
    z-index: 100;

    width: fit-content;
    max-width: 95%;

    margin: 0 auto 40px auto;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 8px;

    overflow-x: auto;
    display: flex;
    justify-content: center;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
}

nav.sticky-nav::-webkit-scrollbar {
    display: none;
}

.nav-link,
.nav__link {
    text-decoration: none;
    color: #1d1d1f;
    font-size: 14px;
    font-weight: 500;
    padding: 10px 20px;
    border-radius: 20px;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
}

.nav-link.active,
.nav__link.active {
    background: #000;
    color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-link:hover:not(.active),
.nav__link:hover:not(.active) {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.02);
}

/* --- 3. 页面主体容器 --- */
.main-container,
.layout {
    width: 90%;
    max-width: 980px;
    margin: 0 auto;
    padding-bottom: 80px;
}

/* --- 4. Hero Section --- */
.hero-section {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeInUp 0.8s ease-out;
    scroll-margin-top: 100px;
}

h1.product-title {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -1.5px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #000 0%, #434343 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

p.product-subtitle {
    font-size: 24px;
    color: #86868b;
    font-weight: 400;
    margin-bottom: 40px;
}

/* ==========================================================================
   通用媒体框（Hero/爆炸图）
   ========================================================================== */
.hero-image-placeholder,
.media-frame {
    width: 100%;
    border-radius: 40px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(120deg, #e0e0e0 0%, #f5f5f5 100%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
}

.hero-image-placeholder::after {
    content: none;
    position: absolute;
}

.hero-image-placeholder img,
.media-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 比例类：兼容旧命名 + 支持更规范命名 */
.hero-image-16x9,
.hero-image--16x9,
.media-frame--16x9 {
    aspect-ratio: 16 / 9;
}

.hero-image-3x2,
.hero-image--3x2,
.media-frame--3x2 {
    aspect-ratio: 3 / 2;
}

/* ==========================================================================
   Hero 视频：封面图 -> 点击播放 -> 播放结束回封面
   ========================================================================== */
.hero-media {
    position: relative;
}

/* 封面按钮占满框架 */
.hero-media__poster {
    position: absolute;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    cursor: pointer;
}

.hero-media__poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.hero-media__play {
    position: absolute;

    /* 原来是居中：
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    */

    /* 改为左下角 */
    left: 24px;
    bottom: 24px;
    transform: none;

    width: 74px;
    height: 74px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.hero-media__play::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    transform: translate(-35%, -50%);
    border-style: solid;
    border-width: 12px 0 12px 18px;
    border-color: transparent transparent transparent rgba(255, 255, 255, 0.95);
}

.hero-media__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: none;
    background: #000;
}

/* 播放中：显示 video 隐藏封面 */
.hero-media.is-playing .hero-media__video {
    display: block;
}

.hero-media.is-playing .hero-media__poster {
    display: none;
}

/* --- 5. Bento Grid 特性网格 --- */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 60px;
    scroll-margin-top: 100px;
}

/* 一级卡片：Bento（差异项保留在自身） */
.bento-card {
    border-radius: 30px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
}

.bento-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.1);
}

/* 兼容旧 wide，同时提供更语义的 card--wide */
.bento-card.wide,
.bento-card.card--wide {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
}

.card-content {
    flex: 1;
}

/* card-title 为 h3：清除默认 margin，保持原视觉 */
.card-title {
    font-size: 32px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #1d1d1f;
}

.card-text {
    font-size: 17px;
    line-height: 1.6;
    color: #515154;
}

/* 二级卡片（保持原样）：图片容器 3:2 */
.card-img-placeholder {
    background: #e5e5e5;
    border-radius: 20px;
    margin-top: 20px;
    aspect-ratio: 3 / 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    overflow: hidden;
    position: relative;
}

.card-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.wide .card-img-placeholder,
.card--wide .card-img-placeholder {
    margin-top: 0;
    margin-left: 40px;
    width: 50%;
    flex-shrink: 0;
}

/* --- 6. 细节展示 Section（一级卡片差异项） --- */
.detail-section {
    border-radius: 40px;
    padding: 60px;
    text-align: center;
    scroll-margin-top: 100px;
}

/* 桌面：标题居中；移动端在 media 内改左对齐 */
.detail-title {
    font-size: 40px;
    font-weight: 700;
    margin-bottom: 60px;
    text-align: center;
}

/* specs 标题基准：与 grid-container 左边界一致（桌面保持） */
.specs-section > .detail-title {
    padding: 0 40px;
}

/* 桌面端不换行 */
.mobile-br {
    display: none;
}

.detail-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.detail-icon {
    width: 80px;
    height: 80px;
    background: #f5f5f7;
    border-radius: 50%;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #000;
}

h3 {
    font-size: 20px;
    margin-bottom: 10px;
}

p.detail-desc {
    color: #86868b;
    font-size: 15px;
}

/* --- 7. 规格参数 Section（一级卡片差异项） --- */
.specs-section {
    padding: 80px 0;
    text-align: center;
    border-radius: 40px;
    margin-top: 40px;
    scroll-margin-top: 100px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 300px 300px;
    gap: 20px;
    margin-top: 50px;
    padding: 0 40px;
}

/* 二级卡片（保持原样） */
.grid-item {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    padding: 30px;
    background: #fff;
    border-radius: 30px;
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.grid-item:hover {
    transform: scale(1.02);
}

.grid-item.wide,
.grid-item.card--wide {
    grid-column: span 2;
}

.grid-title {
    font-size: 14px;
    font-weight: 600;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

/* grid-value 改为 h3：字号/字重/颜色与 card-title 一致 */
.grid-value {
    font-size: 32px;
    font-weight: 600;
    color: #1d1d1f;
    line-height: 1.2;
    margin: 0;
}

.grid-desc {
    font-size: 17px;
    color: #424245;
    margin-top: 10px;
}

.grid-item > div,
.grid-item .grid-desc {
    position: relative;
    z-index: 1;
}

.grid-icon-placeholder {
    position: absolute;
    right: 20px;
    bottom: 20px;
    width: 128px;
    height: 128px;
    object-fit: cover;
    z-index: 0;
    opacity: 0.18;
    pointer-events: none;
}

/* --- 图片可点击放大：交互提示（可选但常用）--- */
.js-lightbox {
    cursor: zoom-in;
}

/* --- 8. 响应式适配 --- */
@media (max-width: 820px) {
    nav.sticky-nav,
    .nav {
        justify-content: flex-start;
        padding: 10px;
        width: fit-content;
        max-width: 95%;
    }

    h1.product-title { font-size: 40px; }
    p.product-subtitle { font-size: 20px; }

    .feature-grid { grid-template-columns: 1fr; }

    .bento-card.wide,
    .bento-card.card--wide {
        grid-column: span 1;
        flex-direction: column;
    }

    .wide .card-img-placeholder,
    .card--wide .card-img-placeholder {
        width: 100%;
        margin-left: 0;
        margin-top: 20px;
    }

    .detail-section { padding: 40px 20px; }

    .detail-row {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }

    .grid-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        padding: 0 20px;
    }

    .grid-item { min-height: 200px; }
    .grid-item.wide,
    .grid-item.card--wide { grid-column: span 1; }

    /* 移动端：标题左对齐 */
    .detail-title {
        text-align: left;
    }

    /* 移动端左缩进统一到 40px 基准（与 specs 标题一致） */
    .detail-section .detail-title {
        padding-left: 20px;
        padding-right: 20px;
    }

    /* 移动端逗号后换行 */
    .mobile-br {
        display: block;
    }

    .hero-media__play {
        left: 16px;
        bottom: 16px;
        width: 64px;
        height: 64px;
    }

    .hero-media__play::before {
        border-width: 10px 0 10px 16px;
    }
}

/* --- 动画：首屏渐入上移 --- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   Lightbox（点击图片查看大图）
   ========================================================================== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
}

.lightbox.is-open {
    display: block;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.lightbox__content {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.lightbox__img {
    max-width: min(1100px, 92vw);
    max-height: 86vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 30px 120px rgba(0, 0, 0, 0.45);
    background: rgba(255, 255, 255, 0.04);
}

.lightbox__close {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    cursor: pointer;
    font-size: 18px;
    line-height: 42px;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.lightbox__close:hover {
    background: rgba(0, 0, 0, 0.5);
}
