* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'TikTok Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-image: url('../assets/images/body_background_01.png');
    background-repeat: repeat;
    background-position: top center;
    background-attachment: scroll;
    background-color: #ffffff;
    color: #000000;
    overflow-x: hidden;
    min-height: 100vh;
}

:root {
    --hero-columns-gap: 150px;             /* 左文案与右轮播的固定间距 */
    --content-max: 1400px;                 /* 居中内容最大宽度 */
    --hero-left-margin: 100px;            /* 左侧文本区域距离页面左边距 */
    --carousel-stage-width: 936px;         /* 功能截图展示宽度上限 (720px * 1.3) */
    --carousel-container-width: 1040px;     /* 轮播容器（包括指示器）固定宽度 (800px * 1.3) */
    --indicator-width: 8px;                 /* 指示器宽度 */
    --indicator-gap: 60px;                 /* 指示器与舞台右缘的固定间距 */
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    background: rgba(245, 245, 245, 0.6);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.nav {
    padding: 10px 20px;
}

.nav-container {
    max-width: 1250px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    position: relative;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.brand:hover {
    transform: scale(1.02);
}

.brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    display: block;
    opacity: 1;
    visibility: visible;

    min-width: 60px;
    transition: opacity 0.3s ease;
}

.brand-logo[alt="Logo not found"] {
    display: none;
}

.brand-logo[alt="Logo not found"] + .brand-name::before {
    content: "⚡";
    margin-right: 8px;
    font-size: 24px;
}

.brand-name {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 600;
    font-size: 20px;
    color: #000000;
    letter-spacing: -0.5px;
}

.header-actions {
    display: flex;
    gap: 24px;
    align-items: center;
}

.header-action {
    color: #666666;
    text-decoration: none;
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.header-action:hover {
    color: #000000;
}

.header-action::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: #000000;
    transition: width 0.3s ease;
}

.header-action:hover::after {
    width: 100%;
}

.container {
    width: min(var(--content-max), 100vw - 40px);
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 0 20px;
}

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 84px;
    box-sizing: border-box;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--hero-columns-gap);
    min-height: 600px;
    width: 100%;
}

.hero-left {
    position: fixed; /* 固定左侧文本容器，使其相对屏幕定位 */
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* 内容右对齐 */
    min-width: 0;
    /* 红色框右边缘固定在图片左边缘（容器左+15）左侧150px：
       right = 指示器右距20 + 指示器宽24 + 轮播与指示器间距100 + 容器宽562 + 容器padding-left 15 + 150
       = 20 + 24 + 100 + 562 + 15 + 150 = 871px
    */
    right: calc(20px + 24px + 100px + 562px + 15px + 150px);
    left: 50px; /* 标题与副标题距屏幕左侧固定 50px */
    max-width: calc(100vw - (20px + 24px + 100px + 562px + 15px + 150px) - 100px);
    box-sizing: border-box;
}

.tarot-readers-carousel {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.carousel-stage {
    position: relative;
    width: 300px;
    height: 400px;
    perspective: 1200px;
    margin-bottom: 30px;
}

.carousel-stage {
    position: relative;
    width: 650px;
    height: 476px;
    perspective: 1200px;
    margin-bottom: 30px;
}

.tarot-reader {
    position: absolute;
    width: 302px;
    height: 476px;
    cursor: pointer;
    border-radius: 0;
    opacity: 1;
    transition: transform 0.3s ease;
}

.tarot-reader .reader-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    transition: transform 0.3s ease;
}

.tarot-reader:hover .reader-image {
    transform: scale(1.02);
}

.tarot-reader[data-reader="lisa"] {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1);
    z-index: 3;
}

.tarot-reader[data-reader="selene"] {
    left: 0px;
    top: 50%;
    transform: translateY(-50%) scale(0.75);
    z-index: 2;
    opacity: 0.8;
}

