/* ========================================
   北美楼凤网 — 小红书 1:1 复刻完整样式
   像素级匹配 xiaohongshu.com/explore
   ======================================== */

/* ===== CSS 变量 — 浅色主题 (:root) ===== */
:root {
    /* XHS 核心色彩 */
    --xhs-red: #FF2442;
    --xhs-red-dark: #E51F38;
    --xhs-red-light: #FF6B81;
    --xhs-bg: #ffffff;
    --xhs-gray-bg: #f5f5f5;
    --xhs-text: #333333;
    --xhs-text-secondary: #999999;
    --xhs-text-muted: #b0b0b0;
    --xhs-border: #f0f0f0;
    --xhs-radius: 8px;
    --xhs-nav-height: 50px;
    --xhs-tab-height: 44px;
    --xhs-font: -apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei","Helvetica Neue",sans-serif;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;

    /* 向后兼容：旧页面使用的 CSS 变量名 → 映射到浅色值 */
    --accent-gold: var(--xhs-red);
    --accent-gold-dark: var(--xhs-red-dark);
    --accent-gold-light: var(--xhs-red-light);
    --accent-gold-hover: var(--xhs-red-dark);
    --bg-primary: var(--xhs-bg);
    --bg-secondary: var(--xhs-gray-bg);
    --bg-card: var(--xhs-bg);
    --bg-tertiary: var(--xhs-gray-bg);
    --bg-hover: #f0f0f0;
    --text-primary: var(--xhs-text);
    --text-secondary: var(--xhs-text-secondary);
    --text-muted: var(--xhs-text-muted);
    --border-color: var(--xhs-border);
    --shadow-gold: 0 4px 16px rgba(255,36,66,0.12);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.08);
    --danger: #ff4d4f;
    --success: #52c41a;
    --warning: #faad14;
    --text-disabled: #cccccc;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

/* ===== Reset ===== */
*,*::before,*::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior:smooth; }
body {
    font-family: var(--xhs-font);
    background: var(--xhs-bg);
    color: var(--xhs-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}
a { text-decoration:none; color:inherit; }
img { max-width:100%; display:block; }
button { cursor:pointer; border:none; outline:none; font-family:inherit; }
input,textarea,select { font-family:inherit; outline:none; }

/* ===== 顶部导航 (XHS 1:1) ===== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--xhs-bg);
    border-bottom: 1px solid var(--xhs-border);
    height: var(--xhs-nav-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
}

.nav-brand { flex-shrink: 0; }

.nav-brand .logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--xhs-red);
}
.nav-brand .logo i { font-size: 22px; }
.nav-brand .logo span { letter-spacing: 1px; }

.nav-search {
    flex: 1;
    max-width: 480px;
    margin: 0 24px;
}

.search-form {
    display: flex;
    align-items: center;
    background: var(--xhs-gray-bg);
    border: 1.5px solid transparent;
    border-radius: 999px;
    height: 36px;
    padding: 0 4px;
    transition: all var(--transition-fast);
}
.search-form:focus-within {
    background: var(--xhs-bg);
    border-color: var(--xhs-red);
}
.search-form input[type="text"] {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0 12px;
    font-size: 14px;
    color: var(--xhs-text);
    min-width: 0;
}
.search-form input[type="text"]::placeholder { color: var(--xhs-text-muted); }
.search-form button {
    background: var(--xhs-red);
    color: #fff;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    flex-shrink: 0;
    transition: background var(--transition-fast);
}
.search-form button:hover { background: var(--xhs-red-dark); }

.nav-menu {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.nav-menu a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: var(--xhs-text);
    transition: all var(--transition-fast);
    white-space: nowrap;
}
.nav-menu a:hover { background: var(--xhs-gray-bg); color: var(--xhs-red); }
.nav-menu a i { font-size: 14px; }

/* 发布按钮 */
.nav-menu a[href*="post_ad"] {
    background: var(--xhs-red);
    color: #fff;
    font-weight: 500;
    padding: 6px 16px;
}
.nav-menu a[href*="post_ad"]:hover {
    background: var(--xhs-red-dark);
    color: #fff;
}

/* 搜索建议 */
.search-suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
    padding: 8px 0;
    display: none;
    z-index: 1001;
}
.suggestion-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--xhs-text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: background var(--transition-fast);
}
.suggestion-item:hover { background: var(--xhs-gray-bg); color: var(--xhs-text); }
.suggestion-item i { font-size: 13px; color: var(--xhs-text-muted); }

