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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #ec4899 100%);
    min-height: 100vh;
}

/* 顶部导航 */
.top-nav {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #374151;
    text-decoration: none; /* For <a> tags */
}

.nav-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.nav-btn.active {
    background: #6366f1;
    color: white;
}

/* 主容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 20px 40px;
}

/* 页面容器 */
.page {
    display: none;
    animation: fadeIn 0.6s ease-out;
}

.page.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 主页样式 */
.home-header {
    text-align: center;
    margin-bottom: 60px;
}

.site-logo {
    font-size: 48px;
    margin-bottom: 10px;
}

.site-title {
    color: white;
    font-size: 36px;
    font-weight: 300;
    margin-bottom: 40px;
}

/* 搜索区域 */
.search-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-engine {
    padding: 10px 20px;
    border: 2px solid #e5e7eb;
    border-radius: 25px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
}

.search-engine.active {
    border-color: #6366f1;
    background: #6366f1;
    color: white;
}

.search-engine:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 18px 24px;
    border: 2px solid #e5e7eb;
    border-radius: 50px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.search-input:focus {
    border-color: #6366f1;
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #6366f1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.search-btn:hover {
    background: #4f46e5;
    transform: translateY(-50%) scale(1.05);
}

/* 书签区域 */
.bookmarks-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.section-title {
    display: flex;
    align-items: center;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 30px;
    color: #1f2937;
}

.section-icon {
    margin-right: 12px;
    font-size: 28px;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.bookmark-category {
    background: #f8fafc;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #e2e8f0;
}

.category-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #374151;
    padding-bottom: 10px;
    border-bottom: 2px solid #6366f1;
}

.bookmark-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bookmark-item {
    display: block;
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-decoration: none;
    color: #374151;
    transition: all 0.3s ease;
    border: 1px solid #e5e7eb;
}

.bookmark-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #6366f1;
}

.bookmark-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: #1f2937;
}

.bookmark-url {
    font-size: 12px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 博客列表页面 */
.blog-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.blog-summary {
    display: flex;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 1px solid #e5e7eb;
}

.blog-summary:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12);
}

.blog-thumbnail {
    width: 200px;
    height: 150px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 24px;
    flex-shrink: 0;
}

.blog-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-info {
    padding: 25px;
    flex: 1;
}

.blog-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 12px;
    font-size: 14px;
    color: #6b7280;
}

.blog-category {
    background: #6366f1;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
}

.blog-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #1f2937;
    line-height: 1.4;
}

.blog-excerpt {
    color: #6b7280;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 博客详情页面 */
.blog-detail {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 50px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.blog-detail-header {
    margin-bottom: 40px;
    text-align: center;
}

.blog-detail-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: #1f2937;
    line-height: 1.3;
}

.blog-detail-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    color: #6b7280;
    font-size: 14px;
}

.blog-detail-content {
    line-height: 1.8;
    color: #374151;
    font-size: 16px;
}

.blog-detail-content p {
    margin-bottom: 20px;
}

.blog-media {
    margin: 30px 0;
    text-align: center;
}

.blog-media img, .blog-media video {
    max-width: 100%;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.back-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
}

/* 后台管理样式 */
.admin-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

#logoutBtn {
    position: absolute;
    top: 40px;
    right: 40px;
    background: #ef4444;
}

#logoutBtn:hover {
    background: #dc2626;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.admin-tabs {
    display: flex;
    margin-bottom: 30px;
    background: #f1f5f9;
    border-radius: 12px;
    padding: 6px;
}

.admin-tab {
    flex: 1;
    padding: 15px 25px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    font-weight: 500;
    color: #64748b;
}

.admin-tab.active {
    background: white;
    color: #6366f1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.form-section {
    background: #f8fafc;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
    font-family: inherit;
}

.btn {
    background: #6366f1;
    color: white;
    padding: 14px 28px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    background: #4f46e5;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
}

.btn-danger {
    background: #ef4444;
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.item-list {
    margin-top: 30px;
}

.list-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #374151;
}

.item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.item:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.item-info {
    flex: 1;
}

.item-title {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 5px;
}

.item-subtitle {
    font-size: 13px;
    color: #6b7280;
}

.item-actions {
    display: flex;
    gap: 10px;
}

/* 登录页面 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.login-form {
    background: white;
    padding: 50px;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    margin: 20px;
}

.login-title {
    text-align: center;
    margin-bottom: 30px;
    color: #1f2937;
    font-size: 28px;
    font-weight: 600;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    text-align: center;
    font-size: 14px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .site-title {
        font-size: 24px;
    }

    .container {
        padding-top: 20px;
    }

    .top-nav {
        position: relative;
        top: 0;
        right: 0;
        justify-content: center;
        padding: 15px 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.2);
        backdrop-filter: blur(10px);
    }

    .search-container {
        padding: 25px;
    }

    .search-engines {
        gap: 8px;
    }

    .search-engine {
        padding: 8px 16px;
        font-size: 13px;
    }

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

    .blog-summary {
        flex-direction: column;
    }

    .blog-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    #logoutBtn {
        top: 20px;
        right: 20px;
    }
}
/* --- 新增书签图标样式 --- */
.bookmark-item-content {
    display: flex;
    align-items: center;
}

.bookmark-favicon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
}

.bookmark-info {
    overflow: hidden; /* 确保长文本能被截断 */
}
