:root {
    --primary-color: #3498db;
    --secondary-color: #9b59b6;
    --accent-color: #e74c3c;
    --text-color: #333;
    --bg-dark: #242424;
    --bg-glass-light: rgba(255, 255, 255, 0.7);
    --bg-glass-dark: rgba(40, 40, 50, 0.8);
    --card-radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

body.dark-mode {
    --text-color: #f1f1f1;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-dark);
    background-image: url("https://www.loliapi.com/bg/");
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    justify-content: center;
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-color);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.loader-text {
    color: white;
    font-size: 1.2rem;
}

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

.app-container {
    min-height: 100vh;
    font-family: Arial, sans-serif;
    padding: 2rem;
    overflow: visible;
    width: 100%;
    max-width: 1300px;
}

/* 新增样式 - 移动端合并的优惠券 */
.merged-coupon {
    display: flex;
    flex-direction: column;
    padding: 25px;
}

.coupon-rows {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.coupon-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 12px 0;
}

.coupon-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 10px;
}

.coupon-desc {
    color: #4bec8e;
    font-weight: 600;
    margin: 0 10px;
}

.coupon-separator {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    margin: 0 15px;
    position: relative;
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
}

@keyframes pulse {
    0% { 
        transform: scale(1);
        text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    }
    50% { 
        transform: scale(1.3);
        color: #f1c40f;
        text-shadow: 0 0 15px rgba(231, 76, 60, 0.8);
    }
    100% { 
        transform: scale(1);
        text-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
    }
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0);
        color: var(--accent-color); 
    }
    50% { 
        transform: translateY(-8px); 
        color: #f1c40f;
        filter: drop-shadow(0 5px 5px rgba(231, 76, 60, 0.4));
    }
}

/* 所有容器(包括coupon card)统一模糊效果 */
.header, .coupon-card, .instructions, .links-container, .footer {
    background: var(--bg-glass-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: var(--shadow) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border-radius: var(--card-radius);
}

body.dark-mode .header,
body.dark-mode .coupon-card,
body.dark-mode .instructions,
body.dark-mode .links-container,
body.dark-mode .footer {
    background: var(--bg-glass-dark) !important;
    border-color: rgba(0, 0, 0, 0.3) !important;
}

.header {
    text-align: center;
    margin: 20px auto;
    padding: 25px 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 700px;
}

.person-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
}

.person {
    text-align: center;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.name {
    font-size: 1.2rem;
    font-weight: bold;
    margin-top: 0.5rem;
    color: var(--primary-color);
}

.title-text {
    color: var(--text-color);
    margin: 0 0 8px;
    font-size: 1.8rem;
    line-height: 1.2;
}

.subtitle-text {
    color: var(--text-color);
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.4;
}

/* ===== 修复优惠券布局问题 ===== */
.coupon-section {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem auto;
    width: 100%;
}

.coupon-card {
    padding: 30px 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    width: 300px;
    max-width: 100%;
}

/* ===== 优惠券悬停效果 ===== */
.coupon-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2) !important;
}

.discount-title {
    color: var(--text-color);
    margin: 15px 0;
    font-size: 1.6rem;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.usage-desc {
    font-weight: 600;
    color: #4bec8e;
    margin: 15px 0 25px;
    font-size: 1rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.coupon-code {
    display: flex;
    justify-content: center;
    width: 100%;
}

.coupon-input {
    width: 160px;
    height: 50px;
    border: none;
    outline: none;
    padding: 0 7px;
    border-radius: 10px;
    color: var(--primary-color);
    text-align: center;
    font-weight: 700;
    font-size: 18px;
    background-color: rgba(0, 0, 0, 0.08);
    box-shadow: inset 2px 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

body.dark-mode .coupon-input {
    border-color: rgba(0, 0, 0, 0.2);
}

.copy-btn {
    height: 50px;
    width: 80px;
    padding: 0;
    border: unset;
    border-radius: 15px;
    color: var(--primary-color);
    z-index: 1;
    background: rgba(232, 232, 232, 0.7);
    position: relative;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 3px 5px 15px -3px rgba(0, 0, 0, 0.2);
    transition: all 0.25s;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    margin-left: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.copy-btn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    border-radius: 15px;
    background-color: var(--secondary-color);
    z-index: -1;
    transition: all 0.25s;
}

.copy-btn:hover {
    color: white;
    box-shadow: 3px 5px 15px -1px rgba(0, 0, 0, 0.3);
    border-color: transparent;
}

.copy-btn:hover::before {
    width: 100%;
}

.instructions {
    padding: 30px 40px;
    text-align: center;
    max-width: 800px;
    margin: 30px auto;
}

.links-container {
    padding: 30px 40px;
    text-align: center;
    max-width: 800px;
    margin: 40px auto 0;
}

.links-title {
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.resource-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.resource-link {
    padding: 10px 25px;
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    border: 1px solid rgba(52, 152, 219, 0.3);
}

.resource-link:hover {
    background-color: rgba(52, 152, 219, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.dark-mode .resource-link {
    background-color: rgba(52, 152, 219, 0.2);
}

.instructions h3 {
    margin-top: 0;
    margin-bottom: 25px;
    color: var(--text-color);
    font-size: 1.5rem;
}

.instructions p {
    margin-bottom: 15px;
    line-height: 1.7;
    font-size: 1.05rem;
}

.footer {
    text-align: center;
    margin: auto auto 20px;
    padding: 25px;
    max-width: 800px;
}

.copyright {
    margin: 5px 0;
    color: var(--text-color);
    font-size: 1rem;
}

.disclaimer {
    margin: 15px 0 5px;
    color: var(--text-color);
    font-style: italic;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }
    
    .header, .instructions, .links-container, .footer {
        width: 95%;
        padding: 25px 20px;
    }
    
    .title-text {
        font-size: 1.6rem;
    }
    
    .discount-title {
        font-size: 1.4rem;
    }
    
    .instructions, .links-container {
        padding: 25px;
    }
    
    .resource-links {
        gap: 15px;
    }
}

@media (max-width: 576px) {
    .app-container {
        padding: 0.8rem;
    }
    
    .coupon-input {
        width: 140px;
        font-size: 16px;
    }
    
    .copy-btn {
        width: 70px;
        font-size: 14px;
    }
    
    .resource-links {
        flex-direction: column;
        align-items: center;
    }
    
    .resource-link {
        width: 80%;
        max-width: 300px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .coupon-section {
        grid-template-columns: 1fr;
    }
    
    .coupon-card {
        padding: 15px;
    }
    
    .discount-title {
        font-size: 1.2rem;
    }
    
    .coupon-input {
        width: 120px;
        font-size: 14px;
    }
    
    .copy-btn {
        width: 60px;
        font-size: 13px;
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.confirm-modal {
    background: var(--bg-glass-light);
    border-radius: var(--card-radius);
    padding: 30px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: modalIn 0.3s ease-out;
    box-shadow: var(--shadow);
}

body.dark-mode .confirm-modal {
    background: var(--bg-glass-dark);
}

.modal-content {
    margin-bottom: 25px;
}

.modal-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.modal-btn {
    padding: 10px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn {
    background: var(--primary-color);
    color: white;
}

.confirm-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.cancel-btn {
    background: rgba(0,0,0,0.1);
    color: var(--text-color);
}

.cancel-btn:hover {
    background: rgba(0,0,0,0.15);
}

.fade-in {
    animation: fadeIn 1.2s ease-out forwards;
}

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

@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}