/* ========== 全局变量与基础样式 ========== */
:root {
    --primary-color: #ff6b9d;
    --secondary-color: #c06c84;
    --accent-color: #f8b195;
    --gradient-start: #ff6b9d;
    --gradient-end: #c06c84;
    --gradient-bg: linear-gradient(135deg, #ff6b9d 0%, #c06c84 50%, #6c5b7b 100%);
    --gradient-soft: linear-gradient(135deg, #ffeef8 0%, #f8e8f0 100%);
    --text-primary: #2d1b3d;
    --text-secondary: #6b5b7b;
    --text-light: #9b8ba8;
    --bg-primary: #ffffff;
    --bg-secondary: #fff5f9;
    --bg-card: #ffffff;
    --border-color: #f0e0eb;
    --shadow-sm: 0 2px 8px rgba(192, 108, 132, 0.08);
    --shadow-md: 0 4px 16px rgba(192, 108, 132, 0.12);
    --shadow-lg: 0 8px 32px rgba(192, 108, 132, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --nav-height: 60px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --font-display: 'Ma Shan Zheng', cursive;
    --font-body: 'ZCOOL XiaoWei', serif;
}

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-body);
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 20%, rgba(255, 107, 157, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(108, 91, 123, 0.05) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* ========== 应用容器 ========== */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    z-index: 1;
    background: var(--bg-secondary);
}

.page-content {
    padding-bottom: calc(var(--nav-height) + var(--safe-area-bottom) + 10px);
    min-height: calc(100vh - var(--nav-height) - var(--safe-area-bottom));
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========== 轮播图 ========== */
.carousel-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--gradient-bg);
}

.carousel {
    width: 100%;
    height: 100%;
    position: relative;
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    width: 24px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.95);
}

