:root {
    --primary-color: #ff7a18;
    --primary-dark: #e65a00;
    --primary-light: #fff4e8;
    --accent-blue: #2563eb;
    --bg-page: #f5f6fa;
    --text-color: #1a1a2e;
    --muted-color: #8b92a8;
    --tab-h: 62px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    font-size: 16px;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "PingFang SC", "HarmonyOS Sans", "Segoe UI", -apple-system, sans-serif;
    margin: 0;
    padding: 0;
    background: var(--bg-page);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
}

.app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: #fff;
    max-width: 430px;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), 0 24px 64px rgba(15, 15, 15, 0.08);
    position: relative;
}

/* 子页顶栏 */
.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    padding: 14px 18px 10px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.app-header-brand {
    font-size: 17px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-hero {
    padding: 8px 18px 4px;
}

.page-hero-title {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.page-hero-sub {
    margin: 6px 0 0;
    font-size: 13px;
    color: var(--muted-color);
}

.tab-content-list .card-grid,
.tab-content-list .empty-state {
    margin-top: 8px;
}

header {
    padding: 20px 18px 12px;
}


.banner-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 24px;
    margin: 0 16px;
    height: 210px;
    background: linear-gradient(135deg, #ffe0b5, #ffc2b5);
    box-shadow: 0 25px 45px rgba(255, 122, 24, 0.35);
}

.banner-carousel .slides {
    display: flex;
    height: 100%;
    transition: transform 0.6s ease;
    user-select: none;
    touch-action: pan-y;
}

.banner-carousel .slide {
    min-width: 100%;
    height: 100%;
}

.banner-carousel .slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
    border: 4px solid rgba(255, 255, 255, 0.4);
}

.banner-carousel .indicators {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
}

.banner-carousel .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.banner-carousel .dot.active {
    transform: scale(1.3);
    background: #fff;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 18px 8px;
}

.section-title {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title::before {
    content: '';
    width: 6px;
    height: 18px;
    border-radius: 999px;
    background: linear-gradient(180deg, var(--primary-color), var(--primary-dark));
}

.modules-grid,
.card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 0 16px 8px;
}

.module-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    color: #1f1f1f;
}

