/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    padding-bottom: 80px;
}

/* 顶部标题 */
.header {
    text-align: center;
    padding: 40px 20px 20px;
    color: white;
}

.gift-icon {
    font-size: 48px;
    color: #ffd700;
    margin-bottom: 16px;
}

.header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.subtitle {
    font-size: 16px;
    opacity: 0.9;
}

/* 主要内容区域 */
.main-content {
    padding: 0 20px;
}

/* 富文本展示区 */
.rich-text-section {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.copy-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.rich-content {
    line-height: 1.6;
    color: #555;
}

.rich-content h2, .rich-content h3 {
    color: #333;
    margin-bottom: 12px;
}

.rich-content ul {
    padding-left: 20px;
    margin-bottom: 12px;
}

.rich-content li {
    margin-bottom: 8px;
}

/* 无内容状态样式 */
.no-content {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.no-content-icon {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.no-content h4 {
    font-size: 18px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
}

.no-content p {
    margin-bottom: 8px;
    line-height: 1.6;
    font-size: 15px;
    color: #888;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
}

/* 取号结果展示区 */
.coupon-result {
    background: linear-gradient(135deg, #00c853 0%, #4caf50 100%);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0, 200, 83, 0.4);
    backdrop-filter: blur(10px);
    color: white;
    border: 3px solid #00e676;
    position: relative;
    overflow: hidden;
}

.coupon-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00e676, #69f0ae, #00e676);
    animation: shimmer 2s ease-in-out infinite;
}

.result-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    color: white;
    font-weight: 700;
    font-size: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.result-header span:first-child {
    font-size: 32px;
    margin-right: 16px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.coupon-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.coupon-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 12px;
    padding: 8px 0;
    gap: 8px;
}

.coupon-item:last-child {
    margin-bottom: 0;
}

.coupon-item .label {
    font-weight: 700;
    color: rgba(255, 255, 255, 0.95);
    min-width: 90px;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    padding-top: 12px;
    flex-shrink: 0;
}

.coupon-item .value {
    flex: 1;
    color: #00c853;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 12px 14px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    word-break: break-all;
    word-wrap: break-word;
    min-height: 40px;
    line-height: 1.5;
    overflow-wrap: break-word;
}

.copy-code-btn {
    background: rgba(255, 255, 255, 0.25);
    color: #00c853;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    min-width: 44px;
    height: fit-content;
}

.copy-code-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* 卡券状态和操作区 */
.coupon-status {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.remaining-count {
    text-align: center;
    margin-bottom: 20px;
    font-size: 18px;
}

.remaining-count .count {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin: 0 8px;
}

.claim-btn {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.claim-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.claim-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.claim-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* 底部导航栏 */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    padding: 12px 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #999;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.nav-item.active {
    color: #667eea;
}

.nav-item i {
    font-size: 20px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
}

/* 个人中心页面样式 */
.user-profile {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 24px 20px;
    margin: 20px;
    display: flex;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.avatar i {
    font-size: 24px;
    color: white;
}

.user-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
    color: #333;
}

.join-date {
    color: #666;
    font-size: 14px;
}

.coupon-stats {
    display: flex;
    margin: 0 20px 20px;
    gap: 16px;
}

.stat-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.stat-number {
    font-size: 32px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.stat-number.valid {
    color: #4caf50;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.view-records {
    margin: 0 20px 20px;
}

.record-link {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.record-link:hover {
    transform: translateY(-2px);
}

/* 清除缓存功能样式 */
.clear-cache {
    margin: 0 20px 20px;
}

.cache-link {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid #ff6b6b;
}

.cache-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff5252;
}

.cache-link .link-content i {
    color: #ff6b6b;
}

.link-content {
    display: flex;
    align-items: center;
}

.link-content i {
    font-size: 24px;
    color: #667eea;
    margin-right: 16px;
}

.link-text span {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.link-text small {
    color: #666;
    font-size: 14px;
}

.record-link .fa-chevron-right {
    color: #ccc;
    font-size: 16px;
}

.important-notice {
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #ffc107;
    border-radius: 16px;
    padding: 20px;
    margin: 0 20px 20px;
    display: flex;
    align-items: flex-start;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.2);
}

.notice-icon {
    color: #ffc107;
    font-size: 24px;
    margin-right: 16px;
    margin-top: 2px;
}

.notice-content p {
    color: #333;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 6px;
    font-weight: 500;
}

.notice-content p:last-child {
    margin-bottom: 0;
}

/* 记录页面样式 */
.page-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px;
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #667eea;
    cursor: pointer;
    margin-right: 16px;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s ease;
}

.back-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.page-header h1 {
    font-size: 20px;
    color: #333;
}

.stats-summary {
    display: flex;
    margin: 0 20px 20px;
    gap: 16px;
}

.summary-item {
    flex: 1;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.summary-number {
    font-size: 28px;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 8px;
}

.summary-number.valid {
    color: #4caf50;
}

.summary-label {
    color: #666;
    font-size: 14px;
}

.records-list {
    margin: 0 20px;
}

.record-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.record-number {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
}

.record-time {
    color: #666;
    font-size: 14px;
}

.record-code {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.code-text {
    font-family: 'Courier New', monospace;
    color: #333;
    font-size: 16px;
}

.copy-record-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.copy-record-btn:hover {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4c93 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    margin-bottom: 8px;
    font-size: 16px;
}

.empty-state p:last-child {
    font-size: 14px;
    opacity: 0.7;
}

/* Toast提示 */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #00c853 0%, #4caf50 100%);
    color: white;
    padding: 18px 32px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 12px 40px rgba(0, 200, 83, 0.4);
    backdrop-filter: blur(10px);
    border: 2px solid #00e676;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00e676, #69f0ae, #00e676);
    animation: shimmer 2s ease-in-out infinite;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast:not(.show) {
    transform: translateX(-50%) translateY(-10px);
}

/* 成功提示框样式 */
.success-toast {
    background: linear-gradient(135deg, #00c853 0%, #4caf50 100%) !important;
    box-shadow: 0 12px 40px rgba(0, 200, 83, 0.4) !important;
    border: 2px solid #00e676 !important;
}

.success-toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00e676, #69f0ae, #00e676);
    animation: shimmer 2s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .container {
        padding-bottom: 70px;
    }
    
    .header {
        padding: 30px 15px 15px;
    }
    
    .main-content {
        padding: 0 15px;
    }
    
    .user-profile,
    .coupon-stats,
    .view-records,
    .important-notice,
    .stats-summary,
    .records-list {
        margin-left: 15px;
        margin-right: 15px;
    }
    
    .page-header {
        padding: 15px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromTop {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0% {
        box-shadow: 0 12px 40px rgba(0, 200, 83, 0.4);
    }
    50% {
        box-shadow: 0 12px 40px rgba(0, 200, 83, 0.6), 0 0 20px rgba(0, 200, 83, 0.3);
    }
    100% {
        box-shadow: 0 12px 40px rgba(0, 200, 83, 0.4);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideInFromTop 0.6s ease-out;
}

.bounce-in {
    animation: bounceIn 0.8s ease-out, pulse 2s ease-in-out infinite;
}

/* 成功提示框动画 */
.success-bounce-in {
    animation: bounceIn 0.8s ease-out, pulse 2s ease-in-out infinite;
}

/* 加载状态 */
.loading {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.loading i {
    font-size: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
