:root {
    --primary: #E53935;
    --primary-dark: #C62828;
    --primary-light: #EF5350;
    --bg: #F8F8F8;
    --card-bg: #FFFFFF;
    --text-primary: #212121;
    --text-secondary: #757575;
    --text-hint: #BDBDBD;
    --border: #EEEEEE;
    --divider: #F0F0F0;
    --success: #4CAF50;
    --warning: #FF9800;
    --error: #F44336;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --radius: 8px;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--text-primary);
    background: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--primary);
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
}

/* 布局容器 */
.container {
    max-width: 750px;
    margin: 0 auto;
    padding: 0 12px;
    min-height: 100vh;
    background: var(--bg);
    position: relative;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 12px;
    margin-bottom: 10px;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    line-height: 40px;
}

.btn-primary {
    background: var(--primary);
    color: #FFFFFF;
}

.btn-primary:active {
    background: var(--primary-dark);
}

.btn-outline {
    background: #FFFFFF;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
    line-height: 32px;
}

.btn-disabled {
    background: var(--text-hint);
    color: #FFFFFF;
    cursor: not-allowed;
}

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

.form-label {
    display: block;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-control {
    width: 100%;
    height: 40px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-primary);
    background: #FFFFFF;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
}

textarea.form-control {
    height: auto;
    min-height: 80px;
    padding: 10px 12px;
    resize: vertical;
}

select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%23757575'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

/* Tab导航样式 */
.tabs {
    display: flex;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tab-item {
    flex: 1;
    min-width: 60px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    transition: color 0.2s;
}

.tab-item.active {
    color: var(--primary);
    font-weight: 600;
}

.tab-item.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 24px;
    height: 3px;
    background: var(--primary);
    border-radius: 2px;
}

/* 列表样式 */
.list-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid var(--divider);
}

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

.list-item-thumb {
    width: 100px;
    height: 80px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    margin-right: 10px;
    background: var(--border);
}

.list-item-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.list-item-title {
    font-size: 15px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.list-item-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-secondary);
}

.list-item-price {
    color: var(--primary);
    font-size: 16px;
    font-weight: 600;
}

/* 搜索框样式 */
.search-bar {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: 20px;
    padding: 0 12px;
    height: 36px;
    margin: 8px 0;
}

.search-bar input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    background: transparent;
}

.search-bar .search-icon {
    width: 18px;
    height: 18px;
    fill: var(--text-hint);
    margin-right: 6px;
}

/* 头部导航 */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--primary);
    color: #FFFFFF;
    padding: 0 12px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-title {
    font-size: 18px;
    font-weight: 600;
}

.header a {
    color: #FFFFFF;
}

/* 底部Tab */
.footer-tabs {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    height: 52px;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    border-top: 1px solid var(--border);
    z-index: 100;
}

.footer-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-decoration: none;
    padding-top: 2px;
    line-height: 1.2;
}

.footer-tab.active {
    color: var(--primary);
}

.footer-tab-icon {
    font-size: 22px;
    margin-bottom: 2px;
}

.footer-tab-publish {
    background: var(--primary);
    color: #FFFFFF;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-top: -20px;
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
}

/* 轮播 */
.swiper-container {
    width: 100%;
    border-radius: var(--radius);
    overflow: hidden;
}

.swiper-slide img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

/* 栏目图标网格 */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    padding: 12px 0;
}

.category-grid-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-primary);
}

.category-grid-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 6px;
}

.category-grid-name {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 统计数据 */
.stats-row {
    display: flex;
    justify-content: space-around;
    padding: 6px 0;
    text-align: center;
}

.stats-item-value {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
    line-height: 1.2;
}

.stats-item-label {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-hint);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state-text {
    font-size: 14px;
}

/* Toast */
.toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #FFFFFF;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
}

/* 图片上传区域 */
.upload-area {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.upload-item {
    width: 80px;
    height: 80px;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

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

.upload-item .remove-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    color: #FFFFFF;
    border: none;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.upload-add {
    width: 80px;
    height: 80px;
    border: 1px dashed var(--text-hint);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--text-hint);
    cursor: pointer;
}

/* 加载更多 */
.load-more {
    text-align: center;
    padding: 16px;
    color: var(--text-secondary);
    font-size: 13px;
}

.load-more.loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

.load-more.error {
    color: var(--error);
}

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

/* 页面底部留白（给固定底部Tab腾空间） */
.page-bottom {
    height: 60px;
}

/* 底部ICP备案号 */
.site-icp {
    text-align: center;
    padding: 8px 12px 70px;  /* 底部留70px避开固定底栏 */
    font-size: 12px;
    background: var(--bg);
}
.site-icp a {
    color: var(--text-secondary);
    text-decoration: none;
}
.site-icp a:hover {
    color: var(--primary);
}

/* 凌云商家卡片网格 */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.shop-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.shop-card:active {
    opacity: 0.85;
}

.shop-card-img {
    width: 100%;
    height: 130px;
    overflow: hidden;
    background: var(--border);
}

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

.shop-card-body {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.shop-card-title {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 6px;
}

.shop-card-price {
    font-size: 15px;
    font-weight: 600;
    color: var(--primary);
}

/* ===== 详情页图片轮播 ===== */
.detail-carousel {
    position: relative;
    width: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: var(--border);
}

.detail-carousel-track {
    display: flex;
    width: 100%;
    height: 220px;
    transition: transform 0.35s ease;
}

.detail-carousel-slide {
    min-width: 100%;
    height: 100%;
    flex-shrink: 0;
}

.detail-carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.detail-carousel-dots {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 2;
}

.detail-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s;
}

.detail-carousel-dot.active {
    background: #fff;
    width: 20px;
    border-radius: 4px;
}

/* 凌云商家详情轮播 - 图片完整显示 */
.detail-carousel-deal {
    background: #333;
}
.detail-carousel-deal .detail-carousel-track {
    height: auto;
    max-height: 500px;
}
.detail-carousel-deal .detail-carousel-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #333;
}
.detail-carousel-deal .detail-carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: contain;
}

