/* 2026 马年主题全局样式 */
:root {
    --primary-red: #8b0000;
    --gold: #f3cf9a;
    --bright-red: #ff2d2d;
    --orange-gold: #ffaa00;
    --white-soft: rgba(255, 255, 255, 0.9);
}

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

body {
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--primary-red);
    color: var(--gold);
    min-height: 100vh;
    overflow-x: hidden;
}

/* 动态背景 */
.bg-decoration {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: radial-gradient(circle at center, #a00000 0%, #600000 100%);
}

.glow-top {
    position: absolute;
    top: -10%; left: -10%;
    width: 50%; height: 50%;
    background: var(--bright-red);
    filter: blur(120px);
    opacity: 0.2;
}

.glow-bottom {
    position: absolute;
    bottom: -10%; right: -10%;
    width: 50%; height: 50%;
    background: var(--orange-gold);
    filter: blur(120px);
    opacity: 0.2;
}

.container {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 3rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1.2rem;
    border: 1px solid rgba(243, 207, 154, 0.3);
    border-radius: 50px;
    background: rgba(243, 207, 154, 0.1);
    font-size: 0.85rem;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 3rem;
    margin: 0 0 1rem;
    font-weight: 900;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.subtitle {
    opacity: 0.8;
    font-size: 1.1rem;
}

/* 模式切换器 */
.mode-switcher {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.2);
    padding: 0.4rem;
    border-radius: 20px;
    width: fit-content;
    margin: 0 auto 3rem;
    border: 1px solid rgba(243, 207, 154, 0.1);
}

.mode-switcher label {
    padding: 0.8rem 1.5rem;
    border-radius: 15px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.mode-switcher input:checked + label {
    background: var(--gold);
    color: var(--primary-red);
    box-shadow: 0 4px 15px rgba(243, 207, 154, 0.3);
}

.mode-switcher input { display: none; }

/* 布局网格 */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; }
}

/* 预览卡片 */
.preview-card {
    background: rgba(0,0,0,0.3);
    padding: 1.5rem;
    border-radius: 30px;
    border: 1px solid rgba(243, 207, 154, 0.1);
    backdrop-filter: blur(10px);
}

.aspect-ratio-box {
    position: relative;
    width: 100%;
    padding-top: 133.33%; /* 3:4 */
    background: rgba(255,255,255,0.05);
    border-radius: 20px;
    overflow: hidden;
}

.placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
}

.icon-camera::before { content: "📸"; font-size: 3rem; }

.base-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-overlay {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    width: 45%;
    aspect-ratio: 3/4;
    border: 3px solid var(--gold);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.user-overlay img { width: 100%; height: 100%; object-fit: cover; }

.preview-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.5);
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    font-size: 0.6rem;
    letter-spacing: 1px;
}

.helper-text {
    margin-top: 1rem;
    font-size: 0.8rem;
    opacity: 0.4;
    text-align: center;
}

/* 表单元素 */
.action-area { display: flex; flex-direction: column; gap: 1.5rem; }

.label {
    display: block;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    opacity: 0.6;
}

.btn-upload {
    width: 100%;
    padding: 1.2rem 1.5rem;
    background: var(--gold);
    color: var(--primary-red);
    border: none;
    border-radius: 18px;
    font-weight: 900;
    font-size: 1.1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: 0.3s;
}

.btn-upload:hover { background: white; }

.custom-select {
    width: 100%;
    padding: 1.2rem;
    background: rgba(0,0,0,0.4);
    border: 1px solid rgba(243, 207, 154, 0.3);
    border-radius: 18px;
    color: var(--gold);
    font-size: 1rem;
    appearance: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem;
    background: rgba(255,255,255,0.05);
    border-radius: 15px;
    font-size: 0.9rem;
}

.checkbox-group label {
    cursor: pointer;
    user-select: none;
}

.terms-agreement-wrapper {
    margin-top: 20px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.terms-agreement-wrapper a {
    color: #fff;
    text-decoration: underline;
}

.terms-agreement-wrapper a:hover {
    text-decoration: none;
}

.btn-submit {
    width: 100%;
    padding: 1.5rem;
    background: linear-gradient(90deg, #ffaa00, #ff4d00);
    border: none;
    border-radius: 50px;
    color: white;
    font-size: 1.25rem;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(255, 77, 0, 0.3);
    transition: 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
}

.btn-submit:hover:not(:disabled) { transform: translateY(-3px); filter: brightness(1.1); }
.btn-submit.disabled { opacity: 0.3; cursor: not-allowed; transform: none; }

.disclaimer {
    font-size: 0.75rem;
    opacity: 0.5;
    text-align: center;
    line-height: 1.6;
}

/* 加载动画 */
#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(139, 0, 0, 0.98);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(20px);
}

.loader-content {
    width: 300px;
    text-align: center;
}

.spinner {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 2rem;
}

.spinner-inner {
    position: absolute;
    inset: 0;
    border: 4px solid rgba(243, 207, 154, 0.2);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: spin 2s linear infinite;
}

.percentage {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.5rem;
}

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

.progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 10px;
    margin-top: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--gold);
    width: 0%;
    transition: 0.1s;
}

/* 结果页特有 */
.result-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    background: rgba(0,0,0,0.2);
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(243, 207, 154, 0.1);
    text-align: center;
}

.error-details {
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 0, 0, 0.2);
    text-align: left;
}

.error-details p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.error-info {
    font-size: 0.8rem;
    opacity: 0.8;
    word-break: break-all;
}

.result-container .header {
    margin-bottom: 2rem;
}

.result-container .header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.result-container .header .subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-bottom: 2rem;
}

.image-display {
    margin: 2rem auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-result {
    width: 100%;
    max-width: 600px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    margin-bottom: 1.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.download-hint {
    font-size: 1rem;
    opacity: 0.8;
    text-align: center;
    margin-top: 1rem;
    background: rgba(255,255,255,0.1);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    display: inline-block;
}

.red-envelope-section {
    margin-top: 2rem;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 20px;
    text-align: center;
}

.qr-code { width: 250px; height: 250px; margin-top: 1rem; object-fit: contain; }

.btn-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-primary {
    flex: 1;
    background: var(--gold);
    color: var(--primary-red);
    text-decoration: none;
    padding: 1rem;
    border-radius: 50px;
    font-weight: bold;
    text-align: center;
}

.btn-secondary {
    flex: 1;
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
    padding: 1rem;
    border-radius: 50px;
    font-weight: bold;
    text-align: center;
}

/* 精彩展厅 */
.showcase-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(243, 207, 154, 0.1);
}

.showcase-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.showcase-title {
    font-size: 1.8rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.title-line {
    width: 1.5rem;
    height: 4px;
    background: var(--gold);
    border-radius: 2px;
}

.showcase-subtitle {
    font-size: 0.8rem;
    opacity: 0.5;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.showcase-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 15px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(243, 207, 154, 0.1);
}

.showcase-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.showcase-item:hover img {
    transform: scale(1.1);
}

.showcase-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.showcase-item:hover .showcase-overlay {
    opacity: 1;
}

.showcase-overlay p {
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    text-align: center;
    margin: 0;
}

.showcase-item.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-content {
    font-size: 2rem;
    opacity: 0.2;
    transition: transform 0.3s ease;
}

.showcase-item.placeholder:hover .placeholder-content {
    transform: scale(1.1);
}

.hidden { display: none !important; }

.footer {
    text-align: center;
    padding: 3rem 0;
    opacity: 0.5;
    font-size: 0.8rem;
}