:root {
    --primary-color: #4A90E2;
    --primary-hover: #357ABD;
    --secondary-color: #50E3C2;
    --text-color: #333333;
    --light-text: #666666;
    --bg-color: #F8F9FA;
    --white: #FFFFFF;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

a {
    text-decoration: none;
    color: inherit;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 60px;
    display: flex;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 32px;
    width: 32px;
    background-color: #eee; /* Placeholder bg */
    border-radius: 8px;
}

.app-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

main {
    margin-top: 60px;
}

/* Hero Section */
.hero {
    background: url('../images/banner-bg.jpg') no-repeat center center/cover;
    padding: 60px 0;
    text-align: center;
    position: relative;
    /* 增加一个深色遮罩以保证文字可读性 */
    background-color: #f5f7fa; /* 备用背景色 */
}

/* 如果背景图较亮，可以加一个半透明遮罩 */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.4); /* 轻微白色遮罩，保持清新感 */
    /* background: rgba(0, 0, 0, 0.1); */ /* 或者用轻微黑色遮罩 */
    z-index: 1;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero-content {
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 16px;
    color: #2c3e50; /* 加深标题颜色 */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #4a5568; /* 加深副标题颜色 */
    margin-bottom: 32px;
    font-weight: 500;
}

.download-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px; /* 增加底部间距给更新日期 */
}

.update-info {
    font-size: 0.9rem;
    color: #ffffff; /* 使用略带蓝色的灰色，与整体色调融合 */
    margin-top: 12px;
    opacity: 0.9;
    font-weight: 500;
    /*text-shadow: 0 1px 1px rgba(255,255,255,0.5);*/
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    /* 让 SVG 图标变白以适应按钮背景 */
    filter: brightness(0) invert(1);
}

.btn-svg-icon {
    width: 21px;
    height: 21px;
    margin-right: 8px;
    flex: 0 0 auto;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: var(--shadow);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

.btn-large {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 16px 40px;
    font-size: 1.2rem;
}

.icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.hero-image {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.device-mockup-transparent {
    width: 100%;
    max-width: 700px; /* 限制最大宽度，避免图片过大 */
    margin: 0 auto;
    position: relative;
    /* 移除之前的边框、背景色和阴影，因为现在是透明样机图 */
}

.device-mockup-transparent img {
    display: block;
    width: 100%;
    height: auto;
    /* 如果图片自带阴影则不需要加，如果不够立体可以加一点 drop-shadow */
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.2));
}

/* Features Section */
.features {
    padding: 80px 0;
    background-color: var(--white);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 48px;
    color: var(--text-color);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 32px;
}

.feature-item {
    text-align: center;
    padding: 32px;
    border-radius: 16px;
    background-color: var(--bg-color);
    transition: transform 0.3s ease;
}

.feature-item:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 16px;
    background-image: url('../images/features-sprite.png');
    background-repeat: no-repeat;
    background-size: 400% 200%; /* 图片宽度是容器的4倍，高度适配 */
    background-color: transparent;
}

/* 利用 background-position 定位每个图标 */
/* 第1个图标：0% */
.icon-scale {
    background-position: 0% 40%;
}

/* 第2个图标：33.333% */
.icon-report {
    background-position: 33.333% 40%;
}

/* 第3个图标：66.666% */
.icon-privacy {
    background-position: 66.666% 40%;
}

/* 第4个图标：100% */
.icon-expert {
    background-position: 100% 40%;
}

.feature-item h3 {
    margin-bottom: 12px;
    color: var(--text-color);
}

.feature-item p {
    color: var(--light-text);
    font-size: 0.95rem;
}

/* Bottom CTA */
.bottom-cta {
    padding: 80px 0;
    text-align: center;
    background:
        linear-gradient(90deg, rgba(25, 107, 190, 0.82), rgba(0, 163, 173, 0.68)),
        url('../images/cta-bg.png') no-repeat center center/cover;
    color: var(--white);
}

.bottom-cta h2 {
    margin-bottom: 32px;
    color: var(--white);
}

.bottom-cta .btn {
    background-color: var(--white);
    color: var(--primary-color);
}

/* Footer */
.footer {
    background-color: #333;
    color: #999;
    padding: 40px 0;
    text-align: center;
    font-size: 0.9rem;
}

.footer-links {
    margin-top: 16px;
}

.footer-links a:hover {
    color: var(--white);
}

.divider {
    margin: 0 8px;
    color: #555;
}

/* Responsive */
@media (min-width: 768px) {
    .hero .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .hero-content {
        flex: 1;
        margin-bottom: 0;
        padding-right: 40px;
    }

    .download-buttons {
        justify-content: flex-start;
    }
    
    .update-info {
        text-align: left; /* PC端左对齐 */
    }

    .hero-image {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
    }
    
    .download-buttons {
        flex-direction: column;
    }

    .device-mockup-transparent {
        max-width: 100%;
        margin-top: 20px;
    }
}

