:root {
    --primary: #2563EB;
    --primary-dark: #1D4ED8;
    --primary-light: #3B82F6;
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F59E0B;
    --bg: #F8FAFC;
    --white: #FFFFFF;
    --text: #1E293B;
    --text-light: #64748B;
    --border: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-sm: 8px;
    --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.3);
    --transition: all 0.2s ease;
}

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

body {
    font-family: 'Noto Sans SC', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a {
    text-decoration: none;
    color: inherit;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1D4ED8 0%, #2563EB 50%, #10B981 100%);
    color: var(--white);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(10px);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo i {
    font-size: 28px;
}

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

.nav a {
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s;
    font-size: 14px;
}

.nav a:hover {
    background: rgba(255,255,255,0.2);
}

.btn-logout {
    background: rgba(255,255,255,0.2);
    padding: 8px 16px;
    border-radius: 20px;
}

.btn-register {
    background: var(--secondary);
}

.user-info {
    padding: 8px 16px;
    font-weight: 500;
}

/* Main */
.main {
    flex: 1;
    padding: 30px 0;
}

/* Footer */
.footer {
    background: #263238;
    color: #B0BEC5;
    padding: 30px 0;
    text-align: center;
}

.footer p {
    margin: 5px 0;
}

.footer-sub {
    font-size: 14px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.2);
}

.btn-secondary:hover {
    background: var(--secondary-light);
    transform: translateY(-1px);
}

.btn-block {
    width: 100%;
    justify-content: center;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #E8F5E9;
    color: var(--primary);
    border: 1px solid #C8E6C9;
}

.alert-error {
    background: #FFEBEE;
    color: #C62828;
    border: 1px solid #FFCDD2;
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, rgba(0,80,40,0.85) 0%, rgba(0,60,80,0.85) 100%),
                url('https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=1200') center/cover;
    padding: 80px 40px;
    border-radius: var(--radius);
    margin-bottom: 40px;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--white);
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.hero .btn {
    background: var(--white);
    color: var(--primary);
}

.hero .btn:hover {
    background: var(--secondary);
    color: var(--white);
}

.hero-bg {
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="80" cy="20" r="40" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="60" r="30" fill="rgba(255,255,255,0.08)"/></svg>') no-repeat center;
}

/* Features */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.feature-card {
    background: var(--white);
    padding: 30px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.feature-icon {
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 28px;
    color: var(--white);
}

.feature-card h3 {
    margin-bottom: 10px;
    color: var(--primary);
}

.feature-card p {
    color: var(--text-light);
    font-size: 14px;
}

/* Ads Section (Homepage) */
.ads-section {
    margin: 40px 0;
}

.ads-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: var(--text);
}

.ads-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.ads-section .ad-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.ads-section .ad-card:hover {
    transform: translateY(-5px);
}

.ads-section .ad-image {
    height: 150px;
    overflow: hidden;
}

.ads-section .ad-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ads-section .ad-content {
    padding: 20px;
}

.ads-section .ad-content h3 {
    font-size: 18px;
    color: var(--text);
    margin-bottom: 10px;
}

.ads-section .ad-content p {
    color: var(--text-light);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.ads-section .ad-contact {
    display: inline-block;
    color: var(--primary);
    font-weight: 500;
    font-size: 14px;
}

.more-link {
    text-align: center;
    margin-top: 30px;
}

.more-link a {
    color: var(--primary);
    font-size: 16px;
    text-decoration: none;
}

.more-link a:hover {
    text-decoration: underline;
}

/* About Section */
.about-section {
    background: var(--bg);
    padding: 60px 40px;
    border-radius: var(--radius);
    margin-top: 40px;
}

.about-section h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: var(--text);
}

.about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text p {
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 15px;
}

.about-text strong {
    color: var(--primary);
}

.about-stats {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-item {
    background: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    text-align: center;
    box-shadow: var(--shadow);
}

.stat-number {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-light);
    font-size: 14px;
}