.tarot-reader[data-reader="isabella"] {
    right: 0px;
    top: 50%;
    transform: translateY(-50%) scale(0.75);
    z-index: 2;
    opacity: 0.8;
}

.hero-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    width: auto; /* 自适应内容宽度 */
    min-width: auto;
    max-width: none;
    margin-left: auto; /* 右侧靠右对齐 */
    /* 调试边框已移动到图片元素上 */
    box-sizing: border-box;
    position: relative; /* 为子元素定位提供上下文 */
}

.hero-text {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 720px; /* 现代网页常用阅读宽度上限 */
    align-items: flex-start; /* 左对齐 */
    text-align: left;
    flex: 1;
    min-width: 0;
    padding-left: 50px; /* 与屏幕左侧固定 50px 的视觉对齐 */
    margin-left: 0;
    box-sizing: border-box;
}

.hero-title-wrapper {
    position: relative;
    display: flex;
    justify-content: flex-start; /* 标题左对齐 */
    width: 100%;
    overflow: visible;
}

.hero-title-star {
    position: absolute;
    right: 0;
    bottom: calc(100% + 37px);
    width: auto;
    height: auto;
    max-width: 120px;
}

.hero-title {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 900;
    font-size: clamp(14px, 2.5vw, 28px); /* 缩小为原先的一半 */
    line-height: 1.2;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    text-align: right;
}

.hero-subtitle {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 600; /* 弱化：从 900 降到 600 */
    font-size: clamp(15px, 2.6vw, 18px); /* 略微缩小字号 */
    color: rgba(0, 0, 0, 0.75); /* 弱化：降低对比度 */
    letter-spacing: -0.2px; /* 减小字距强调 */
    justify-content: flex-end;
}

