/* by cursor */
/* 全局样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 14px;
}

.mobile-app {
    max-width: 100%;
    margin: 0;
    background: white;
    height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: none;
}

/* 顶部导航栏 */
.app-header {
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(255,102,0,0.3);
    padding: 12px 12px 9px 12px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mobile-app > .app-header {
    align-self: stretch;
    flex-shrink: 0;
}

/* 首页有「⋯」时去掉右侧大块留白，让按钮贴近屏幕右缘（仍保留安全区与少量触控边距） */
.app-header.bld-header-trim-pad-r {
    padding-right: max(4px, env(safe-area-inset-right, 0px));
}

/* 新头部搜索条（整行必须撑满宽度，避免晚插入第三列后整行缩成 max-content） */
.header-search-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* 搜索区占满中间剩余宽度（勿对 form 写 width:0，部分 WebKit 会算成整行 max-content 缩窄） */
.header-search-bar .header-input-wrap {
    flex: 1 1 0%;
    min-width: 0;
}

.header-more-wrap {
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-more-wrap.header-more-wrap--off {
    display: none !important;
}

.header-more-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.header-more-btn i {
    font-size: 18px;
    line-height: 1;
}

.header-more-btn:active {
    background: rgba(255, 255, 255, 0.32);
}

.header-more-menu {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 148px;
    padding: 6px 0;
    margin: 0;
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
    z-index: 1100;
}

.header-more-menu.is-open {
    display: block;
}

.header-more-menu-item {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    text-align: left;
    font-size: 15px;
    color: #333;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.header-more-menu-item:active {
    background: #f5f5f5;
}

.header-location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    padding: 8px 10px;
    border-radius: 18px;
    font-size: 13px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: 42%;
}

.header-location #headerRegionName {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.header-location i:first-child { font-size: 14px; flex-shrink: 0; }
.header-location i:last-child { font-size: 12px; opacity: .9; flex-shrink: 0; }

.header-input-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    padding: 8px 8px;
    border-radius: 22px;
    position: relative;
    overflow: hidden;
}

.header-input-wrap i { color: #999; font-size: 14px; }
.header-input-wrap input {
    border: none;
    outline: none;
    font-size: 13px;
    width: 100%;
    min-width: 0;
    padding: 0 88px 0 6px;
    text-overflow: ellipsis;
}

.header-search-btn {
    display: none;
}

.header-search-inner-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: #ff6b3b;
    color: #fff;
    border: none;
    padding: 6px 10px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

.location {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
}

.location i:first-child {
    color: #fff;
    font-size: 14px;
}

.location i:last-child {
    font-size: 12px;
    opacity: 0.8;
}

.search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255,255,255,0.2);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-btn:hover {
    background: rgba(255,255,255,0.3);
}

.search-btn i {
    font-size: 14px;
}

/* 主内容区域 */
.app-content {
    padding: 0 0 80px 0;
    background: #f5f5f5;
    flex: 1 1 auto;
    overflow-y: auto;
}

/* 服务分类网格 */
.service-grid {
    background: linear-gradient(180deg, rgba(255,255,255,0.98) 0%, rgba(255,255,255,0.92) 100%);
    margin-bottom: 8px;
    padding: 10px 8px 4px 8px;
    border-radius: 12px;
    height: auto;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px 10px 8px;
    background: linear-gradient(90deg, rgba(255,102,0,0.12), rgba(255,102,0,0.06));
    border-radius: 8px;
}

.section-title i {
    color: #ff6600;
    font-size: 16px;
}

.section-title span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.service-grid .section-title {
    justify-content: space-between;
}

.home-svc-more {
    margin-left: auto;
    font-size: 12px;
    font-weight: 400;
    color: #ff6600;
    text-decoration: none;
    cursor: pointer;
}

.grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 6px;
    height: auto;
    align-content: flex-start;
}

.grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px;
    text-align: center;
    cursor: pointer;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    transition: transform .12s ease;
    flex: 0 0 calc((100% - 24px) / 5);
}

.grid-item:nth-child(4n) { }
.grid-item:nth-child(n+21) { }

.grid-item:hover {
    transform: translateY(-1px);
}

