/* ========== 基础重置 ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fa;
    color: #333;
    font-size: 14px;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

.page-wrap {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: #f5f7fa;
}

/* ========== 顶部导航 ========== */
.header {
    padding: env(safe-area-inset-top) 16px 8px;
    color: #fff;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    min-height: 150px;
    background: linear-gradient(180deg, rgb(238 238 238) 0%, #2061af 100%);
}

.header-content {
    position: relative;
    z-index: 1;
}

.sub-row {
    display: flex;
    margin-top: 60px;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 0 4px;
}

/* 语言切换 */
.lang-switch {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 30px;
    padding: 2px;
    display: inline-flex;
    flex-shrink: 0;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.lang-item {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 30px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.lang-item.active {
    background: #fff;
    color: #1677ff;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.lang-item:active {
    transform: scale(0.95);
}

/* 地区天气 */
.local-weather {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 2px 16px;
    font-size: 13px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    min-height: 30px;
    gap: 6px;
    transition: all 0.2s ease;
}

.local-weather:active {
    opacity: 0.7;
    transform: scale(0.97);
}

.local {
    display: flex;
    align-items: center;
    gap: 4px;
}

.uzicons {
    font-size: 16px;
    line-height: 1;
}

.area-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.arrow-down {
    font-size: 10px;
    margin-left: 2px;
    opacity: 0.8;
}

.weather {
    font-size: 12px;
    opacity: 0.9;
    white-space: nowrap;
    margin-left: 6px;
}

/* RTL布局 */
.rtl .sub-row {
    flex-direction: row-reverse;
}

.rtl .local-weather {
    flex-direction: row-reverse;
}

.rtl .arrow-down {
    transform: rotate(180deg);
}

.rtl .weather {
    margin-left: 0;
    margin-right: 6px;
}

/* ========== 分类 ========== */
.head-mod {
    position: fixed;
    left: 8px;
    right: 8px;
    top: 110px;
    padding: 8px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid rgba(150, 200, 240, 0.6);
    z-index: 10;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: none;
}

.head-mod.show {
    display: block;
}

.cate-wrap {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.cate-wrap::-webkit-scrollbar {
    display: none;
}

.cate-item {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 10px;
    background: #f0f7ff;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
    text-align: center;
}

.cate-item.active {
    background: #1677ff;
    color: #fff;
}

.cate-item:active {
    transform: scale(0.95);
}

.card-img .default-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
    color: #1677ff;
    background: #f0f7ff;
    border-radius: 50%;
}

.cat-names {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

.cat-name {
    font-size: 13px;
    font-weight: 600;
}

.cat-sub {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 2px;
}

.rtl .cate-wrap {
    flex-direction: row-reverse;
}

/* ========== 主内容 ========== */
.main-wrap {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: 40px;
    padding-bottom: 60px;
}

.main-wrap::-webkit-scrollbar {
    display: none;
}

/* ========== 加载状态 ========== */
.loading-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(22, 119, 255, 0.2);
    border-top-color: #1677ff;
    border-radius: 50%;
    animation: rotate 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #999;
    font-size: 14px;
}

/* ========== 服务模块 ========== */
.service-mod {
    margin: 0 8px;
    border-radius: 10px;
    background: #fff;
    padding: 8px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.card-swiper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    display: flex;
    gap: 16px;
    scrollbar-width: none;
}

.card-swiper::-webkit-scrollbar {
    display: none;
}

.service-card {
    flex-shrink: 0;
    width: 140px;
    padding: 10px;
    text-align: center;
    scroll-snap-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.service-card.active .card-tit {
    color: #1677ff;
}

.card-img {
    width: 100px;
    height: 100px;
    margin: 0 auto;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    background: #f0f7ff;
}

.service-card.active .card-img {
    box-shadow: 0 4px 20px rgba(22, 119, 255, 0.25);
    border: 2px solid #1677ff;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-img .default-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 48px;
    color: #1677ff;
    background: #f0f7ff;
}

.card-tit {
    font-size: 14px;
    font-weight: 500;
    margin-top: 8px;
}

.mod-tits {
    text-align: center;
    font-size: 12px;
    color: #918a8a;
    padding: 5px 0;
}

/* ========== 空状态 ========== */
.empty-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
}

.empty-icon {
    font-size: 60px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 14px;
    color: #999;
}

/* ========== 表单 ========== */
.form-box {
    background: #fff;
    border-radius: 16px;
    padding: 12px 12px 5px;
    margin: 8px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.form-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 16px;
}

.form-item {
    display: flex;
    margin-bottom: 16px;
    align-items: center;
    gap: 8px;
}

.form-item:last-child {
    margin-bottom: 0;
}

.label {
    font-size: 20px;
    color: #666;
    width: 36px;
    flex-shrink: 0;
    text-align: center;
}

.input-item {
    flex: 1;
    height: 44px;
    line-height: 44px;
    background: #f7fcfd;
    border: 1px solid #e8eef8;
    border-radius: 10px;
    padding: 0 16px;
    color: #333;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s ease;
}

.input-item:active {
    background: #eef4fa;
}

.input-item input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    font-size: 14px;
    color: #333;
}

.input-item input::placeholder {
    color: #bbb;
}

.rtl .form-item {
    flex-direction: row-reverse;
}

/* ========== 服务关闭 ========== */
.service-closed {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 30px;
    background: #fff;
    border-radius: 16px;
    margin: 20px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.closed-icon {
    font-size: 72px;
    margin-bottom: 24px;
}

.closed-text {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 30px;
}

.retry-btn {
    padding: 12px 48px;
    background: #1677ff;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.retry-btn:active {
    opacity: 0.8;
    transform: scale(0.95);
}

/* ========== 底部 ========== */
.blank {
    height: 20px;
}

/* ========== 底部操作栏 ========== */
.bottom-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    z-index: 20;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.04);
}

.btn-contact {
    flex: 0 0 auto;
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid #e0e0e0;
    background: #f5f5f5;
    color: #666;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-contact:active {
    transform: scale(0.95);
}

.btn-next {
    flex: 1;
    padding: 10px 20px;
    border-radius: 24px;
    border: none;
    background: #1677ff;
    color: #fff;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-next:active {
    transform: scale(0.97);
    opacity: 0.8;
}

.btn-next.disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-next.disabled:active {
    transform: none;
    opacity: 0.6;
}

/* ========== Toast容器 ========== */
.toast-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999;
    pointer-events: none;
}

