:root {
    /* Color Palette - Premium Light Theme */
    --bg-light: #F7F8FA;
    --bg-card: #FFFFFF;
    --bg-glass: rgba(255, 255, 255, 0.76);
    --text-primary: #111418;
    --text-secondary: #717680;
    --text-muted: #A0A5B1;

    --accent-purple: #9D4EDD;
    --accent-pink: #FF758F;
    --accent-gradient: linear-gradient(135deg, #E6B9FF, #FFC2D1);
    --btn-gradient: linear-gradient(135deg, #CBA4FF, #FFB3C6);
    --text-gradient: linear-gradient(135deg, #6B21A8, #BE185D);

    /* Effects */
    --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    --glass-shadow: 0 12px 32px rgba(0, 0, 0, 0.06);
    --glass-border: 1px solid rgba(255, 255, 255, 1);
    --glass-blur: blur(24px);

    /* Spacing & Radii */
    --padding-sc: 16px;
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-round: 50%;
}

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

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

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    background-color: var(--bg-light);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.05);
    /* 仅在宽屏两边产生轻微阴影，提升质感 */
}

#router-view {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 75px;
    /* Space for nav */
}

/* --- App Pages --- */
.page {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes floating {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes pulse-purple {
    0% {
        box-shadow: 0 0 0 0 rgba(157, 78, 221, 0.4);
    }

    70% {
        box-shadow: 0 0 0 15px rgba(157, 78, 221, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(157, 78, 221, 0);
    }
}

/* --- Common UI Components --- */
.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 24px var(--padding-sc) 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title .more {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: normal;
}

/* --- Home Page Specifics --- */
.hero-banner {
    margin: 0;
    position: relative;
    height: 350px;
    background-size: cover;
    background-position: center top;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0 var(--padding-sc) 80px;
    color: #fff;
    border-radius: 0 0 32px 32px;
}

/* Gradient overlay to fade smoothly into the light background and darken the top */
.hero-banner::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 25%, transparent 55%, var(--bg-light) 92%, var(--bg-light) 100%);
    border-radius: 0 0 32px 32px;
    z-index: 1;
}

.hero-banner>* {
    position: relative;
    z-index: 2;
}

.hero-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
}

.hero-top-bar .logo-text {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 1px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.hero-top-bar .vip-badge {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.hero-top-bar .vip-badge.is-vip {
    background: rgba(30, 25, 0, 0.5);
    border: 1px solid rgba(251, 191, 36, 0.4);
    color: #FDE68A;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.15);
}


.banner-title {
    margin-bottom: 15px;
}

.banner-title h1 {
    font-size: 3.2rem;
    line-height: 1;
    margin-bottom: 8px;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(135deg, #FF7676, #FFAE64, #FFD27C, #FF7676);
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(255, 118, 118, 0.25));
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    letter-spacing: -1px;
    animation: shimmering 4s linear infinite;
}

@keyframes shimmering {
    0% {
        background-position: 0% center;
    }

    100% {
        background-position: 200% center;
    }
}

.banner-title .subtitle {
    display: block;
    min-height: 3rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #F3E8FF;
    margin-bottom: 10px;
    letter-spacing: 1px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4), 0 0 8px rgba(168, 85, 247, 0.2);
    opacity: 0.95;
    white-space: pre-line;
    position: relative;
    padding-left: 5px;
}

/* Real-time Blinking Cursor */
.banner-title .subtitle::after {
    content: '';
    display: inline-block;
    width: 3px;
    /* Enlarged width */
    height: 1.1em;
    /* Enlarged height */
    background: #FFFFFF;
    margin-left: 6px;
    vertical-align: -2px;
    /* Fine-tuned vertical alignment */
    animation: cursorBlink 0.8s step-end infinite;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.6);
    /* Added subtle glow */
}

@keyframes cursorBlink {

    from,
    to {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.banner-title .btn-small {
    background: rgba(255, 255, 255, 0.95);
    color: var(--accent-purple);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    /* Removed the underline */
}

/* Main CTA Button */
.main-cta-wrapper {
    margin: -75px var(--padding-sc) 24px;
    position: relative;
    z-index: 10;
}

.main-cta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    background: linear-gradient(to right, #EBE1FF 0%, #F5F0FF 50%, #FFFFFF 100%);
    color: var(--text-primary);
    padding: 16px 20px;
    border-radius: 20px;
    font-size: 1.15rem;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(157, 78, 221, 0.15), inset 0 2px 4px rgba(255, 255, 255, 1);
    border: 3px solid #fff;
    transition: transform 0.2s;
    text-decoration: none;
}

.main-cta:active {
    transform: scale(0.96);
}

.main-cta svg {
    color: var(--text-primary);
    stroke-width: 2.5;
}

/* Core Features Grid - Redesigned to 2x2 Rectangular with Upward Protrusion */
.core-features {
    padding: 0 var(--padding-sc);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-gap: 32px 20px;
    /* Vertical gap increased for protrusion */
    margin-top: 40px;
}

.feature-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    height: 70px;
    /* Fine-tuned to 70px */
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding-left: 80px;
    padding-right: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.04);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: visible;
}

.feature-item:active {
    transform: translateY(2px);
}

.feature-icon-wrapper {
    position: absolute;
    bottom: 0;
    left: 12px;
    width: 66px;
    /* Previously 54px */
    height: 88px;
    /* Previously 72px (maintained 3:4 ratio) */
    display: flex;
    align-items: flex-end;
    justify-content: center;
    overflow: visible;
    z-index: 10;
}

.feature-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.15));
    /* Add shadow to image instead of container */
}