.grid-item i {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    margin-bottom: 6px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    background: linear-gradient(135deg, #ff8a3d, #ff5a3d);
    box-sizing: border-box;
}

.grid-item span {
    font-size: 11px;
    color: #333;
    line-height: 1.2;
    word-break: break-all;
}

.grid-item.highlight {
    color: #ff6600;
}

.grid-item.highlight i {
    background: linear-gradient(135deg, #ffd666, #ff9f1a);
}

.grid-item.highlight span {
    color: #ff6600;
}

/* 彩色图标渐变（循环一些颜色，提升设计感） */
.grid-item:nth-child(8n+1) i { background: linear-gradient(135deg, #FF6A88, #FF99AC); }
.grid-item:nth-child(8n+2) i { background: linear-gradient(135deg, #4FACFE, #00F2FE); }
.grid-item:nth-child(8n+3) i { background: linear-gradient(135deg, #43E97B, #38F9D7); }
.grid-item:nth-child(8n+4) i { background: linear-gradient(135deg, #FAD961, #F76B1C); }
.grid-item:nth-child(8n+5) i { background: linear-gradient(135deg, #A18CD1, #FBC2EB); }
.grid-item:nth-child(8n+6) i { background: linear-gradient(135deg, #84FAB0, #8FD3F4); }
.grid-item:nth-child(8n+7) i { background: linear-gradient(135deg, #FCCF31, #F55555); }
.grid-item:nth-child(8n+8) i { background: linear-gradient(135deg, #5EE7DF, #B490CA); }

/* 推荐内容区域 */
.recommendations {
    background: white;
    margin-bottom: 8px;
}

/* 商品展示区域 */
.product-showcase {
    background: #f5f5f5;
    padding: 12px 8px;
    margin-bottom: 8px;
}

.showcase-container {
    display: flex;
    gap: 8px;
    margin-top: 5px;
}

.showcase-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.showcase-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 左列卡片高度调整 - 改为自适应，最小高度 */
.showcase-left .product-card:first-child {
    min-height: 200px;
}

.showcase-left .product-card:last-child {
    min-height: 220px;
}

.showcase-left .product-card:nth-child(2) {
    min-height: 210px;
}

/* 右列卡片高度 - 改为自适应 */
.showcase-right .product-card {
    min-height: 210px;
}

.product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

.card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
    flex-shrink: 0;
}

.card-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 左列卡片图片高度调整 - 统一高度，减少空白 */
.showcase-left .product-card:first-child .card-image img {
    height: 160px;
    object-fit: cover;
}

.showcase-left .product-card:last-child .card-image img {
    height: 160px;
    object-fit: cover;
}

.showcase-left .product-card:nth-child(2) .card-image img {
    height: 160px;
    object-fit: cover;
}

/* 右列卡片图片高度 - 统一高度 */
.showcase-right .product-card .card-image img {
    height: 160px;
    object-fit: cover;
}

.category-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.card-content {
    padding: 10px 12px;
    min-height: auto;
}

.card-content:empty {
    display: none;
}

.card-desc {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-desc:empty {
    display: none;
}

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

.price {
    font-size: 14px;
    font-weight: 600;
    color: #ff4757;
}

.action-tag {
    background: #f1f2f6;
    color: #666;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
}

.recommendation-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 6px;
    height: auto;
    align-content: flex-start;
}

.recommendation-card {
    padding: 14px 6px;
    cursor: pointer;
    text-align: center;
    min-height: 96px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    transition: transform .12s ease;
}

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

.card-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.card-header i {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #fff;
    font-size: 18px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    background: linear-gradient(135deg, #ff8a3d, #ff5a3d);
}

.card-header span {
    font-size: 11px;
    font-weight: 500;
    color: #333;
}

/* 推荐卡片图标渐变与服务网格保持一致风格 */
.recommendation-card:nth-child(3n+1) .card-header i { background: linear-gradient(135deg, #4FACFE, #00F2FE); }
.recommendation-card:nth-child(3n+2) .card-header i { background: linear-gradient(135deg, #43E97B, #38F9D7); }
.recommendation-card:nth-child(3n+3) .card-header i { background: linear-gradient(135deg, #FAD961, #F76B1C); }

.card-content h4 {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    text-align: center;
}

.card-content p {
    font-size: 10px;
    color: #666;
    line-height: 1.3;
    text-align: center;
}

/* 发布按钮区域 */
.publish-section {
    padding: 20px 16px;
    background: white;
    margin-bottom: 8px;
    text-align: center;
}

.publish-btn {
    background: linear-gradient(135deg, #ff6600 0%, #ff8533 100%);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 15px rgba(255,102,0,0.3);
}

.publish-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255,102,0,0.4);
}

.publish-btn i {
    font-size: 18px;
}

/* 底部导航栏 - 已移至common.css统一管理，此处保留注释以便参考 */
/*
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    transform: none;
    width: 100%;
    max-width: none;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 8px 0 8px 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: color 0.2s ease;
    position: relative;
    flex: 1 1 0;
    padding-bottom: 8px;
}

.nav-item i {
    font-size: 20px;
    color: #999;
}

.nav-item span {
    font-size: 10px;
    color: #999;
}

.nav-item.active i,
.nav-item.active span {
    color: #ff6600;
}
*/

.badge {
    position: absolute;
    top: 4px;
    right: 8px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

/* 中间悬浮按钮样式 - 已移至common.css统一管理，此处保留注释以便参考 */
/*
.nav-center {
    position: relative;
    flex: 0 0 96px;
}

.center-btn {
    position: absolute;
    left: 50%;
    top: -20px;
    transform: translateX(-50%);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: #fff;
    color: #999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    margin: 0;
    line-height: 1;
}

/* 发布按钮图标样式已移至common.css统一管理 */
/*
.center-btn i { 
    font-size: 24px; 
    line-height: 1;
    display: inline-block;
    color: #999;
}
*/

/* 发布按钮文字样式已移至common.css统一管理 */
/*
.center-label {
    display: block;
    margin-top: 36px;
    font-size: 11px;
    font-weight: 600;
    color: #ff6600;
}
*/
*/

/* 小程序环境下隐藏回退按钮（在小程序 webview 中，使用小程序自带的返回键） */
.miniapp-env .order-header .btn-back {
    display: none !important;
}

.miniapp-env .publish-header .btn-back {
    display: none !important;
}

/* 模态框样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
    justify-content: center;
    align-items: flex-end;
    z-index: 2000;
    backdrop-filter: blur(5px);
}

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

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

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

.search-header {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    gap: 12px;
}

.search-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease;
}

.search-input:focus {
    border-color: #ff6600;
}

.search-close,
.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    padding: 8px;
}

.search-content {
    padding: 16px;
}

.search-suggestions h4 {
    font-size: 14px;
    color: #333;
    margin-bottom: 12px;
}

.suggestion-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag {
    background: #f0f0f0;
    color: #666;
    padding: 8px 12px;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.tag:hover {
    background: #ff6600;
    color: white;
}

/* 发布模态框 */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
}

.modal-header h3 {
    font-size: 16px;
    color: #333;
    margin: 0;
}

.modal-body {
    padding: 16px;
}

.publish-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.option-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #f8f8f8;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.option-btn:hover {
    background: #ff6600;
    color: white;
}

.option-btn i {
    font-size: 24px;
    color: #ff6600;
    transition: color 0.2s ease;
}

.option-btn:hover i {
    color: white;
}

.option-btn span {
    font-size: 13px;
    font-weight: 500;
}

/* 服务模态框 */
.service-modal .modal-body {
    padding: 20px;
}

.service-content {
    line-height: 1.6;
}

/* 响应式设计 */
@media (max-width: 375px) {
    .grid-item {
        padding: 12px 6px;
    }
    
    .grid-item i {
        font-size: 20px;
    }
    
    .grid-item span {
        font-size: 11px;
    }
    
    .recommendation-card {
        padding: 12px 8px;
        min-height: 100px;
    }
    
    .card-header i {
        font-size: 18px;
    }
    
    .card-header span {
        font-size: 11px;
    }
    
    .card-content h4 {
        font-size: 12px;
    }
    
    .card-content p {
        font-size: 10px;
    }
}

@media (max-width: 320px) {
    .grid-item {
        padding: 10px 4px;
    }
    
    .grid-item i {
        font-size: 18px;
    }
    
    .grid-item span {
        font-size: 10px;
    }
    
    .recommendation-card {
        padding: 10px 6px;
        min-height: 90px;
    }
    
    .card-header i {
        font-size: 16px;
    }
    
    .card-header span {
        font-size: 10px;
    }
    
    .card-content h4 {
        font-size: 11px;
    }
    
    .card-content p {
        font-size: 9px;
    }
    
    .publish-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    /* 底部菜单样式已移至common.css统一管理 */
    /*
    .nav-item i {
        font-size: 18px;
    }
    
    .nav-item span {
        font-size: 10px;
    }
    */
}

/* 触摸优化 */
.grid-item,
.recommendation-card,
/* .nav-item, */ /* 底部菜单样式已移至common.css统一管理 */
.publish-btn,
.option-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* 滚动优化 */
.app-content {
    -webkit-overflow-scrolling: touch;
}

/* 安全区域适配 */
@supports (padding: max(0px)) {
    /* 底部菜单样式已移至common.css统一管理 */
    /*
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    */
    */
    
    .app-header {
        padding-top: calc(12px + env(safe-area-inset-top));
    }
}

/* 加载动画 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #ff6600;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 16px;
    margin-bottom: 8px;
    color: #666;
}

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

/* 工具提示 */
.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}

/* 按钮状态 */
.btn:active {
    transform: scale(0.98);
}

/* 焦点样式 */
button:focus,
input:focus,
select:focus {
    outline: 2px solid #ff6600;
    outline-offset: 2px;
}

/* 选择文本样式 */
::selection {
    background: #ff6600;
    color: white;
}

::-moz-selection {
    background: #ff6600;
    color: white;
}