@media (max-width: 768px) {
    /* Header */
    .header-content {
        flex-direction: column;
        height: auto;
        padding: 10px;
        gap: 10px;
    }
    
    .nav {
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }
    
    .nav a {
        padding: 5px 8px;
        font-size: 12px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .about-content {
        grid-template-columns: 1fr;
    }
    
    /* 详情页响应式 - 二手市场/广告 */
    .item-detail-container {
        padding: 0 10px;
    }
    
    .item-detail {
        border-radius: 8px;
    }
    
    .item-detail-image {
        width: 100% !important;
        max-height: 150px !important;
        height: 150px !important;
        margin-bottom: 10px;
        border-radius: 6px;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: #f5f5f5;
    }
    
    .item-detail-image img {
        max-width: 100% !important;
        max-height: 150px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    .item-detail-video {
        width: 100% !important;
        max-height: 150px !important;
        height: 150px !important;
        margin-bottom: 10px;
        border-radius: 6px;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
    }
    
    .item-detail-video video {
        max-width: 100% !important;
        max-height: 150px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .item-detail-content {
        padding: 20px 15px;
    }
    
    .item-detail-content h1 {
        font-size: 22px;
    }
    
    .item-price .price {
        font-size: 26px;
    }
    
    .item-meta {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px;
    }
    
    .item-description h3,
    .item-contact h3 {
        font-size: 16px;
    }
    
    .item-contact p {
        font-size: 15px;
    }
    
    /* 社区页面响应式 */
    .community-container {
        grid-template-columns: 1fr;
    }
    
    .community-sidebar {
        order: -1;
    }
    
    .community-sidebar h3 {
        font-size: 16px;
    }
    
    .category-list li a {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .create-post {
        padding: 20px 15px;
    }
    
    .create-post h3 {
        font-size: 18px;
    }
    
    .post-form .form-group input,
    .post-form .form-group textarea {
        font-size: 14px;
    }
    
    .posts-list h3 {
        font-size: 18px;
    }
    
    .post-card {
        padding: 15px;
    }
    
    .post-header {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 12px;
    }
    
    .post-title {
        font-size: 16px;
    }
    
    .post-content {
        font-size: 14px;
    }
    
    .post-footer {
        font-size: 13px;
    }
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 40px;
}

.page-header h1 {
    font-size: 32px;
    color: var(--primary);
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Auth */
.auth-container {
    max-width: 450px;
    margin: 40px auto;
}

.auth-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.auth-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 30px;
    text-align: center;
}

.auth-header i {
    font-size: 48px;
    margin-bottom: 10px;
}

.auth-header h2 {
    font-size: 24px;
}

.auth-form {
    padding: 30px;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.auth-form input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
}

.auth-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.auth-footer {
    padding: 20px 30px;
    background: #FAFAFA;
    text-align: center;
    border-top: 1px solid var(--border);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 500;
}

/* Community */
.community-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

.community-sidebar {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
}

.community-sidebar h3 {
    margin-bottom: 20px;
    color: var(--primary);
    font-size: 18px;
}

.category-list {
    list-style: none;
}

.category-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s;
    color: var(--text);
}

.category-list li a:hover,
.category-list li a.active {
    background: var(--primary);
    color: var(--white);
}

.community-main {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.create-post {
    background: var(--white);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
}

.create-post h3 {
    margin-bottom: 20px;
    color: var(--primary);
}

.post-form input,
.post-form select,
.post-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 15px;
    font-family: inherit;
}

.post-form input:focus,
.post-form select:focus,
.post-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.post-title {
    font-size: 18px !important;
    font-weight: 500;
}

.form-row select {
    width: 200px;
}

.posts-list h3 {
    margin-bottom: 20px;
    color: var(--primary);
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.post-card:hover {
    transform: translateX(5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.post-media {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.post-media img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

.post-media video {
    width: 100%;
    max-height: 400px;
    background: #000;
}

.post-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--text-light);
}

.post-category {
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.category-discussion { background: #E3F2FD; color: #1565C0; }
.category-complaint { background: #FFEBEE; color: #C62828; }
.category-suggestion { background: #FFF8E1; color: #F57F17; }
.category-notice { background: #F3E5F5; color: #7B1FA2; }

.post-title a {
    font-size: 18px;
    color: var(--text);
    font-weight: 600;
}

.post-title a:hover {
    color: var(--primary);
}

.post-content {
    color: var(--text-light);
    margin: 12px 0;
    line-height: 1.7;
}

.post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-light);
    font-size: 14px;
}

.read-more {
    color: var(--primary);
    font-weight: 500;
}

/* Post Detail */
.post-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    margin-bottom: 20px;
    font-weight: 500;
}

.post-detail {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
}

.post-detail-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.post-detail-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
    border-radius: var(--radius);
    margin-bottom: 25px;
    background: #f5f5f5;
}

.post-detail-image img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.post-detail-video {
    width: 100%;
    max-height: 400px;
    background: #000;
    border-radius: var(--radius);
    margin-bottom: 25px;
    overflow: hidden;
}

.post-detail-video video {
    width: 100%;
    height: 400px;
    object-fit: contain;
    display: block;
}

.post-detail-header h1 {
    font-size: 28px;
    margin: 15px 0;
}

.post-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    font-size: 14px;
}

.post-detail-content {
    line-height: 1.8;
    font-size: 16px;
    white-space: pre-wrap;
}

.comments-section h3 {
    color: var(--primary);
    margin-bottom: 20px;
}

.comment-form {
    margin-bottom: 25px;
}

.comment-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.comment-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
}

.comment-author {
    color: var(--primary);
    font-weight: 500;
}

.comment-date {
    color: var(--text-light);
}

/* Market */
.market-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.item-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.item-image {
    height: 200px;
    overflow: hidden;
}

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

.item-no-image {
    background: linear-gradient(135deg, #E8F5E9 0%, #C8E6C9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--primary);
}

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

.item-content {
    padding: 20px;
}

.item-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--text);
}

.item-description {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 15px;
    line-height: 1.6;
}

.item-price {
    margin-bottom: 15px;
}

.price {
    font-size: 24px;
    font-weight: 700;
    color: #E53935;
}

.item-meta {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 10px;
}

.item-contact {
    background: #F5F5F5;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--primary);
    font-weight: 500;
}

/* Item Detail */
.item-detail-container {
    max-width: 800px;
    margin: 0 auto;
}

.item-detail {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.item-detail-image {
    width: 100%;
    max-height: 400px;
    overflow: hidden;
}

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

.item-detail-video video {
    width: 100%;
    max-height: 400px;
}

.item-detail-content {
    padding: 30px;
}

.item-detail-content h1 {
    margin: 0 0 20px 0;
    font-size: 28px;
}

.item-detail-content .item-price {
    margin-bottom: 20px;
}

.item-detail-content .item-price .price {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary);
}

.item-detail-content .item-meta {
    display: flex;
    gap: 20px;
    color: var(--text-light);
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.item-description {
    margin-bottom: 25px;
}

.item-description h3 {
    font-size: 18px;
    margin-bottom: 10px;
}

.item-description p {
    line-height: 1.8;
    color: var(--text);
}

.item-detail-content .item-contact {
    margin-bottom: 25px;
}

.item-detail-content .item-actions {
    display: flex;
    gap: 15px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.item-detail-container .back-link {
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 20px;
}

.item-detail-container .back-link:hover {
    text-decoration: underline;
}

/* Form */
.form-container {
    max-width: 600px;
    margin: 0 auto;
}

.publish-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.upload-row .form-group input[type="file"] {
    padding: 10px;
    background: #F5F5F5;
    border: 2px dashed var(--border);
    border-radius: 8px;
    cursor: pointer;
}

.upload-row .form-group input[type="file"]:hover {
    border-color: var(--primary);
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Post detail */
    .post-detail-container {
        padding: 15px;
    }
    
    .post-detail {
        padding: 20px 15px;
    }
    
    .post-detail h1 {
        font-size: 20px;
    }
    
    .post-detail-content {
        font-size: 15px;
        line-height: 1.7;
    }
    
    .comments-section {
        padding: 20px 15px;
    }
    
    .comment-form textarea {
        font-size: 14px;
    }
    
    .comment-card {
        padding: 15px;
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .btn-sm {
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .btn-xs {
        padding: 4px 8px;
        font-size: 11px;
    }

    /* Admin */
    .admin-tabs {
        flex-direction: column;
        gap: 8px;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .admin-table {
        font-size: 12px;
    }
    
    .admin-table th,
    .admin-table td {
        padding: 8px 4px;
    }
    
    .admin-table-wrap {
        overflow-x: auto;
    }

    /* Hero section */
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }

    /* Stats */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .stat-card {
        padding: 15px;
    }
    
    .stat-card h3 {
        font-size: 28px;
    }
    
    .stat-card p {
        font-size: 13px;
    }

    /* Footer */
    .footer {
        padding: 20px 15px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    /* Action buttons */
    .post-actions,
    .item-actions,
    .ad-actions,
    .comment-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .post-actions .btn,
    .item-actions .btn,
    .ad-actions .btn {
        flex: 1;
        text-align: center;
    }

    /* Category tags */
    .post-category,
    .category-tag {
        font-size: 11px;
        padding: 4px 8px;
    }

    /* Empty state */
    .empty-state {
        padding: 40px 20px;
    }
    
    .empty-state i {
        font-size: 48px;
    }
    
    .empty-state p {
        font-size: 14px;
    }
}

/* 极小屏幕优化 */
@media (max-width: 480px) {
    .header-content {
        padding: 10px;
    }
    
    .nav {
        gap: 5px;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav a {
        padding: 5px 8px;
        font-size: 11px;
        white-space: nowrap;
    }
    
    .nav a i {
        font-size: 10px;
    }
    
    .logo {
        font-size: 18px;
    }
    
    .logo i {
        font-size: 20px;
    }
    
    .page-header h1 {
        font-size: 20px;
    }
    
    .auth-card {
        padding: 20px 15px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    /* 详情页极小屏幕 */
    .item-detail {
        padding: 8px;
    }
    
    .item-detail-image {
        width: 100% !important;
        max-height: 100px !important;
        height: 100px !important;
        margin-bottom: 8px;
        border-radius: 4px;
        overflow: hidden !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    .item-detail-image img {
        max-width: 100% !important;
        max-height: 100px !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center !important;
    }
    
    .item-detail-video {
        width: 100% !important;
        max-height: 100px !important;
        height: 100px !important;
        margin-bottom: 8px;
        border-radius: 4px;
    }
    
    .item-detail-video video {
        max-width: 100% !important;
        max-height: 100px !important;
        width: auto !important;
        height: auto !important;
    }
    
    .item-detail-video video {
        height: 200px;
    }
    
    .item-detail-content h1 {
        font-size: 20px;
    }
    
    .item-price .price {
        font-size: 24px;
    }
    
    .item-description p,
    .item-contact p {
        font-size: 14px;
    }
    
    .item-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .item-actions .btn {
        width: 100%;
        text-align: center;
    }
    
    /* 社区页面极小屏幕 */
    .community-sidebar {
        padding: 15px;
    }
    
    .category-list li a {
        padding: 8px 10px;
        font-size: 13px;
    }
    
    .create-post {
        padding: 15px;
    }
    
    .create-post h3 {
        font-size: 16px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .upload-row {
        flex-direction: column;
    }
    
    .post-card {
        padding: 12px;
    }
    
    .post-header {
        font-size: 11px;
        flex-wrap: wrap;
    }
    
    .post-title {
        font-size: 15px;
    }
    
    .post-content {
        font-size: 13px;
    }
    
    .post-footer {
        font-size: 12px;
    }
    
    .post-media {
        max-height: 200px;
    }
    
    .post-media img,
    .post-media video {
        max-height: 200px;
    }
    
    /* 首页响应式 */
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-buttons .btn {
        width: 100%;
    }
    
    .features {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .feature-card {
        padding: 20px 15px;
    }
    
    .feature-card h3 {
        font-size: 16px;
    }
    
    .feature-card p {
        font-size: 13px;
    }
    
    /* 二手市场/广告响应式 */
    .market-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .item-card {
        padding: 15px;
    }
    
    .item-image {
        height: 180px;
    }
    
    .item-content h3 {
        font-size: 16px;
    }
    
    .item-description {
        font-size: 13px;
    }
    
    .item-price .price {
        font-size: 20px;
    }
    
    .item-meta {
        font-size: 12px;
    }
    
    .item-contact {
        font-size: 13px;
    }
}

/* 编辑删除按钮样式 */
.post-actions, .item-actions, .ad-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-sm {
    padding: 5px 12px;
    font-size: 13px;
    margin-right: 8px;
}

.btn-xs {
    padding: 3px 8px;
    font-size: 12px;
    margin-left: 8px;
}

.comment-actions {
    float: right;
}

.comment-actions .btn {
    margin-left: 5px;
}

.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    border-color: #bd2130;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    border-radius: 8px;
    background: var(--white);
    color: var(--text);
    border: 1px solid var(--border);
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
}

.pagination-btn:hover:not(.disabled):not(.active) {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn.dots {
    border: none;
    background: transparent;
    cursor: default;
}

.pagination-info {
    color: var(--text-light);
    font-size: 14px;
    margin-left: 15px;
}

/* Admin Panel */
.admin-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.admin-section {
    background: var(--white);
    padding: 25px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.admin-section h2 {
    color: var(--primary);
    margin-bottom: 20px;
    font-size: 20px;
}

.admin-table-wrap {
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

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

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text);
}

.admin-table tr:hover {
    background: #f8f9fa;
}

.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: #E8F5E9;
    color: var(--primary);
}

.badge-warning {
    background: #FFF8E1;
    color: #F57F17;
}

.badge-danger {
    background: #FFEBEE;
    color: #C62828;
}

.btn-success {
    background: var(--primary);
    color: white;
}

.btn-warning {
    background: #FF9800;
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
}

.empty-state i {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
    margin-bottom: 20px;
}

.post-count {
    font-size: 14px;
    color: var(--text-light);
    font-weight: normal;
}

/* ==================== 
   新增优化样式 
   ==================== */

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 110;
}

.hamburger-line {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 2px;
    transition: var(--transition);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Active Navigation State */
.nav a.active {
    background: rgba(255, 255, 255, 0.25);
    font-weight: 500;
}

.nav a.user-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nav a.user-link .username {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Focus States for Accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Alert Improvements */
.flash-messages {
    margin-bottom: 20px;
}

.alert-dismissible {
    position: relative;
    padding-right: 50px;
}

.alert-close {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 5px;
    font-size: 16px;
    transition: opacity 0.2s;
}

.alert-close:hover {
    opacity: 1;
}

.alert-warning {
    background: #FFF8E1;
    color: #F57F17;
    border: 1px solid #FFE082;
}

.alert-info {
    background: #E3F2FD;
    color: #1565C0;
    border: 1px solid #90CAF9;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    z-index: 99;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

.back-to-top:active {
    transform: translateY(0);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--white);
    border-radius: var(--radius);
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: 400px;
    animation: slideIn 0.3s ease;
    border-left: 4px solid var(--primary);
}

.toast.toast-success {
    border-left-color: var(--primary);
}

.toast.toast-error {
    border-left-color: #C62828;
}

.toast.toast-warning {
    border-left-color: #F57F17;
}

.toast.toast-info {
    border-left-color: #1565C0;
}

.toast-icon {
    font-size: 20px;
}

.toast-success .toast-icon {
    color: var(--primary);
}

.toast-error .toast-icon {
    color: #C62828;
}

.toast-warning .toast-icon {
    color: #F57F17;
}

.toast-info .toast-icon {
    color: #1565C0;
}

.toast-message {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 5px;
    font-size: 14px;
}

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

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.hiding {
    animation: slideOut 0.3s ease forwards;
}

/* Form Improvements */
.form-group input:invalid:not(:placeholder-shown),
.form-group textarea:invalid:not(:placeholder-shown) {
    border-color: #C62828;
}

.form-group input:valid:not(:placeholder-shown),
.form-group textarea:valid:not(:placeholder-shown) {
    border-color: var(--primary);
}

.form-group small {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-light);
}

.form-group .input-error {
    color: #C62828;
    font-size: 12px;
    margin-top: 5px;
}

/* Loading Button State */
.btn.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    color: white;
}

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

/* Image Placeholder for Lazy Loading */
.image-placeholder {
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
    font-size: 48px;
}

img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img.loaded {
    opacity: 1;
}

/* Footer Improvements */
.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 25px;
    margin-bottom: 20px;
    padding: 25px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.footer-logo i {
    font-size: 28px;
}

.footer-desc {
    color: #B0BEC5;
    font-size: 16px;
    text-align: center;
    margin: 5px 0 0 0;
}

.footer-address {
    color: #B0BEC5;
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    width: 100%;
}

.footer-links a {
    color: #B0BEC5;
    text-decoration: none;
    font-size: 15px;
}

.footer-links a {
    color: #B0BEC5;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: white;
}

.footer-contact {
    color: #B0BEC5;
    font-size: 14px;
    text-align: center;
    margin-top: 10px;
}

.footer-contact p {
    margin: 8px 0;
    text-align: center;
}

.copyright {
    text-align: center;
    color: #78909C;
    font-size: 13px;
    margin: 0;
}

/* ==================== 
   移动端优化 
   ==================== */

@media (max-width: 768px) {
    /* Mobile Menu */
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: linear-gradient(135deg, #1B5E20 0%, #2E7D32 100%);
        flex-direction: column;
        padding: 20px;
        gap: 10px;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: var(--transition);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        max-height: calc(100vh - 70px);
        overflow-y: auto;
    }
    
    .nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    .nav a {
        width: 100%;
        padding: 12px 16px;
        border-radius: 8px;
        font-size: 16px;
    }
    
    .nav a:hover,
    .nav a.active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* Toast on mobile */
    .toast-container {
        left: 20px;
        right: 20px;
        top: 80px;
    }
    
    .toast {
        min-width: auto;
        max-width: none;
        width: 100%;
    }
    
    /* Back to top on mobile */
    .back-to-top {
        width: 44px;
        height: 44px;
        font-size: 16px;
        bottom: 20px;
        right: 20px;
    }
    
    /* Footer on mobile */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .footer-contact {
        text-align: center;
    }
    
    .footer-logo {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .nav a.user-link .username {
        max-width: 60px;
    }
}
