/* === 全局重置与基础 === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f0f4f8;
    color: #1a202c;
    line-height: 1.6;
}

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

a {
    text-decoration: none;
    color: #3182ce;
    transition: color 0.3s;
}

a:hover {
    color: #2b6cb0;
}

/* === 头部 === */
header {
    background: linear-gradient(135deg, #1a202c, #2d3748);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo a {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1px;
}

.logo a i {
    color: #63b3ed;
    margin-right: 8px;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links a {
    color: #e2e8f0;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.3s, color 0.3s;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

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

.hamburger span {
    width: 28px;
    height: 3px;
    background: #fff;
    border-radius: 3px;
    transition: all 0.3s;
}

.promo-banner {
    background: linear-gradient(90deg, #f6e05e, #ecc94b);
    color: #1a202c;
    text-align: center;
    padding: 10px 0;
    font-weight: 600;
}

.promo-banner a {
    color: #2b6cb0;
    text-decoration: underline;
}

.promo-banner i {
    color: #e53e3e;
    margin-right: 5px;
}

/* === Hero 区域 === */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.hero h1 {
    font-size: 42px;
    margin-bottom: 15px;
    text-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hero p {
    font-size: 18px;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.95;
}

.search-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar input {
    padding: 14px 20px;
    width: 400px;
    max-width: 80%;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    outline: none;
}

.search-bar button {
    padding: 14px 30px;
    background: #ed8936;
    color: #fff;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.search-bar button:hover {
    background: #dd6b20;
    transform: translateY(-2px);
}

.sort-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 15px;
}

.sort-btn {
    background: rgba(255,255,255,0.2);
    color: #fff;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 14px;
    border: 1px solid rgba(255,255,255,0.3);
    transition: all 0.3s;
}

.sort-btn.active, .sort-btn:hover {
    background: #fff;
    color: #2d3748;
}

/* === 分类筛选 === */
.categories {
    background: #fff;
    padding: 20px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.cat-btn {
    padding: 8px 18px;
    background: #edf2f7;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    color: #2d3748;
    font-weight: 500;
}

.cat-btn.active, .cat-btn:hover {
    background: #3182ce;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(49, 130, 206, 0.3);
}

/* === 卡片网格 === */
.cards-section {
    padding: 40px 0;
}

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

.card {
    background: #fff;
    border-radius: 16px;
    padding: 25px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(0,0,0,0.03);
}

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

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    background: linear-gradient(135deg, #e2e8f0, #edf2f7);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    font-size: 30px;
    color: #3182ce;
    overflow: hidden;
}

.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1a202c;
}

.card p {
    color: #4a5568;
    font-size: 14px;
    flex-grow: 1;
    margin-bottom: 12px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.rating i {
    color: #cbd5e0;
    font-size: 14px;
    margin-right: 2px;
}

.rating i.filled {
    color: #ecc94b;
}

.tag {
    background: #edf2f7;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #2d3748;
}

.tag.hot {
    background: #fed7d7;
    color: #c53030;
}

.tag.new {
    background: #c6f6d5;
    color: #276749;
}

.card-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.visit-btn, .fav-btn, .share-btn {
    padding: 8px 14px;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.visit-btn {
    background: #3182ce;
    color: #fff;
}

.visit-btn:hover {
    background: #2b6cb0;
}

.fav-btn {
    background: #edf2f7;
    color: #4a5568;
}

.fav-btn:hover, .fav-btn.active {
    background: #feb2b2;
    color: #c53030;
}

.share-btn {
    background: #edf2f7;
    color: #4a5568;
}

.share-btn:hover {
    background: #e2e8f0;
}

.visit-count {
    margin-top: 10px;
    font-size: 12px;
    color: #a0aec0;
}

.no-results {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #718096;
}

/* === 页脚 === */
footer {
    background: #1a202c;
    color: #a0aec0;
    padding: 30px 0;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #e2e8f0;
    font-size: 14px;
}

.footer-links a:hover {
    color: #fff;
}

footer p {
    font-size: 14px;
}

footer a {
    color: #63b3ed;
}

/* === 管理后台 === */
.admin-login-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-login {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    width: 360px;
    max-width: 90%;
}

.admin-login h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #2d3748;
}

.admin-login input {
    width: 100%;
    padding: 14px;
    margin-bottom: 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s;
}

.admin-login input:focus {
    border-color: #3182ce;
}

.admin-login button {
    width: 100%;
    padding: 14px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.admin-login button:hover {
    background: #2b6cb0;
}

.admin-body {
    background: #f0f4f8;
}

.admin-body header {
    background: #2d3748;
    padding: 15px 0;
}

.admin-body header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-body header h1 {
    font-size: 24px;
    color: #fff;
}

.logout-btn, .back-btn {
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.2);
    transition: all 0.3s;
}

.logout-btn:hover, .back-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.admin-main {
    padding: 30px 0;
}

.admin-section {
    background: #fff;
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.admin-section h2 {
    margin-bottom: 20px;
    color: #2d3748;
    font-size: 22px;
}

.admin-form input, .admin-form textarea {
    width: 100%;
    padding: 12px;
    margin-bottom: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border 0.3s;
}

.admin-form input:focus, .admin-form textarea:focus {
    border-color: #3182ce;
}

.admin-form button {
    padding: 12px 30px;
    background: #3182ce;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.admin-form button:hover {
    background: #2b6cb0;
}

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

table th, table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

table th {
    background: #edf2f7;
    font-weight: 600;
    color: #2d3748;
}

.edit-btn, .delete-btn {
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-right: 5px;
}

.edit-btn {
    background: #ecc94b;
    color: #1a202c;
}

.delete-btn {
    background: #fc8181;
    color: #fff;
}

.error {
    color: #e53e3e;
    background: #fed7d7;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    text-align: center;
}

.success {
    color: #276749;
    background: #c6f6d5;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
}

/* === 内页通用 === */
.page-content {
    padding: 50px 0;
    min-height: 60vh;
}

.page-content h1 {
    font-size: 36px;
    margin-bottom: 20px;
    color: #1a202c;
}

.page-content p {
    font-size: 16px;
    color: #4a5568;
    max-width: 800px;
}

/* === 响应式 === */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        flex-direction: column;
        background: #2d3748;
        position: absolute;
        top: 60px;
        left: 0;
        width: 100%;
        padding: 20px;
        gap: 15px;
    }

    .nav-links.active {
        display: flex;
    }

    .hamburger {
        display: flex;
    }

    .hero h1 {
        font-size: 28px;
    }

    .search-bar input {
        width: 100%;
    }

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

    .admin-body header .container {
        flex-direction: column;
        gap: 10px;
    }

    table {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 22px;
    }
    .hero p {
        font-size: 15px;
    }
}