﻿* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 0px;
}

/* Header Styles */
.header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-top {
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.city-selector {
    position: relative;
    display: inline-block;
}

.current-city {
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    padding: 5px 10px;
    background: #f0f0f0;
    border-radius: 5px;
}

.city-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: none;
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
}

.city-selector:hover .city-dropdown {
    display: block;
}

.city-dropdown a {
    display: block;
    padding: 8px 15px;
    color: #333;
    text-decoration: none;
    white-space: nowrap;
}

    .city-dropdown a:hover {
        background: #f0f0f0;
    }

.user-actions {
    float: right;
}

.btn-publish {
    background: #ff6600;
    color: #fff;
    padding: 8px 20px;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

    .btn-publish:hover {
        background: #ff5500;
    }

/* Category Navigation */
.category-nav {
    background: #fff;
    overflow-x: auto;
    white-space: nowrap;
    padding: 10px 0;
}

.category-list {
    list-style: none;
    display: inline-flex;
    gap: 20px;
    padding: 0 15px;
}

    .category-list li a {
        color: #666;
        text-decoration: none;
        font-size: 15px;
        padding: 5px 0;
        display: inline-block;
        transition: color 0.3s;
    }

        .category-list li a:hover,
        .category-list li a.active {
            color: #ff6600;
            border-bottom: 2px solid #ff6600;
        }



/* 🔥 最终修复版：全端瀑布流，手机必显2列 */
.waterfall-container {
    padding: 15px 0;
}

.waterfall-grid {
    column-count: 3;
    column-gap: 12px;
    -webkit-column-count: 3;
    -webkit-column-gap: 12px;
}

.waterfall-item {
    break-inside: avoid !important;
    -webkit-break-inside: avoid !important;
    display: inline-block !important;
    width: 100% !important;
    margin-bottom: 12px;
}

/* 平板：2列 */
@media (max-width: 768px) {
    .waterfall-grid {
        column-count: 2 !important;
        column-gap: 10px !important;
        -webkit-column-count: 2 !important;
        -webkit-column-gap: 10px !important;
    }
}

/* 手机：强制2列（你要的效果） */
@media (max-width: 480px) {
    .waterfall-grid {
        column-count: 2 !important;
        column-gap: 8px !important;
        -webkit-column-count: 2 !important;
        -webkit-column-gap: 8px !important;
    }
}


.waterfall-item {
    break-inside: avoid;
    margin-bottom: 20px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

    .waterfall-item:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    }

.item-link {
    text-decoration: none;
    color: #333;
    display: block;
}

.item-image {
    width: 100%;
    padding-top: 75%;
    position: relative;
    overflow: hidden;
    background: #f0f0f0;
}

    .item-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-image-text {
    color: #999;
    font-size: 14px;
}

.item-info {
    padding: 12px;
}

.item-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.item-price {
    color: #ff6600;
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 8px;
}

.item-meta {
    font-size: 12px;
    color: #999;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.urgent-badge {
    background: #ff4444;
    color: #fff;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
}

/* Detail Page */
.detail-article {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.detail-title {
    font-size: 24px;
    color: #333;
    flex: 1;
}

.urgent-tag, .top-tag, .recommend-tag {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: normal;
}

.urgent-tag {
    background: #ff4444;
    color: #fff;
}

.top-tag {
    background: #ff9900;
    color: #fff;
}

.recommend-tag {
    background: #4caf50;
    color: #fff;
}

.detail-images {
    margin-bottom: 20px;
}

.detail-image {
    max-width: 100%;
    margin-bottom: 10px;
    border-radius: 5px;
}

.detail-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.info-row {
    margin-bottom: 10px;
    display: flex;
}

    .info-row .label {
        width: 100px;
        color: #666;
    }

    .info-row .value {
        flex: 1;
        color: #333;
    }

    .info-row .price {
        color: #ff6600;
        font-size: 20px;
        font-weight: bold;
    }

.detail-description {
    margin-bottom: 20px;
}

    .detail-description h3 {
        margin-bottom: 10px;
        font-size: 18px;
    }

.description-content {
    line-height: 1.8;
}

.contact-info {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

    .contact-info h3 {
        margin-bottom: 10px;
        font-size: 18px;
    }

.contact-card {
    line-height: 1.8;
}

.contact-phone {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.copy-btn {
    background: #4caf50;
    color: #fff;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

    .copy-btn:hover {
        background: #45a049;
    }

.action-buttons {
    margin-top: 20px;
}

.btn-accept {
    width: 100%;
    padding: 12px;
    font-size: 16px;
}

.status-message {
    text-align: center;
    padding: 12px;
    background: #f0f0f0;
    border-radius: 5px;
    color: #666;
}

.related-items {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

    .related-items h3 {
        margin-bottom: 15px;
        font-size: 18px;
    }

.related-list {
    display: grid;
    gap: 10px;
}

.related-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: #333;
}

    .related-item:hover {
        background: #f5f5f5;
    }

    .related-item h4 {
        font-size: 14px;
        font-weight: normal;
        flex: 1;
    }

    .related-item .price {
        color: #ff6600;
        font-weight: bold;
    }

/* Publish Form */
.publish-form {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.form-group {
    margin-bottom: 20px;
}

    .form-group label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
    }

    .form-group .required {
        color: #ff0000;
    }

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

    .form-control:focus {
        outline: none;
        border-color: #ff6600;
    }

textarea.form-control {
    resize: vertical;
}

.form-control-file {
    padding: 5px 0;
}

.form-text {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-group {
    display: flex;
    gap: 15px;
}

    .checkbox-group label {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        font-weight: normal;
    }

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn-primary {
    background: #ff6600;
    color: #fff;
}

    .btn-primary:hover {
        background: #ff5500;
    }

.btn-default {
    background: #f0f0f0;
    color: #333;
}

    .btn-default:hover {
        background: #e0e0e0;
    }

.text-danger {
    color: #ff0000;
    font-size: 12px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: #999;
}

/* Admin Styles */
.admin-container {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: #2c3e50;
    color: #fff;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

    .admin-sidebar .logo {
        padding: 20px;
        text-align: center;
        border-bottom: 1px solid #34495e;
    }

        .admin-sidebar .logo h2 {
            font-size: 18px;
            margin: 0;
        }

.admin-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .admin-nav li a {
        display: block;
        padding: 12px 20px;
        color: #ecf0f1;
        text-decoration: none;
        transition: background 0.3s;
    }

        .admin-nav li a:hover,
        .admin-nav li a.active {
            background: #34495e;
        }

.admin-content {
    flex: 1;
    margin-left: 250px;
    background: #ecf0f1;
    padding: 20px;
}

.admin-header {
    background: #fff;
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .admin-header h1 {
        font-size: 20px;
        margin: 0;
    }

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

    .stat-card h3 {
        font-size: 14px;
        color: #7f8c8d;
        margin-bottom: 10px;
    }

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: #2c3e50;
}

.table-container {
    background: #fff;
    border-radius: 5px;
    overflow-x: auto;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

    .data-table th,
    .data-table td {
        padding: 12px;
        text-align: left;
        border-bottom: 1px solid #ddd;
    }

    .data-table th {
        background: #f8f9fa;
        font-weight: 500;
    }

    .data-table tr:hover {
        background: #f5f5f5;
    }

.status-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.status-expired {
    background: #f8d7da;
    color: #721c24;
}

.btn-small {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    margin: 0 2px;
}

.btn-top {
    background: #ff9900;
    color: #fff;
}

.btn-recommend {
    background: #4caf50;
    color: #fff;
}

.btn-delete {
    background: #ff4444;
    color: #fff;
}

.pagination {
    margin-top: 20px;
    display: flex;
    justify-content: center;
    gap: 5px;
}

    .pagination a,
    .pagination span {
        padding: 5px 10px;
        border: 1px solid #ddd;
        background: #fff;
        color: #333;
        text-decoration: none;
        border-radius: 3px;
    }

    .pagination .current {
        background: #ff6600;
        color: #fff;
        border-color: #ff6600;
    }

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 200px;
    }

    .admin-content {
        margin-left: 200px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .info-row {
        flex-direction: column;
    }

        .info-row .label {
            width: auto;
            margin-bottom: 5px;
        }
}

@media (max-width: 480px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .admin-content {
        margin-left: 0;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }
}
