/* ============ Reset & Base ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --primary: #1890ff;
    --primary-dark: #096dd9;
    --primary-light: #e6f7ff;
    --accent: #ff7a45;
    --text-dark: #1f1f1f;
    --text-mid: #595959;
    --text-light: #8c8c8c;
    --border: #e8e8e8;
    --bg: #f5f7fa;
    --white: #ffffff;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 32px rgba(24, 144, 255, 0.18);
    --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
        "Hiragino Sans GB", "Segoe UI", Roboto, sans-serif;
    color: var(--text-dark);
    background-color: var(--bg);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; outline: none; background: none; }

/* ============ Header ============ */
.header {
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    height: 68px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.3px;
}

.logo::before { content: "🏙"; font-size: 26px; }

.nav { display: flex; align-items: center; gap: 8px; }

.nav a {
    padding: 8px 16px;
    font-size: 15px;
    color: var(--text-mid);
    font-weight: 500;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav a:hover { color: var(--primary); background-color: var(--primary-light); }
.nav a.active { color: var(--primary); }

.btn-post {
    background-color: var(--primary);
    color: var(--white) !important;
    padding: 9px 20px !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    box-shadow: 0 2px 6px rgba(24, 144, 255, 0.3);
    transition: all 0.25s ease;
}

.btn-post:hover {
    background-color: var(--primary-dark) !important;
    color: var(--white) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 144, 255, 0.4);
}

.nav-mobile-toggle { display: none; font-size: 24px; color: var(--text-dark); }

/* ============ Hero ============ */
.hero {
    background: linear-gradient(135deg, #1890ff 0%, #36cfc9 100%);
    padding: 64px 24px 96px;
    color: var(--white);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: ""; position: absolute; top: -40%; right: -10%;
    width: 500px; height: 500px;
    background: rgba(255, 255, 255, 0.08); border-radius: 50%;
}

.hero::after {
    content: ""; position: absolute; bottom: -50%; left: -10%;
    width: 400px; height: 400px;
    background: rgba(255, 255, 255, 0.06); border-radius: 50%;
}

.hero-content { max-width: 880px; margin: 0 auto; position: relative; z-index: 1; }

.hero h1 {
    font-size: 38px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.hero p { font-size: 17px; opacity: 0.92; margin-bottom: 32px; }

.search-bar {
    display: flex;
    background-color: var(--white);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-width: 760px;
    margin: 0 auto;
}

.search-bar input {
    flex: 1; border: none; outline: none;
    padding: 14px 18px;
    font-size: 16px; color: var(--text-dark);
    background: transparent; font-family: inherit;
}

.search-bar input::placeholder { color: var(--text-light); }

.search-btn {
    background-color: var(--primary);
    color: var(--white);
    padding: 0 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    display: flex; align-items: center; gap: 6px;
}

.search-btn:hover { background-color: var(--primary-dark); }

/* ============ Filters ============ */
.filters-wrap {
    max-width: 1280px;
    margin: -48px auto 0;
    padding: 0 24px;
    position: relative;
    z-index: 2;
}

.filters {
    background-color: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 20px 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
}

.filter-group {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1; min-width: 140px;
}

.filter-group label {
    font-size: 12px; color: var(--text-light);
    font-weight: 600; letter-spacing: 0.5px;
}

.filter-group select {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-dark);
    background-color: var(--white);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpath fill='%23595959' d='M6 8L0 0h12z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

.filter-group select:hover,
.filter-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.12);
}

