/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 柔和的灰蓝色渐变背景 - 护眼配色 */
    --bg-primary: linear-gradient(135deg, #e8eaf6 0%, #f5f7fa 100%);
    --bg-secondary: rgba(255, 255, 255, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --card-bg: rgba(255, 255, 255, 0.9);
    --card-hover: rgba(255, 255, 255, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* 深色模式 - 柔和的深灰色背景 */
    --bg-primary: linear-gradient(135deg, #1e1e2e 0%, #2a2a3e 100%);
    --bg-secondary: rgba(30, 30, 46, 0.95);
    --text-primary: #e8eaf6;
    --text-secondary: #b4b7c9;
    --card-bg: rgba(42, 42, 62, 0.9);
    --card-hover: rgba(42, 42, 62, 1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 导航栏 */
.navbar {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 20px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
}

.nav-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-box {
    padding: 12px 20px;
    border: 2px solid transparent;
    border-radius: 25px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    width: 300px;
    transition: var(--transition);
}

.search-box:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 返回博客按钮 */
.back-to-blog {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.back-to-blog:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.back-to-blog svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.back-to-blog span {
    color: white;
}

.theme-toggle {
    background: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(15deg);
}

/* 主内容区 */
.main-content {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* 分类侧边栏 */
.categories {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.categories h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-btn {
    background: transparent;
    border: none;
    padding: 12px 16px;
    text-align: left;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1rem;
    transition: var(--transition);
    font-weight: 500;
}

.category-btn:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    transform: translateX(5px);
}

.category-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* 网站卡片网格 */
.bookmarks-section {
    min-height: 400px;
}

.bookmarks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* 网站卡片 */
.bookmark-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.bookmark-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    background: var(--card-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 15px;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-shrink: 0;
}

.card-icon img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.card-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-url {
    color: #667eea;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 1.2rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 200px 1fr;
    }

    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .categories {
        position: static;
    }

    .category-list {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .nav-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .search-box {
        width: 100%;
        order: 3;
    }

    .back-to-blog {
        order: 1;
        padding: 8px 16px;
        font-size: 0.9rem;
    }

    .back-to-blog svg {
        width: 18px;
        height: 18px;
    }

    .theme-toggle {
        order: 2;
    }

    .bookmarks-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    .navbar {
        padding: 15px 20px;
    }

    .logo {
        font-size: 1.5rem;
    }

    .back-to-blog span {
        display: none;
    }

    .back-to-blog {
        padding: 10px;
        border-radius: 50%;
        width: 40px;
        height: 40px;
        justify-content: center;
    }

    .back-to-blog svg {
        width: 20px;
        height: 20px;
    }

    .theme-toggle {
        width: 40px;
        height: 40px;
    }

    .bookmarks-grid {
        grid-template-columns: 1fr;
    }
}


/* ========================================================================
   悬浮球菜单样式
   ======================================================================== */

.floating-menu-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    opacity: 1;
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: all;
}

/* 悬浮球按钮 */
.floating-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 10;
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.floating-btn:active {
    transform: scale(0.95);
}

.floating-btn svg {
    width: 24px;
    height: 24px;
    color: white;
    transition: all 0.3s ease;
}

.floating-btn .icon-close {
    position: absolute;
    opacity: 0;
    transform: rotate(-90deg);
}

.floating-btn.active .icon-menu {
    opacity: 0;
    transform: rotate(90deg);
}

.floating-btn.active .icon-close {
    opacity: 1;
    transform: rotate(0deg);
}

.floating-btn.active {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* 菜单项容器 */
.floating-menu-items {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-menu-items.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 菜单项 */
.floating-menu-items .menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 28px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-decoration: none;
    color: #2d3748;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: right center;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

.floating-menu-items .menu-item:hover {
    transform: translateX(-5px) scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 1);
}

.floating-menu-items .menu-item svg {
    width: 20px;
    height: 20px;
    color: #667eea;
    flex-shrink: 0;
}

.floating-menu-items .menu-item span {
    color: #2d3748;
}

/* 深色模式适配 */
[data-theme="dark"] .floating-menu-items .menu-item {
    background: rgba(45, 55, 72, 0.95);
    color: #f7fafc;
}

[data-theme="dark"] .floating-menu-items .menu-item:hover {
    background: rgba(45, 55, 72, 1);
}

[data-theme="dark"] .floating-menu-items .menu-item span {
    color: #f7fafc;
}

[data-theme="dark"] .floating-menu-items .menu-item svg {
    color: #a78bfa;
}

/* 菜单项动画延迟 */
.floating-menu-items.active .menu-item:nth-child(1) {
    transition-delay: 0.05s;
}

.floating-menu-items.active .menu-item:nth-child(2) {
    transition-delay: 0.1s;
}

.floating-menu-items.active .menu-item:nth-child(3) {
    transition-delay: 0.15s;
}

.floating-menu-items.active .menu-item:nth-child(4) {
    transition-delay: 0.2s;
}

.floating-menu-items.active .menu-item:nth-child(5) {
    transition-delay: 0.25s;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .floating-menu-container {
        bottom: 20px;
        right: 20px;
    }

    .floating-btn {
        width: 50px;
        height: 50px;
    }

    .floating-btn svg {
        width: 22px;
        height: 22px;
    }

    .floating-menu-items .menu-item {
        padding: 10px 16px;
        font-size: 13px;
    }

    .floating-menu-items .menu-item svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {
    .floating-menu-container {
        bottom: 15px;
        right: 15px;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
    }

    .floating-menu-items .menu-item {
        padding: 10px 14px;
        font-size: 12px;
    }
}
