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

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    min-height: 100vh;
}

.hidden {
    display: none !important;
}

.step-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Step 1: Instructions */
.instructions-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.instructions-box h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    text-align: center;
    color: #6b3e26;
}

.instructions-content {
    margin-bottom: 30px;
}

.instructions-content h2 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #4b2e19;
}

.instructions-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    margin-bottom: 15px;
    color: #555;
}

.instructions-content strong {
    color: #d2691e;
    font-weight: 600;
}

.notice {
    background: #fff3e6;
    border-left: 4px solid #d2691e;
    padding: 15px;
    margin-top: 20px;
    border-radius: 4px;
}

.notice p {
    margin: 0;
    color: #8b4513;
    font-weight: 500;
}

.start-btn {
    width: 100%;
    padding: 15px 30px;
    background: #d2691e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.start-btn:hover {
    background: #a0522d;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(210,105,30,0.3);
}

/* Step 2: Choice Task */
#step2 {
    flex-direction: column;
    padding: 20px;
    align-items: stretch;
}

.ai-module {
    background: linear-gradient(135deg, #6b3e26 0%, #8b5a3c 100%);
    color: #fff;
    padding: 20px 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(107,62,38,0.2);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.ai-module h2 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.ai-module p {
    font-size: 1rem;
    opacity: 0.95;
}

.products-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.section-title {
    font-size: 1.25rem;
    color: #4b2e19;
    margin: 10px 0 10px 0;
    font-weight: 700;
}

.survey-container,
.recommendations-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto 20px auto;
}

.survey-card {
    background: #fff;
    border-radius: 12px;
    padding: 22px 22px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border: 1px solid rgba(107,62,38,0.08);
}

.survey-card h3 {
    margin-bottom: 8px;
    color: #4b2e19;
}

.survey-hint {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 14px;
}

.survey-question {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.55;
    margin-bottom: 10px;
}

.tag-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tag-option {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
    font-size: 0.98rem;
    color: #333;
}

.tag-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tag-option:hover {
    background: #fff8f0;
    border-color: rgba(210,105,30,0.45);
}

.tag-option:has(input:checked) {
    background: #fff3e6;
    border-color: rgba(210,105,30,0.55);
    box-shadow: 0 6px 18px rgba(210,105,30,0.12);
    font-weight: 650;
}

.survey-group {
    padding: 14px 0;
    border-top: 1px solid #eee;
}

.survey-group:first-of-type {
    border-top: none;
    padding-top: 4px;
}

.survey-group h4 {
    font-size: 1.05rem;
    color: #4b2e19;
    margin-bottom: 10px;
}

.survey-items {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.survey-item {
    display: grid;
    grid-template-columns: minmax(180px, 260px) 1fr;
    gap: 10px;
    align-items: center;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 10px 12px;
}

.survey-item.single {
    grid-template-columns: 1fr;
}

.survey-item-title {
    font-weight: 650;
    color: #333;
    font-size: 0.98rem;
}

.survey-bipolar {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: #666;
    font-size: 0.92rem;
    margin-bottom: 8px;
}

.survey-bipolar .left,
.survey-bipolar .right {
    flex: 1;
}

.survey-bipolar .right {
    text-align: right;
}

.likert {
    display: grid;
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 8px;
    justify-items: center;
    align-items: center;
}

.likert-option {
    display: grid;
    grid-template-rows: auto auto;
    gap: 4px;
    justify-items: center;
    cursor: pointer;
    user-select: none;
}

.likert-option input[type="radio"] {
    transform: scale(1.05);
    cursor: pointer;
}

.likert-option span {
    font-size: 0.85rem;
    color: #555;
}

.survey-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.pref-continue-btn {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 14px 22px;
    font-size: 1.02rem;
}

.pref-continue-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.start-btn.small {
    width: auto;
    padding: 12px 18px;
    font-size: 1rem;
}

.survey-error {
    color: #b42318;
    background: #fff1f0;
    border: 1px solid rgba(180,35,24,0.25);
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 0.95rem;
}

.top3-grid {
    padding-top: 10px;
}

.reason {
    margin: 8px 0 10px 0;
    padding: 10px 10px;
    background: #fff3e6;
    border: 1px solid rgba(210,105,30,0.22);
    border-radius: 10px;
    color: #8b4513;
    font-size: 0.92rem;
    line-height: 1.5;
    text-align: left;
}

.recommend-empty {
    grid-column: 1 / -1;
    background: #fff;
    border: 1px dashed rgba(107,62,38,0.35);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #555;
}

.recommend-empty-inner h4 {
    margin-bottom: 6px;
    color: #4b2e19;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.product-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.product-card.recommended {
    border: 2px solid #d2691e;
    background: #fff8f0;
}

.recommend-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #d2691e;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1;
}

.top3-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #2563eb;
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 1;
}