/* Store badge under subtitle */
.store-links {
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.store-item { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.store-frame { height: 64px; display: flex; align-items: center; }
.store-badge { height: auto; width: auto; max-height: 100%; display: block; }
@media (max-width: 480px) {
    .store-frame { height: 55px; }
}
.store-badge.apple { filter: grayscale(1); opacity: .7; }
.store-badge.apple { transform: scale(1.08); transform-origin: center; }
.store-link.disabled { cursor: default; }
/* 去掉针对 Google 的位置微调，交给容器统一对齐 */
.store-links .store-badge:not(.apple) { margin-top: 0; }
.store-caption { font-size: 12px; line-height: 1; color: rgba(0,0,0,.55); text-align: center; }

/* Fine-tune Google Play badge vertical alignment */
.store-links .store-badge:not(.apple) { margin-top: -14px; }

.hero-subtitle .line {
    color: #000000;
    letter-spacing: -3.45px;
}

.hero-description {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 2vw, 15px);
    line-height: 1.33;
    color: rgba(0, 0, 0, 0.6);
    letter-spacing: -0.23px;
    max-width: 100%;
}

/* App feature carousel (right) */
.app-carousel {
    position: relative;
    /* 30px(左右padding总和) + 舞台宽 + 60px(gap) + 24px(indicator) */
    width: calc(30px + clamp(320px, 44vw, 562px) + var(--indicator-gap) + 24px);
    height: clamp(420px, 75vh, 720px); /* 小屏更易完整显示 */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 15px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.app-carousel .carousel-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: clamp(320px, 44vw, 562px); /* 高度优先时，舞台宽也自适应 */
    height: 100% !important;
    margin-bottom: 0 !important;
}

.app-slide {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none;
    visibility: hidden; /* 非激活的slide不影响布局 */
}

.app-slide.active {
    opacity: 1;
    transform: scale(1);
    position: absolute; /* 填充舞台区域，保证高度约束生效 */
    inset: 0;
    pointer-events: auto;
    visibility: visible;
    width: 100%;
    height: 100%;
    top: auto;
    left: auto;
    right: auto;
    bottom: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.app-slide .slide-bg {
    display: none; /* 暂时隐藏背景 */
}

.app-slide.active .slide-foreground {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.app-slide:not(.active) .slide-foreground {
    display: none; /* 非激活的slide不显示 */
}

.app-slide .slide-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(0px) brightness(1);
    opacity: 0.35;
}

.app-slide .slide-foreground img {
    width: auto;
    height: 100%;
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* 同时受限于宽和高，保证完整显示 */
    transform: none;
    box-sizing: border-box;
}

/* Vertical indicators */
.carousel-indicators {
    position: absolute; /* 贴内容容器右侧 */
    left: calc(15px + clamp(320px, 44vw, 562px) + var(--indicator-gap));
    width: 24px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
    /* 调试边框移除 */
    box-sizing: border-box;
    padding: 0;
    z-index: 10;
}

/* 确保指示器相对于 .hero 定位，而不是相对于 .app-carousel */
/* 由于指示器在 .app-carousel 内部，我们需要使用 fixed 定位并相对于 viewport 计算 */

.indicator {
    width: 8px;
    height: 28px;
    background: rgba(0, 0, 0, 0.2);
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.indicator:hover {
    background: rgba(0, 0, 0, 0.35);
}

.indicator.active {
    background: #000000;
    height: 40px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

@media screen and (max-width: 1024px), screen and (max-device-width: 1024px), screen and (pointer: coarse) {
    .hero-content {
        flex-direction: column;
        gap: 32px;
    }

    .hero-left {
        width: 100%;
        justify-content: flex-start;
        margin-right: 0; /* 移动端取消右边距 */
    }

    .hero-right {
        width: 100%;
        max-width: var(--carousel-container-width);
    }

    .hero-text {
        align-items: flex-start;
        text-align: left;
    }

    .hero-title-wrapper {
        justify-content: flex-start;
    }

    .hero-title {
        white-space: normal;
    }

    .app-carousel {
        height: 420px;
        width: 100%;
        max-width: var(--carousel-container-width);
    }

    .app-carousel .carousel-stage {
        width: auto !important;
        max-width: none !important;
    }

    .carousel-indicators {
        left: auto;
        right: 6px;
    }
}

.cta {
    padding: 80px 0;
    position: relative;
    z-index: 10;
}

.cta-card {
    background: #000000;
    border-radius: 16px;
    padding: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e3eaef;
    max-width: 735px;
    margin: 0 auto;
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cta-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.cta-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.cta-logo {
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cta-logo img {
    width: 26px;
    height: auto;
}

.cta-title {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 600;
    font-size: 16px;
    color: white;
    text-transform: capitalize;
}

.cta-button {
    width: 135px;
    height: 40px;
}

.cta-button img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.tarot-showcase {
    position: relative;
    height: 300px;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

.tarot-wheel {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(1184px, 90vw);
    height: 297px;
    animation: rotateWheel 60s linear infinite;
}

@keyframes rotateWheel {
    from { transform: translateX(-50%) rotate(0deg); }
    to { transform: translateX(-50%) rotate(360deg); }
}

.tarot-wheel img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.page-main {
    padding-top: 140px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.page-section {
    padding: 120px 0;
    flex: 1;
}

.page-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
}

.page-container h2 {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 700;
    font-size: 28px;
    margin-top: 48px;
    margin-bottom: 16px;
    color: #000000;
}

.page-container p,
.page-container ul {
    margin-bottom: 16px;
}

.page-container ul {
    padding-left: 20px;
}

.page-title {
    font-family: 'TikTok Sans', sans-serif;
    font-weight: 800;
    font-size: 48px;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    color: #000000;
}

.page-lead {
    font-family: 'TikTok Sans', sans-serif;
    font-size: 18px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.7);
    margin-bottom: 32px;
}

@media screen and (max-width: 1024px), screen and (max-device-width: 1024px), screen and (pointer: coarse) {
    body.legal-page {
        background-color: #ffffff;
        background-image: none;
    }

    body.legal-page .header {
        display: none;
    }

    body.legal-page .page-main {
        padding-top: 32px;
    }

    body.legal-page .page-section {
        padding: 32px 0;
    }

    body.legal-page .page-container {
        padding: 0 20px;
    }
}

body.legal-page.legal-mobile {
    background-color: #ffffff;
    background-image: none;
}

body.legal-page.legal-mobile .header {
    display: none;
}

body.legal-page.legal-mobile .page-main {
    padding-top: 32px;
}

body.legal-page.legal-mobile .page-section {
    padding: 32px 0;
}

body.legal-page.legal-mobile .page-container {
    padding: 0 20px;
}

/* SDK List Styles */
.sdk-list {
    margin: 32px 0;
    overflow-x: auto;
}

.sdk-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'TikTok Sans', sans-serif;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.sdk-table thead {
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.sdk-table th {
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #000000;
    border-bottom: 2px solid rgba(0, 0, 0, 0.15);
}

.sdk-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(0, 0, 0, 0.8);
}

.sdk-table tbody tr:last-child td {
    border-bottom: none;
}

.sdk-table tbody tr:hover:not(.sdk-category) {
    background: rgba(0, 0, 0, 0.02);
    transition: background 0.2s ease;
}

.sdk-table .sdk-category {
    background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
    font-weight: 600;
}

.sdk-table .sdk-category td {
    padding: 12px 20px;
    color: #000000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.sdk-name {
    font-weight: 600;
    color: #000000;
}

.sdk-table a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sdk-table a:hover {
    color: #0052a3;
    text-decoration: underline;
}

.sdk-table .no-policy {
    color: rgba(0, 0, 0, 0.5);
    font-style: italic;
    font-size: 13px;
}

/* Mobile Responsive Styles for SDK Table */
@media screen and (max-width: 768px) {
    .sdk-list {
        margin: 24px 0;
    }

    /* Hide table header */
    .sdk-table thead {
        display: none;
    }
    
    /* Convert table to blocks */
    .sdk-table,
    .sdk-table tbody,
    .sdk-table tr,
    .sdk-table td {
        display: block;
        width: 100%;
    }
    
    /* Category rows - full width labels */
    .sdk-table .sdk-category {
        margin-top: 16px;
        margin-bottom: 8px;
        border-radius: 4px;
        background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    }

    .sdk-table .sdk-category td {
        padding: 10px 16px;
        text-align: center;
        font-size: 15px;
    }
    
    /* Regular rows - card style */
    .sdk-table tr:not(.sdk-category) {
        margin-bottom: 16px;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 8px;
        overflow: hidden;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }
    
    .sdk-table tr:not(.sdk-category) td {
        padding: 12px 16px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
        position: relative;
        padding-left: 40%;
        min-height: 48px;
        display: flex;
        align-items: center;
    }
    
    .sdk-table tr:not(.sdk-category) td:last-child {
        border-bottom: none;
    }
    
    /* Add labels for mobile */
    .sdk-table tr:not(.sdk-category) td:before {
        content: attr(data-label);
        position: absolute;
        left: 16px;
        width: calc(40% - 32px);
        font-weight: 600;
        color: #000000;
        font-size: 13px;
        white-space: nowrap;
    }
    
    .sdk-table tr:not(.sdk-category) td:nth-child(1):before {
        content: "SDK/Service";
    }
    
    .sdk-table tr:not(.sdk-category) td:nth-child(2):before {
        content: "Purpose";
    }
    
    .sdk-table tr:not(.sdk-category) td:nth-child(3):before {
        content: "Privacy Policy";
    }

    /* Adjust SDK name on mobile */
    .sdk-table tr:not(.sdk-category) .sdk-name {
        font-size: 14px;
        word-break: break-word;
    }
}

/* Additional mobile adjustments for legal-page mode */
@media screen and (max-width: 1024px), screen and (max-device-width: 1024px), screen and (pointer: coarse) {
    body.legal-page .sdk-list {
        margin: 24px 0;
    }

    body.legal-page .sdk-table {
        font-size: 14px;
    }
}