.filter-apply,
.filter-reset {
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.filter-apply {
    background-color: var(--primary);
    color: var(--white);
}
.filter-apply:hover { background-color: var(--primary-dark); }

.filter-reset { color: var(--primary); }
.filter-reset:hover { background-color: var(--primary-light); }

/* ============ Ticker ============ */
.ticker { max-width: 1280px; margin: 32px auto 0; padding: 0 24px; }

.ticker-bar {
    display: flex; align-items: center;
    background: linear-gradient(90deg, #e6f7ff 0%, #f0f9ff 50%, #e6fffb 100%);
    border: 1px solid #bae7ff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(24, 144, 255, 0.06);
}

.ticker-label {
    flex-shrink: 0;
    display: flex; align-items: center; gap: 6px;
    background-color: var(--primary);
    color: var(--white);
    padding: 10px 18px;
    font-size: 13px; font-weight: 600;
    letter-spacing: 0.3px;
    z-index: 2;
}

.ticker-label::before { content: "📢"; font-size: 14px; }

.ticker-viewport {
    flex: 1; overflow: hidden; position: relative;
    -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
    mask-image: linear-gradient(90deg, transparent 0, #000 48px, #000 calc(100% - 48px), transparent 100%);
}

.ticker-track {
    display: flex; width: max-content;
    animation: ticker-scroll 36s linear infinite;
}

.ticker-viewport:hover .ticker-track { animation-play-state: paused; }

.ticker-item {
    flex-shrink: 0;
    display: inline-flex; align-items: center;
    padding: 10px 28px;
    font-size: 14px;
    color: var(--text-dark);
    white-space: nowrap;
    border-right: 1px dashed rgba(24, 144, 255, 0.25);
}

.ticker-item strong { color: var(--primary); font-weight: 600; margin-left: 4px; }
.ticker-item .price { color: var(--accent); font-weight: 700; margin-left: 4px; }

@keyframes ticker-scroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

/* ============ Listings ============ */
.listings { max-width: 1280px; margin: 0 auto; padding: 48px 24px 64px; }

.section-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}

.section-head h2 {
    font-size: 26px; font-weight: 700; letter-spacing: -0.3px;
}

.section-head h2 small {
    font-size: 14px; font-weight: 400; color: var(--text-light); margin-left: 8px;
}

.empty-state {
    text-align: center;
    padding: 80px 24px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    color: var(--text-mid);
}

.empty-state .icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; color: var(--text-dark); margin-bottom: 8px; }
.empty-state p { font-size: 14px; color: var(--text-light); }

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 1180px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 880px)  { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px)  { .grid { grid-template-columns: 1fr; } }

/* ============ Card ============ */
.card {
    background-color: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex; flex-direction: column;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #f0f0f0;
}

.card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-image img { transform: scale(1.06); }

.badge {
    position: absolute; top: 12px; left: 12px;
    background-color: var(--accent);
    color: var(--white);
    padding: 4px 10px;
    font-size: 12px; font-weight: 600;
    border-radius: 4px; letter-spacing: 0.3px;
}

.card-body {
    padding: 16px 18px 18px;
    display: flex; flex-direction: column;
    flex: 1;
}

.card-price {
    font-size: 22px; font-weight: 700;
    color: var(--primary); margin-bottom: 6px;
    letter-spacing: -0.3px;
}

.card-price small { font-size: 13px; font-weight: 500; color: var(--text-light); }

.card-title {
    font-size: 15px; font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 10px; line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    font-size: 13px; color: var(--text-mid);
    margin-bottom: 12px;
    display: flex; align-items: center; gap: 6px;
}
.card-meta::before { content: "📍"; font-size: 13px; }

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }

.tag {
    font-size: 12px; padding: 3px 10px; border-radius: 4px; font-weight: 500;
    background-color: var(--primary-light); color: var(--primary);
}
.tag.tag-green  { background-color: #f6ffed; color: #389e0d; }
.tag.tag-orange { background-color: #fff7e6; color: #d46b08; }
.tag.tag-purple { background-color: #f9f0ff; color: #722ed1; }

/* ============ Detail page ============ */
.detail { max-width: 1080px; margin: 0 auto; padding: 32px 24px 64px; }

.detail-breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 16px;
}
.detail-breadcrumb a { color: var(--primary); }
.detail-breadcrumb a:hover { text-decoration: underline; }

.gallery {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    grid-template-rows: 200px 200px;
    gap: 8px;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
}

.gallery img {
    width: 100%; height: 100%; object-fit: cover;
    transition: opacity 0.2s ease;
}

.gallery a:hover img { opacity: 0.9; }

.gallery .main-img { grid-row: 1 / 3; height: 408px; }
.gallery .single   { grid-column: 1 / -1; grid-row: 1 / 3; height: 408px; }

@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        grid-template-rows: 240px;
    }
    .gallery .main-img, .gallery .single { grid-row: 1; height: 240px; }
    .gallery .thumb { display: none; }
}

.detail-body {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 32px;
}

@media (max-width: 880px) { .detail-body { grid-template-columns: 1fr; } }