/* Top3 推荐角标：进入商品页、生成推荐后即显示，无需滑到底部 */
#step2 .ai-badge {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

/* 「选择」按钮：需滚动到页面最底部（浏览完全部商品）后才显示 */
#step2 .ai-gated {
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

#step2.show-ai-badges .ai-gated {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.product-info {
    width: 100%;
    text-align: center;
    margin-bottom: 15px;
}

.product-info h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #333;
}

.product-tagline {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.4;
}

.product-rating {
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.rating-label {
    color: #666;
}

.rating-value {
    color: #d2691e;
    font-weight: 600;
}

.product-price {
    font-size: 1.3rem;
    color: #d2691e;
    font-weight: 600;
}

.select-btn {
    width: 100%;
    padding: 12px 20px;
    background: #d2691e;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.select-btn:hover {
    background: #a0522d;
    transform: scale(1.02);
}

.select-btn:active {
    transform: scale(0.98);
}

/* Step 3: Finish */
.finish-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    max-width: 700px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.finish-box h1 {
    font-size: 2rem;
    margin-bottom: 30px;
    color: #6b3e26;
}

.selected-product-summary h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #4b2e19;
}

.selected-product-card {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 30px;
    display: flex;
        flex-direction: column;
    align-items: center;
    gap: 20px;
    }
    
.selected-product-card img {
    width: 250px;
    height: 250px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: #f9f9f9;
    }
    
.product-details {
    text-align: center;
    }
    
.product-details h3 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    color: #333;
    }
    
.product-details .product-price {
    font-size: 1.8rem;
    color: #d2691e;
    font-weight: 600;
    margin-bottom: 15px;
    }
    
.time-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    }
    
.time-info p {
    color: #666;
    font-size: 1rem;
}

.completion-note {
    margin-top: 14px;
    padding: 14px 16px;
    background: #fff3e6;
    border: 1px solid rgba(210,105,30,0.25);
    border-radius: 10px;
    text-align: left;
}

.completion-title {
    margin: 0 0 8px 0;
    color: #8b4513;
    font-weight: 700;
    font-size: 1.05rem;
}

.completion-desc {
    margin: 6px 0 0 0;
    color: #8b4513;
    font-size: 0.98rem;
    line-height: 1.5;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .instructions-box {
        padding: 25px;
    }
    
    .instructions-box h1 {
        font-size: 1.5rem;
    }
    
    .instructions-content p {
        font-size: 1rem;
    }
    
    .ai-module {
        padding: 15px 20px;
    }
    
    .ai-module h2 {
        font-size: 1.2rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 10px;
    }

    .survey-item {
        grid-template-columns: 1fr;
    }

    .survey-bipolar {
        flex-direction: column;
    }

    .survey-bipolar .right {
        text-align: left;
    }

    .likert {
        grid-template-columns: repeat(7, minmax(30px, 1fr));
        gap: 6px;
    }
    
    .finish-box {
        padding: 25px;
    }

    .selected-product-card img {
        width: 200px;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .step-container {
        padding: 10px;
    }

    .instructions-box,
    .finish-box {
        padding: 20px;
    }

    .product-card {
        padding: 12px;
    }

    .product-card img {
        height: 120px;
        margin-bottom: 10px;
    }

    .product-info h3 {
        font-size: 0.88rem;
    }

    .product-tagline {
        font-size: 0.78rem;
    }

    .product-info .product-price {
        font-size: 0.95rem;
    }

    .product-card .select-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        width: 100%;
        max-width: 100%;
    }

    .recommend-badge,
    .top3-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}