/* ========== 滚动公告 ========== */
.announcement-bar {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(90deg, #fff5f9 0%, #ffeef8 100%);
    border-bottom: 1px solid var(--border-color);
    overflow: hidden;
}

.announcement-icon {
    font-size: 18px;
    margin-right: 10px;
    flex-shrink: 0;
}

.announcement-scroll {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 20px;
}

.announcement-text {
    position: absolute;
    white-space: nowrap;
    animation: scrollText 20s linear infinite;
    color: var(--text-secondary);
    font-size: 14px;
}

@keyframes scrollText {
    0% {
        transform: translateX(100%);
    }
    100% {
        transform: translateX(-100%);
    }
}

/* ========== 盲盒区域 ========== */
.blind-box-section {
    padding: 20px 16px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 2px;
}

.blind-box-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

.blind-box-card {
    position: relative;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.blind-box-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.blind-box-card:hover::before,
.blind-box-card:active::before {
    opacity: 1;
}

.blind-box-card:hover,
.blind-box-card:active {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.male-box {
    background: linear-gradient(135deg, #e8f4f8 0%, #d0e8f0 100%);
    border: 2px solid #b8d8e8;
}

.female-box {
    background: linear-gradient(135deg, #ffeef8 0%, #ffd8e8 100%);
    border: 2px solid #ffb8d0;
}

.box-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

.box-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.box-price {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}

/* 盲盒抽取动画 */
.blind-box-card.drawing {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0) rotate(0);
    }
    25% {
        transform: translateX(-5px) rotate(-5deg);
    }
    75% {
        transform: translateX(5px) rotate(5deg);
    }
}

/* ========== 投放表单 ========== */
.submit-form {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.submit-form textarea {
    width: 100%;
    min-height: 120px;
    padding: 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    resize: vertical;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.submit-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

.char-count {
    font-size: 13px;
    color: var(--text-light);
}

/* ========== 公告面板 ========== */
.notice-panel {
    padding: 20px 16px;
}

.notice-list {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.notice-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.notice-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notice-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ========== 底部导航 ========== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    background: var(--bg-card);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 8px;
    padding-bottom: var(--safe-area-bottom);
    box-shadow: 0 -2px 12px rgba(192, 108, 132, 0.08);
    z-index: 100;
    border-top: 1px solid var(--border-color);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px 0;
}

.nav-icon {
    font-size: 24px;
    margin-bottom: 4px;
    transition: transform 0.3s ease;
}

.nav-label {
    font-size: 12px;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.nav-item.active .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* ========== 客服页面 ========== */
.page-header {
    background: var(--gradient-bg);
    padding: 20px 16px;
    color: white;
}

.page-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    letter-spacing: 2px;
}

.service-content {
    padding: 20px 16px;
}

.complaint-form,
.complaint-history {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.complaint-form h3,
.complaint-history h3 {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 16px;
}

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

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 15px;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.complaint-list {
    max-height: 400px;
    overflow-y: auto;
}

.complaint-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

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

.complaint-type {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    margin-bottom: 8px;
}

.complaint-type.complaint {
    background: #ffe8e8;
    color: #d63031;
}

.complaint-type.suggestion {
    background: #e8f4ff;
    color: #0984e3;
}

.complaint-type.feedback {
    background: #e8ffe8;
    color: #00b894;
}

.complaint-content {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.complaint-time {
    font-size: 12px;
    color: var(--text-light);
}

/* ========== 我的页面 ========== */
.profile-header {
    background: var(--gradient-bg);
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    color: white;
}

.profile-avatar {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 16px;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.avatar-edit {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid white;
}

.profile-info {
    text-align: center;
    margin-bottom: 20px;
}

.profile-info h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.profile-info p {
    font-size: 14px;
    opacity: 0.9;
}

.profile-balance {
    background: rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(10px);
}

.balance-label {
    font-size: 14px;
    opacity: 0.9;
}

.balance-amount {
    font-size: 24px;
    font-weight: 600;
}

.btn-recharge {
    background: white;
    color: var(--primary-color);
    border: none;
    padding: 6px 16px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-recharge:hover,
.btn-recharge:active {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

.profile-menu {
    padding: 20px 16px;
}

.menu-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 16px 20px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.menu-item:hover,
.menu-item:active {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
}

.menu-icon {
    font-size: 20px;
    margin-right: 12px;
}

.menu-text {
    flex: 1;
    font-size: 15px;
    color: var(--text-primary);
}

.menu-arrow {
    font-size: 20px;
    color: var(--text-light);
}

/* ========== 按钮样式 ========== */
.btn-primary {
    background: var(--gradient-bg);
    color: white;
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-xl);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
    width: 100%;
    font-family: var(--font-body);
}

.btn-primary:hover,
.btn-primary:active {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-small {
    padding: 10px 20px;
    font-size: 14px;
    width: auto;
}

/* ========== 弹窗样式 ========== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 18px;
    color: var(--text-primary);
}

.modal-close {
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

/* ========== 登录弹窗 ========== */
.login-modal {
    padding: 30px 24px;
}

.login-header {
    text-align: center;
    margin-bottom: 24px;
}

.login-logo {
    font-size: 60px;
    margin-bottom: 12px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.login-header h2 {
    font-family: var(--font-display);
    font-size: 28px;
    color: var(--text-primary);
    margin-bottom: 6px;
    letter-spacing: 2px;
}

.login-header p {
    font-size: 14px;
    color: var(--text-secondary);
}

.login-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    background: var(--bg-secondary);
    padding: 4px;
    border-radius: var(--radius-md);
}

.tab-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    font-family: var(--font-body);
}

.tab-btn.active {
    background: var(--bg-card);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.auth-form {
    display: block;
}

.auth-form.hidden {
    display: none;
}

/* ========== 弹窗公告 ========== */
.popup-modal {
    padding: 30px 24px;
    text-align: center;
}

.popup-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
}

.popup-content {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
    margin: 20px 0;
}

/* ========== 抽取结果弹窗 ========== */
.draw-result-modal {
    padding: 30px 24px;
    text-align: center;
}

.draw-result-header {
    margin-bottom: 20px;
}

.draw-icon {
    font-size: 60px;
    margin-bottom: 12px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

.draw-result-header h3 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--text-primary);
    letter-spacing: 2px;
}

.draw-result-content {
    background: var(--gradient-soft);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.8;
}

/* ========== 编辑资料弹窗 ========== */
.edit-profile-modal {
    padding: 0;
}

.edit-profile-modal form {
    padding: 20px;
}

/* ========== 纸条记录弹窗 ========== */
.notes-history-modal {
    padding: 0;
}

.notes-tabs {
    display: flex;
    gap: 8px;
    padding: 16px 20px;
    background: var(--bg-secondary);
}

.notes-list {
    padding: 20px;
    max-height: 400px;
    overflow-y: auto;
}

.note-item {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.note-content {
    font-size: 15px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.note-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-light);
}

/* ========== 充值弹窗 ========== */
.recharge-modal {
    padding: 0;
}

.recharge-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 20px;
}

.recharge-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.recharge-item:hover,
.recharge-item.selected {
    border-color: var(--primary-color);
    background: var(--gradient-soft);
}

.recharge-amount {
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 6px;
}

.recharge-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.recharge-modal .form-group {
    padding: 0 20px;
}

.recharge-modal .btn-primary {
    margin: 20px;
    width: calc(100% - 40px);
}

/* ========== Toast提示 ========== */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    max-width: 80%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    animation: toastIn 0.3s ease;
}

@keyframes toastIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
    }
    to {
        transform: translate(-50%, -50%) scale(1);
    }
}

/* ========== 加载动画 ========== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 响应式设计 ========== */
@media (max-width: 480px) {
    .app-container {
        max-width: 100%;
    }
    
    .bottom-nav {
        max-width: 100%;
    }
    
    .carousel-container {
        height: 180px;
    }
    
    .section-title {
        font-size: 20px;
    }
    
    .box-icon {
        font-size: 40px;
    }
    
    .profile-header {
        padding: 24px 16px;
    }
    
    .profile-avatar {
        width: 70px;
        height: 70px;
    }
}

@media (max-width: 360px) {
    .blind-box-grid {
        gap: 12px;
    }
    
    .blind-box-card {
        padding: 20px 12px;
    }
    
    .box-icon {
        font-size: 36px;
    }
    
    .recharge-options {
        grid-template-columns: 1fr;
    }
}

/* ========== 滚动条样式 ========== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

/* ========== 隐藏类 ========== */
.hidden {
    display: none !important;
}
