/* 漫画风格主题 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --sidebar-width: 240px;
    --header-height: 60px;
    --primary-color: #ff6b9d;
    --secondary-color: #ffd93d;
    --bg-color: #fff8f0;
    --card-bg: #ffffff;
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --border-color: #2d3436;
    --shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    --shadow-hover: 6px 6px 0 rgba(0, 0, 0, 0.15);
}

body {
    font-family: "Comic Sans MS", "Microsoft YaHei", sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* 左侧边栏 */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--card-bg);
    border-right: 3px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 3px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: bold;
    color: white;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.logo i {
    font-size: 24px;
}

/* 侧边栏导航 */
.sidebar-nav {
    flex: 1;
    padding: 16px 0;
    overflow-y: auto;
}

.nav-title {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: bold;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.nav-item {
    margin: 6px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    transition: all 0.2s;
    font-weight: bold;
}

.nav-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.nav-link i:first-child {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.nav-link span {
    flex: 1;
}

.nav-link .arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-item.active .arrow {
    transform: rotate(90deg);
}

.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 12px;
    margin-top: 8px;
    margin-bottom: 8px;
}

.nav-item.active .nav-submenu {
    max-height: 500px;
}

.nav-sublink {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    margin-bottom: 6px;
    border: 2px solid var(--border-color);
    position: relative;
    background: white;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.nav-sublink::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 0;
    background: var(--primary-color);
    border-radius: 2px;
    transition: height 0.2s ease;
}

.nav-sublink:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateX(4px);
    box-shadow: 3px 3px 0 rgba(255, 107, 129, 0.3);
}

.nav-sublink:hover::before {
    height: 60%;
}

.nav-sublink i {
    width: 18px;
    margin-right: 10px;
    font-size: 14px;
    color: var(--primary-color);
}

/* 侧边栏底部 */
.sidebar-footer {
    padding: 16px;
    border-top: 3px solid var(--border-color);
}

.footer-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    background: white;
    transition: all 0.2s;
    font-weight: bold;
}

.footer-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.footer-link i {
    margin-right: 8px;
}

/* 主内容区域 */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 顶部栏 */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 3px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.05);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: var(--secondary-color);
    border: 2px solid var(--border-color);
    font-size: 18px;
    color: var(--text-primary);
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    font-weight: bold;
}

.menu-toggle:hover {
    background: var(--primary-color);
    color: white;
}

.page-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-title i {
    color: var(--primary-color);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 用户操作按钮 */
.user-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add,
.btn-icon {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background: white;
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: bold;
}

.btn-add:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg) scale(1.1);
}

.btn-icon:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

