* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

:root {
    --primary-green: #2e7d32;
    --light-green: #4caf50;
    --lighter-green: #81c784;
    --lightest-green: #e8f5e9;
    --dark-green: #1b5e20;
    --accent-color: #ff9800;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #dce7dc;
    --shadow: 0 4px 12px rgba(46, 125, 50, 0.1);
    --radius: 10px;
}

body {
    background-color: #ffffff;
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-green), var(--dark-green));
    color: white;
    padding: 30px 0;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
}

.logo h1 {
    font-size: 2.2rem;
    font-weight: 600;
}

.logo p {
    font-size: 1rem;
    opacity: 0.9;
}

.stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.15);/* 保持半透明白色 */
    padding: 10px 20px;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* 主内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 900px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 表单卡片 */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: var(--light-green);
    color: white;
    padding: 20px 25px;
}

.card-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
}

.required::after {
    content: " *";
    color: #e53935;
}

input, select, textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--light-green);
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.address-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.payment-options {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.payment-option {
    flex: 1;
    text-align: center;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.payment-option:hover {
    border-color: var(--light-green);
}

.payment-option.selected {
    border-color: var(--light-green);
    background-color: var(--lightest-green);
}

.payment-option i {
    font-size: 1.5rem;
    margin-bottom: 5px;
    color: var(--primary-green);
}

.price-display {
    background-color: var(--lightest-green);
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    margin-top: 10px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-green);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 14px 28px;
    background-color: var(--primary-green);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-align: center;
}

.btn:hover {
    background-color: var(--dark-green);
    transform: translateY(-2px);
}

.btn i {
    margin-right: 8px;
}

/* 订单列表样式 */
.orders-list {
    max-height: 500px;
    overflow-y: auto;
}

.order-item {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s;
}

.order-item:hover {
    background-color: var(--lightest-green);
}

.order-item:last-child {
    border-bottom: none;
}

.no-orders {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-light);
    font-style: italic;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.order-id {
    font-weight: 700;
    color: var(--primary-green);
}

.order-date {
    color: var(--text-light);
    font-size: 0.9rem;
}

.order-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.status-pending {
    background-color: #fff3e0;
    color: #ef6c00;
}

.status-processing {
    background-color: #e3f2fd;
    color: #1565c0;
}

.status-completed {
    background-color: #e8f5e9;
    color: var(--primary-green);
}

.status-cancelled {
    background-color: #f5f5f5;
    color: #757575;
}

.order-details {
    margin-top: 10px;
}

.detail-row {
    display: flex;
    margin-bottom: 5px;
}

.detail-label {
    min-width: 100px;
    color: var(--text-light);
}

.detail-value {
    flex: 1;
}

.technician-info {
    background-color: var(--lightest-green);
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
}

.technician-name {
    font-weight: 600;
    color: var(--primary-green);
}

.payment-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
}

.payment-paid {
    background-color: #e8f5e9;
    color: var(--primary-green);
}

.payment-unpaid {
    background-color: #ffebee;
    color: #c62828;
}

/* 消息提示 */
.message {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: none;
}

.message.success {
    background-color: #e8f5e9;
    color: var(--primary-green);
    border-left: 4px solid var(--primary-green);
}

.message.error {
    background-color: #ffebee;
    color: #c62828;
    border-left: 4px solid #c62828;
}

/* 地址选择器样式 */
.address-fixed {
    background-color: #f5f5f5;
    color: #666;
}

.address-input-group {
    display: flex;
    gap: 10px;
}

.address-input {
    flex: 1;
}

.address-label {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 5px;
}

/* 费用说明样式 */
.cost-info {
    background-color: var(--lightest-green);
    padding: 20px;
    border-radius: 8px;
    margin-top: 20px;
}

.cost-info h3 {
    color: var(--primary-green);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.cost-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.cost-item {
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    border-left: 4px solid var(--light-green);
}

.cost-label {
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 5px;
}

.cost-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-green);
}

