/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-overflow-scrolling: touch;
}

/* 移动端专用优化 */
.mobile-device {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

.mobile-device * {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.mobile-device input, .mobile-device textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.nav-link:hover::before {
    left: 100%;
}

/* 英雄区域 */
.hero {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 分类区域 */
.category-section {
    padding: 4rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 3rem;
    color: #2c3e50;
}

/* 优惠券网格 */
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.coupon-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.coupon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.coupon-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 3px solid #f8f9fa;
}

.coupon-info {
    padding: 1.5rem;
}

.coupon-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.coupon-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.coupon-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #e74c3c;
    color: white;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.coupon-category.meituan {
    background: #ffc107;
    color: #333;
}

.coupon-category.eleme {
    background: #007bff;
}

.coupon-category.jingdong {
    background: #e74c3c;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #333;
}

.modal-body {
    display: flex;
    flex-direction: column;
}

#modal-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 15px 15px 0 0;
}

.modal-info {
    padding: 2rem;
}

#modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2c3e50;
}

#modal-description {
    color: #666;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.action-btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.action-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.action-btn.copy {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.action-btn.copy:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(240, 147, 251, 0.4);
}

/* 提示框样式 */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 2rem 3rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 1.2rem;
    z-index: 2000;
    display: none;
    animation: toastIn 0.3s ease;
    box-shadow: 0 10px 30px rgba(40, 167, 69, 0.3);
    text-align: center;
    line-height: 1.5;
    min-width: 300px;
    max-width: 90vw;
}

/* 底部样式 */
.footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastIn {
    from { 
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8);
    }
    to { 
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* 快速导航浮动按钮 */
.quick-nav {
    position: fixed;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-nav-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
}

.quick-nav-btn.meituan {
    background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%);
}

.quick-nav-btn.eleme {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.quick-nav-btn.jingdong {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.quick-nav-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.quick-nav-btn.active {
    transform: scale(1.15);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

/* 回到顶部按钮 */
.back-to-top {
    position: fixed;
    right: 30px;
    bottom: 30px;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 200;
    opacity: 0;
    visibility: hidden;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .header {
        padding: 0.8rem 0;
    }
    
    .header .container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .logo {
        font-size: 1.5rem;
    }
    
    .nav {
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        min-width: 100px;
        text-align: center;
    }
    
    .hero {
        padding: 2.5rem 0;
    }
    
    .hero-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        margin-top: 0.5rem;
    }
    
    .section-title {
        font-size: 1.8rem;
        margin-bottom: 2rem;
    }
    
    .category-section {
        padding: 2.5rem 0;
    }
    
    .coupon-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .coupon-card {
        border-radius: 12px;
        box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    }
    
    .coupon-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 15px 35px rgba(0,0,0,0.12);
    }
    
    .coupon-image {
        height: 180px;
    }
    
    .coupon-info {
        padding: 1.2rem;
    }
    
    .coupon-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }
    
    .coupon-description {
        font-size: 0.85rem;
        margin-top: 0.5rem;
    }
    
    .coupon-category {
        font-size: 0.75rem;
        padding: 0.25rem 0.6rem;
        margin-bottom: 0.8rem;
    }
    
    /* 模态框移动端优化 */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    .close {
        right: 15px;
        top: 10px;
        font-size: 32px;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(0,0,0,0.1);
        border-radius: 50%;
    }
    
    #modal-image {
        height: 200px;
    }
    
    .modal-info {
        padding: 1.5rem;
    }
    
    #modal-title {
        font-size: 1.3rem;
        line-height: 1.3;
    }
    
    #modal-description {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }
    
    .action-btn {
        padding: 1rem 1.5rem;
        font-size: 1rem;
        border-radius: 10px;
        min-height: 50px;
    }
    
    /* 快速导航移动端优化 */
    .quick-nav {
        right: 10px;
        gap: 6px;
        top: 45%;
    }
    
    .quick-nav-btn {
        width: 45px;
        height: 45px;
        font-size: 0.7rem;
        line-height: 1.1;
    }
    
    .back-to-top {
        right: 10px;
        bottom: 20px;
        width: 45px;
        height: 45px;
        font-size: 1.1rem;
    }
    
    /* 提示框移动端优化 */
    .toast {
        padding: 1.5rem 2rem;
        font-size: 1rem;
        min-width: 280px;
        max-width: 90vw;
        border-radius: 12px;
    }
}

/* 小屏幕手机优化 */
@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .header {
        padding: 0.6rem 0;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .nav-link {
        padding: 0.5rem 0.8rem;
        font-size: 0.85rem;
        min-width: 90px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.6rem;
        margin-bottom: 1.5rem;
    }
    
    .category-section {
        padding: 2rem 0;
    }
    
    .coupon-grid {
        gap: 1.2rem;
    }
    
    .coupon-image {
        height: 160px;
    }
    
    .coupon-info {
        padding: 1rem;
    }
    
    .coupon-title {
        font-size: 1rem;
    }
    
    .coupon-description {
        font-size: 0.8rem;
    }
    
    /* 模态框小屏幕优化 */
    .modal-content {
        width: 98%;
        margin: 2% auto;
        border-radius: 12px;
    }
    
    .close {
        right: 10px;
        top: 8px;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
    
    #modal-image {
        height: 180px;
        border-radius: 12px 12px 0 0;
    }
    
    .modal-info {
        padding: 1.2rem;
    }
    
    #modal-title {
        font-size: 1.2rem;
    }
    
    #modal-description {
        font-size: 0.85rem;
        margin-bottom: 1.2rem;
    }
    
    .action-btn {
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
        min-height: 48px;
    }
    
    /* 快速导航小屏幕优化 */
    .quick-nav {
        right: 8px;
        gap: 5px;
    }
    
    .quick-nav-btn {
        width: 40px;
        height: 40px;
        font-size: 0.65rem;
    }
    
    .back-to-top {
        right: 8px;
        bottom: 15px;
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    /* 提示框小屏幕优化 */
    .toast {
        padding: 1.2rem 1.5rem;
        font-size: 0.95rem;
        min-width: 260px;
        max-width: 92vw;
        border-radius: 10px;
    }
    
    .footer {
        padding: 1.5rem 0;
        font-size: 0.9rem;
    }
}

/* 超小屏幕优化 */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .nav {
        gap: 0.3rem;
    }
    
    .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 1.4rem;
    }
    
    .quick-nav-btn {
        width: 35px;
        height: 35px;
        font-size: 0.6rem;
    }
    
    .back-to-top {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}