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

:root {
    --bg: #ffffff;
    --text: #1a1a2e;
    --card-bg: #ffffff;
    --shadow: 0 8px 30px rgba(0,0,0,0.08);
    --accent: #e94560;
    --accent2: #0f3460;
    --radius: 16px;
    --transition: 0.3s ease;
    --border: #e0e0e0;
    --input-bg: #f5f5f5;
    --header-bg: rgba(255,255,255,0.95);
    --footer-bg: #1a1a2e;
    --footer-text: #ccc;
}

[data-theme="dark"] {
    --bg: #121212;
    --text: #e0e0e0;
    --card-bg: #1e1e1e;
    --shadow: 0 8px 30px rgba(0,0,0,0.4);
    --accent: #ff6b6b;
    --accent2: #4ecdc4;
    --border: #333;
    --input-bg: #2a2a2a;
    --header-bg: rgba(18,18,18,0.95);
    --footer-bg: #0a0a0a;
    --footer-text: #aaa;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    transition: background var(--transition), color var(--transition);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
}

.logo {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav {
    display: flex;
    gap: 24px;
}

.nav a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: color var(--transition);
}

.nav a:hover, .nav a.active {
    color: var(--accent);
}

.nav a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

.nav a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text);
    font-size: 1.1rem;
    transition: all var(--transition);
}

.icon-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.hamburger span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

/* Hero */
.hero {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    text-align: center;
    padding: 80px 20px 60px;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.4rem;
    margin-bottom: 16px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 32px;
}

.search-bar {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.search-bar input {
    flex: 1;
    padding: 16px 24px;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: #333;
}

.search-bar button {
    padding: 16px 32px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background var(--transition);
}

.search-bar button:hover {
    background: #d6384f;
}

/* Filters */
.filters {
    margin-bottom: 32px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.filter-group select {
    padding: 10px 18px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border var(--transition);
    outline: none;
}

.filter-group select:focus {
    border-color: var(--accent);
}

/* Listings Grid */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
    margin-bottom: 60px;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.12);
}

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

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
}

.card-body h3 a {
    color: var(--text);
    text-decoration: none;
}

.card-body h3 a:hover {
    color: var(--accent);
}

.location {
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.desc {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.5;
}

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

.price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.price small {
    font-size: 0.8rem;
    font-weight: 400;
    color: #888;
}

.rating {
    color: #f39c12;
    font-weight: 600;
}

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

.tag {
    background: var(--input-bg);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    color: var(--text);
    border: 1px solid var(--border);
}

/* Stats */
.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-bottom: 60px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
}

.stat-item i {
    font-size: 2.4rem;
    color: var(--accent);
    margin-bottom: 8px;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
}

/* Heatmap */
.heatmap {
    margin-bottom: 60px;
}

.heatmap h2 {
    text-align: center;
    margin-bottom: 24px;
    font-size: 1.8rem;
}

.heatmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
}

.heatmap-cell {
    background: var(--input-bg);
    border-radius: 8px;
    padding: 12px 6px;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text);
    transition: background 0.3s;
    cursor: default;
}

.heatmap-cell[data-count] {
    background: hsl(0, 80%, calc(100% - min(var(--count), 80) * 0.8%));
}

[data-theme="dark"] .heatmap-cell[data-count] {
    background: hsl(0, 80%, calc(20% + min(var(--count), 80) * 0.6%));
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 48px 0 0;
}

.footer-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 32px;
    margin-bottom: 32px;
}

.footer-col h4 {
    margin-bottom: 16px;
    color: #fff;
    font-size: 1.1rem;
}

.footer-col a {
    display: block;
    color: var(--footer-text);
    text-decoration: none;
    margin-bottom: 8px;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: var(--accent);
}

.social-icons {
    display: flex;
    gap: 12px;
}

.social-icons a {
    font-size: 1.4rem;
}

.footer-bottom {
    text-align: center;
    padding: 16px 0;
    border-top: 1px solid #333;
}

/* Login Page */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg);
}

.login-container {
    background: var(--card-bg);
    padding: 48px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-container h2 {
    margin-bottom: 24px;
    color: var(--accent);
}

.login-container input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 1rem;
}

.login-container button {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: background var(--transition);
}

.login-container button:hover {
    background: #d6384f;
}

.login-container a {
    display: inline-block;
    margin-top: 16px;
    color: var(--accent);
    text-decoration: none;
}

/* Admin Page */
.admin-page {
    background: var(--bg);
}

.admin-header {
    background: var(--accent2);
    color: #fff;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h2 {
    font-size: 1.4rem;
}

.admin-container {
    max-width: 1100px;
    margin: 32px auto;
    padding: 0 20px;
}

.admin-section {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 32px;
}

.admin-section h3 {
    margin-bottom: 20px;
    color: var(--accent);
    font-size: 1.3rem;
}

.admin-form input,
.admin-form textarea,
.ai-form input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--input-bg);
    color: var(--text);
    font-size: 0.95rem;
    outline: none;
}

.admin-form textarea {
    min-height: 80px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row input {
    flex: 1;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition);
    text-decoration: none;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: #d6384f;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th, .admin-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.admin-table th {
    background: var(--input-bg);
    font-weight: 600;
}

.actions {
    display: flex;
    gap: 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background: rgba(0,0,0,0.5);
}

.modal-content {
    background: var(--card-bg);
    margin: 10% auto;
    padding: 32px;
    border-radius: var(--radius);
    max-width: 600px;
    width: 90%;
    box-shadow: 0 16px 48px rgba(0,0,0,0.2);
}

.close {
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: var(--text);
}

.close:hover {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    .nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--header-bg);
        padding: 20px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    }

    .nav.open {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .listings {
        grid-template-columns: 1fr;
    }

    .stats {
        gap: 32px;
    }

    .form-row {
        flex-direction: column;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Static Pages Generic */
.page-content {
    padding: 60px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.page-content h1 {
    font-size: 2rem;
    margin-bottom: 24px;
    color: var(--accent);
}

.page-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

/* Detail Page */
.detail-page .detail-header {
    background: linear-gradient(135deg, var(--accent2), var(--accent));
    color: #fff;
    padding: 60px 20px;
    text-align: center;
}

.detail-page .detail-header h1 {
    font-size: 2.2rem;
    margin-bottom: 12px;
}

.detail-page .detail-body {
    padding: 40px 20px;
    max-width: 800px;
    margin: 0 auto;
}

.detail-page .detail-body img {
    width: 100%;
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.share-buttons {
    display: flex;
    gap: 12px;
    margin-top: 24px;
}

.share-buttons .share-btn {
    padding: 10px 20px;
    border-radius: 30px;
    border: none;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    transition: opacity 0.3s;
}

.share-buttons .share-btn:hover {
    opacity: 0.85;
}

.share-btn.weibo { background: #e6162d; }
.share-btn.wechat { background: #07c160; }
.share-btn.twitter { background: #1da1f2; }
.share-btn.facebook { background: #1877f2; }