/* ===== 全局重置 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #4573A5;
    min-height: 100vh;
    padding-bottom: 20px;
}

/* ===== 主容器 ===== */
.page-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 10px 20px;
}

/* ===== 加载状态 ===== */
.matching-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
}
.matching-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}
.matching-text {
    font-size: 18px;
    color: #fff;
    font-weight: 600;
    letter-spacing: 2px;
}
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== 主标题 ===== */
.main-title {
    background-color: #1989F9;
    color: #fff;
    padding: 8px;
    text-align: center;
    font-size: 18px;
    font-weight: 600;
    border-radius: 3px 3px 0 0;
    margin-top: 10px;
}

/* ===== 商品信息 ===== */
.product-info {
    background-color: #bfdbfe;
    padding: 15px;
    border-radius: 0 0 3px 3px;
    margin-bottom: 10px;
}
.product-info .label {
    font-size: 14px;
    color: #1e40af;
    margin-bottom: 5px;
    display: block;
}
.product-info .value {
    font-size: 20px;
    color: #E85716;
    font-weight: 600;
}
.product-info .info-item {
    text-align: center;
    margin-top: 12px;
}
.product-info .product-img {
    border-radius: 5px;
    max-width: 400px;
    width: 90%;
    display: block;
    margin: 0 auto;
    background: #e9ecef;
    object-fit: contain;
}
.product-info .product-img-error {
    border-radius: 5px;
    max-width: 400px;
    width: 90%;
    margin: 0 auto;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 50px;
    color: #adb5bd;
}

/* ===== 平台按钮 ===== */
.btn-platform {
    width: 100% !important;
    height: 40px !important;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    border: none;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 16px !important;
    box-sizing: border-box;
    margin: 10px 0 0 0 !important;
    transition: all 0.3s ease;
    color: #fff;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.btn-platform.btn-taobao {
    background: #ff5000;
}
.btn-platform.btn-jd {
    background: #ff0f23;
}
.btn-platform.btn-douyin {
    background: #20202b;
}
.btn-platform:hover {
    opacity: 0.85;
}
.btn-platform:active {
    transform: scale(0.97);
}

/* ===== 输入区域 ===== */
.input-section {
    background-color: #fff;
    border-radius: 3px;
    padding: 15px;
    margin-bottom: 10px;
}
.input-label {
    display: block;
    width: 100%;
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 600;
    margin: 0 0 10px 0 !important;
}
.smart-text-area {
    margin-bottom: 20px;
}
.smart-text-area textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.2s;
    outline: none;
}
.smart-text-area textarea:focus {
    border-color: #409eff;
}

.input-group {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}
.input-group:last-of-type {
    border-bottom: none;
}
.input-group .label {
    width: 60px;
    font-size: 14px;
    color: #333;
    font-weight: 500;
    flex-shrink: 0;
}
.input-group input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: #333;
    padding: 4px 0;
    background: transparent;
}
.input-group input::placeholder {
    color: #999;
}

.btn-submit {
    width: 100%;
    height: 40px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 3px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 15px;
    transition: all 0.3s ease;
}
.btn-submit:hover {
    opacity: 0.85;
}
.btn-submit:active {
    transform: scale(0.97);
}
.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.btn-submit .spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 4px;
    vertical-align: middle;
}

/* ===== 操作步骤 ===== */
.steps-section {
    background-color: #fff;
    border-radius: 3px;
    padding: 15px;
    margin-bottom: 10px;
}
.steps-section .title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}
.steps-section .warning {
    font-size: 14px;
    color: #dc2626;
    font-weight: 600;
    margin-bottom: 10px;
}
.steps-section .steps {
    font-size: 13px;
    color: #666;
    line-height: 1.8;
}

/* ===== 倒计时 ===== */
.countdown-section {
    background-color: #fff;
    border-radius: 3px;
    padding: 15px;
    text-align: center;
    margin-bottom: 10px;
}
.countdown-section .label {
    font-size: 14px;
    color: #333;
    margin-bottom: 5px;
}
.countdown-section .time {
    font-size: 20px;
    color: #dc2626;
    font-weight: 600;
}

/* ===== 通用工具 ===== */
.hidden {
    display: none !important;
}
.mt-10 {
    margin-top: 10px;
}

/* ===== 弹窗（模态框） ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.closing {
    animation: fadeOut 0.2s ease forwards;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.96);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.96);
    }
}

.modal-box {
    background-color: rgb(227, 236, 249);
    border-radius: 8px;
    max-width: 400px;
    width: 100%;
    padding: 24px 20px 20px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-box .modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    text-align: center;
    margin-bottom: 12px;
}
.modal-box .modal-body {
    font-size: 14px;
    color: #222;
    line-height: 1.7;
}
.modal-box .modal-body strong {
    color: #e53935;
}
.modal-box .modal-body .highlight {
    color: #e53935;
    font-weight: bold;
    font-size: 16px;
}
.modal-box .modal-body .highlight-orange {
    color: #E85716;
    font-weight: bold;
    font-size: 16px;
}
.modal-box .modal-img {
    width: 80%;
    max-width: 300px;
    border-radius: 20px;
    display: block;
    margin: 12px auto;
    background: #e9ecef;
    object-fit: contain;
}
.modal-box .modal-img-error {
    width: 80%;
    max-width: 300px;
    margin: 12px auto;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #adb5bd;
    border-radius: 5px;
}
.modal-box .modal-footer {
    text-align: center;
    margin-top: 16px;
}
.modal-box .modal-footer .btn-confirm {
    width: 70px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background: #409eff;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}
.modal-box .modal-footer .btn-confirm:hover {
    background: #66b1ff;
}
.modal-box .modal-footer .btn-confirm:active {
    transform: scale(0.96);
}

/* 弹窗内图片双列 */
.modal-img-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0;
}
.modal-img-row img {
    width: 98%;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    background: #e9ecef;
    object-fit: contain;
}

/* ===== 结果页面（全屏覆盖） ===== */
.result-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #4573A5;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    animation: fadeIn 0.3s ease;
}
.result-overlay.closing {
    animation: fadeOut 0.25s ease forwards;
}
.result-box {
    background: #fff;
    border-radius: 12px;
    padding: 30px 24px 24px;
    max-width: 400px;
    width: 100%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.result-box .result-icon {
    font-size: 56px;
    margin-bottom: 12px;
}
.result-box .result-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 8px;
}
.result-box .result-title.success {
    color: #52c41a;
}
.result-box .result-title.fail {
    color: #ff4d4f;
}
.result-box .result-title.close {
    color: #faad14;
}
.result-box .result-detail {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
    margin: 10px 0 16px;
    text-align: left;
    word-break: break-all;
}
.result-box .result-detail .label {
    font-weight: 500;
    color: #333;
}
.result-box .result-detail .val {
    color: #E85716;
    font-weight: 600;
}
.result-box .btn-result {
    width: 120px;
    height: 40px;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    cursor: pointer;
    background: #409eff;
    transition: background 0.2s;
    margin-top: 8px;
}
.result-box .btn-result:hover {
    background: #66b1ff;
}
.result-box .btn-result:active {
    transform: scale(0.96);
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
    .page-container {
        padding: 0 6px 20px;
    }
    .product-info .value {
        font-size: 17px;
    }
    .modal-box {
        padding: 18px 14px 16px;
    }
    .result-box {
        padding: 24px 16px 20px;
    }
}

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar {
    width: 4px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* 加载中按钮状态 */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}