/* Old icon style for fallback or other items */
.feature-icon {
    position: absolute;
    left: 12px;
    bottom: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #F0F2F5;
    color: var(--text-primary);
    z-index: 5;
}

.feature-item:hover .feature-icon {
    transform: translateY(-4px) scale(1.05);
}

.feature-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 4px;
}

.feature-content .title {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 800;
    white-space: nowrap;
}

.feature-content .desc {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Secondary Features - Hidden */
.secondary-features {
    display: none;
}

.secondary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.secondary-item .icon {
    font-size: 1.5rem;
    color: var(--text-secondary);
}

.secondary-item span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* Waterfall Layout - Xiaohongshu Style */
.waterfall-container {
    column-count: 2;
    column-gap: 8px;
    padding: 0 var(--padding-sc) 20px;
}

.wf-card {
    break-inside: avoid;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.wf-card:active {
    transform: scale(0.97);
}

.wf-card-cover {
    position: relative;
    width: 100%;
    min-height: 120px;
    overflow: hidden;
    background: #f0f2f5;
}

.wf-card-cover img,
.wf-card-cover video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

/* Force hide all webkit Shadow DOM video controls */
.wf-card-cover video::-webkit-media-controls,
.wf-card-cover video::-webkit-media-controls-start-playback-button,
.wf-card-cover video::-webkit-media-controls-enclosure,
.wf-card-cover video::-webkit-media-controls-panel,
.wf-card-cover video::-webkit-media-controls-play-button,
.xhs-slide video::-webkit-media-controls,
.xhs-slide video::-webkit-media-controls-start-playback-button,
.xhs-slide video::-webkit-media-controls-enclosure,
.xhs-slide video::-webkit-media-controls-panel,
.xhs-slide video::-webkit-media-controls-play-button {
    display: none !important;
    -webkit-appearance: none;
}

.wf-video-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 28px;
    height: 28px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.7rem;
    backdrop-filter: blur(4px);
}

.wf-multi-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    padding: 3px 6px;
    display: flex;
    align-items: center;
    backdrop-filter: blur(4px);
}

.wf-card-body {
    padding: 8px 10px 10px;
}

.wf-card-title {
    font-size: 0.82rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 8px;
}

