/* ===== Reset & Base ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: #f5f7fa;
    color: #1a1a2e;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== Top Navigation Bar ===== */
.navbar {
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.navbar-brand i {
    font-size: 1.4rem;
    color: #4fc3f7;
}
.navbar-links {
    display: flex;
    align-items: center;
    gap: 16px;
}
.navbar-links a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 20px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.navbar-links a:hover {
    color: #fff;
    background: rgba(255,255,255,0.12);
}
.navbar-links a i {
    font-size: 0.85rem;
}

/* ===== Main Container ===== */
.main-container {
    width: 100%;
    max-width: 520px;
    padding: 32px 20px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ===== Hero / App Header ===== */
.app-hero {
    text-align: center;
    margin-bottom: 32px;
    width: 100%;
    animation: fadeInUp 0.5s ease;
}
.app-icon-wrapper {
    width: 88px;
    height: 88px;
    margin: 0 auto 16px;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.app-icon-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.app-hero h1 {
    font-size: 1.6rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 6px;
}
.app-hero p {
    font-size: 0.92rem;
    color: #6b7280;
    line-height: 1.5;
}

/* ===== Description Card ===== */
.desc-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    animation: fadeInUp 0.5s ease 0.05s both;
}
.desc-card .desc-brief {
    font-size: 0.95rem;
    color: #1f2937;
    line-height: 1.6;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.desc-card .desc-brief i {
    color: #4fc3f7;
    margin-right: 6px;
}
.desc-card .desc-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 0 0;
    cursor: pointer;
    font-size: 0.82rem;
    color: #4fc3f7;
    user-select: none;
    transition: color 0.2s;
    border: none;
    background: none;
    width: 100%;
}
.desc-card .desc-toggle:hover { color: #0ea5e9; }
.desc-card .desc-toggle i {
    transition: transform 0.25s ease;
    font-size: 0.75rem;
}
.desc-card .desc-toggle.collapsed i { transform: rotate(0deg); }
.desc-card .desc-toggle:not(.collapsed) i { transform: rotate(180deg); }
.desc-card .desc-detailed-wrap {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    max-height: 0;
    opacity: 0;
}
.desc-card .desc-detailed-wrap.open {
    max-height: 600px;
    opacity: 1;
}
.desc-card .desc-detailed {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.7;
    padding-top: 14px;
}

/* ===== QR Code Card ===== */
.qr-card {
    width: 100%;
    background: #fff;
    border-radius: 16px;
    padding: 28px 24px;
    margin-bottom: 24px;
    text-align: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    animation: fadeInUp 0.5s ease 0.1s both;
}
.qr-card img {
    width: 180px;
    height: 180px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 12px;
    display: none;
}
.qr-label {
    font-size: 0.88rem;
    color: #6b7280;
    line-height: 1.6;
    white-space: pre-line;
    display: none;
}

/* ===== Download Buttons ===== */
.download-section {
    width: 100%;
    animation: fadeInUp 0.5s ease 0.2s both;
}
.download-section h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.download-section h2 i { color: #4fc3f7; }
.btn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.app-download-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 500;
    color: #1f2937;
    text-decoration: none;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.app-download-btn i {
    font-size: 1.15rem;
    width: 22px;
    text-align: center;
}
.app-download-btn:hover {
    border-color: #4fc3f7;
    box-shadow: 0 4px 12px rgba(79,195,247,0.2);
    transform: translateY(-1px);
}
.app-download-btn:active { transform: translateY(0); }

/* Platform-specific icon colors */
.btn-apple i,
.btn-ios i { color: #007aff; }
.btn-google i { color: #4285F4; }
.btn-google svg.gp-icon { vertical-align: middle; margin-right: 2px; flex-shrink: 0; }
.btn-nux i { color: #4fc3f7; }
.btn-android i,
.btn-androidstore i { color: #3ddc84; }
.btn-windows i,
.btn-win i { color: #0078d6; }
.btn-macos i,
.btn-mac i { color: #555; }
.btn-third i { color: #007aff; }

/* ===== WeChat overlay ===== */
.wechat-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.72);
    z-index: 200;
    padding: 24px;
    overflow-y: auto;
}
.wechat-overlay.show,
.wechat-overlay[style*="display: block"],
.wechat-overlay[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}
.wechat-card {
    background: #fff;
    border-radius: 20px;
    padding: 36px 28px 28px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0,0,0,0.3);
    animation: fadeInUp 0.35s ease;
}
.wechat-card .icon-wechat {
    font-size: 3rem;
    color: #07c160;
    margin-bottom: 12px;
}
.wechat-card h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 8px;
}
.wechat-card .step-list {
    text-align: left;
    margin: 16px 0;
    padding: 0;
    list-style: none;
}
.wechat-card .step-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.92rem;
    color: #374151;
    border-bottom: 1px solid #f3f4f6;
}
.wechat-card .step-list li:last-child { border-bottom: none; }
.wechat-card .step-list li .step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #e8f5fe;
    color: #0ea5e9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    font-weight: 700;
    flex-shrink: 0;
}
.wechat-card .step-list li img.icon-safari {
    width: 24px;
    height: 24px;
    vertical-align: middle;
}
.wechat-card .btn-close-wechat {
    display: inline-block;
    margin-top: 16px;
    padding: 10px 32px;
    background: #f3f4f6;
    color: #6b7280;
    border-radius: 24px;
    font-size: 0.88rem;
    text-decoration: none;
    transition: background 0.2s;
}
.wechat-card .btn-close-wechat:hover { background: #e5e7eb; }

/* ===== ICP Info ===== */
.icp-info {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: center;
    margin-top: 4px;
}

/* ===== Footer ===== */
.footer {
    width: 100%;
    max-width: 520px;
    padding: 24px 20px 32px;
    text-align: center;
    font-size: 0.78rem;
    color: #9ca3af;
    border-top: 1px solid #e5e7eb;
    margin-top: 8px;
}
.footer a {
    color: #6b7280;
    text-decoration: none;
}
.footer a:hover { color: #4fc3f7; }

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== Responsive ===== */
@media (max-width: 420px) {
    .main-container { padding: 20px 16px 32px; }
    .app-icon-wrapper { width: 72px; height: 72px; }
    .app-hero h1 { font-size: 1.35rem; }
    .btn-grid { grid-template-columns: 1fr; }
    .qr-card img { width: 150px; height: 150px; }
    .navbar { padding: 0 16px; }
    .navbar-brand { font-size: 1rem; }
    .navbar-links a span { display: none; }
}
@media (min-width: 768px) {
    .main-container { max-width: 600px; padding: 40px 24px 48px; }
    .btn-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== Legacy ID-based visibility (preserved for qrJump.js) ===== */
#view-ios, #view-android, #wx-android, #defaultBg { display: none; }
#BtArea { display: none; }
#qrlabel, #qrimage { display: none; }
#top-view-sub { display: none; }