.detail-main h1 {
    font-size: 26px;
    margin-bottom: 8px;
    letter-spacing: -0.3px;
}

.detail-meta-row {
    color: var(--text-mid);
    font-size: 14px;
    margin-bottom: 16px;
    display: flex; flex-wrap: wrap; gap: 12px;
}
.detail-meta-row span { display: inline-flex; align-items: center; gap: 4px; }

.detail-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }

.spec-grid {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px 24px;
}

.spec-grid dt { font-size: 12px; color: var(--text-light); margin-bottom: 4px; letter-spacing: 0.5px; }
.spec-grid dd { font-size: 15px; color: var(--text-dark); font-weight: 600; }

.detail-description {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 28px;
    box-shadow: var(--shadow-sm);
    line-height: 1.85;
    white-space: pre-wrap;
    font-size: 15px;
    color: #333;
}

.contact-card {
    position: sticky; top: 88px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 24px;
    align-self: start;
}

.contact-card .big-price {
    font-size: 30px;
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 4px;
}
.contact-card .big-price small {
    font-size: 14px; color: var(--text-light); font-weight: 500;
}

.contact-card .price-note {
    font-size: 13px; color: var(--text-mid); margin-bottom: 20px;
}

.contact-btn {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%;
    padding: 14px;
    font-size: 15px; font-weight: 600;
    border-radius: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    color: var(--white);
}

.contact-btn.wechat   { background-color: #07c160; }
.contact-btn.wechat:hover   { background-color: #06ad55; }
.contact-btn.whatsapp { background-color: #25d366; }
.contact-btn.whatsapp:hover { background-color: #20bd5a; }

.contact-divider {
    text-align: center;
    color: var(--text-light);
    font-size: 12px;
    margin: 16px 0 12px;
}

.disclaimer {
    margin-top: 16px;
    padding: 12px;
    background: #fffbe6;
    border: 1px solid #ffe58f;
    border-radius: 8px;
    font-size: 12px;
    color: #876800;
    line-height: 1.6;
}

/* ============ Footer ============ */
.footer {
    background-color: #001529;
    color: rgba(255, 255, 255, 0.65);
    padding: 48px 24px 24px;
    margin-top: 32px;
}

.footer-inner {
    max-width: 1280px; margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}

.footer-col h4 { color: var(--white); font-size: 15px; margin-bottom: 16px; font-weight: 600; }
.footer-col p  { font-size: 13px; line-height: 1.7; margin-bottom: 8px; }
.footer-col ul { list-style: none; }
.footer-col ul li { font-size: 13px; margin-bottom: 8px; }
.footer-col ul li a { transition: color 0.2s ease; }
.footer-col ul li a:hover { color: var(--primary); }

.footer-bottom {
    max-width: 1280px; margin: 0 auto;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px; text-align: center;
}

@media (max-width: 880px) { .footer-inner { grid-template-columns: 1fr 1fr; gap: 28px; } }
@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }

/* ============ Responsive ============ */
@media (max-width: 768px) {
    .hero { padding: 48px 20px 80px; }
    .hero h1 { font-size: 28px; }
    .hero p  { font-size: 15px; }
    .search-bar { flex-direction: column; padding: 12px; gap: 8px; }
    .search-bar input { padding: 12px 14px; }
    .search-btn { padding: 14px; justify-content: center; width: 100%; }
    .nav { gap: 4px; }
    .nav a:not(.btn-post) { display: none; }
    .nav-mobile-toggle { display: block; }
    .section-head h2 { font-size: 22px; }
    .filters { padding: 16px; }
    .filter-group { flex: 1 1 calc(50% - 8px); min-width: 0; }
    .filter-apply, .filter-reset { flex: 1 1 100%; text-align: center; }
    .ticker-item { padding: 10px 18px; font-size: 13px; }
    .ticker-track { animation-duration: 28s; }
}

/* ============ Flash messages ============ */
.flash-wrap {
    max-width: 1080px; margin: 16px auto 0; padding: 0 24px;
}
.flash {
    padding: 12px 16px; border-radius: 8px;
    font-size: 14px; margin-bottom: 8px;
}
.flash.success { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.flash.error   { background: #fff1f0; color: #cf1322; border: 1px solid #ffa39e; }
.flash.info    { background: #e6f7ff; color: #096dd9; border: 1px solid #91d5ff; }