/* ===== 分类标签栏 (XHS 1:1) ===== */
.category-filter {
    position: sticky;
    top: var(--xhs-nav-height);
    z-index: 999;
    background: var(--xhs-bg);
    border-bottom: 1px solid var(--xhs-border);
    height: var(--xhs-tab-height);
    display: flex;
    align-items: center;
    padding: 0 16px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.category-filter::-webkit-scrollbar { display: none; }

.filter-title { display: none; }

.filter-items {
    display: flex;
    gap: 24px;
    height: 100%;
    align-items: center;
}

.filter-item {
    position: relative;
    font-size: 15px;
    color: var(--xhs-text-secondary);
    height: 100%;
    display: flex;
    align-items: center;
    white-space: nowrap;
    transition: color var(--transition-fast);
    cursor: pointer;
    padding: 0 2px;
}

.filter-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    border-radius: 2px;
    background: var(--xhs-red);
    transition: width var(--transition-fast);
}

.filter-item:hover { color: var(--xhs-text); }

.filter-item.active {
    color: var(--xhs-text);
    font-weight: 600;
}
.filter-item.active::after { width: 20px; }

/* ===== 城市筛选（XHS次级pill） ===== */
.city-filter {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    gap: 8px;
    background: var(--xhs-bg);
    border-bottom: 1px solid var(--xhs-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.city-filter::-webkit-scrollbar { display: none; }

.city-filter .filter-title {
    display: inline;
    font-size: 13px;
    color: var(--xhs-text-muted);
    flex-shrink: 0;
    margin-right: 4px;
}

.city-filter .filter-items {
    display: flex;
    gap: 6px;
    height: auto;
    align-items: center;
}

.city-filter .filter-item {
    font-size: 13px;
    height: auto;
    padding: 3px 12px;
    border-radius: 12px;
    background: var(--xhs-gray-bg);
    color: var(--xhs-text-secondary);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
}
.city-filter .filter-item:hover {
    background: #ffe8eb;
    color: var(--xhs-red);
}
.city-filter .filter-item.active {
    background: var(--xhs-red);
    color: #fff;
    font-weight: 500;
}
.city-filter .filter-item::after { display: none; }

/* 地区触发器 */
.region-trigger {
    cursor: pointer;
    user-select: none;
}
.region-trigger:hover {
    background: #ffe8eb;
    color: var(--xhs-red);
}

/* 城市子项 */
.filter-item-sm {
    font-size: 12px !important;
    padding: 2px 10px !important;
}

/* ===== 瀑布流容器 ===== */
.waterfall-wrap {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px;
}

/* ===== 各区段标题 ===== */
.section-label {
    font-size: 16px;
    font-weight: 600;
    color: var(--xhs-text);
    padding: 12px 0 8px;
    letter-spacing: 0.5px;
}

/* ===== 瀑布流 (XHS 1:1) ===== */
.waterfall {
    columns: 5;
    column-gap: 12px;
}

/* ===== 广告卡片 (XHS 1:1) ===== */
.ad-card {
    break-inside: avoid;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
}

.ad-card a { display: block; }

.card-img-box {
    position: relative;
    width: 100%;
    border-radius: var(--xhs-radius);
    overflow: hidden;
    background: var(--xhs-gray-bg);
}
.card-img-box img {
    width: 100%;
    display: block;
    transition: transform 0.3s ease;
    min-height: 120px;
    object-fit: cover;
}

/* 图片加载失败回退 */
.card-img-box .img-fallback {
    display: none;
    width: 100%;
    padding-bottom: 100%;
    background: linear-gradient(135deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #ccc;
}

.ad-card:hover .card-img-box img { transform: scale(1.03); }

/* 图片数量角标 */
.card-img-box .img-count {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 3px;
    line-height: 1.6;
}

/* 广告类型标签（置顶/轮播/特推） */
.card-img-box .ad-type-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    color: #fff;
    line-height: 1.6;
}
.ad-type-badge.premium  { background: var(--xhs-red); }
.ad-type-badge.spotlight { background: #FF6B35; }
.ad-type-badge.boost { background: var(--xhs-red-dark); }

/* 卡片信息区 (XHS 1:1) */
.card-info {
    padding: 6px 0 0;
}

.card-info h4 {
    font-size: 14px;
    font-weight: 400;
    color: var(--xhs-text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    margin-bottom: 4px;
}

/* XHS 卡片底部行 */
.card-footer {
    display: flex;
    align-items: center;
    height: 20px;
    margin-top: 2px;
    gap: 8px;
}

.card-footer .card-category {
    font-size: 12px;
    color: var(--xhs-text-secondary);
}

.card-footer .card-city {
    font-size: 12px;
    color: var(--xhs-text-muted);
    display: flex;
    align-items: center;
    gap: 2px;
}
.card-footer .card-city::before {
    content: '';
    display: inline-block;
    width: 1px;
    height: 10px;
    background: #ddd;
    margin-right: 4px;
}

.card-footer .card-price {
    margin-left: auto;
    font-size: 14px;
    font-weight: 700;
    color: var(--xhs-red);
}

/* 旧版 card-meta / card-price 兼容 */
.card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.card-meta span {
    font-size: 12px;
    color: var(--xhs-text-secondary);
    background: var(--xhs-gray-bg);
    padding: 1px 6px;
    border-radius: 3px;
}
.card-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--xhs-red);
}

/* ===== 跑马灯横幅 (XHS风格) ===== */
.carousel-banner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px 12px;
}
.carousel-banner .carousel-inner {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 8px;
    border-radius: var(--xhs-radius);
    scrollbar-width: none;
}
.carousel-banner .carousel-inner::-webkit-scrollbar { display: none; }
.carousel-banner .carousel-slide {
    flex: 0 0 calc(100% - 0px);
    scroll-snap-align: start;
    border-radius: var(--xhs-radius);
    overflow: hidden;
    position: relative;
    background: var(--xhs-gray-bg);
}
.carousel-banner .carousel-slide img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}
.carousel-banner .carousel-slide .slide-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    background: linear-gradient(transparent, rgba(0,0,0,0.5));
    color: #fff;
    font-size: 15px;
    font-weight: 500;
}

