/* 预算计算器浮动组件样式 */
.budget-float-widget {
    position: fixed;
    right: 20px;
    bottom: 230px;
    z-index: 9998;
}

.budget-float-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #D4AF37 0%, #E8C547 100%);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: all 0.3s ease;
}

.budget-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.5);
}

.budget-float-btn i {
    font-size: 1.5rem;
    color: #1A1A1A;
}

.budget-float-text {
    font-size: 0.65rem;
    color: #1A1A1A;
    font-weight: 600;
    margin-top: 2px;
}

/* 弹窗样式 */
.budget-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.budget-modal-overlay.active {
    display: flex;
}

.budget-modal-content {
    background: #1a1a2e;
    border-radius: 16px;
    width: 100%;
    max-width: 1000px;
    max-height: 90vh;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    display: flex;
    flex-direction: column;
}

.budget-modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 50%;
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.budget-modal-close:hover {
    background: #D4AF37;
    color: #1A1A1A;
}

.budget-modal-header {
    padding: 24px 24px 16px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-modal-header h3 {
    font-size: 1.25rem;
    color: #D4AF37;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.budget-modal-header p {
    font-size: 0.8rem;
    color: #888;
}

.budget-modal-body {
    padding: 0;
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 左侧表单区域 */
.budget-form-left {
    flex: 1;
    padding: 20px 24px;
    overflow-y: auto;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    min-width: 0;
}

/* 右侧结果区域 */
.budget-result-right {
    flex: 0 0 380px;
    padding: 24px;
    background: #0d0d1a;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* 表单行布局 */
.budget-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.budget-form-row .budget-form-group {
    margin-bottom: 12px;
}

/* 结果区域空状态 */
.budget-result-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 200px;
    height: 100%;
}

.budget-result-empty i {
    font-size: 3rem;
    color: #D4AF37;
    opacity: 0.5;
    margin-bottom: 16px;
}

.budget-result-empty p {
    color: #888;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* 模式切换 */
.budget-mode-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: #0d0d1a;
    border-radius: 10px;
    padding: 4px;
}

.budget-mode-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #aaa;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.budget-mode-tab:hover {
    color: #fff;
}

.budget-mode-tab.active {
    background: linear-gradient(135deg, #D4AF37 0%, #E8C547 100%);
    color: #1A1A1A;
}

/* 表单样式 */
.budget-form-section {
    display: none;
}

.budget-form-section.active {
    display: block;
}

.budget-form-title {
    font-size: 0.85rem;
    margin-bottom: 10px;
    color: #D4AF37;
    font-weight: 500;
}

.budget-form-group {
    margin-bottom: 14px;
}

.budget-form-group label {
    display: block;
    margin-bottom: 6px;
    color: #aaa;
    font-size: 0.8rem;
}

.budget-form-control {
    width: 100%;
    padding: 10px 14px;
    background: #0d0d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-sizing: border-box;
}

.budget-form-control:focus {
    outline: none;
    border-color: #D4AF37;
}

select.budget-form-control {
    width: 100%;
    padding: 10px 14px;
    background: #0d0d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9rem;
    transition: all 0.3s;
    box-sizing: border-box;
    cursor: pointer;
}

select.budget-form-control:focus {
    outline: none;
    border-color: #D4AF37;
}

select.budget-form-control option {
    background: #0d0d1a;
    color: #fff;
    padding: 10px;
}

/* 确保下拉框可以正常交互 */
.budget-form-group {
    position: relative;
    z-index: 1;
}

select.budget-form-control {
    position: relative;
    z-index: 2;
}

/* 房型选择 */
.budget-house-type-category {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.budget-house-type-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 14px;
}

.budget-house-type-card {
    background: #0d0d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 6px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.budget-house-type-card:hover,
.budget-house-type-card.selected {
    border-color: #D4AF37;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
}

.budget-house-type-card i {
    font-size: 1.2rem;
    color: #D4AF37;
    margin-bottom: 4px;
}

.budget-house-type-card h4 {
    font-size: 0.75rem;
    margin-bottom: 2px;
    color: #fff;
}

.budget-house-type-card p {
    font-size: 0.65rem;
    color: #888;
}

/* 面积选择 */
.budget-area-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.budget-area-chip {
    padding: 6px 12px;
    background: #0d0d1a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    cursor: pointer;
    font-size: 0.75rem;
    color: #aaa;
    transition: all 0.3s;
}

.budget-area-chip.selected {
    background: #D4AF37;
    color: #1A1A1A;
    border-color: #D4AF37;
}

/* 计算按钮 */
.budget-btn-calculate {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #D4AF37 0%, #E8C547 100%);
    color: #1A1A1A;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    transition: all 0.3s;
}

.budget-btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.3);
}

.budget-btn-calculate:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* 错误消息 */
.budget-error-message {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 0.85rem;
    display: none;
}

/* 结果面板 */
.budget-result-panel {
    flex: 1;
    padding: 0;
    background: transparent;
    border-radius: 0;
    border: none;
    display: flex;
    flex-direction: column;
}

.budget-result-panel.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.budget-result-panel.has-result {
    background: #1a1a2e;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.budget-price-display {
    text-align: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.budget-price-value {
    font-size: 2rem;
    font-weight: 700;
    color: #D4AF37;
}

.budget-price-unit {
    color: #888;
    font-size: 0.8rem;
    margin-top: 4px;
}

.budget-cost-breakdown {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.budget-cost-item {
    background: #1a1a2e;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

.budget-cost-item .label {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 4px;
}

.budget-cost-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
}

.budget-contact-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 14px;
}

.budget-btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.budget-btn-phone {
    background: linear-gradient(135deg, #D4AF37 0%, #E8C547 100%);
    color: #1A1A1A;
}

.budget-btn-wechat {
    background: linear-gradient(135deg, #07C160 0%, #05a350 100%);
    color: white;
}

.budget-disclaimer {
    text-align: center;
    font-size: 0.7rem;
    color: #888;
    margin-top: 12px;
    padding: 12px;
    background: rgba(212, 175, 55, 0.05);
    border-radius: 8px;
}

/* 加载动画 */
.budget-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 26, 26, 0.3);
    border-radius: 50%;
    border-top-color: #1A1A1A;
    animation: budget-spin 1s linear infinite;
}

@keyframes budget-spin {
    to { transform: rotate(360deg); }
}

/* 设备配置样式 */
.budget-device-category {
    margin-bottom: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    background: #0d0d1a;
}

.budget-device-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.85rem;
    color: #D4AF37;
    font-weight: 500;
}

.budget-device-title:hover {
    background: rgba(212, 175, 55, 0.1);
}

.budget-device-title i:first-child {
    margin-right: 8px;
    width: 18px;
}

.budget-device-toggle {
    color: #888;
    font-size: 0.75rem;
    transition: all 0.3s;
}

.budget-device-list {
    display: block;
    padding: 8px 12px;
}

.budget-device-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.02);
}

