/* CSS 变量定义 */
:root {
    --primary-color: #ff6f61;
    --secondary-color: #ffc107;
    --background-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #333;
    --light-text: #f8f9fa;
    --coupon-color-start: #FFD700;
    --coupon-color-end: #FF4500;
    --coupon-color-start-clicked: #75b798;
    --coupon-color-end-clicked:  #198754;
}

/* 基础样式 */
body {
    background-color: var(--background-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* 导航栏样式 */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-weight: bold;
    color: var(--light-text) !important;
}

.navbar-brand img {
    width: 24px;
    height: 24px;
    vertical-align: text-bottom;
}

/* 英雄区域样式 */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--light-text);
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
}

/* 表单控件样式 */
.form-control:focus,
.btn-primary:focus {
    box-shadow: 0 0 0 0.25rem rgba(255, 111, 97, 0.5);
    border-color: var(--primary-color);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: background-color 0.3s, transform 0.3s;
}

.btn-primary:hover {
    background-color: #e65a50;
    border-color: #e65a50;
    transform: translateY(-2px);
}

/* 产品卡片样式 */
.product-card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    background-color: var(--card-bg);
}

.product-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.product-card .card-img-top {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.product-card .card-body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card .card-title {
    font-weight: 600;
    font-size: 1.1rem;
}

/* 价格样式 */
.price {
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.4rem;
}

.total-price {
    color: #6c757d;
    font-size: 0.9rem;
}

/* 历史记录样式 */
.history-item {
    cursor: pointer;
    transition: background-color 0.2s;
}

.history-item:hover {
    background-color: #e9ecef;
}

.history-item .delete-history {
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s, opacity 0.2s linear;
}

.history-item:hover .delete-history {
    visibility: visible;
    opacity: 1;
}

/* 加载器样式 */
#loader {
    display: none;
    text-align: center;
    padding: 3rem 0;
}

.spinner-border {
    width: 3rem;
    height: 3rem;
    color: var(--primary-color);
}

#discover-btn .spinner-border {
    width: 1rem;
    height: 1rem;
    color: var(--light-text);
    font-size: small;
}

/* 章节标题样式 */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 600;
    position: relative;
}

.section-title::after {
    content: '';
    width: 60px;
    height: 4px;
    background: var(--primary-color);
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

/* 价格信息样式 */
.price-info {
    color: #6c757d;
    cursor: pointer;
    font-size: 1rem;
    margin-left: 5px;
}

/* 摘要容器样式 */
#summary-container {
    background-color: #fff;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.07);
}

/* 随机需求按钮样式 */
#random-requirement {
    background: white;
    border: 1px solid #ddd;
}

/* 彩色魔法棒图标 - 基本彩虹色 */
#random-requirement .fa-wand-magic-sparkles {
    background: linear-gradient(90deg, 
        #ff0000, /* 红 */
        #ff8000, /* 橙 */
        #ffff00, /* 黄 */
        #00ff00, /* 绿 */
        #0080ff, /* 蓝 */
        #8000ff, /* 靛 */
        #ff00ff, /* 紫 */
        #ff0000); /* 重复红色以实现无缝循环 */
    background-size: 200% 200%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
    animation: rainbow 2s linear infinite;
    font-size: 18px;
}

@keyframes rainbow {
    0% { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}

/* 移动端特定样式 */
@media (max-width: 767.98px) {
    .hero {
        padding: 2.5rem 0;
    }
    .hero h1 {
        font-size: 2.2rem;
    }
    .hero .lead {
        font-size: 1rem;
    }
    
    #recommendationForm .input-group {
        flex-wrap: wrap;
    }

    #recommendationForm .input-group > .form-control {
        /* Make the input take the full width, pushing buttons to the next line */
        flex: 1 1 100%;
        margin-bottom: 0.5rem;
    }

    #recommendationForm .input-group > .budget-btn {
        /* Allow buttons to grow and fill the line */
        flex-grow: 1;
    }
}

/* 点击指示器样式 */
.purchase-action .click-indicator {
    display: none;
}
.purchase-action.clicked .click-indicator {
    display: inline-block;
}
.purchase-action.clicked .unclicked-icon{
    display: none;   
}
.purchase-action.clicked .btn-coupon{
    background: linear-gradient(to left, var(--coupon-color-start-clicked), var(--coupon-color-end-clicked));
    
}

/* 优惠券按钮样式 */
.btn-coupon {
    background: linear-gradient(to left, var(--coupon-color-start), var(--coupon-color-end));
    border: none;
    color: white;
    font-weight: bold;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-coupon:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 69, 0, 0.3);
}

/* 淘口令按钮样式 */
.taokouling-btn {
    transition: all 0.3s;
}

.taokouling-btn:hover {
    transform: translateY(-2px);
}

/* 平台标识样式 */
.platform-badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 0.7rem;
    font-weight: bold;
    border-radius: 4px;
    color: white;
    margin-left: 8px;
    vertical-align: top;
}

.platform-taobao {
    background-color: #ff4000;
}

.platform-jd {
    background-color: #c00000;
}

.platform-pdd {
    background-color: #d0021b;
}

/* 淘口令信息样式 */
.taokouling-info {
    background-color: #f8f9fa;
    border-radius: 4px;
    padding: 5px;
    margin-top: 8px;
}