/* ===== 搜索结果提示 ===== */
.search-notice {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 16px 0;
    font-size: 13px;
    color: var(--xhs-text-secondary);
}
.search-notice strong { color: var(--xhs-text); }
.search-notice a { color: var(--xhs-red); margin-left: 8px; font-size: 12px; }

/* ===== 分页 (XHS风格) ===== */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px 0 48px;
}
.pagination a,.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 13px;
    color: var(--xhs-text-secondary);
    background: var(--xhs-bg);
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}
.pagination a:hover { background: #fff0f3; color: var(--xhs-red); border-color: var(--xhs-red); }
.pagination .current {
    background: var(--xhs-red);
    color: #fff;
    font-weight: 600;
    border-color: var(--xhs-red);
}
.pagination .disabled { color: #ddd; pointer-events: none; }

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 80px 16px;
    color: var(--xhs-text-secondary);
}
.empty-state .empty-icon { font-size: 56px; color: #e8e8e8; margin-bottom: 12px; }
.empty-state h3 { font-size: 16px; color: var(--xhs-text); margin-bottom: 6px; font-weight: 500; }
.empty-state p { font-size: 13px; color: var(--xhs-text-muted); }

/* ===== 回到顶部 (XHS风格) ===== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: var(--xhs-text-secondary);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s;
    z-index: 998;
    border: 1px solid #eee;
}
.back-to-top.visible { opacity:1; visibility:visible; }
.back-to-top:hover { background: var(--xhs-red); color: #fff; border-color: var(--xhs-red); }

/* ===== 页脚 (XHS风格) ===== */
.footer {
    background: var(--xhs-bg);
    border-top: 1px solid var(--xhs-border);
    padding: 36px 16px 24px;
}
.footer-content {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
}
.footer-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--xhs-text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.footer-section h4 i { color: var(--xhs-red); font-size: 12px; }
.footer-section p,.footer-section a {
    font-size: 12px;
    color: var(--xhs-text-secondary);
    line-height: 2;
}
.footer-section a { display: block; transition: color var(--transition-fast); }
.footer-section a:hover { color: var(--xhs-red); }
.footer-bottom {
    max-width: 900px;
    margin: 24px auto 0;
    padding-top: 16px;
    border-top: 1px solid var(--xhs-border);
    text-align: center;
    font-size: 11px;
    color: var(--xhs-text-muted);
}

/* ===== 详情页 (XHS风格) ===== */
.detail-container { max-width: 700px; margin: 0 auto; padding: 0 16px; }
.detail-card { background: var(--xhs-bg); }

/* 幻灯片 */
.carousel-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: var(--xhs-radius);
    user-select: none;
}
.carousel-track { display: flex; transition: transform 0.5s cubic-bezier(0.25,0.1,0.25,1); }
.carousel-slide { flex: 0 0 100%; }
.carousel-slide img { display: block; width: 100%; max-height: 460px; object-fit: contain; }
.no-image-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 280px;
    color: #ddd;
    font-size: 48px;
    background: var(--xhs-gray-bg);
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.85);
    border: none;
    border-radius: 50%;
    color: #333;
    cursor: pointer;
    font-size: 14px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    transition: all var(--transition-fast);
}
.carousel-btn:hover { background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 10px 0;
}
.carousel-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    padding: 0;
}
.carousel-dot.active { background: var(--xhs-red); width: 18px; border-radius: 3px; }