.module-image {
    width: 76px;
    height: 76px;
    border-radius: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: linear-gradient(140deg, #ffffff, #f1f4ff);
    box-shadow: 0 18px 40px rgba(15, 20, 40, 0.16);
    border: 1px solid rgba(18, 51, 255, 0.08);
    overflow: hidden;
}

.module-image img,
.module-placeholder {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    object-fit: cover;
    background: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    color: #243270;
}

.module-card .module-text {
    font-size: 13px;
    color: #1f1f1f;
    font-weight: 600;
}

.module-card .module-subtext {
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 999px;
    width: fit-content;
    margin: 0 auto;
}

.module-card-0 .module-subtext { background: rgba(255,160,0,0.15); color: #d35400; }
.module-card-1 .module-subtext { background: rgba(18,51,255,0.12); color: #1c2fbf; }
.module-card-2 .module-subtext { background: rgba(46,204,113,0.12); color: #13834c; }
.module-card-3 .module-subtext { background: rgba(255,99,132,0.15); color: #c0392b; }
.module-card-4 .module-subtext { background: rgba(155,89,182,0.15); color: #7d3c98; }
.module-card-5 .module-subtext { background: rgba(0,0,0,0.08); color: #2d3436; }

.module-card .title {
    font-weight: 700;
    font-size: 13px;
    line-height: 1.1;
}

.module-card .desc {
    font-size: 11px;
    opacity: 0.75;
}

.card-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding-bottom: 16px;
}

.feature-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 4px 20px rgba(255, 122, 24, 0.08);
    gap: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.feature-card:active {
    transform: scale(0.99);
}

.feature-card .card-body {
    flex: 1;
    min-width: 0;
}

.feature-card img {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    object-fit: cover;
}

.feature-card .title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 3px;
    line-height: 1.3;
}

.feature-card .desc {
    font-size: 12px;
    color: var(--muted-color);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 操作按钮 */
.feature-card .btn,
.feature-card .btn-action {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 72px;
    padding: 9px 14px;
    border-radius: 999px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 14px rgba(255, 122, 24, 0.35);
    transition: transform 0.15s, box-shadow 0.15s;
}

.feature-card .btn-action:active {
    transform: scale(0.96);
    box-shadow: 0 2px 8px rgba(255, 122, 24, 0.3);
}

.feature-card .btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.feature-card .btn.is-disabled,
.feature-card span.btn.is-disabled {
    background: #eef0f5;
    color: #a0a8b8;
    box-shadow: none;
    min-width: 72px;
    padding: 9px 12px;
    font-weight: 600;
}

.feature-card .btn.is-disabled.btn-developing,
.feature-card span.btn.is-disabled.btn-developing {
    background: #fff4e6;
    color: #c2410c;
}

.module-image-static {
    cursor: default;
}

.empty-state {
    margin: 24px 16px;
    padding: 32px 20px;
    text-align: center;
    border-radius: 16px;
    background: #fff;
    color: var(--muted-color);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.empty-state p {
    margin: 0;
    font-size: 14px;
}

.tab-content {
    flex: 1;
    padding-bottom: calc(var(--tab-h) + var(--safe-bottom) + 16px);
}

/* 底部 Tab 导航 */
.tab-bar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 430px;
    display: flex;
    align-items: stretch;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.06);
    padding-bottom: var(--safe-bottom);
    z-index: 100;
}

.tab-item {
    flex: 1;
    padding: 8px 4px 10px;
    text-align: center;
    color: var(--muted-color);
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.tab-item.active {
    color: var(--primary-color);
    font-weight: 700;
}

.tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 10px;
    transition: background 0.2s, transform 0.2s;
}

.tab-icon svg {
    width: 22px;
    height: 22px;
}

.tab-item.active .tab-icon {
    background: var(--primary-light);
    transform: translateY(-1px);
}

.tab-label {
    line-height: 1.2;
}

.support-card {
    margin: 12px 16px 18px;
    padding: 22px 20px;
    border-radius: 20px;
    background: linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
    box-shadow: 0 8px 32px rgba(15, 20, 40, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.support-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(255, 122, 24, 0.1);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
}

.chip-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
    animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.support-tip {
    color: var(--muted-color);
    margin: 0;
    font-size: 13px;
}

.support-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.support-item {
    border: none;
    width: 100%;
    background: #f8fafc;
    border-radius: 14px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: background 0.15s;
}

.support-item:active {
    background: #f1f5f9;
}

.support-item .label {
    font-size: 12px;
    color: var(--muted-color);
    margin-bottom: 4px;
}

.support-item .value {
    font-size: 15px;
    font-weight: 600;
    color: #1f1f1f;
}

.copy-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.support-qrcode {
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.qr-wrapper {
    display: inline-flex;
    padding: 18px;
    border-radius: 26px;
    background: #fff5e8;
    border: 1px dashed rgba(255,122,24,0.4);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.5), 0 20px 40px rgba(255,180,0,0.15);
    width: 220px;
    height: 220px;
    box-sizing: border-box;
    max-width: 100%;
    margin: 0 auto;
}

.qr-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    display: block;
    max-width: 100%;
    box-sizing: border-box;
}

.qr-caption {
    font-size: 13px;
    color: var(--muted-color);
    margin-top: 10px;
}

@media (max-width: 480px) {
    .modules-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 640px) {
    .support-card {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .support-qrcode {
        justify-self: center;
    }
}

/* 复制 Toast */
.app-toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--tab-h) + var(--safe-bottom) + 20px);
    transform: translateX(-50%) translateY(12px);
    padding: 10px 20px;
    border-radius: 999px;
    background: rgba(26, 26, 46, 0.92);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
    z-index: 200;
    max-width: 90%;
    text-align: center;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