.wf-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wf-card-author {
    display: flex;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

.wf-avatar {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.wf-author-name {
    font-size: 0.7rem;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wf-card-type {
    flex-shrink: 0;
    font-size: 0.65rem;
    color: #7c3aed;
    background: #f3e8ff;
    padding: 2px 8px;
    border-radius: 8px;
    font-weight: 600;
    white-space: nowrap;
}

.wf-type-handsome_gen {
    color: #059669;
    background: #d1fae5;
}

.wf-type-lady_gen {
    color: #7c3aed;
    background: #f3e8ff;
}

.wf-type-action_clone {
    color: #1f2937;
    background: #e5e7eb;
}

.wf-type-ai_redraw {
    color: #b45309;
    background: #fef3c7;
}

/* Legacy waterfall-item compat */
.waterfall-item {
    break-inside: avoid;
    margin-bottom: 12px;
    border-radius: var(--radius-md);
    overflow: hidden;
    position: relative;
    background: var(--bg-card);
    box-shadow: var(--card-shadow);
}

.waterfall-item img {
    width: 100%;
    display: block;
    object-fit: cover;
}

.waterfall-item .info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
}

.waterfall-item .tag {
    font-size: 0.65rem;
    font-weight: 500;
}

/* --- Mine Page Specifics --- */
.mine-header {
    padding: 60px var(--padding-sc) 30px;
    background: #fff;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
    margin-bottom: 24px;
}

.avatar-wrapper {
    position: relative;
}

.avatar {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-round);
    object-fit: cover;
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    background: #111;
    color: #fff;
    width: 24px;
    height: 24px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.user-info h2 {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.user-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.vip-banner {
    margin: 0 var(--padding-sc) 24px;
    background: #1A1A1A;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.vip-banner::before {
    content: 'V';
    position: absolute;
    right: -10px;
    top: -30px;
    font-size: 120px;
    font-weight: 900;
    font-style: italic;
    color: rgba(255, 255, 255, 0.05);
}

.vip-banner .text-content {
    flex: 1;
    margin-right: 12px;
}

.vip-banner .vip-title {
    color: #FFEBB8;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.vip-banner .vip-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 235, 184, 0.7);
}

.vip-banner .btn-subscribe {
    flex-shrink: 0;
    background: linear-gradient(to right, #FFEBB8, #F3C65D);
    color: #4A3300;
    border: none;
    padding: 10px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(243, 198, 93, 0.2);
}

.mine-account-card {
    margin: 0 var(--padding-sc) 24px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--card-shadow);
}

.mine-account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.mine-account-row.secondary {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.mine-account-label {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.mine-account-value {
    font-size: 1.5rem;
    color: var(--text-primary);
}

.mine-text-btn {
    border: none;
    background: transparent;
    color: var(--accent-purple);
    font-weight: 700;
    font-size: 0.85rem;
}

.mine-text-btn.danger {
    color: #ef4444;
}

.btn-outline.small {
    width: auto;
    padding: 10px 16px;
    border-radius: 12px;
}

/* Agent Card inside Mine */
.agent-card {
    margin: 0 var(--padding-sc) 24px;
    background: #fff;
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--card-shadow);
}

.agent-card .header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.agent-card h3 {
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.agent-stats {
    display: flex;
    gap: 40px;
    margin-bottom: 20px;
}

.stat-item h4 {
    font-size: 1.4rem;
    color: var(--text-primary);
}

.stat-item p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.btn-outline {
    width: 100%;
    padding: 12px;
    background: #F7F8FA;
    border: none;
    color: var(--text-primary);
    border-radius: 12px;
    font-weight: 500;
    font-size: 0.9rem;
}

/* --- Liquid Glass Bottom Nav (Light Mode) --- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-top: var(--glass-border);
    box-shadow: var(--glass-shadow);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    width: 60px;
    cursor: pointer;
    transition: color 0.3s;
}

.nav-item.active {
    color: var(--text-primary);
}

/* 当手机键盘弹出导致屏幕高度变小时，或者通过全局 JS 检测到输入框聚焦时，隐藏底部导航栏，防止被顶起影响界面 */
@media screen and (max-height: 550px) {
    .bottom-nav {
        display: none !important;
    }
}
body.keyboard-open .bottom-nav {
    display: none !important;
}

.nav-item.active .icon {
    color: var(--text-primary);
}

.nav-item .icon {
    width: 24px;
    height: 24px;
    transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
}

.nav-item.active .icon {
    transform: translateY(-2px);
}

.nav-item span {
    font-size: 0.65rem;
    font-weight: 600;
}

/* --- Empty Works Animation V2 --- */
.empty-works-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px 80px;
}

.empty-animation-v2 {
    position: relative;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
}

.polaroid-wrapper {
    position: relative;
    width: 72px;
    height: 86px;
    animation: floatPolaroid 3.5s ease-in-out infinite;
    z-index: 2;
}

.polaroid {
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 4px;
    padding: 6px 6px 20px 6px;
    box-shadow: 0 10px 24px rgba(203, 164, 255, 0.4), 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: rotate(-8deg);
    position: relative;
    z-index: 2;
    display: flex;
}

.polaroid-bg {
    position: absolute;
    width: 100%;
    height: 100%;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    top: 6px;
    left: 12px;
    transform: rotate(12deg);
    z-index: 1;
}

.photo-area {
    width: 100%;
    background: linear-gradient(135deg, #f0f2f5, #e2e8f0);
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

.photo-area svg {
    width: 32px;
    height: 32px;
    stroke-width: 1.5;
}

.sparkle {
    position: absolute;
    font-size: 1.5rem;
    z-index: 3;
    animation: twinkle 2.5s ease-in-out infinite alternate;
}

.s1 {
    top: 15px;
    left: 10px;
    animation-delay: 0s;
    font-size: 1.2rem;
}

.s2 {
    bottom: 15px;
    right: 15px;
    animation-delay: 1.2s;
    font-size: 1.6rem;
    transform: scale(1.2);
}

@keyframes floatPolaroid {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-12px);
    }

    100% {
        transform: translateY(0);
    }
}

@keyframes twinkle {
    0% {
        transform: scale(0.6) rotate(0deg);
        opacity: 0.3;
    }

    50% {
        transform: scale(1.2) rotate(15deg);
        opacity: 1;
    }

    100% {
        transform: scale(0.6) rotate(0deg);
        opacity: 0.3;
    }
}

.empty-works-container p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.empty-works-container .btn-primary {
    background: var(--btn-gradient);
    color: #fff;
    border: none;
    padding: 12px 36px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 8px 20px rgba(203, 164, 255, 0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 8px;
}

.empty-works-container .btn-primary:active {
    transform: scale(0.95);
    box-shadow: 0 4px 10px rgba(203, 164, 255, 0.3);
}

/* --- Refined Generative Layout --- */
.rg-page {
    background: var(--bg-light);
    min-height: 100vh;
    padding-bottom: 0;
    display: flex;
    flex-direction: column;
}

.rg-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px var(--padding-sc);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 2000;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.rg-close {
    padding: 8px;
    margin-left: -8px;
    cursor: pointer;
    color: var(--text-secondary);
}

.rg-title-wrapper {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.rg-title {
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 10px;
    transition: background 0.2s;
    user-select: none;
}

.rg-title:active {
    background: #f0f2f5;
}

.rg-title-arrow {
    transition: transform 0.3s ease;
}

.rg-title-arrow.open {
    transform: rotate(180deg);
}

.rg-version {
    font-size: 0.8rem;
    background: #fff;
    border: 1px solid #ebedf0;
    padding: 4px 10px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Function Dropdown */
.rg-func-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) scale(0.95);
    min-width: 180px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
}

.rg-func-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) scale(1);
}

.func-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.func-item:hover {
    background: #f7f8fa;
}

.func-item.active {
    background: #f3e8ff;
    color: var(--accent-purple);
}

.func-item.active svg {
    stroke: var(--accent-purple);
}

.rg-dropdown-overlay {
    position: fixed;
    inset: 0;
    z-index: 49;
    display: none;
}

.rg-dropdown-overlay.open {
    display: block;
}

.rg-tabs {
    display: flex;
    background: #fff;
    border-radius: 12px;
    margin: 10px var(--padding-sc) 20px;
    padding: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.rg-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.rg-tab.active {
    background: #f0f2f5;
    color: var(--text-primary);
}

.rg-prompt-container {
    margin: 0 var(--padding-sc) 20px;
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    position: relative;
    border: 1px solid #ebedf0;
}

.rg-textarea {
    width: 100%;
    height: 140px;
    border: none;
    outline: none;
    resize: none;
    font-size: 0.95rem;
    color: var(--text-primary);
    line-height: 1.5;
    font-family: inherit;
    background: transparent;
}

.rg-textarea::placeholder {
    color: #afb8c1;
}

.rg-tools {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    gap: 12px;
}

.r-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.r-icon.magic {
    background: var(--btn-gradient);
    color: #fff;
    box-shadow: 0 4px 10px rgba(203, 164, 255, 0.4);
}

/* Face Reference Upload Zone */
.rg-upload-zone {
    margin: 0 var(--padding-sc) 20px;
}

.upload-box {
    background: #fff;
    border: 2px dashed #d4d8e0;
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.upload-box:hover {
    border-color: var(--accent-purple);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.upload-placeholder:hover {
    background: #faf8ff;
}

.upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f3e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.upload-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.upload-preview {
    position: relative;
    width: 100%;
}

.upload-preview img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    border-radius: 14px;
}

.preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background 0.2s;
}

.preview-remove:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Preset Image Cards */
.rg-presets-section {
    margin: 0 var(--padding-sc) 20px;
}

.rg-presets-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.rg-presets-header .label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.r-refresh {
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    padding: 4px;
}

.preset-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.preset-card {
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.25s;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.preset-card.active {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 16px rgba(157, 78, 221, 0.2);
}

.preset-img {
    width: 100%;
    aspect-ratio: 3 / 4;
    background-size: cover;
    background-position: center;
}

.preset-label {
    text-align: center;
    padding: 8px 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.rg-warning {
    margin: 0 var(--padding-sc);
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    margin-bottom: 120px;
}

/* --- Lady Gen Character Configuration Area --- */
.rg-config-section {
    margin: 0 var(--padding-sc) 20px;
    background: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
}

.config-group {
    margin-bottom: 20px;
}

.config-group:last-child {
    margin-bottom: 0;
}

.config-label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: block;
}

.config-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.config-chip {
    padding: 10px 18px;
    background: #f8fafc;
    border: 1.5px solid #f1f5f9;
    border-radius: 12px;
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.config-chip.active {
    background: #f5f3ff;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.config-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.config-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.config-input {
    width: 100%;
    height: 48px;
    background: #f8fafc;
    border: 1.5px solid #f1f5f9;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 0.85rem;
    color: var(--text-primary);
    font-weight: 600;
    transition: all 0.2s;
}

.config-input:focus {
    background: #fff;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    outline: none;
}

select.config-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.config-input::placeholder {
    color: #94a3b8;
    font-weight: 400;
}

/* Bottom Island controls */
.rg-bottom-island {
    position: fixed;
    /* 防止被移动端键盘顶起，使用固定的初始高度变量 */
    top: calc(var(--vh-initial, 100vh) - 76px);
    top: calc(var(--vh-initial, 100dvh) - 76px);
    left: var(--padding-sc);
    right: var(--padding-sc);
    display: flex;
    gap: 12px;
    z-index: 100;
}

.rg-combo-btn {
    background: #1a1a1a;
    color: #fff;
    padding: 0 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.rg-combo-btn span {
    padding: 0 6px;
}

.rg-combo-btn .divider {
    width: 1px;
    height: 12px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 2px;
    padding: 0;
}

.rg-combo-btn .chevron {
    color: rgba(255, 255, 255, 0.6);
    padding-right: 0;
}

.rg-generate-btn {
    flex: 1;
    background: var(--btn-gradient);
    border: none;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(203, 164, 255, 0.4);
}

.rg-generate-btn span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.rg-generate-btn:active {
    transform: scale(0.98);
}

/* Settings Sheet */
.rg-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 101;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.rg-overlay.open {
    opacity: 1;
    visibility: visible;
}

.rg-settings-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 24px 24px 0 0;
    padding: 24px var(--padding-sc) 40px;
    z-index: 102;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rg-settings-panel.open {
    transform: translateY(0);
}

.close-panel {
    padding: 4px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f2f5;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.close-panel:active {
    background: #e2e8f0;
}

/* Increased Height for Bottom Island Buttons */
.rg-bottom-island {
    bottom: 24px;
}

.rg-combo-btn {
    height: 56px;
    padding: 0 20px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.rg-generate-btn {
    height: 56px;
    border-radius: 20px;
}

/* --- Settings Sheet Param Controls --- */
.sp-header {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sp-group {
    margin-bottom: 24px;
}

.sp-label {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.sp-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sp-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.sp-item {
    background: #f7f8fa;
    border: 1.5px solid transparent;
    border-radius: 12px;
    padding: 14px 0;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sp-item.active {
    background: #f3e8ff;
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.sp-slider-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.sp-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #ebedf0;
    outline: none;
}

.sp-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(157, 78, 221, 0.4);
    transition: transform 0.2s;
}

.sp-slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

/* Ratio Boxes */
.rb {
    border: 1.5px solid currentColor;
    border-radius: 2px;
}

.r11 {
    width: 14px;
    height: 14px;
}

.r916 {
    width: 10px;
    height: 16px;
}

.r169 {
    width: 16px;
    height: 10px;
}

.r43 {
    width: 16px;
    height: 12px;
}

.r34 {
    width: 12px;
    height: 16px;
}

.r32 {
    width: 15px;
    height: 10px;
}

.r23 {
    width: 10px;
    height: 15px;
}

.r219 {
    width: 18px;
    height: 8px;
}

.sp-generate-btn {
    width: 100%;
    margin-top: 16px;
    background: var(--btn-gradient);
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(203, 164, 255, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-generate-btn:active {
    transform: scale(0.98);
}

/* ===== Action Clone Page ===== */
.ac-section {
    margin: 0 var(--padding-sc) 24px;
}

.ac-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.ac-section-header span {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ac-hint {
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    margin-left: auto;
}

.ac-step-badge {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Upload Areas */
.ac-upload-area {
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
    border: 2px dashed #d4d8e0;
    transition: border-color 0.2s;
}

.ac-upload-area:hover {
    border-color: var(--accent-purple);
}

.ac-upload-placeholder,
.ac-char-upload {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 36px 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.ac-char-upload {
    background: #fff;
    border: 2px dashed #d4d8e0;
    border-radius: 16px;
    transition: border-color 0.2s, background 0.2s;
}

.ac-char-upload:hover {
    border-color: var(--accent-purple);
    background: #faf8ff;
}

.ac-upload-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #f3e8ff;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-purple);
    margin-bottom: 12px;
}

.ac-upload-icon.video {
    background: #EDE7F6;
}

.ac-upload-icon.video svg {
    margin-left: 3px;
    /* Optically center the play triangle */
}

.ac-upload-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ac-upload-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Video Preview */
.ac-video-preview {
    position: relative;
}

.ac-video-preview video {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 14px;
    background: #000;
}

/* Character Preview */
.ac-char-preview {
    position: relative;
}

.ac-char-preview img {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    display: block;
    border-radius: 14px;
}

/* Source Tabs */
.ac-tabs {
    display: flex;
    background: #fff;
    border-radius: 12px;
    padding: 4px;
    margin-bottom: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ac-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.ac-tab.active {
    background: #f0f2f5;
    color: var(--text-primary);
}

/* Works Grid (Horizontal Scroll) */
.ac-works-grid {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.ac-works-grid::-webkit-scrollbar {
    display: none;
}

.ac-work-item {
    flex-shrink: 0;
    width: calc(33.333% - 7px);
    /* 3 items visible */
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    background: #f7f8fa;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.ac-work-item.empty-work {
    border: 2px dashed #d4d8e0;
}

.ac-work-item.empty-work:hover {
    border-color: var(--accent-purple);
    background: #faf8ff;
}

.ac-work-item.selected {
    border-color: var(--accent-purple);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.2);
}

@keyframes acShimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.ac-work-item.img-work {
    background: linear-gradient(90deg, #f0f2f5 25%, #e6e8eb 50%, #f0f2f5 75%);
    background-size: 200% 100%;
    animation: acShimmer 1.5s infinite linear;
}

.ac-work-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ac-empty-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

/* Duration Selector */
.ac-duration-group {
    display: flex;
    gap: 12px;
}

.ac-duration-item {
    flex: 1;
    background: #fff;
    border: 2px solid transparent;
    border-radius: 16px;
    padding: 20px 16px;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.ac-duration-item .dur-num {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.ac-duration-item .dur-unit {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.ac-duration-item.active {
    border-color: var(--accent-purple);
    background: #f3e8ff;
}

.ac-duration-item.active .dur-num {
    color: var(--accent-purple);
}

.ac-duration-item.active .dur-unit {
    color: var(--accent-purple);
}

/* Bottom Generate Bar */
.ac-bottom-bar {
    position: fixed;
    /* 防止被移动端键盘顶起 */
    top: calc(var(--vh-initial, 100vh) - 80px);
    top: calc(var(--vh-initial, 100dvh) - 80px);
    left: var(--padding-sc);
    right: var(--padding-sc);
    z-index: 100;
}

.ac-generate-btn {
    width: 100%;
    height: 56px;
    background: var(--btn-gradient);
    border: none;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(203, 164, 255, 0.4);
}

.ac-generate-btn span {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.ac-generate-btn:active {
    transform: scale(0.98);
}

/* ===== Import Photo Page ===== */
.ip-preview-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 var(--padding-sc) 24px;
}

.ip-image-wrapper {
    width: 100%;
    max-width: 320px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
}

.ip-image-wrapper img {
    width: 100%;
    max-height: 360px;
    object-fit: cover;
    display: block;
}

.ip-hint {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

.ip-functions {
    padding: 0 var(--padding-sc);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ip-func-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #fff;
    border-radius: 16px;
    padding: 18px 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
}

.ip-func-card:active {
    transform: scale(0.98);
    border-color: var(--accent-purple);
    background: #faf8ff;
}

.ip-func-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ip-func-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ip-func-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ip-func-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.ip-func-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
}

/* ===== VIP Subscribe Page ===== */
.vip-page {
    background: var(--bg-light);
    padding-bottom: 100px;
}

.vip-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d1b4e 40%, #4a1942 100%);
    padding: 0 var(--padding-sc) 32px;
    border-radius: 0 0 32px 32px;
    position: relative;
    overflow: hidden;
}

.vip-hero::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -40px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.vip-hero::after {
    content: '';
    position: absolute;
    bottom: -30px;
    left: -20px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.2) 0%, transparent 70%);
    border-radius: 50%;
}

.vip-hero-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    margin-bottom: 24px;
    position: relative;
    z-index: 2;
}

.vip-hero-title {
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.vip-hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.vip-live-tip {
    margin-top: 14px;
    font-size: 0.76rem;
    color: rgba(255, 255, 255, 0.72);
    text-align: center;
}

.vip-crown {
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.4));
}

.vip-hero-name {
    color: #fff;
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 6px;
    background: linear-gradient(to right, #FFD700, #FFA500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.vip-hero-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.vip-credits-info {
    display: flex;
    align-items: center;
    gap: 28px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 32px;
}

.vip-credits-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.vip-credits-num {
    color: #FFD700;
    font-size: 1.2rem;
    font-weight: 800;
}

.vip-credits-label {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
}

.vip-credits-divider {
    width: 1px;
    height: 32px;
    background: rgba(255, 255, 255, 0.15);
}

/* Redeem Section */
.vip-plans-section {
    padding: 24px var(--padding-sc) 0;
}

.vip-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.vip-redeem-box {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.vip-redeem-input-wrapper {
    display: flex;
    align-items: center;
    background: #f7f8fa;
    border-radius: 12px;
    padding: 0 16px;
    height: 52px;
    margin-bottom: 16px;
    border: 1.5px solid transparent;
    transition: all 0.2s;
}

.vip-redeem-input-wrapper:focus-within {
    border-color: var(--accent-purple);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.1);
}

.vip-redeem-icon {
    color: var(--text-muted);
    margin-right: 12px;
    flex-shrink: 0;
}

.vip-redeem-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
    width: 100%;
}

.vip-redeem-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.vip-redeem-clear {
    color: #bfc4cc;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    transition: color 0.15s;
}

.vip-redeem-clear:hover,
.vip-redeem-clear:active {
    color: var(--text-secondary);
}

.vip-redeem-btn {
    width: 100%;
    height: 52px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #1d1e22 0%, #3a3f47 100%);
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.vip-redeem-btn:disabled {
    opacity: 0.72;
    cursor: not-allowed;
}

.vip-redeem-btn:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.vip-redeem-hint {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.vip-redeem-result {
    margin-top: 10px;
    font-size: 0.8rem;
    text-align: center;
    min-height: 20px;
}

/* Benefits */
.vip-benefits-section {
    padding: 28px var(--padding-sc) 0;
}

.vip-benefits-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.vip-benefit-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 8px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.vip-benefit-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vip-benefit-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.vip-benefit-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
}

/* Compare Table */
.vip-compare-section {
    padding: 28px var(--padding-sc) 0;
}

.vip-compare-table {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.vip-compare-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px;
    padding: 14px 20px;
    border-bottom: 1px solid #f0f2f5;
    align-items: center;
}

.vip-compare-row:last-child {
    border-bottom: none;
}

.vip-compare-row.header {
    background: #f7f8fa;
}

.vip-compare-feature {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.vip-compare-row.header .vip-compare-feature {
    color: var(--text-muted);
    font-weight: 500;
}

.vip-compare-free {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.vip-compare-vip {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.vip-compare-vip.highlight {
    color: var(--accent-purple);
    font-weight: 700;
}

/* Guarantee */
.vip-guarantee {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px var(--padding-sc);
    color: var(--text-muted);
    font-size: 0.75rem;
}

/* ===== Agent Apply Page ===== */
.agent-page {
    background: #f7f8fa;
    padding-bottom: 75px;
}

.ag-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    position: relative;
    z-index: 10;
}

.ag-header-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
}

.ag-banner {
    background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    padding: 16px var(--padding-sc) 40px;
    position: relative;
    overflow: hidden;
    color: #fff;
    border-radius: 0 0 24px 24px;
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.2);
}

.ag-banner::before {
    content: '';
    position: absolute;
    right: -20px;
    bottom: -20px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 60%);
    border-radius: 50%;
}

.ag-banner-content {
    position: relative;
    z-index: 2;
}

.ag-banner-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ag-banner-desc {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 16px;
}

.ag-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ag-tag {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.ag-privileges {
    padding: 24px var(--padding-sc) 0;
    margin-top: -20px;
    position: relative;
    z-index: 5;
}

.ag-section-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.ag-privilege-list {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.ag-privilege-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ag-icon-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ag-privilege-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.ag-privilege-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.ag-form-section {
    padding: 24px var(--padding-sc);
}

.ag-form {
    background: #fff;
    border-radius: 16px;
    padding: 20px 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ag-form-group {
    margin-bottom: 16px;
}

.ag-form-group:last-child {
    margin-bottom: 0;
}

.ag-form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ag-form-label .required {
    color: #FF6B6B;
    margin-left: 4px;
}

.ag-input,
.ag-textarea {
    width: 100%;
    background: #f7f8fa;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 12px 14px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
    font-family: inherit;
}

.ag-input:focus,
.ag-textarea:focus {
    background: #fff;
    border-color: var(--accent-purple);
    outline: none;
    box-shadow: 0 0 0 3px rgba(157, 78, 221, 0.1);
}

.ag-input::placeholder,
.ag-textarea::placeholder {
    color: #afb8c1;
}

.ag-textarea {
    resize: none;
    line-height: 1.5;
}

.ag-bottom-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 14px var(--padding-sc) 28px;
    background: #fff;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.04);
    z-index: 100;
}

.ag-submit-btn {
    width: 100%;
    height: 48px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(255, 117, 143, 0.3);
    transition: all 0.2s;
}

.ag-submit-btn:active {
    transform: scale(0.98);
}

/* ===== Auth Page ===== */
.auth-page {
    background: var(--bg-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Let the header inherit natural text colors in light mode */
.auth-page .rg-header,
.auth-page .rg-close,
.auth-page .rg-title {
    color: var(--text-primary);
}

.auth-visual {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 290px;
    background: linear-gradient(135deg, #F5EEFF 0%, #FFF0F3 50%, #FFFBEB 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-top: 0;
    border-radius: 0 0 40px 40px;
    box-shadow: 0 10px 40px rgba(157, 78, 221, 0.08);
    /* Soft colored shadow */
    z-index: 0;
}

.auth-orb {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(157, 78, 221, 0.18) 0%, transparent 65%);
    border-radius: 50%;
    top: -40px;
    right: -60px;
    filter: blur(20px);
    animation: float 6s ease-in-out infinite;
}

.auth-orb.secondary {
    background: radial-gradient(circle, rgba(255, 117, 143, 0.18) 0%, transparent 65%);
    bottom: -60px;
    left: -40px;
    width: 220px;
    height: 220px;
    top: auto;
    right: auto;
    animation-delay: -3s;
}

.auth-brand {
    text-align: center;
    z-index: 2;
    margin-top: 10px;
    /* Push down below the header */
}

/* Make logo ring match light theme */
.auth-logo-ring {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    border: 1px solid rgba(255, 255, 255, 1);
    box-shadow: 0 8px 32px rgba(157, 78, 221, 0.15);
}

.auth-logo-svg {
    color: var(--accent-purple);
}

.auth-brand-title {
    font-size: 1.7rem;
    font-weight: 900;
    margin-bottom: 4px;
    letter-spacing: 3px;
    color: var(--text-primary) !important;
    text-shadow: none;
}

.auth-brand-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary) !important;
    letter-spacing: 1.5px;
}

.auth-card {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 30px 24px;
    margin: 220px var(--padding-sc) 20px;
    /* Push card down below absolute visual */
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
    position: relative;
    z-index: 10;
}

/* Auth Tabs */
.auth-tabs {
    display: flex;
    background: #f0f2f5;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 28px;
}

.auth-tab {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-tab.active {
    background: #fff;
    color: var(--text-primary);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Auth Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.auth-field {
    display: flex;
    flex-direction: column;
}

.auth-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    transition: color 0.3s;
    z-index: 2;
}

.auth-input-wrapper input {
    width: 100%;
    height: 54px;
    background: #f7f8fa;
    border: 1.5px solid transparent;
    border-radius: 16px;
    padding: 0 16px 0 46px;
    font-size: 0.95rem;
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
    box-sizing: border-box;
}

.auth-input-wrapper input:focus {
    background: #fff;
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 4px rgba(157, 78, 221, 0.1);
    outline: none;
}

.auth-input-wrapper input:focus~.auth-input-icon,
.auth-input-wrapper input:not(:placeholder-shown)~.auth-input-icon {
    color: var(--accent-purple);
}

.auth-input-wrapper input::placeholder {
    color: #c4c9d2;
}

.auth-error {
    font-size: 0.85rem;
    color: #e11d48;
    min-height: 20px;
    text-align: center;
    font-weight: 500;
    margin-top: -8px;
}

.auth-submit-btn {
    width: 100%;
    height: 54px;
    background: var(--accent-gradient);
    border: none;
    border-radius: 16px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 8px 24px rgba(157, 78, 221, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 4px;
}

.auth-submit-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 12px rgba(157, 78, 221, 0.2);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.auth-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}

.auth-footer {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: auto;
    padding-bottom: 24px;
}

.auth-footer a {
    color: var(--accent-purple);
    text-decoration: none;
}

/* ===== Credit Logs Page ===== */
.credit-logs-page {
    background: #f8f9fb;
    min-height: 100vh;
}

.credit-logs-container {
    padding: 16px var(--padding-sc);
}

.credit-log-item {
    background: #fff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.log-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.log-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.log-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.log-amount {
    font-size: 1.1rem;
    font-weight: 800;
}

.log-amount.plus {
    color: #10b981;
}

.log-amount.minus {
    color: #ef4444;
}

.empty-logs,
.loading-placeholder,
.error-msg {
    text-align: center;
    padding: 60px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== Reward Modal ===== */
.ag-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.ag-modal-overlay.active {
    visibility: visible;
    opacity: 1;
}

.reward-modal {
    width: 80%;
    max-width: 320px;
    background: #fff;
    border-radius: 32px;
    padding: 32px 24px;
    text-align: center;
    position: relative;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.ag-modal-overlay.active .reward-modal {
    transform: scale(1);
}

.reward-icon {
    width: 80px;
    height: 80px;
    background: var(--accent-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 10px 20px rgba(157, 78, 221, 0.3);
    color: #fff;
}

.reward-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.reward-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 24px;
}

.reward-btn {
    width: 100%;
    height: 50px;
    background: var(--text-primary);
    color: #fff;
    border: none;
    border-radius: 25px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.reward-btn:active {
    transform: scale(0.96);
}



@keyframes float {

    0%,
    100% {
        transform: translate(0, 0);
    }

    50% {
        transform: translate(-10px, 15px);
    }
}

/* ===== Settings Page ===== */
.settings-group {
    background: #fff;
    border-radius: 16px;
    margin: 16px var(--padding-sc);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 16px;
    background: #fff;
    cursor: pointer;
    border-bottom: 1px solid #f0f2f5;
}

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

.settings-item:active {
    background: #f9fafb;
}

.settings-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.settings-label svg {
    color: var(--text-secondary);
}

.settings-value {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.settings-logout-btn {
    width: 100%;
    padding: 16px;
    background: transparent;
    border: none;
    color: #e11d48;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.settings-logout-btn:active {
    background: #fef1f2;
}


/* ===== Profile Edit Modal ===== */
.profile-modal-content {
    background: #fff;
    width: 85%;
    max-width: 340px;
    border-radius: 24px;
    padding: 24px;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ag-modal-overlay.active .profile-modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header h4 {
    margin: 0;
    font-size: 1.15rem;
}

.modal-header svg {
    color: var(--text-muted);
    cursor: pointer;
}

.profile-avatar-edit {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 24px;
    position: relative;
    cursor: pointer;
    border: 2px solid #f0f2f5;
}

.profile-avatar-edit .avatar-preview {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-avatar-edit .edit-badge {
    position: absolute;
    bottom: 0;
    right: -4px;
    background: var(--text-primary);
    color: white;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    border: 2px solid #fff;
}

.input-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--accent-purple);
}

.modal-footer {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.btn-cancel,
.btn-save {
    flex: 1;
    padding: 12px;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
}

.btn-cancel {
    background: #f3f4f6;
    color: var(--text-secondary);
}

.btn-save {
    background: var(--text-primary);
    color: #fff;
}

/* ===== Action Clone Progress & Result Modals ===== */
.ac-progress-card {
    background: #fff;
    width: 80%;
    max-width: 300px;
    border-radius: 24px;
    padding: 36px 24px;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ag-modal-overlay.active .ac-progress-card {
    transform: scale(1);
}

.ac-progress-spinner {
    width: 52px;
    height: 52px;
    border: 4px solid #f0f2f5;
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.ac-progress-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.ac-progress-hint {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.ac-cancel-btn {
    border: none;
    background: #f3f4f6;
    color: var(--text-secondary);
    padding: 10px 28px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.ac-result-card {
    background: #fff;
    width: 90%;
    max-width: 400px;
    border-radius: 24px;
    overflow: hidden;
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ag-modal-overlay.active .ac-result-card {
    transform: scale(1);
}

.ac-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 1.05rem;
    border-bottom: 1px solid #f0f2f5;
}

.ac-result-header svg {
    cursor: pointer;
    color: var(--text-muted);
}

#acResultContent {
    padding: 16px;
    max-height: 60vh;
    overflow-y: auto;
}

.ac-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 16px 16px;
    padding: 14px;
    background: var(--text-primary);
    color: #fff;
    border-radius: 16px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.95rem;
}

.ac-prompt-textarea {
    width: calc(100% - 32px);
    margin: 0 16px 12px;
    /* Added 12px bottom margin */
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: border-color 0.2s;
    color: var(--text-primary);
    background: #fff;
    min-height: 100px;
    /* Enlarge the box */
}

.ac-prompt-textarea:focus {
    border-color: var(--accent-purple);
}

/* ===== 我的作品网格 ===== */
.works-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0 4px;
    margin-top: 16px;
}

.work-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.work-card.pending {
    background: #f1f5f9;
}

.work-card img,
.work-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.work-card-info {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.work-card-shimmer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmerLoading 1.5s infinite;
}

.shimmer-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(124, 58, 237, 0.2);
    border-top-color: var(--accent-purple);
    border-radius: 50%;
    animation: spinner 1s linear infinite;
}

@keyframes shimmerLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ===== Document Pages (Agreement & Policy) ===== */
.doc-page {
    background: #fff;
    min-height: 100vh;
    padding-bottom: 40px;
}

.doc-content {
    padding: 24px var(--padding-sc);
    color: var(--text-primary);
    line-height: 1.7;
}

.doc-main-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-align: center;
    color: var(--text-primary);
}

.doc-update-time {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
}

.doc-section {
    margin-bottom: 28px;
}

.doc-section h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    position: relative;
    padding-left: 12px;
}

.doc-section h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 4px;
    background: var(--accent-purple);
    border-radius: 2px;
}

.doc-section p {
    font-size: 0.95rem;
    margin-bottom: 12px;
    text-align: justify;
}

.doc-section strong {
    color: var(--text-primary);
    font-weight: 700;
}

.doc-section ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.doc-section li {
    font-size: 0.95rem;
    margin-bottom: 8px;
    list-style: disc;
}

/* ==============================================================
   APP 下载引导相关样式
   ============================================================== */

.app-dl-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    animation: pulseBadge 2s infinite ease-in-out;
}

@keyframes pulseBadge {
    0% { transform: scale(1); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
    50% { transform: scale(1.05); box-shadow: 0 4px 15px rgba(16, 185, 129, 0.5); }
    100% { transform: scale(1); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
}

.app-dl-prompt-card {
    width: 85%;
    max-width: 340px;
    background: #fff;
    border-radius: 24px;
    padding: 32px 24px 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ag-modal-overlay.active .app-dl-prompt-card {
    transform: scale(1);
    opacity: 1;
}

.app-dl-prompt-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 8px;
    background: linear-gradient(90deg, #10b981, #34d399, #10b981);
    background-size: 200% auto;
    animation: gradientShift 3s linear infinite;
}

.dl-prompt-header h3 {
    margin: 0 0 12px;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dl-prompt-header p {
    margin: 0 0 24px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.dl-prompt-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 下载详情页样式 */
.app-download-page {
    background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 50%, #f8fafc 100%);
    min-height: 100vh;
}

.download-container {
    padding: var(--padding-sc);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.download-hero {
    text-align: center;
    margin-bottom: 40px;
}

.download-icon {
    width: 100px;
    height: 100px;
    border-radius: 24px;
    margin: 0 auto 20px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    position: relative;
}

.download-icon img {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
}

.download-icon::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg, #34d399 0%, transparent 100%);
    z-index: -1;
    opacity: 0.6;
}

.download-hero h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin: 0 0 8px;
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.download-hero p {
    color: #64748b;
    font-size: 0.95rem;
    margin: 0;
}

.download-btns {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.dl-btn {
    display: flex;
    align-items: center;
    background: #fff;
    padding: 16px 20px;
    border-radius: 20px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.04);
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    border: 1px solid rgba(0,0,0,0.05);
}

.dl-btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
}

.dl-btn svg {
    margin-right: 16px;
    color: #059669;
}

.dl-text {
    display: flex;
    flex-direction: column;
}

.dl-text span {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.dl-text small {
    font-size: 0.8rem;
    color: #94a3b8;
}

.dl-ios svg {
    color: #0f172a;
}

.download-tips {
    margin-top: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.8rem;
    background: rgba(255,255,255,0.6);
    padding: 16px;
    border-radius: 12px;
}

.dl-btn.dl-btn-primary {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    padding: 14px 24px;
}

.dl-btn.dl-btn-outline {
    background: transparent;
    color: #64748b;
    border: none;
    box-shadow: none;
    justify-content: center;
    font-size: 0.95rem;
    padding: 12px 24px;
}

.dl-btn.dl-btn-outline:active {
    background: #f1f5f9;
}