/* 网站链接按钮 */
.website-link-wrap { padding: 12px 20px; border-bottom: 1px solid var(--xhs-border); }
.website-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    background: var(--xhs-red);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background var(--transition-fast);
}
.website-link-btn:hover { background: var(--xhs-red-dark); }

/* 详情内容 */
.detail-body { padding: 20px; }
.detail-header { margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--xhs-border); }
.detail-title { color: var(--xhs-text); font-size: 22px; font-weight: 600; margin-bottom: 10px; line-height: 1.4; }
.detail-meta { display: flex; gap: 16px; flex-wrap: wrap; color: var(--xhs-text-secondary); font-size: 13px; margin-bottom: 12px; }
.detail-meta span { display: flex; align-items: center; gap: 4px; }
.detail-price { display: inline-block; font-size: 28px; font-weight: 700; color: var(--xhs-red); }
.detail-content { color: var(--xhs-text); font-size: 15px; line-height: 1.8; margin-bottom: 24px; white-space: pre-wrap; word-break: break-word; }
.detail-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.detail-tag {
    padding: 4px 12px;
    background: var(--xhs-gray-bg);
    border-radius: 12px;
    font-size: 12px;
    color: var(--xhs-text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.detail-actions { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--xhs-border); }
.detail-actions .btn {
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    cursor: pointer;
    text-decoration: none;
}
.detail-actions .btn-primary { background: var(--xhs-red); color: #fff; }
.detail-actions .btn-primary:hover { background: var(--xhs-red-dark); }
.detail-actions .btn-outline { background: #fff; color: var(--xhs-text); border: 1px solid var(--xhs-border); }
.detail-actions .btn-outline:hover { border-color: var(--xhs-red); color: var(--xhs-red); }

/* ===== 表单页面 (登录/注册/发布) ===== */
.auth-page,.post-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: var(--xhs-gray-bg);
}
.auth-card,.post-card {
    width: 100%;
    max-width: 400px;
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 36px 32px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.auth-card h2,.post-card h2 {
    font-size: 22px;
    font-weight: 600;
    color: var(--xhs-text);
    text-align: center;
    margin-bottom: 6px;
}
.auth-card .auth-subtitle {
    font-size: 13px;
    color: var(--xhs-text-secondary);
    text-align: center;
    margin-bottom: 28px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--xhs-text);
    margin-bottom: 5px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--xhs-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--xhs-text);
    background: var(--xhs-gray-bg);
    transition: all var(--transition-fast);
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--xhs-red);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(255,36,66,0.06);
}
.form-group textarea { min-height: 100px; resize: vertical; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 22px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    text-decoration: none;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--xhs-red); color: #fff; }
.btn-primary:hover { background: var(--xhs-red-dark); }
.btn-outline { background: #fff; color: var(--xhs-text); border: 1px solid var(--xhs-border); }
.btn-outline:hover { border-color: var(--xhs-red); color: var(--xhs-red); }

.auth-links {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--xhs-text-secondary);
}
.auth-links a { color: var(--xhs-red); font-weight: 500; margin: 0 3px; }
.auth-links a:hover { text-decoration: underline; }

