* {
    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 (Automation) */
#step2 {
    flex-direction: column;
    padding: 20px;
    align-items: stretch;
}

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

.survey-container,
.delegate-container,
.products-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 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);
    margin-bottom: 20px;
}

.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 {
    position: relative;
    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[type="radio"] {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 2;
    -webkit-appearance: none;
    appearance: none;
}

.tag-option span {
    position: relative;
    z-index: 0;
    pointer-events: none;
}

.tag-option input[type="radio"]:focus-visible + span {
    outline: 2px solid #d2691e;
    outline-offset: 3px;
    border-radius: 6px;
}

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

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

.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;
}

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

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

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

.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;
    margin-top: 6px;
}

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

/* 默认商品大卡片 */
.default-product-card {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    margin-bottom: 20px;
    border: 3px solid #d2691e;
}

.default-product-card img {
    width: 300px;
    height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9f9f9;
}

.default-product-card .product-details {
    text-align: center;
}

.default-product-card .product-details h3 {
    font-size: 1.8rem;
    margin-bottom: 15px;
    color: #333;
}

.default-product-card .product-rating {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.default-product-card .rating-label {
    color: #666;
}

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

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

/* AI通知 */
.ai-notice {
    text-align: center;
    margin-bottom: 25px;
}

.ai-notice p {
    font-size: 1.35rem;
    color: #111827;
    font-weight: 800;
    background: linear-gradient(135deg, #fff3e6 0%, #ffe4c7 100%);
    padding: 14px 26px;
    border-radius: 12px;
    display: inline-block;
    border: 2px solid rgba(210,105,30,0.35);
    box-shadow: 0 10px 24px rgba(210,105,30,0.18);
    letter-spacing: 0.5px;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 30px;
}

.confirm-btn,
.change-btn {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.confirm-btn {
    background: #d2691e;
    color: #fff;
}

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

.change-btn {
    background: #fff;
    color: #d2691e;
    border: 2px solid #d2691e;
}

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

/* 商品列表 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    padding: 20px 0;
    margin-top: 20px;
}

.flash-attention {
    outline: 3px solid rgba(210,105,30,0.35);
    outline-offset: 6px;
    border-radius: 12px;
}

.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.default-choice {
    border: 2px solid #d2691e;
    background: #fff8f0;
}

.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;
}

.ai-pick-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;
}

/* 默认隐藏：只有滚动到底部（浏览完成）后才显示推荐角标 */
.ai-badge {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

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

/* 选择按钮也延迟：滚动到底部后才可见 */
.ai-gated {
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    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);
}

.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;
}

.attr-label {
    font-weight: 700;
    color: #333;
}

.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-rating {
    margin-bottom: 10px;
    font-size: 1.1rem;
}

.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;
    }
    
    .default-product-card {
        padding: 25px;
    }
    
    .default-product-card img {
        width: 200px;
        height: 200px;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .confirm-btn,
    .change-btn {
        width: 100%;
    }

    .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;
    }
    
    .default-product-card {
        padding: 20px;
    }

    .default-product-card img {
        width: 150px;
        height: 150px;
    }

    .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,
    .ai-pick-badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
}