.budget-device-item:hover {
    background: rgba(33, 150, 243, 0.08);
    border-color: rgba(33, 150, 243, 0.3);
}

.budget-device-check {
    width: 18px;
    height: 18px;
    margin-right: 12px;
    margin-top: 2px;
    cursor: pointer;
    accent-color: #2196F3;
    flex-shrink: 0;
}

.device-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.device-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.budget-device-name {
    font-size: 0.85rem;
    color: #fff;
    font-weight: 500;
}

.budget-device-price {
    font-size: 0.8rem;
    color: #D4AF37;
    font-weight: 600;
}

.device-recommend-tag {
    font-size: 0.65rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    white-space: nowrap;
}

/* 房间推荐标签 */
.room-recommend-badge {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 功能空间网格 */
.budget-space-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.budget-space-item {
    position: relative;
    cursor: pointer;
}

.budget-space-check {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.budget-space-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 14px 10px;
    background: #0d0d1a;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    transition: all 0.3s;
    text-align: center;
}

.budget-space-item:hover .budget-space-content {
    border-color: rgba(156, 39, 176, 0.5);
    background: rgba(156, 39, 176, 0.05);
}

.budget-space-check:checked + .budget-space-content {
    border-color: #9C27B0;
    background: rgba(156, 39, 176, 0.1);
}

.budget-space-content i {
    font-size: 1.5rem;
    color: #9C27B0;
    margin-bottom: 8px;
}

.budget-space-name {
    font-size: 0.8rem;
    color: #fff;
    font-weight: 500;
    margin-bottom: 4px;
}

.budget-space-area {
    font-size: 0.7rem;
    color: #888;
    margin-bottom: 4px;
}

.budget-space-price {
    font-size: 0.75rem;
    color: #D4AF37;
    font-weight: 600;
}

.space-recommend-tag {
    position: absolute;
    top: -6px;
    right: -6px;
    font-size: 0.6rem;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 500;
    z-index: 1;
}

/* 响应式 - 平板和手机 */
@media (max-width: 768px) {
    .budget-modal-content {
        max-width: 100%;
        max-height: 85vh;
    }
    
    .budget-modal-body {
        flex-direction: column;
    }
    
    .budget-form-left {
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        max-height: 50vh;
        padding: 16px 20px;
    }
    
    .budget-result-right {
        flex: 0 0 auto;
        min-height: 200px;
        padding: 16px 20px;
    }
    
    .budget-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .budget-float-widget {
        right: 15px;
        bottom: 140px;
    }
    
    .budget-float-btn {
        width: 54px;
        height: 54px;
    }
    
    .budget-float-btn i {
        font-size: 1.25rem;
    }
    
    .budget-house-type-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .budget-form-left {
        padding: 14px 16px;
    }
    
    .budget-result-right {
        padding: 14px 16px;
    }
}