/* ========== 响应式 ========== */
@media (min-width: 768px) {
    .page-wrap {
        max-width: 420px;
        margin: 0 auto;
        box-shadow: 0 0 30px rgba(0,0,0,0.08);
    }
    
    .bottom-actions {
        max-width: 420px;
        left: 50%;
        transform: translateX(-50%);
        border-radius: 0 0 16px 16px;
    }
    
    .header {
        border-radius: 0 0 16px 16px;
    }
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    html, body, .page-wrap {
        background: #1a1a2e;
    }
    
    .form-box {
        background: #16213e;
        border-color: #2a3a5a;
    }
    
    .form-title {
        color: #e0e0e0;
    }
    
    .input-item {
        background: #1a2744;
        border-color: #2a3a5a;
        color: #e0e0e0;
    }
    
    .input-item input {
        color: #e0e0e0;
    }
    
    .input-item input::placeholder {
        color: #666;
    }
    
    .bottom-actions {
        background: #16213e;
        border-color: #2a3a5a;
    }
    
    .btn-contact {
        background: #1a2744;
        border-color: #2a3a5a;
        color: #aaa;
    }
    
    .service-mod {
        background: #16213e;
    }
    
    .head-mod {
        background: #16213e;
        border-color: #2a3a5a;
    }
    
    .cate-item {
        background: #1a2744;
        color: #aaa;
    }
    
    .cate-item.active {
        background: #1677ff;
        color: #fff;
    }
    
    .service-closed {
        background: #16213e;
    }
    
    .closed-text {
        color: #aaa;
    }
    
    .datetime-panel {
        background: #16213e;
    }
    
    .datetime-title {
        color: #e0e0e0;
    }
    
    .datetime-header {
        border-color: #2a3a5a;
    }
    
    .card-img {
        background: #1a2744;
    }
    
    .card-img .default-icon {
        background: #1a2744;
    }
}