.payment-note {
    background-color: #fff8e1;
    border-left: 4px solid var(--accent-color);
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* 页脚 */
footer {
    text-align: center;
    padding: 20px;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    margin-top: 40px;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .address-row {
        grid-template-columns: 1fr;
    }
    
    .payment-options {
        flex-direction: column;
    }
    
    .cost-detail {
        grid-template-columns: 1fr;
    }
}
/* 省市区三级联动样式 */
.region-selector {
    width: 100%;
}

.region-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.region-field {
    flex: 1;
}

.province-field,
.city-field {
    flex: 0 0 auto;
    min-width: 60px;
}

.region-display {
    display: block;
    padding: 10px 12px;
    background: #f0f7f0;
    border: 1px solid #dce7dc;
    border-radius: 6px;
    color: #2d5a2d;
    font-weight: 600;
    text-align: center;
    font-size: 14px;
}

.district-field {
    flex: 1;
}

.district-field select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dce7dc;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    color: #333;
    appearance: auto;
}

.district-field select:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 2px rgba(76, 175, 80, 0.1);
}



/* 响应式调整 */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
}

/* 订单查询区域 */
.order-search-box {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.order-search-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.order-search-btn {
    padding: 8px 16px;
    background: #1976D2;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.order-search-btn:hover {
    background: #1565C0;
}

/* 订单列表容器 */
#orders-list-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

/* 订单项样式 */
.order-item {
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
}

.order-item h4 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333;
}

.order-item p {
    margin: 4px 0;
    font-size: 13px;
    color: #666;
}

.order-item .status-paid {
    color: #2E7D32;
    font-weight: bold;
}

.order-item .status-unpaid {
    color: #E53935;
    font-weight: bold;
}

.no-orders {
    text-align: center;
    color: #999;
    padding: 20px;
}

