/* ============ 弹窗组件 ============ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.modal-header h3 {
    font-size: 17px;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    right: 16px;
    font-size: 20px;
    color: var(--text-light);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 20px 16px;
}

/* 登录弹窗 */
.login-modal .login-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFF5F5, #FFE0E0);
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.input-group input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
}

.code-row {
    display: flex;
    gap: 10px;
}

.code-row input {
    flex: 1;
}

.code-btn {
    padding: 10px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--primary);
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
}

.login-agreement {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 14px;
}

.login-agreement .link {
    color: var(--primary);
    cursor: pointer;
}

/* 协议弹窗 */
.agreement-modal {
    max-height: 70vh;
}

.agreement-body {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-secondary);
    white-space: pre-line;
}

/* 产品详情弹窗 */
.product-detail-modal {
    max-height: 85vh;
}

.detail-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.detail-info {
    padding: 16px;
}

.detail-price {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary);
}

.detail-price::before {
    content: '¥';
    font-size: 18px;
}

.detail-price .original {
    font-size: 14px;
    color: var(--text-light);
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: 400;
}

.detail-name {
    font-size: 17px;
    font-weight: 600;
    margin: 8px 0;
}

.detail-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: var(--text-light);
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.detail-actions {
    display: flex;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.detail-actions .btn-buy {
    flex: 1;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

.detail-actions .btn-cart {
    padding: 14px 20px;
    background: var(--bg);
    border: none;
    border-radius: 24px;
    font-size: 16px;
    cursor: pointer;
}
