/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: #1e2030;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* 背景样式 - 增强渐变效果 */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -10;
    background: linear-gradient(-45deg, 
        rgba(20, 30, 60, 0.9),
        rgba(30, 40, 80, 0.9),
        rgba(40, 50, 90, 0.9),
        rgba(25, 35, 70, 0.9)
    );
    background-size: 400% 400%;
    animation: gradient 20s ease infinite;
}

/* 背景渐变动画 - 加快速度 */
@keyframes gradient {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* 添加半透明背景覆盖层 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 28, 40, 0.3);  /* 暗色半透明覆盖 */
    z-index: -1;
}

/* 粒子容器 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -5;
    overflow: hidden;
    pointer-events: none;
}

/* 粒子样式 - 增加亮度和可见度 */
.particle {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(100, 150, 255, 0.4);
    box-shadow: 0 0 10px rgba(150, 200, 255, 0.6);
    pointer-events: none;
}

/* 粒子闪烁动画 */
@keyframes twinkle {
    0%, 100% { opacity: 0.2; }
    50% { opacity: 0.5; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #3a3f59;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #e0e0e0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

#date-time {
    font-size: 1rem;
    color: #b0b0b0;
}

/* 搜索栏样式 */
.search-container {
    max-width: 700px;
    margin: 0 auto 40px;
}

.search-box {
    display: flex;
    background: rgba(55, 60, 90, 0.8);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    margin-bottom: 15px;
    margin-top: 20px; /* 增加与上方搜索引擎按钮的间距 */
}

.search-box:focus-within {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    background: rgba(60, 65, 95, 0.9);
}

#search-input {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 1rem;
    outline: none;
    background: transparent;
    color: #e0e0e0;
}

#search-input::placeholder {
    color: #9aa0c2;
}

#search-button {
    border: none;
    background: #4d5987;
    color: #e0e0e0;
    padding: 0 25px;
    cursor: pointer;
    transition: background 0.3s;
}

#search-button:hover {
    background: #5d6aa0;
}

.search-engines {
    display: flex;
    justify-content: center;
    gap: 15px; /* 增加搜索引擎按钮之间的间距 */
    margin-bottom: 15px; /* 增加搜索引擎按钮与搜索框之间的间距 */
    padding: 10px 0; /* 增加上下内边距 */
}

.search-engine {
    width: 50px; /* 增加宽度 */
    height: 50px; /* 增加高度 */
    border-radius: 50%;
    border: 2px solid transparent;
    background: rgba(55, 60, 90, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #a0a0c0;
    font-size: 14px; /* 增加字体大小 */
    font-weight: 500; /* 增加字体粗细 */
}

.search-engine img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    filter: brightness(0.9);
}

.search-engine.active {
    border-color: #717cb4;
    transform: scale(1.1);
    background: rgba(65, 70, 100, 0.9);
    color: #e0e0e0;
}

/* 书签部分样式 */
.bookmarks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.section {
    background: rgba(45, 50, 75, 0.8);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    transition: transform 0.3s, box-shadow 0.3s;
}

.section:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    background: rgba(50, 55, 80, 0.85);
}

.section h2 {
    color: #d0d0e0;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3f59;
    font-size: 1.4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section h2 .controls {
    display: flex;
    gap: 10px;
}

.section h2 .controls button {
    background: none;
    border: none;
    color: #a0a0c0;
    cursor: pointer;
    font-size: 1rem;
    transition: color 0.3s;
}

.section h2 .controls button:hover {
    color: #e0e0e0;
}

.links-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.bookmark-item {
    text-decoration: none;
    color: #d0d0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    cursor: pointer;
    background-color: rgba(60, 65, 95, 0.6);
    position: relative;
}

.bookmark-item:hover {
    background-color: rgba(70, 75, 105, 0.8);
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.bookmark-item .icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    background-color: rgba(70, 75, 105, 0.5);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.bookmark-item .icon i {
    font-size: 1.5rem;
    color: #a0a0c0;
}

.bookmark-item:hover .icon i {
    color: #d0d0e0;
}

.bookmark-item .icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: brightness(0.9);
}

.bookmark-item .title {
    font-size: 0.9rem;
    text-align: center;
    word-break: break-word;
}

/* 拖拽相关样式 */
.bookmark-item.dragging {
    opacity: 0.5;
    background-color: rgba(80, 85, 130, 0.7);
}

.bookmark-item .drag-handle {
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.2s;
    color: #8090c0;
    cursor: move;
}

.bookmark-item:hover .drag-handle {
    opacity: 1;
}

/* 添加链接表单样式 */
.add-link-form {
    background: rgba(45, 50, 75, 0.9);
    padding: 20px;
    border-radius: 10px;
    margin-top: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: none;
}

.add-link-form.visible {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #b0b0c0;
    font-size: 0.9rem;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #3a3f59;
    background: rgba(55, 60, 90, 0.8);
    color: #e0e0e0;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #5d6aa0;
}

.button-group {
    display: flex;
    gap: 10px;
}

.button-group button {
    padding: 8px 15px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.button-group button.save {
    background: #4d5987;
    color: #e0e0e0;
}

.button-group button.save:hover {
    background: #5d6aa0;
}

.button-group button.cancel {
    background: rgba(60, 60, 60, 0.5);
    color: #b0b0c0;
}

.button-group button.cancel:hover {
    background: rgba(70, 70, 70, 0.7);
    color: #e0e0e0;
}

/* 图标选择器相关样式 */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.overlay.visible {
    display: block;
}

.icon-selector {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 800px;
    max-height: 80vh;
    background-color: #2a2d3e;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    z-index: 1001;
    overflow: hidden;
    padding: 20px;
}

.icon-selector.visible {
    display: block;
}

.icon-selector-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #3a3f55;
}

.icon-selector-header h3 {
    margin: 0;
    color: #e0e0e0;
}

.close-button {
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.close-button:hover {
    color: #ff5555;
}

.icon-search {
    margin-bottom: 15px;
}

.icon-search input {
    width: 100%;
    padding: 10px;
    background-color: #363b54;
    border: 1px solid #4a5173;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 1rem;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 15px;
    max-height: 60vh;
    overflow-y: auto;
    padding: 10px;
}

.icon-item {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    background-color: #363b54;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.icon-item:hover {
    background-color: #4a5173;
    transform: scale(1.05);
}

.icon-item i {
    font-size: 24px;
    color: #e0e0e0;
}

/* 底部样式 */
footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    color: #a0a0c0;
    font-size: 0.9rem;
    background-color: rgba(45, 50, 75, 0.7);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(5px);
}

footer a {
    color: #8090c0;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    color: #a0b0d0;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .bookmarks {
        grid-template-columns: 1fr;
    }
    
    .links-container {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
    
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    }
    
    .icon-item {
        width: 50px;
        height: 50px;
    }
}

@media (max-width: 480px) {
    .search-box {
        border-radius: 25px;
    }
    
    #search-input {
        padding: 12px 15px;
    }
    
    #search-button {
        padding: 0 15px;
    }
    
    .search-engines {
        gap: 5px;
    }
    
    .search-engine {
        width: 30px;
        height: 30px;
    }
} 