.alert {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    margin-bottom: 16px;
}
.alert-error { background: #FFF0F0; color: #D43D3D; border: 1px solid #FFD4D4; }
.alert-success { background: #F0FFF4; color: #2D8A4E; border: 1px solid #D4FFE4; }

.field-error {
    color: #f44336;
    font-size: 12px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== 仪表盘 ===== */
.dashboard-page,.my-ads-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
}
.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.dash-header h2 { font-size: 20px; font-weight: 600; color: var(--xhs-text); }
.dash-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    border: 1px solid var(--xhs-border);
}
.dash-card-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dash-card-title { font-size: 15px; font-weight: 500; color: var(--xhs-text); margin-bottom: 4px; }
.dash-card-meta { font-size: 12px; color: var(--xhs-text-secondary); }

.badge {
    display: inline-block;
    padding: 1px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
}
.badge-active { background: #E8F5E9; color: #2D8A4E; }
.badge-pending { background: #FFF8E1; color: #F57F17; }
.badge-expired { background: #F5F5F5; color: #999; }
.badge-draft { background: #F3E5F5; color: #7B1FA2; }

/* 通用表格（管理后台列表用） */
table { width:100%; border-collapse:collapse; }
table th { text-align:left; padding:10px 12px; font-size:12px; color:var(--xhs-text-secondary); border-bottom:2px solid var(--xhs-border); text-transform:uppercase; letter-spacing:0.5px; }
table td { padding:10px 12px; font-size:13px; color:var(--xhs-text); border-bottom:1px solid var(--xhs-border); }
table tr:hover td { background:var(--xhs-gray-bg); }

/* ===== 响应式 ===== */
@media (max-width: 1600px) { .waterfall { columns: 5; } }
@media (max-width: 1400px) { .waterfall { columns: 4; } }
@media (max-width: 1100px) { .waterfall { columns: 3; } }
@media (max-width: 768px) {
    .waterfall { columns: 2; column-gap: 8px; }
    .ad-card { margin-bottom: 12px; }
    .navbar { padding: 0 12px; }
    .nav-brand .logo span { font-size: 17px; }
    .nav-brand .logo i { font-size: 18px; }
    .nav-search { margin: 0 8px; }
    .nav-menu a { font-size: 0; padding: 8px; }
    .nav-menu a i { font-size: 18px; }
    .nav-menu a[href*="post_ad"] { padding: 8px 10px; font-size: 0; }
    .category-filter { padding: 0 12px; }
    .filter-items { gap: 18px; }
    .filter-item { font-size: 14px; }
    .city-filter { padding: 6px 12px; }
    .waterfall-wrap { padding: 8px 12px; }
    .footer-content { grid-template-columns: 1fr; gap: 20px; }
    .carousel-banner .carousel-slide img { height: 140px; }
    .section-label { font-size: 15px; }
    .card-info h4 { font-size: 13px; }
    .card-footer .card-price { font-size: 13px; }
}
@media (max-width: 480px) {
    .waterfall { columns: 2; column-gap: 6px; }
    .ad-card { margin-bottom: 10px; }
}

/* ===== [data-theme="dark"] 管理员深色主题 ===== */
[data-theme="dark"] {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-card: #151515;
    --bg-tertiary: #1a1a1a;
    --bg-hover: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #999;
    --text-muted: #666;
    --border-color: #2a2a2a;
    --accent-gold: #D4AF37;
    --accent-gold-dark: #C4A030;
    --accent-gold-light: #E8C84A;
    --accent-gold-hover: #C4A030;
    --danger: #ff4d4f;
    --success: #52c41a;
    --warning: #faad14;
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.50);
    --text-disabled: #555555;
    --xhs-bg: var(--bg-primary);
    --xhs-gray-bg: var(--bg-secondary);
    --xhs-text: var(--text-primary);
    --xhs-text-secondary: var(--text-secondary);
    --xhs-text-muted: var(--text-muted);
    --xhs-border: var(--border-color);
    font-family: var(--xhs-font);
    color: var(--text-primary);
    background: var(--bg-primary);
}

[data-theme="dark"] body { background: var(--bg-primary); color: var(--text-primary); }
[data-theme="dark"] .card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 24px; }
[data-theme="dark"] a { color: var(--accent-gold); transition: color var(--transition-fast); }
[data-theme="dark"] a:hover { color: var(--accent-gold-hover); }
[data-theme="dark"] .btn-primary { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }
[data-theme="dark"] .btn-primary:hover { background: var(--accent-gold-hover); }
[data-theme="dark"] .btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 10px 14px;
    font-size: 14px;
}
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus { border-color: var(--accent-gold); outline: none; }
[data-theme="dark"] table th { color: var(--accent-gold); border-bottom-color: var(--border-color); }
[data-theme="dark"] table td { color: var(--text-secondary); border-bottom-color: var(--border-color); }
[data-theme="dark"] table tr:hover td { background: var(--bg-hover); }