/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CSS 变量定义 - 简约配色 */
:root {
    /* 主色调 - 简约蓝色 */
    --primary-color: #007AFF;
    --secondary-color: #5856D6;
    --accent-color: #FF9500;
    --success-color: #34C759;
    --warning-color: #FF9500;
    --error-color: #FF3B30;
    
    /* 浅色主题 - 简约白色 */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-muted: #8e8e93;
    --border-color: #d1d1d6;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

/* iOS 系统自适应暗黑模式 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #0A84FF;
        --secondary-color: #5E5CE6;
        --accent-color: #FF9F0A;
        --success-color: #30D158;
        --warning-color: #FF9F0A;
        --error-color: #FF453A;
        
        --bg-primary: #000000;
        --bg-secondary: #1c1c1e;
        --bg-tertiary: #2c2c2e;
        --text-primary: #ffffff;
        --text-secondary: #ebebf5;
        --text-muted: #8e8e93;
        --border-color: #38383a;
        --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
        --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -1px rgb(0 0 0 / 0.2);
        --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2);
        --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 10px 10px -5px rgb(0 0 0 / 0.2);
    }
    
    .header {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
    }
}

/* 手动暗色主题 */
[data-theme="dark"] {
    --primary-color: #0A84FF;
    --secondary-color: #5E5CE6;
    --accent-color: #FF9F0A;
    --success-color: #30D158;
    --warning-color: #FF9F0A;
    --error-color: #FF453A;
    
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #ebebf5;
    --text-muted: #8e8e93;
    --border-color: #38383a;
    --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -1px rgb(0 0 0 / 0.2);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.3), 0 4px 6px -2px rgb(0 0 0 / 0.2);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 10px 10px -5px rgb(0 0 0 / 0.2);
}

[data-theme="dark"] .header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%) !important;
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: all 0.3s ease;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 头部样式 */
.header {
    text-align: center;
    padding: 3rem 0;
    position: relative;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    margin: 0 -1rem 2rem -1rem;
    color: white;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.15"/><circle cx="20" cy="80" r="0.5" fill="white" opacity="0.15"/><circle cx="80" cy="30" r="0.5" fill="white" opacity="0.15"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
    z-index: 2;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.theme-icon {
    font-size: 1.2rem;
}

/* 主要内容区域 */
.main {
    flex: 1;
    padding-bottom: 2rem;
}

/* 平台板块样式 */
.platform-section {
    margin-bottom: 2.5rem;
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
    overflow: hidden;
}

.platform-section:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.platform-header {
    display: flex;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    background: var(--bg-secondary);
    margin-bottom: 0;
}

.platform-icon {
    width: 3rem;
    height: 3rem;
    margin-right: 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.platform-icon svg {
    width: 2rem;
    height: 2rem;
}

.meituan-icon {
    background: #ffd23f;
}

.eleme-icon {
    background: #487BF2;
}

.jd-icon {
    background: #F53415;
}

.didi-icon {
    background: #F39826;
}

.platform-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* 优惠券网格 */
.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 0;
    padding: 0 1.5rem 1.5rem 1.5rem;
}

/* 优惠券卡片 */
.coupon-card {
    background: transparent;
    border-radius: 0;
    padding: 1rem 0;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.coupon-card:last-child {
    border-bottom: none;
}

.coupon-card:hover {
    background: var(--bg-secondary);
    padding-left: 1rem;
    padding-right: 1rem;
    margin-left: -1rem;
    margin-right: -1rem;
    border-radius: 8px;
    border-bottom: 1px solid transparent;
}

.coupon-card:last-child:hover {
    border-bottom: 1px solid transparent;
}

.coupon-card:active {
    transform: scale(0.98);
}

.coupon-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.coupon-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.coupon-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.coupon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    min-width: 80px;
}

.coupon-action:hover {
    background: var(--secondary-color);
}

/* 页脚样式 */
.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.beian {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.beian a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.3s ease;
}

.beian a:hover {
    color: var(--primary-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header {
        margin: 0 -0.75rem 1.5rem -0.75rem;
        padding: 2rem 0;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .theme-toggle {
        width: 2.5rem;
        height: 2.5rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    .theme-icon {
        font-size: 1rem;
    }
    
    .platform-section {
        padding: 0;
        margin-bottom: 2rem;
    }
    
    .platform-header {
        padding: 1rem 1rem 0.75rem 1rem;
    }
    
    .coupon-grid {
        padding: 0 1rem 1rem 1rem;
    }
    
    .platform-icon {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .platform-icon svg {
        width: 1.5rem;
        height: 1.5rem;
    }
    
    .platform-name {
        font-size: 1.25rem;
    }
    
    .coupon-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .coupon-card {
        padding: 0.75rem 0;
        gap: 0.75rem;
    }
    
    .coupon-card:hover {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
        margin-left: -0.75rem;
        margin-right: -0.75rem;
    }
    
    .coupon-title {
        font-size: 1rem;
    }
    
    .coupon-desc {
        font-size: 0.85rem;
    }
    
    .coupon-action {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        min-width: 80px;
        border-radius: 6px;
    }
    

}

@media (max-width: 480px) {
    .title {
        font-size: 1.75rem;
    }
    
    .platform-header {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .platform-icon {
        margin-right: 0;
    }
}

/* 简化的动画效果 */
.platform-section {
    opacity: 1;
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

/* 选中文本样式 */
::selection {
    background: var(--accent-color);
    color: var(--text-primary);
}



/* 成功提示样式优化 */
.toast {
    border-radius: 8px !important;
    font-weight: 500 !important;
}

/* 焦点样式 */
.coupon-card:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.theme-toggle:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}