/* 内容包装器 */
.content-wrapper {
    flex: 1;
    padding: 24px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* 每日一言 */
.daily-quote {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.quote-icon {
    position: absolute;
    top: 10px;
    left: 15px;
    font-size: 24px;
    color: rgba(255, 255, 255, 0.3);
}

.quote-text {
    color: white;
    font-size: 16px;
    font-weight: bold;
    margin: 0 0 8px 0;
    padding-left: 35px;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.quote-author {
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
    padding-left: 35px;
    display: block;
}

/* 搜索框容器 */
.search-container {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* 最近访问 */
.recent-visits {
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.recent-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.recent-header h3 {
    font-size: 16px;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-recent {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
}

.clear-recent:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.recent-list {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 0;
}

.recent-item {
    flex-shrink: 0;
    width: 120px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s;
}

.recent-item:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.recent-item-icon {
    width: 32px;
    height: 32px;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 8px;
    border: 2px solid var(--border-color);
}

.recent-item-icon img {
    width: 18px;
    height: 18px;
}

.recent-item-title {
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-box-center {
    position: relative;
    width: 100%;
    max-width: 700px;
}

/* 搜索引擎下拉选择器 */
.search-engine-dropdown {
    position: relative;
    z-index: 10;
}

.engine-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: var(--text-primary);
    transition: all 0.2s;
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.1);
}

.engine-current:hover {
    background: var(--bg-color);
    border-color: var(--primary-color);
    transform: translateY(-50%) translateY(-2px);
    box-shadow: 3px 3px 0 rgba(255, 107, 129, 0.2);
}

.engine-current i:first-child {
    font-size: 16px;
    color: var(--primary-color);
}

.engine-current i:last-child {
    font-size: 12px;
    transition: transform 0.2s;
}

.engine-current.active i:last-child {
    transform: rotate(180deg);
}

.engine-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.1);
    min-width: 160px;
    display: none;
    overflow: hidden;
}

.engine-dropdown-menu.show {
    display: block;
    animation: dropdownSlide 0.2s ease;
}

@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.engine-option:last-child {
    border-bottom: none;
}

.engine-option:hover {
    background: var(--primary-light);
    color: var(--primary-color);
}

.engine-option i,
.engine-option span:first-child {
    font-size: 16px;
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

.engine-option:hover i,
.engine-option:hover span:first-child {
    transform: scale(1.1);
}

/* 搜索表单 */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 140px;
    color: var(--text-secondary);
    font-size: 18px;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 14px 60px 14px 170px;
    border: 3px solid var(--border-color);
    border-radius: 20px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    background: white;
    font-family: inherit;
    font-weight: bold;
}

.search-input:focus {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.search-submit {
    position: absolute;
    right: 6px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--border-color);
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.search-submit:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
    transform: scale(1.1) rotate(15deg);
}

/* 返回按钮 */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: white;
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    margin-bottom: 20px;
    transition: all 0.2s;
    font-weight: bold;
}

.back-button:hover {
    background: var(--secondary-color);
    transform: translateX(-4px);
    box-shadow: var(--shadow);
}

/* 分类区域 */
.category-section {
    margin-bottom: 40px;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow);
}

.category-title-wrapper {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.category-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.category-title i {
    color: var(--primary-color);
}

/* 子分类标签 */
.subcategory-tabs {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* 移动端横向滚动 */
@media (max-width: 768px) {
    .subcategory-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        -ms-overflow-style: none;
        padding-bottom: 4px;
    }
    
    .subcategory-tabs::-webkit-scrollbar {
        display: none;
    }
}

.subcategory-tab {
    padding: 8px 20px;
    background: white;
    border: 3px solid #333;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    position: relative;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.2);
}

.subcategory-tab:hover {
    background: #FFF5F7;
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 rgba(255, 107, 129, 0.3);
}

.subcategory-tab.active {
    background: var(--primary-color);
    border-color: #333;
    color: white;
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
}

.subcategory-tab.active:hover {
    transform: translate(1px, 1px);
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3);
}

.category-count {
    background: var(--secondary-color);
    color: var(--text-primary);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    border: 2px solid var(--border-color);
}

/* 链接网格 */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 4px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* 链接卡片 */
.link-card {
    background: transparent;
    border: none;
    border-radius: 12px;
    padding: 0;
    text-decoration: none;
    color: var(--text-primary);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block;
    position: relative;
    perspective: 1000px;
    height: 100px;
    z-index: 1;
    opacity: 1;
    transform: scale(1);
}

/* 隐藏的卡片 */
.link-card[style*="display: none"] {
    display: none !important;
}

.link-card:hover {
    z-index: 2;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.link-card:hover .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    padding: 12px;
    gap: 10px;
    border: 3px solid var(--border-color);
    overflow: hidden;
}

.card-front {
    background: white;
}

.card-back {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    transform: rotateY(180deg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 8px;
}

.card-back-content {
    color: white;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    overflow: hidden;
}

.card-back-title {
    font-size: 13px;
    font-weight: bold;
    text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 4px;
    margin-top: 4px;
}

.card-back-url {
    font-size: 9px;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    padding: 0 4px;
}

.card-back-btn {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
    padding: 3px 10px;
    border-radius: 6px;
    font-weight: bold;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 2px;
}

.card-back-btn:hover {
    background: var(--secondary-color);
    color: var(--text-primary);
}

.card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    border: 2px solid var(--border-color);
    font-weight: bold;
}

.card-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border-radius: 10px;
    border: 2px solid var(--border-color);
}