/* --- UI-UX-Pro-Max Unified Modal Styles --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px); /* 磨砂玻璃效果 */
    -webkit-backdrop-filter: blur(8px);
    z-index: 2000;
    display: none; /* 默认隐藏 */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    width: 90%;
    max-width: 520px;
    box-shadow: 
        0 20px 50px -12px rgba(0, 0, 0, 0.25),
        0 0 0 1px rgba(0, 0, 0, 0.05); /* 细腻的内描边 */
    transform: scale(0.95) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* 弹性动画 */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

.modal-overlay.active .modal-content {
    transform: scale(1) translateY(0);
}

.modal-header {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, #ffffff, #fafafa);
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.modal-header h3, .modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    color: #1a1a1a;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.close-btn {
    background: rgba(0,0,0,0.05);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    font-size: 20px;
    transition: all 0.2s ease;
    padding: 0;
    line-height: 1;
}

.close-btn:hover {
    background: rgba(0,0,0,0.1);
    color: #000;
    transform: rotate(90deg);
}

.btn:focus-visible,
.close-btn:focus-visible,
.changelog-filter-btn:focus-visible,
.sdk-type-option:focus-visible {
    outline: 3px solid rgba(74, 144, 226, 0.35);
    outline-offset: 3px;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.changelog-toolbar {
    display: flex;
    gap: 8px;
    padding: 14px 24px 0;
    background: #fff;
}

.changelog-filter-btn {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #666;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.changelog-filter-btn:hover {
    color: var(--primary-color);
    border-color: rgba(0, 122, 255, 0.35);
}

.changelog-filter-btn.active {
    background: rgba(0, 122, 255, 0.08);
    color: var(--primary-color);
    border-color: rgba(0, 122, 255, 0.2);
    font-weight: 600;
}

/* 针对滚动条的美化 */
.modal-body::-webkit-scrollbar {
    width: 6px;
}
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
}

/* 兼容旧的 modal 类名 */
.modal {
    display: none;
}

/* Changelog Items */
.changelog-version {
    margin-bottom: 20px;
}

.changelog-version:last-child {
    margin-bottom: 0;
}

.changelog-version-title {
    color: #1a1a1a;
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.changelog-item {
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
    animation: fadeIn 0.4s ease forwards;
}

.changelog-item:last-child {
    border-bottom: none;
}

.changelog-date {
    display: block;
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 6px;
    font-family: monospace;
}

.changelog-content {
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    white-space: pre-line;
}

/* SDK Download Modal */
.sdk-modal-content {
    max-width: 580px;
}

.modal-eyebrow {
    margin: 0 0 2px;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.sdk-modal-body {
    padding-top: 20px;
}

.sdk-intro {
    margin-bottom: 22px;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.65;
}

.sdk-fieldset {
    min-width: 0;
    margin: 0 0 20px;
    padding: 0;
    border: 0;
}

.sdk-fieldset legend {
    display: block;
    margin-bottom: 9px;
    color: #1e293b;
    font-size: 0.88rem;
    font-weight: 700;
}

.sdk-type-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.sdk-type-option {
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid #dfe5ec;
    border-radius: 12px;
    background: #fff;
    color: #1e293b;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.sdk-type-option:hover {
    border-color: #9bc2ef;
    background: #f8fbff;
}

.sdk-type-option.active {
    border-color: var(--primary-color);
    background: #eef6ff;
    box-shadow: 0 0 0 1px var(--primary-color);
}

.sdk-type-option:disabled {
    border-color: #e2e8f0;
    background: #f8fafc;
    cursor: not-allowed;
    opacity: 0.72;
}

.sdk-type-heading {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sdk-type-option strong,
.sdk-type-option span {
    display: block;
}

.sdk-type-option strong {
    margin-bottom: 2px;
    font-size: 1rem;
}

.sdk-type-option span {
    overflow: hidden;
    color: #64748b;
    font-size: 0.8rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sdk-type-option .sdk-status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    padding: 2px 7px;
    border-radius: 999px;
    background: #e5f1ff;
    color: #2869a8;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.4;
}

.sdk-type-option:disabled .sdk-status-badge {
    background: #e2e8f0;
    color: #475569;
}

.sdk-selection {
    display: flex;
    align-items: center;
    gap: 13px;
    margin-bottom: 16px;
    padding: 14px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.sdk-selection-icon {
    display: flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: #e5f1ff;
    color: var(--primary-color);
}

.sdk-selection-icon svg {
    width: 22px;
    height: 22px;
}

.sdk-selection strong {
    display: block;
    color: #1e293b;
    font-size: 0.94rem;
}

.sdk-selection p {
    margin-top: 2px;
    color: #64748b;
    font-size: 0.8rem;
}

.sdk-download-btn {
    width: 100%;
    border-radius: 12px;
}

.sdk-download-btn[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.55;
}

.sdk-empty-state {
    padding: 18px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
    font-size: 0.9rem;
}

@media (max-width: 480px) {
    .sdk-trigger-btn {
        margin-top: 0;
    }

    .sdk-modal-content {
        width: calc(100% - 24px);
        max-height: calc(100vh - 24px);
        border-radius: 16px;
    }

    .sdk-type-options {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .modal-overlay,
    .modal-content,
    .btn,
    .close-btn,
    .sdk-type-option {
        transition: none;
    }
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