/* 安装单价说明样式 */
.price-info-box {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.price-info-box div {
    transition: all 0.2s ease;
}


/* 轮播图样式 */
.carousel-section {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-section h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* Swiper 容器 - 关键修复 */
.swiper-container.construction-carousel {
    width: 100%;
    max-width: 400px;     /* 桌面端最大 500px */
    height: auto;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    border-radius: 4px;
}

/* Wrapper - 所有 slide 水平排列 */
.construction-carousel .swiper-wrapper {
    display: flex;
    flex-direction: row;
    position: relative;
}

/* 单个 slide */
.construction-carousel .swiper-slide {
    width: 100%;
    flex-shrink: 0;
    position: relative;
}

/* 图片 */
.construction-carousel .swiper-slide img {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 1;   /* 宽高比 2:1，即 500:250 */
    object-fit: cover;
    display: block;
}

/* 图片描述 */
.construction-carousel .slide-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: #fff;
    font-size: 13px;
    text-align: center;
}

/* 分页器 */
.construction-carousel .swiper-pagination {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.construction-carousel .swiper-pagination-bullet {
    width: 8px;
    height: 8px;
    background: rgba(255, 255, 255, 0.6);
    margin: 0 4px;
}

.construction-carousel .swiper-pagination-bullet-active {
    background: #2E7D32;
}

/* 导航按钮 */
.construction-carousel .swiper-button-next,
.construction-carousel .swiper-button-prev {
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 50%;
    color: #fff;
    z-index: 10;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.construction-carousel .swiper-button-prev {
    left: 10px;
}

.construction-carousel .swiper-button-next {
    right: 10px;
}

.construction-carousel .swiper-button-next::after,
.construction-carousel .swiper-button-prev::after {
    font-size: 16px;
}

/* 空状态 */
.carousel-empty {
    text-align: center;
    padding: 30px;
    color: #999;
    font-size: 14px;
}


/* ===== 响应式布局 - 手机端适配 ===== */

/* 平板及以下设备 */
@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
    }
    
    .form-section,
    .sidebar-section {
        width: 100%;
        max-width: 100%;
    }
}

/* 手机端 */
@media (max-width: 640px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .form-section,
    .sidebar-section {
        width: 100%;
        max-width: 100%;
        padding: 12px;
    }
    
    /* 轮播图自适应 */
    .carousel-section {
        /*width: 100%;*/
        width: 380px !important;
        max-width: 380px !important;
        margin: 10px auto;
        padding: 10px;
    }
    
    .swiper-container.construction-carousel {
        width: 100%;
        height: auto;
    }
    
    .construction-carousel .swiper-slide img {
        width: 100%;
        height: auto;
        aspect-ratio: 2 / 1;
        object-fit: cover;
    }
    
    /* 导航按钮在手机上缩小 */
    .construction-carousel .swiper-button-next,
    .construction-carousel .swiper-button-prev {
        width: 28px;
        height: 28px;
    }
    
    .construction-carousel .swiper-button-next::after,
    .construction-carousel .swiper-button-prev::after {
        font-size: 12px;
    }
    
    /* 分页器在手机上调整位置 */
    .construction-carousel .swiper-pagination {
        bottom: 5px;
    }
    
    .construction-carousel .swiper-pagination-bullet {
        width: 6px;
        height: 6px;
    }
    
    /* 头部信息在手机上堆叠 */
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .stats {
        margin-top: 10px;
        justify-content: center;
    }
    
    /* 表单在手机上全宽 */
    .form-group input,
    .form-group select,
    .form-group textarea {
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 订单搜索框 */
    .order-search-box {
        flex-direction: column;
    }
    
    .order-search-input {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .order-search-btn {
        width: 100%;
    }
}

/* ========== 真机终极防偏移补丁 ========== */
@media (max-width: 768px) {
    /* 1. 容器本身：只用宽度和居中，不碰高度和定位 */
    .carousel-section {
        width: 95vw !important;
        max-width: 380px !important;
        min-width: 320px !important;
        margin: 10px auto !important; /* 靠这个实现真正的水平居中 */
        padding: 10px !important;
        left: auto !important;       /* ✅ 清除之前的 left: 0 */
        transform: translateX(0) !important; /* ✅ 清除之前的 transform */
        position: relative !important; /* 恢复正常的文档流定位 */
        box-sizing: border-box !important;
    }

    /* 2. Swiper 容器：使用 Flex 布局强制居中，这是解决偏移的核心 */
    .carousel-section .swiper-container {
        width: 100%;
        height: auto; /* 自动高度，随图片变化，绝不出错 */
        display: flex; /* 启用 Flex */
        align-items: center; /* 垂直居中 */
        justify-content: center; /* 水平居中 */
        overflow: hidden;
    }

    /* 3. 轮播图图片：自适应缩放，不变形 */
    .carousel-section .swiper-slide img {
        width: 100%;
        height: auto;
        display: block; /* 消除图片底部的默认间隙 */
        object-fit: cover; /* 如果你想让图片铺满不留白，用 cover；如果想完整显示用 contain */
    }

    /* 4. 导航按钮（左右箭头）：绝对定位 + 垂直居中 */
    .carousel-section .swiper-button-next,
    .carousel-section .swiper-button-prev {
        position: absolute;
        top: 50%;
        transform: translateY(-50%); /* 垂直居中 */
        z-index: 10;
        width: 30px;
        height: 30px;
        background: rgba(0, 0, 0, 0.5);
        border-radius: 50%;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
    }
    .carousel-section .swiper-button-prev {
        left: 10px;
    }
    .carousel-section .swiper-button-next {
        right: 10px;
    }

    /* 5. 分页器（底部小圆点）：强制水平居中 */
    .carousel-section .swiper-pagination {
        position: absolute;
        bottom: 10px;
        left: 0;
        right: 0;
        text-align: center;
        z-index: 10;
    }
}