:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #10b981;
    --bg-color: #f0f9ff;
    --card-bg: rgba(255, 255, 255, 0.7);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
    --glass-border: 1px solid rgba(255, 255, 255, 0.18);
    --glass-backdrop: blur(20px);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-color: #0c0a1a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --border-color: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    transition: var(--transition);
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 15% 85%, rgba(120, 119, 198, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 85% 15%, rgba(255, 119, 198, 0.4) 0%, transparent 60%),
        radial-gradient(circle at 35% 35%, rgba(120, 219, 255, 0.3) 0%, transparent 60%),
        radial-gradient(circle at 70% 70%, rgba(255, 219, 120, 0.2) 0%, transparent 60%),
        radial-gradient(circle at 50% 20%, rgba(120, 255, 219, 0.2) 0%, transparent 60%);
    z-index: -1;
    pointer-events: none;
}

/* 网格背景 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -3;
    pointer-events: none;
    opacity: 0.6;
}

[data-theme="dark"] body::after {
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
    opacity: 0.4;
}

/* 浮动粒子背景 - 调整为更柔和的上升效果 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, rgba(255, 255, 255, 0.05) 50%, transparent 100%);
    border-radius: 50%;
    animation: gentleRise 30s infinite ease-in-out;
    filter: blur(3px);
    opacity: 0.6;
}

.particle:nth-child(1) {
    width: 60px;
    height: 60px;
    left: 10%;
    animation-delay: 0s;
    animation-duration: 25s;
}

.particle:nth-child(2) {
    width: 40px;
    height: 40px;
    left: 20%;
    animation-delay: 2s;
    animation-duration: 20s;
}

.particle:nth-child(3) {
    width: 80px;
    height: 80px;
    left: 70%;
    animation-delay: 4s;
    animation-duration: 30s;
}

.particle:nth-child(4) {
    width: 30px;
    height: 30px;
    left: 80%;
    animation-delay: 6s;
    animation-duration: 18s;
}

.particle:nth-child(5) {
    width: 50px;
    height: 50px;
    left: 90%;
    animation-delay: 8s;
    animation-duration: 22s;
}

@keyframes gentleRise {
    0% {
        transform: translateY(100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
    20% {
        opacity: 0.4;
        transform: translateY(80vh) translateX(5px) scale(0.8);
    }
    80% {
        opacity: 0.4;
        transform: translateY(-20vh) translateX(-3px) scale(0.8);
    }
    100% {
        transform: translateY(-100vh) translateX(0) scale(0.5);
        opacity: 0;
    }
}

@keyframes gradientBG {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

header {
    text-align: center;
    padding: 60px 0 40px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    border-radius: 0 0 30px 30px;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    z-index: 2;
    pointer-events: none;
}

.header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

h1 {
    font-weight: 800;
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: white;
    letter-spacing: -1.5px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    z-index: 3;
}

header p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 3;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: white;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    z-index: 5;
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(180deg);
}

.search-section {
    padding: 40px 0 30px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 0.05) 100%);
    position: relative;
    z-index: 10;
    margin-top: -20px;
    border-radius: 30px 30px 0 0;
}

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

.search-box {
    display: flex;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(31, 38, 135, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    transition: var(--transition);
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.search-box:focus-within {
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.01);
}

#search-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 15px;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-weight: 500;
}

#search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

[data-theme="dark"] #search-input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

#search-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

#search-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.quick-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
    max-width: 500px;
    margin: 0 auto;
    padding: 0 20px;
}

.quick-action-btn {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.2);
    border: var(--glass-border);
    border-radius: 10px;
    color: white;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: var(--transition);
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--glass-shadow);
}

.quick-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(31, 38, 135, 0.2);
}

.bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    padding: 0 20px;
    margin: 0 auto 60px;
    max-width: 1200px;
    justify-content: start;
}

.category {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 16px 20px;
    box-shadow: var(--glass-shadow);
    border: var(--glass-border);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    max-width: 250px;
}

.category:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.2);
}

.category::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, rgba(255, 255, 255, 0.1) 100%);
    border-radius: 16px;
    z-index: -1;
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-color);
}

.category h2 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}

.category-count {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    flex-shrink: 0;
}

.links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.links a {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    font-size: 14px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    white-space: nowrap;
    overflow: hidden;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.1);
}

.links a:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--primary-color);
    transform: translateX(4px);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.1);
}

.link-icon {
    width: 14px;
    height: 14px;
    margin-right: 6px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    display: none;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

footer {
    text-align: center;
    padding: 30px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    border-top: 1px solid var(--border-color);
}

.admin-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--primary-color);
    color: white;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 12px;
    transition: var(--transition);
    z-index: 100;
}

.admin-link:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

#refresh-btn {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    font-size: 16px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    transition: all 0.3s ease;
    z-index: 99;
}

#refresh-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    .bookmarks {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 12px;
    }

    h1 {
        font-size: 2rem;
    }

    .search-container {
        margin-bottom: 20px;
    }

    .quick-actions {
        gap: 8px;
    }

    .quick-action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    header {
        padding: 40px 0 30px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .bookmarks {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 10px;
        padding: 0 10px;
    }

    .category {
        padding: 12px 16px;
        max-width: 200px;
    }

    .theme-toggle {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