.card-icon img {
    width: 20px;
    height: 20px;
}

.card-icon i {
    font-size: 20px;
    color: var(--text-secondary);
}

.card-content {
    flex: 1;
    min-width: 0;
}

.card-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 更多卡片 */
.more-card {
    border-style: dashed;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    text-align: center;
    min-height: 80px;
}

.more-card:hover {
    background: var(--bg-color);
    transform: translateY(-4px);
}

.more-card .card-icon {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
}

.more-card .card-icon i {
    font-size: 24px;
    color: var(--primary-color);
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 24px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 3px solid var(--border-color);
    background: white;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
}

.footer a:hover {
    text-decoration: underline;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: 3px solid var(--border-color);
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    z-index: 999;
    font-size: 20px;
    font-weight: bold;
}

.back-to-top:hover {
    transform: translateY(-4px) rotate(360deg);
    box-shadow: var(--shadow-hover);
}

.back-to-top.show {
    display: flex;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        width: 280px !important;
        max-width: 80vw !important;
        z-index: 1002 !important;
        position: fixed !important;
        left: -280px !important;
        top: 0 !important;
        height: 100vh !important;
        transition: left 0.3s ease !important;
    }
    
    .sidebar.active {
        left: 0 !important;
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.5) !important;
    }
    
    /* 添加遮罩层 */
    body.sidebar-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1001;
        animation: fadeIn 0.3s ease;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
    }
    
    .search-box-center {
        max-width: 100%;
    }
    
    .engine-current {
        padding: 8px 10px;
        font-size: 12px;
        left: 6px;
    }
    
    .search-icon {
        left: 110px;
        font-size: 16px;
    }
    
    .search-input {
        padding: 12px 50px 12px 140px;
        font-size: 14px;
    }
    
    .page-title {
        font-size: 16px;
    }
    
    .page-title i {
        display: none;
    }
    
    .links-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .content-wrapper {
        padding: 12px;
    }
    
    .category-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 10px 12px;
    }
    
    .category-title-wrapper {
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .category-title {
        font-size: 18px;
    }
    
    .subcategory-tabs {
        width: 100%;
        gap: 6px;
    }
    
    .subcategory-tab {
        padding: 6px 12px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    
    .category-count {
        align-self: flex-end;
        position: absolute;
        top: 10px;
        right: 12px;
    }
    
    .card-title {
        font-size: 13px;
    }
    
    .card-description {
        font-size: 11px;
    }
    
    .daily-quote {
        padding: 12px;
        margin-bottom: 16px;
    }
    
    .quote-text {
        font-size: 14px;
    }
    
    .settings-content {
        width: 90%;
        max-width: 400px;
    }
    
    .user-actions {
        gap: 6px;
    }
    
    .btn-add, .btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .back-to-top {
        width: 44px;
        height: 44px;
        right: 16px;
        bottom: 16px;
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .links-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .top-header {
        padding: 0 12px;
        height: 50px;
    }
    
    .header-left {
        gap: 8px;
    }
    
    .page-title {
        font-size: 14px;
    }
    
    .engine-current span {
        display: none;
    }
    
    .engine-current {
        padding: 6px 8px;
        left: 6px;
        font-size: 14px;
    }
    
    .search-icon {
        left: 50px;
        font-size: 14px;
    }
    
    .search-input {
        font-size: 13px;
        padding: 10px 45px 10px 75px;
        border-radius: 16px;
    }
    
    .search-submit {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }
    
    .content-wrapper {
        padding: 10px;
    }
    
    .category-header {
        padding: 8px 10px;
    }
    
    .category-title {
        font-size: 16px;
    }
    
    .subcategory-tab {
        padding: 5px 10px;
        font-size: 11px;
        border-width: 2px;
    }
    
    .link-card {
        height: 90px;
    }
    
    .card-front, .card-back {
        padding: 10px;
        gap: 8px;
    }
    
    .card-icon {
        width: 32px;
        height: 32px;
    }
    
    .card-icon img {
        width: 18px;
        height: 18px;
    }
    
    .card-title {
        font-size: 12px;
    }
    
    .card-description {
        font-size: 10px;
        -webkit-line-clamp: 2;
    }
    
    .daily-quote {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .quote-text {
        font-size: 13px;
    }
    
    .quote-author {
        font-size: 10px;
    }
    
    .recent-visits {
        padding: 10px;
    }
    
    .recent-item {
        padding: 8px;
    }
    
    .settings-content {
        width: 95%;
        padding: 16px;
    }
    
    .setting-item {
        padding: 12px;
    }
    
    .setting-title {
        font-size: 13px;
    }
    
    .setting-desc {
        font-size: 11px;
    }
    
    .user-actions {
        gap: 4px;
    }
    
    .btn-add, .btn-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .footer {
        padding: 16px;
        font-size: 12px;
    }
    
    .back-to-top {
        width: 40px;
        height: 40px;
        right: 12px;
        bottom: 12px;
        font-size: 16px;
    }
    
    /* 移动端禁用卡片翻转效果 */
    .link-card:hover .card-inner {
        transform: none;
    }
    
    .card-back {
        display: none;
    }
}
}

/* 滚动条样式 */
.sidebar::-webkit-scrollbar,
.sidebar-nav::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track,
.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb,
.sidebar-nav::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.sidebar::-webkit-scrollbar-thumb:hover,
.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* 暗色主题 */
body.dark-theme {
    --bg-color: #1a1a2e;
    --card-bg: #16213e;
    --text-primary: #eaeaea;
    --text-secondary: #a0a0a0;
    --border-color: #0f3460;
    --primary-color: #e94560;
    --secondary-color: #533483;
    --hover-bg: #0f3460;
    --shadow: 4px 4px 0 rgba(233, 69, 96, 0.2);
    --shadow-hover: 6px 6px 0 rgba(233, 69, 96, 0.3);
}

body.dark-theme .sidebar {
    background: var(--card-bg);
    border-right-color: var(--border-color);
}

body.dark-theme .sidebar-header {
    background: linear-gradient(135deg, #e94560 0%, #533483 100%);
}

body.dark-theme .nav-link,
body.dark-theme .footer-link {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .nav-link:hover,
body.dark-theme .footer-link:hover {
    background: var(--hover-bg);
}

body.dark-theme .nav-sublink {
    color: var(--text-primary);
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.05);
}

body.dark-theme .nav-sublink::before {
    background: var(--primary-color);
}

body.dark-theme .nav-sublink:hover {
    background: var(--hover-bg);
    color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 3px 3px 0 rgba(255, 107, 129, 0.3);
}

body.dark-theme .top-header {
    background: var(--card-bg);
    border-bottom-color: var(--border-color);
}

body.dark-theme .menu-toggle,
body.dark-theme .btn-add,
body.dark-theme .btn-icon {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .menu-toggle:hover,
body.dark-theme .btn-add:hover,
body.dark-theme .btn-icon:hover {
    background: var(--primary-color);
    color: white;
}

body.dark-theme .search-input {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .search-input::placeholder {
    color: var(--text-secondary);
}

body.dark-theme .search-input:focus {
    border-color: var(--primary-color);
}

body.dark-theme .engine-current {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 2px 2px 0 rgba(255, 255, 255, 0.1);
}

body.dark-theme .engine-current:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    box-shadow: 3px 3px 0 rgba(255, 107, 129, 0.3);
}

body.dark-theme .engine-dropdown-menu {
    background: var(--card-bg);
    border-color: var(--border-color);
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.3);
}

body.dark-theme .engine-option {
    color: var(--text-primary);
    border-bottom-color: var(--border-color);
}

body.dark-theme .engine-option:hover {
    background: var(--hover-bg);
}

body.dark-theme .engine-btn {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .engine-btn:hover {
    background: var(--hover-bg);
}

body.dark-theme .engine-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

body.dark-theme .search-submit {
    background: var(--primary-color);
    border-color: var(--border-color);
}

body.dark-theme .recent-visits {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .clear-recent {
    border-color: var(--border-color);
    color: var(--text-secondary);
}

body.dark-theme .clear-recent:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

body.dark-theme .recent-item {
    background: var(--bg-color);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .recent-item:hover {
    background: var(--hover-bg);
}

body.dark-theme .recent-item-icon {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .category-header {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .category-count {
    background: var(--hover-bg);
    border-color: var(--border-color);
}

body.dark-theme .subcategory-tab {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.1);
}

body.dark-theme .subcategory-tab:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: 5px 5px 0 rgba(255, 107, 129, 0.3);
}

body.dark-theme .subcategory-tab.active {
    background: var(--primary-color);
    border-color: var(--border-color);
    color: white;
    box-shadow: 1px 1px 0 rgba(255, 255, 255, 0.2);
}

body.dark-theme .card-front {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .card-icon {
    background: var(--bg-color);
    border-color: var(--border-color);
}

body.dark-theme .back-button {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .back-button:hover {
    background: var(--hover-bg);
}

body.dark-theme .footer {
    background: var(--card-bg);
    border-top-color: var(--border-color);
}

body.dark-theme .back-to-top {
    background: var(--primary-color);
    border-color: var(--border-color);
}

body.dark-theme .settings-content {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .settings-close {
    background: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-primary);
}

body.dark-theme .settings-close:hover {
    background: var(--primary-color);
}

body.dark-theme .setting-item {
    background: var(--bg-color);
    border-color: var(--border-color);
}

body.dark-theme .slider {
    background-color: var(--hover-bg);
    border-color: var(--border-color);
}

body.dark-theme input:checked + .slider {
    background-color: var(--primary-color);
}

/* 右键菜单样式优化 - 使用更高优先级 */
ul.context-menu-list {
    border: 3px solid var(--border-color) !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    padding: 8px !important;
    font-family: inherit !important;
    z-index: 99999 !important;
    background: white !important;
    position: fixed !important;
    min-width: 180px !important;
    list-style: none !important;
}

ul.context-menu-list li.context-menu-item {
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-weight: bold !important;
    transition: all 0.2s !important;
    font-size: 14px !important;
    white-space: nowrap !important;
    display: block !important;
    clear: both !important;
    line-height: 1.5 !important;
    cursor: pointer !important;
    margin: 2px 0 !important;
    overflow: hidden !important;
    height: auto !important;
    width: auto !important;
}

ul.context-menu-list li.context-menu-item:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

ul.context-menu-list li.context-menu-item:hover .context-menu-icon {
    color: white !important;
}

ul.context-menu-list li.context-menu-item:hover span {
    color: white !important;
}

ul.context-menu-list li.context-menu-separator {
    border-top: 2px solid var(--border-color) !important;
    margin: 6px 8px !important;
    height: 0 !important;
    padding: 0 !important;
    display: block !important;
    clear: both !important;
}

ul.context-menu-list li.context-menu-item .context-menu-icon {
    display: inline-block !important;
    width: 20px !important;
    margin-right: 10px !important;
    text-align: center !important;
    float: left !important;
    height: auto !important;
}

ul.context-menu-list li.context-menu-item span {
    display: inline !important;
    float: none !important;
}

/* 强制移除所有可能导致竖排的样式 */
ul.context-menu-list,
ul.context-menu-list *,
ul.context-menu-list li,
ul.context-menu-list li *,
.context-menu-list,
.context-menu-list *,
.context-menu-item,
.context-menu-item *,
.context-menu-icon,
.context-menu-icon * {
    writing-mode: horizontal-tb !important;
    text-orientation: mixed !important;
    direction: ltr !important;
    text-align: left !important;
    -webkit-writing-mode: horizontal-tb !important;
    -ms-writing-mode: lr-tb !important;
}

body.dark-theme ul.context-menu-list {
    background: var(--card-bg) !important;
    border-color: var(--border-color) !important;
}

body.dark-theme ul.context-menu-list li.context-menu-item {
    color: var(--text-primary) !important;
}

body.dark-theme ul.context-menu-list li.context-menu-item:hover {
    background: var(--primary-color) !important;
    color: white !important;
}

/* 加载动画 */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s, visibility 0.5s;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
}

.loading-comic {
    position: relative;
    margin-bottom: 30px;
}

.comic-bubble {
    position: relative;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 30px;
    display: inline-block;
    animation: bubbleBounce 1s ease-in-out infinite;
}

.bubble-text {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
}

.bubble-tail {
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 15px solid white;
}

.bubble-tail::before {
    content: '';
    position: absolute;
    bottom: 3px;
    left: -18px;
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 18px solid var(--border-color);
}

.loading-spinner {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.spinner-star {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    animation: starSpin 1s ease-in-out infinite;
}

.spinner-star:nth-child(2) {
    animation-delay: 0.2s;
    background: var(--secondary-color);
}

.spinner-star:nth-child(3) {
    animation-delay: 0.4s;
    background: var(--primary-color);
}

.loading-text {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: bold;
    animation: textFade 2s ease-in-out infinite;
}

@keyframes bubbleBounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes starSpin {
    0% {
        transform: rotate(0deg) scale(1);
    }
    50% {
        transform: rotate(180deg) scale(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
    }
}

@keyframes textFade {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* 鼠标粒子画布 */
#particleCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
}

body.dark-theme .loading-screen {
    background: var(--bg-color);
}

body.dark-theme .comic-bubble {
    background: var(--card-bg);
    border-color: var(--border-color);
}

body.dark-theme .bubble-text {
    color: var(--primary-color);
}

body.dark-theme .bubble-tail {
    border-top-color: var(--card-bg);
}

body.dark-theme .bubble-tail::before {
    border-top-color: var(--border-color);
}

/* 设置面板 */
.settings-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: none;
}

.settings-panel.active {
    display: block;
}

.settings-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.settings-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: white;
    border: 3px solid var(--border-color);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 3px solid var(--border-color);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-radius: 13px 13px 0 0;
}

.settings-header h3 {
    color: white;
    font-size: 18px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    text-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2);
}

.settings-close {
    background: white;
    border: 2px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
    color: var(--text-primary);
}

.settings-close:hover {
    background: var(--primary-color);
    color: white;
    transform: rotate(90deg);
}

.settings-body {
    padding: 20px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    margin-bottom: 12px;
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s;
}

.setting-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow);
}

.setting-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.setting-info > i {
    font-size: 24px;
    color: var(--primary-color);
    width: 32px;
    text-align: center;
}

.setting-title {
    font-size: 15px;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.setting-desc {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 开关按钮 */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 28px;
    border: 2px solid var(--border-color);
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(22px);
}

.slider:hover {
    box-shadow: 0 0 8px rgba(255, 107, 157, 0.5);
}

/* 主题切换提示 */
.theme-toast {
    position: fixed;
    bottom: 80px;
    right: 24px;
    background: var(--card-bg);
    color: var(--text-primary);
    padding: 12px 20px;
    border: 3px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    z-index: 9999;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
}

.theme-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.theme-toast i {
    font-size: 18px;
    color: var(--primary-color);
}
