* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #f5f9ff;
    color: #0f172a;
}
.app {
    display: flex;
    min-height: 100vh;
}
/* 左侧边栏 */
.sidebar {
    width: 280px;
    background: #ffffff;
    border-right: 1px solid #e2edf2;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
    flex-shrink: 0;
}
.logo {
    padding: 28px 20px 20px 24px;
    border-bottom: 1px solid #eef2f8;
}
.logo h1 {
    font-size: 1.65rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e2a3a, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.logo p {
    font-size: 0.75rem;
    color: #5b6e8c;
    margin-top: 6px;
}
.level1-container {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.level1-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.95rem;
    background: #f8fafd;
    cursor: pointer;
    transition: 0.2s;
    color: #1e2f3e;
}
.level1-item:hover {
    background: #eef2ff;
    color: #2563eb;
}
.level1-item.active {
    background: #eef2ff;
    color: #1d4ed8;
}
.level1-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.level1-title i {
    width: 22px;
}
.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.2s;
}
.submenu-container {
    margin-left: 28px;
    margin-top: 4px;
    margin-bottom: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
    transition: max-height 0.2s ease;
    max-height: 0px;
}
.submenu-item {
    padding: 8px 12px 8px 32px;
    font-size: 0.8rem;
    border-radius: 12px;
    color: #3a546d;
    cursor: pointer;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.submenu-item i {
    font-size: 0.7rem;
    opacity: 0.7;
}
.submenu-item:hover {
    background: #eef2ff;
    color: #2563eb;
}
.sidebar-footer {
    padding: 16px 20px;
    font-size: 11px;
    color: #94a3b8;
    border-top: 1px solid #eef2f8;
    margin-top: auto;
    text-align: center;
}
/* 右侧主内容区 */
.main-content {
    flex: 1;
    padding: 32px 40px;
    overflow-y: auto;
    background: #f5f9ff;
}
/* 顶部功能导航条 */
.feature-tabs {
    background: #1e2a3e;
    margin: -32px -40px 28px -40px;
    padding: 0 40px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    border-bottom: 1px solid #2d3a4e;
}
.feature-tab {
    color: #e2e8f0;
    padding: 14px 24px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-right: 1px solid #334155;
}
.feature-tab:last-child {
    border-right: none;
}
.feature-tab:hover {
    background: #2d3a4e;
    color: white;
}
/* 首页紧凑搜索模块 */
.search-compact-container {
    background: white;
    margin-bottom: 28px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid #eef2f8;
}
.search-box-flat {
    padding: 20px 20px 12px 20px;
    border-bottom: 1px solid #eef2f8;
}
.search-input-flat {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e2edf2;
    transition: 0.2s;
}
.search-input-flat:focus-within {
    border-color: #3b82f6;
    background: white;
}
.search-input-flat i {
    padding: 0 12px 0 16px;
    color: #8ba0bc;
    font-size: 0.9rem;
}
.search-input-flat input {
    flex: 1;
    padding: 12px 16px 12px 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    outline: none;
}
.categories-flat-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #eef2f8;
    background: #ffffff;
}
.category-flat-label {
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #4b6b8f;
    cursor: pointer;
    transition: all 0.15s;
    border-right: 1px solid #eef2f8;
    white-space: nowrap;
}
.category-flat-label:last-child {
    border-right: none;
}
.category-flat-label:hover {
    background: #f0f4fa;
    color: #1e2f3e;
}
.category-flat-label.active {
    background: #eef2ff;
    color: #1d4ed8;
    border-bottom: 2px solid #3b82f6;
    margin-bottom: -1px;
}
.sites-flat-area {
    padding: 16px 20px;
    min-height: 90px;
    background: #fefefe;
}
.sites-flat-container {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.engine-btn-flat {
    background: transparent;
    border: none;
    padding: 4px 8px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    transition: 0.1s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-radius: 0;
}
.engine-btn-flat:hover {
    background: #eef2ff;
    color: #1d4ed8;
}
.ad-placeholder-flat {
    border-top: 1px solid #eef2f8;
    padding: 12px 20px;
    font-size: 0.7rem;
    color: #8ba0bc;
    text-align: center;
    background: #fafcff;
}
/* 书签卡片样式 */
.bookmark-card {
    background: white;
    border-radius: 18px;
    padding: 12px 16px;
    transition: 0.2s;
    border: 1px solid #e6edf4;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}
.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px -8px rgba(0, 0, 0, 0.08);
    border-color: #cbdde9;
}
.bookmark-goto {
    opacity: 0;
    font-size: 1.4rem;
    font-weight: 400;
    color: #8ba0bc;
    transition: opacity 0.15s;
    cursor: pointer;
    margin-left: auto;
    padding: 0 4px;
    user-select: none;
}
.bookmark-card:hover .bookmark-goto {
    opacity: 1;
}
.bookmark-goto:hover {
    color: #3b82f6;
}
.favicon-img {
    width: 32px;
    height: 32px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.favicon-img img {
    width: 18px;
    height: 18px;
    object-fit: contain;
}
.bookmark-info {
    flex: 1;
    overflow: hidden;
}
.bookmark-name {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bookmark-tips {
    font-size: 0.65rem;
    color: #6c86a3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
/* 模态框内二维码区域 */
.modal-qrcode-area {
    border-top: 1px solid #eef2f8;
    padding: 16px 20px;
    text-align: center;
    background: #fafdff;
}
.qrcode-hint {
    font-size: 0.7rem;
    color: #5b6e8c;
    margin-top: 8px;
}
/* 分类书签通用样式 */
.category-header {
    margin-bottom: 28px;
    border-left: 4px solid #3b82f6;
    padding-left: 18px;
}
.category-header h2 {
    font-size: 1.6rem;
    font-weight: 600;
}
.subgroup-section {
    margin-top: 28px;
    scroll-margin-top: 20px;
}
.subgroup-title {
    font-size: 1.2rem;
    font-weight: 600;
    padding-bottom: 6px;
    margin-bottom: 16px;
    border-bottom: 1.5px solid #e2edf2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}
.ad-right-slot {
    font-size: 0.65rem;
    background: #fafcff;
    border: 1px dashed #cbdde9;
    border-radius: 12px;
    padding: 4px 10px;
    color: #8ba0bc;
    text-align: center;
    white-space: nowrap;
}
.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
/* 模态框公用部分 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: 0.2s;
}
.modal-overlay.active {
    visibility: visible;
    opacity: 1;
}
.modal-container {
    background: white;
    width: 90%;
    max-width: 500px;
    border-radius: 28px;
    overflow: hidden;
    animation: fadeScale 0.2s ease;
}
@keyframes fadeScale {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid #eef2f8;
}
.modal-header h3 {
    font-weight: 600;
    font-size: 1.2rem;
}
.modal-close {
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #8ba0bc;
    line-height: 1;
}
.modal-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.info-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.info-label {
    font-weight: 600;
    font-size: 0.7rem;
    color: #546e8a;
}
.info-value {
    background: #f0f4fa;
    padding: 8px 12px;
    border-radius: 14px;
    word-break: break-all;
    font-size: 0.8rem;
}
.visit-btn {
    background: #3b82f6;
    color: white;
    text-align: center;
    padding: 10px 0;
    border-radius: 40px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    margin-top: 4px;
    font-size: 0.85rem;
}
.visit-btn:hover {
    background: #2563eb;
}
.modal-ad-slot {
    margin-top: 8px;
    border-top: 1px solid #eef2f8;
    padding: 10px 20px;
    text-align: center;
    font-size: 0.65rem;
    color: #8ba0bc;
    background: #fafdff;
}
.disclaimer {
    font-size: 0.65rem;
    color: #8ba0bc;
    text-align: center;
    padding: 12px 20px;
    border-top: 1px solid #eef2f8;
    background: #fafdff;
}
.loading-state, .empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #5b6e8c;
}
.spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e9f2;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
/* 响应式 */
@media (max-width: 780px) {
    .app {
        flex-direction: column;
    }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    .main-content {
        padding: 20px;
    }
    .feature-tabs {
        margin: -20px -20px 20px -20px;
        padding: 0 20px;
    }
    .feature-tab {
        padding: 10px 16px;
    }
    .category-flat-label {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    .sites-flat-area {
        padding: 12px 16px;
    }
    .engine-btn-flat {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    .bookmark-goto {
        opacity: 0.6;
    }
}
.smooth-scroll {
    scroll-behavior: smooth;
}