--- START OF FILE style.css ---

:root {
    --primary-color: #4f46e5;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    --secondary-gradient: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    --bg-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.9); /* 增加不透明度，提升文字可读性 */
    --glass-border: rgba(255, 255, 255, 0.6);
    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #1e293b;
    background-color: #f8fafc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

.bg-gradient {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15) 0%, transparent 40%);
}

.navbar {
    width: 100%; max-width: 800px; padding: 15px 20px;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 100;
}

.logo { font-size: 22px; font-weight: 800; color: #1e293b; letter-spacing: -0.5px; }
.logo span { color: #4f46e5; }

.user-actions { display: flex; align-items: center; gap: 10px; }
#userInfo, #guestInfo { display: flex; align-items: center; gap: 8px; }

/* 通用玻璃按钮 */
.btn-glass {
    white-space: nowrap; padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.9);
    color: #333 !important; /* 强制颜色 */
    font-size: 14px; font-weight: 600;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.btn-glass:active { transform: scale(0.95); }
.btn-glass.btn-primary {
    background: var(--primary-color); color: #333 !important; border: none;
}

/* 状态徽章 */
.user-badge {
    font-size: 12px; background: white; padding: 4px 10px;
    border-radius: 12px; color: #333; box-shadow: var(--shadow-sm);
    max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    border: 1px solid #e2e8f0;
}
.points-badge {
    font-size: 12px; font-weight: bold; color: #333;
    background: #fff; padding: 4px 8px; border-radius: 12px;
    border: 1px solid #e2e8f0;
}

/* 图标按钮 */
.btn-icon {
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid #e2e8f0;
    background: white; color: #333 !important; /* 修复图标颜色 */
    display: flex; align-items: center; justify-content: center;
    font-size: 16px; cursor: pointer; box-shadow: var(--shadow-sm);
}

/* 【修复】退出按钮样式优化，使其更显眼 */
.btn-logout {
    border-color: #fee2e2;
    color: #ef4444 !important; /* 红色警告色 */
    font-weight: bold;
    width: auto; /* 允许宽度自适应 */
    padding: 0 10px;
    border-radius: 16px;
    font-size: 13px;
}
.btn-logout:hover { background: #fef2f2; }

/* App 容器 */
.app-container { width: 94%; max-width: 800px; padding-bottom: 60px; margin-top: 10px; }

.hero-section { text-align: center; margin-bottom: 20px; }
.hero-section h1 { font-size: 28px; color: #1e293b; margin-bottom: 8px; }
.subtitle { color: #64748b; font-size: 14px; margin-bottom: 20px; }

.action-links { display: flex; justify-content: center; gap: 12px; }
.link-buy-card, .link-redeem {
    display: inline-block; text-decoration: none; padding: 8px 16px;
    border-radius: 8px; font-size: 13px; font-weight: 600;
}
.link-buy-card { background: #fdf4ff; color: #d946ef; border: 1px solid #f0abfc; }
.link-redeem { background: #fff; color: #333; border: 1px solid #e2e8f0; }

/* 广告位 */
.ad-banner-container {
    width: 100%; margin-bottom: 25px; border-radius: 12px; overflow: hidden;
    box-shadow: var(--shadow-sm); background: #e2e8f0; min-height: 80px; position: relative;
}
.ad-content {
    position: relative; width: 100%; height: 100%; display: flex;
    align-items: center; justify-content: center; background: #cbd5e1;
}
.ad-content img { width: 100%; height: auto; display: block; object-fit: cover; max-height: 120px; position: relative; z-index: 2; }
.ad-fallback-text { position: absolute; color: #64748b; font-size: 12px; z-index: 1; }
.ad-tag {
    position: absolute; bottom: 5px; right: 5px; background: rgba(0,0,0,0.5);
    color: white; font-size: 10px; padding: 2px 5px; border-radius: 4px; z-index: 5;
}

/* 上传区 */
.upload-wrapper { display: flex; gap: 15px; margin-bottom: 25px; }
.upload-card {
    flex: 1; background: var(--glass-bg); backdrop-filter: blur(10px);
    border: 1px solid white; border-radius: 16px; padding: 15px;
    box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
}
.card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.step-num {
    background: #4f46e5; color: white; width: 20px; height: 20px;
    border-radius: 50%; font-size: 12px; display: flex; align-items: center; justify-content: center;
}
.card-header h3 { font-size: 15px; color: #333; font-weight: 600; }

.preview-area {
    width: 100%; height: 180px; background: #f1f5f9;
    border: 2px dashed #cbd5e1; border-radius: 12px;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    cursor: pointer; overflow: hidden; position: relative;
}
.preview-area img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.placeholder p { font-size: 12px; color: #64748b; margin-top: 5px; }
.transfer-icon { display: flex; align-items: center; justify-content: center; font-size: 20px; color: #94a3b8; }

/* 按钮与加载 */
.control-panel { text-align: center; margin-bottom: 30px; }
.btn-generate {
    width: 100%; max-width: 300px; padding: 14px;
    background-image: var(--primary-gradient);
    color: #ffffff !important; border: none; border-radius: 50px;
    font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
    display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0 auto;
    transition: transform 0.2s;
}
.btn-generate:active { transform: scale(0.98); }
.btn-generate:disabled { background: #cbd5e1; background-image: none; cursor: not-allowed; box-shadow: none; }
.cost-tip { font-size: 12px; opacity: 0.9; font-weight: normal; }

/* 结果区 */
.result-card { background: #333; padding: 15px; border-radius: 16px; box-shadow: var(--shadow-lg); text-align: center; }
.image-result img { width: 100%; border-radius: 8px; margin-bottom: 15px; display: block; }
.btn-download {
    display: inline-block; padding: 10px 25px;
    background-image: var(--secondary-gradient); color: white;
    text-decoration: none; border-radius: 25px; font-size: 14px; font-weight: bold;
}

/* 弹窗 */
.modal {
    position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
}
.modal-content {
    background: #ffffff; width: 85%; max-width: 320px; padding: 25px;
    border-radius: 20px; position: relative; text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.close { position: absolute; right: 20px; top: 15px; font-size: 24px; color: #999; cursor: pointer; }
.modern-input {
    width: 100%; padding: 12px; margin-bottom: 15px;
    border: 1px solid #e2e8f0; border-radius: 10px; background: #f8fafc; font-size: 14px; color: #333;
}
.btn-block {
    width: 100%; padding: 12px; background: #4f46e5; color: white;
    border: none; border-radius: 10px; font-size: 15px; font-weight: 600; cursor: pointer;
}
.input-group { display: flex; gap: 8px; margin-bottom: 15px; }
.input-group .modern-input { margin-bottom: 0; }
.btn-code { white-space: nowrap; padding: 0 12px; border: 1px solid #4f46e5; border-radius: 10px; background: white; color: #4f46e5; font-size: 12px; cursor: pointer; }

/* 响应式适配 */
@media (max-width: 600px) {
    .upload-wrapper { flex-direction: column; }
    .transfer-icon { transform: rotate(90deg); margin: -10px 0; z-index: 2; }
    .preview-area { height: 200px; }
    .navbar { padding: 10px 15px; }
    .logo { font-size: 20px; }
    .user-actions { gap: 6px; }
    .user-badge { max-width: 80px; }
    .btn-glass { padding: 6px 12px; font-size: 13px; }
}

.hidden { display: none !important; }