/* ═══════════════════════════════════════
   下载页 · 应用商店风格 + 手机模型预览
   ═══════════════════════════════════════ */

@import url('phone-frame.css');

.page-download {
    background: #fff;
}

.page-download .download-main {
    background: #fff;
}

.download-hero {
    padding: calc(var(--header-height) + clamp(2rem, 5vh, 3rem)) 0 clamp(2.5rem, 6vh, 4rem);
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    display: flex;
    align-items: center;
}

.download-layout {
    display: grid;
    grid-template-columns: minmax(0, 26rem) minmax(0, 1fr);
    gap: clamp(2rem, 6vw, 5rem);
    align-items: center;
}

/* ── 左侧应用信息（微信 / 钉钉下载页风格）── */
.download-info {
    max-width: 26rem;
}

.download-app-icon {
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 0 1.25rem;
    background: none;
    border-radius: 22%;
    display: block;
    overflow: hidden;
    box-shadow: none;
    flex-shrink: 0;
}

.download-app-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 22%;
}

.download-app-name {
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 0.375rem;
    color: var(--text-color);
    line-height: 1.2;
}

.download-app-desc {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.5;
}

.download-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem 0.5rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
}

.download-steps__item {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-color);
}

.download-steps__item:not(:last-child)::after {
    content: '·';
    margin-left: 0.125rem;
    color: var(--text-light);
    font-weight: 400;
}

.download-steps__num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--primary-dark, #0d9a85);
    background: rgba(13, 154, 133, 0.1);
    border-radius: 50%;
    flex-shrink: 0;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.download-intro-text {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.25rem;
}

.download-legal-links {
    font-size: 0.8125rem;
}

.download-legal-link {
    font-size: 0.8125rem;
    color: var(--primary-dark);
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.download-legal-link:hover {
    text-decoration: underline;
}

.download-legal-divider {
    font-size: 0.8125rem;
    color: #ccc;
    margin: 0 0.5rem;
}

.download-btn {
    width: 100%;
    background: #fff;
    border-radius: 0.75rem;
    padding: 0.875rem 1rem;
    display: flex;
    align-items: center;
    border: none;
    transition: transform 0.2s ease, opacity 0.15s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
    min-height: 4rem;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    user-select: none;
}

.download-btn:active {
    transform: translateY(1px);
}

@media (hover: none) {
    .download-btn:active {
        transform: none;
        opacity: 0.88;
    }
}

.download-btn.primary {
    background: linear-gradient(135deg, #11d6bb 0%, #0fc5ac 50%, #0ab39a 100%);
    color: #fff;
    box-shadow: 0 0.35rem 1rem rgba(17, 214, 187, 0.28);
}

.download-btn.primary:hover {
    box-shadow: 0 0.5rem 1.25rem rgba(17, 214, 187, 0.35);
}

.download-btn.secondary {
    background: #fff;
    color: var(--text-color);
    border: 1px solid rgba(17, 214, 187, 0.28);
    box-shadow: none;
}

.download-btn.secondary .download-btn-icon {
    background: rgba(17, 214, 187, 0.1);
    border-color: rgba(17, 214, 187, 0.2);
    color: var(--primary-dark);
}

.download-btn.secondary .download-btn-icon svg {
    stroke: var(--primary-dark);
}

.download-btn[hidden] {
    display: none;
}

.download-btn-icon {
    margin-right: 0.75rem;
    width: 2.5rem;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
}

.download-btn-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.download-btn-content {
    flex: 1;
    margin-right: 0.5rem;
}

.download-btn-title {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
    display: block;
    line-height: 1.3;
}

.download-btn-subtitle {
    font-size: 0.75rem;
    opacity: 0.85;
    display: block;
}

.download-btn-arrow {
    width: 1.125rem;
    height: 1.125rem;
    opacity: 0.85;
    flex-shrink: 0;
}

.download-btn-arrow svg {
    width: 100%;
    height: 100%;
}

/* ── 右侧手机模型 + 截图轮播 ── */
.download-showcase {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    min-width: 0;
    padding: 0.5rem 0 1.25rem;
}

.download-swipe-hint {
    margin: 0;
    font-size: 0.75rem;
    color: var(--text-light);
    letter-spacing: 0.04em;
}

.download-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-indicator {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 999px;
    background: rgba(17, 214, 187, 0.22);
    transition: width 0.3s ease, background 0.3s ease;
    cursor: pointer;
    border: none;
    padding: 0;
}

.download-indicator.active {
    width: 1.25rem;
    background: var(--primary-color);
}

@media (hover: hover) and (pointer: fine) {
    .download-indicator:hover {
        background: rgba(17, 214, 187, 0.55);
    }
}

/* ── Toast / Modal ── */
.download-toast {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    padding: 0.875rem 1.25rem;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    max-width: 80vw;
    text-align: center;
}

.download-toast.is-visible {
    opacity: 1;
}

.download-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    isolation: isolate;
    -webkit-tap-highlight-color: transparent;
}

.download-modal[hidden],
.download-toast[hidden] {
    display: none !important;
}

.download-modal-mask {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.55);
}

body.download-modal-open {
    overflow: hidden;
}

body.download-modal-open .download-buttons {
    visibility: hidden;
}

body.download-modal-open .download-info {
    pointer-events: none;
}

.download-modal-box {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 22rem;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem 1.25rem 1.25rem;
    text-align: center;
}

.download-modal-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.download-modal-body {
    font-size: 0.9375rem;
    color: var(--text-light);
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 1rem;
}

.download-modal-confirm {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (max-width: 991px) {
    .download-hero {
        min-height: auto;
        align-items: flex-start;
    }

    .download-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .download-info {
        max-width: none;
    }

    .download-app-icon {
        width: 4.75rem;
        height: 4.75rem;
        margin-left: auto;
        margin-right: auto;
    }

    .download-app-name,
    .download-app-desc,
    .download-intro-text {
        text-align: center;
    }

    .download-steps {
        flex-direction: column;
        align-items: center;
        gap: 0.625rem;
        width: 100%;
        max-width: 16rem;
        margin-left: auto;
        margin-right: auto;
    }

    .download-steps__item {
        width: 100%;
        justify-content: flex-start;
        padding: 0.5rem 0.75rem;
        background: rgba(13, 154, 133, 0.06);
        border-radius: 0.5rem;
    }

    .download-steps__item:not(:last-child)::after {
        content: none;
    }

    .download-legal-links {
        text-align: center;
    }

    .download-phone {
        width: min(72vw, 17.5rem);
    }
}

@media (max-width: 767px) {
    .download-hero {
        padding-top: calc(var(--header-height) + 1.5rem);
        padding-bottom: 2rem;
    }

    .download-app-icon {
        width: 4.5rem;
        height: 4.5rem;
    }

    .download-app-name {
        font-size: 1.5rem;
    }

    .download-phone {
        width: min(68vw, 16rem);
    }
}