/* 凌云商家拨打按钮（卡片内） */
.btn-call-deal {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius);
    white-space: nowrap;
}
.btn-call-deal:active { background: var(--primary-dark); }

/* 凌云商家底部固定拨打条 */
.deal-call-bar {
    position: fixed;
    bottom: 52px; /* 底部Tab上方 */
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 750px;
    z-index: 90;
    padding: 0 12px;
    pointer-events: none;
}

.deal-call-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    background: linear-gradient(135deg, #FF6B35, #E53935);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1px;
    border-radius: var(--radius);
    box-shadow: 0 4px 16px rgba(229, 57, 53, 0.4);
    text-decoration: none;
    pointer-events: auto;
    animation: callPulse 2s ease-in-out infinite;
}
.deal-call-btn:active {
    box-shadow: 0 2px 8px rgba(229, 57, 53, 0.4);
    transform: scale(0.98);
}

@keyframes callPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(229, 57, 53, 0.4); }
    50% { box-shadow: 0 4px 24px rgba(229, 57, 53, 0.6), 0 0 30px rgba(255, 107, 53, 0.15); }
}

/* 标签 */
.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.tag-top {
    background: #FFF3E0;
    color: #E65100;
}

.tag-hot {
    background: #FCE4EC;
    color: #C62828;
}

.tag-new {
    background: #E8F5E9;
    color: #2E7D32;
}

/* 消息徽标 */
.badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    background: var(--primary);
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* 显示号码按钮 */
.phone-reveal-btn {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    color: var(--primary);
    background: rgba(229, 57, 53, 0.08);
    border: 1px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.phone-reveal-btn:active {
    background: rgba(229, 57, 53, 0.15);
}

/* 数学验证弹窗遮罩 */
.math-quiz-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* 数学验证弹窗卡片 */
.math-quiz-popup {
    background: #fff;
    border-radius: 12px;
    padding: 28px 24px 20px;
    width: 100%;
    max-width: 320px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    text-align: center;
}

.math-quiz-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.math-quiz-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 18px;
}

.math-quiz-question {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.math-quiz-input {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 18px;
    text-align: center;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    -moz-appearance: textfield;
}
.math-quiz-input::-webkit-inner-spin-button,
.math-quiz-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.math-quiz-input:focus {
    border-color: var(--primary);
}

.math-quiz-error {
    margin-top: 8px;
    font-size: 13px;
    color: var(--error);
    text-align: center;
}

.math-quiz-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.math-quiz-btn {
    flex: 1;
    height: 40px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}
.math-quiz-btn:active { opacity: 0.8; }

.math-quiz-btn-cancel {
    background: var(--border);
    color: var(--text-secondary);
}

.math-quiz-btn-submit {
    background: var(--primary);
    color: #fff;
}

/* ===== 视频嵌入 ===== */
.video-iframe-wrap {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}
.video-iframe-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== 右下角悬浮菜单 ===== */
.float-btns {
    position: fixed;
    bottom: 90px;
    right: 16px;
    z-index: 99;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.float-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: all 0.2s;
}
.float-btn:active {
    transform: scale(0.92);
}

.float-btn-service {
    background: #fff;
    color: var(--primary);
    font-size: 14px;
    font-weight: 600;
    width: 48px;
    height: 48px;
}
.float-btn-service:hover {
    background: #FFF5F5;
}

.float-btn-top {
    background: var(--primary);
    color: #fff;
}
.float-btn-top:hover {
    background: var(--primary-dark);
}

/* ===== 客服微信弹窗 ===== */
.service-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
}
.service-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.service-popup {
    background: #fff;
    border-radius: 16px;
    padding: 32px 28px 24px;
    width: 100%;
    max-width: 300px;
    text-align: center;
    position: relative;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}

.service-close {
    position: absolute;
    top: 8px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 24px;
    color: var(--text-hint);
    cursor: pointer;
    line-height: 1;
}
.service-close:active { color: var(--text-primary); }

.service-qr {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    display: block;
    margin: 0 auto 16px;
    border: 1px solid var(--border);
    object-fit: contain;
}

.service-wechat-id {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.service-copy-btn {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    color: var(--primary);
    background: rgba(229,57,53,0.08);
    border: 1px solid var(--primary);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}
.service-copy-btn:active {
    background: rgba(229,57,53,0.15);
}
.service-copy-btn.copied {
    background: var(--success);
    color: #fff;
    border-color: var(--success);
}

.service-tip {
    font-size: 12px;
    color: var(--text-hint);
    margin: 0;
}
