/* 基础样式 */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    transition: background-color 0.3s, color 0.3s;
}

body.dark-mode {
    background-color: #121212;
    color: #f0f0f0;
}

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

/* 头部样式 */
header {
    display: flex;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.dark-mode header {
    border-bottom: 1px solid #444;
}

.search-bar {
    display: flex;
    flex-grow: 1;
}

.search-bar input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 0;
    transition: border-color 0.3s;
}

.dark-mode .search-bar input {
    border-color: #555;
    background-color: #333;
    color: #f0f0f0;
}

.search-bar button {
    display: none;
}

/* 主题切换按钮 */
.theme-switch {
    position: fixed;
    bottom: 20px;
    right: 20px;
}

.theme-switch button {
    padding: 10px;
    background-color: transparent;
    color: #333;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode .theme-switch button {
    color: #f0f0f0;
}

.theme-switch button:hover {
    background-color: rgba(0, 0, 0, 0.1);
    transform: scale(1.1);
}

.dark-mode .theme-switch button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.theme-switch button i {
    font-size: 1.2em;
}

/* 链接分类区块 */
.category {
    margin-bottom: 30px;
}

.category-title {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #007bff;
    transition: color 0.3s;
}

.dark-mode .category-title {
    color: #4da6ff;
}

.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.link-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.dark-mode .link-item {
    background-color: #333;
    border-color: #555;
    color: #f0f0f0;
}

.link-item:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

.dark-mode .link-item:hover {
    background-color: #444;
    border-color: #777;
}

.link-item img {
    max-width: 40px;
    max-height: 40px;
    margin-right: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        width: 95%;
    }

    header {
        flex-direction: column;
        align-items: stretch;
    }

    .search-bar {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* 头部操作区域 */
.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
}

/* 数据管理面板 */
.data-panel {
    display: flex;
    gap: 8px;
}

/* 图标按钮样式 */
.icon-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.icon-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    opacity: 0;
    transition: opacity 0.3s;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    color: #007bff;
}

.icon-btn:hover::after {
    opacity: 1;
}

.icon-btn i {
    font-size: 16px;
    transition: transform 0.3s;
}

.icon-btn:hover i {
    transform: scale(1.1);
}

/* 暗色模式适配 */
.dark-mode .icon-btn {
    background: rgba(255, 255, 255, 0.05);
    color: #888;
}

.dark-mode .icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #4da6ff;
}

/* 文件输入隐藏 */
#importFile {
    display: none;
}

/* 添加工具提示 */
[title] {
    position: relative;
}

[title]:hover::before {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    animation: fadeIn 0.2s ease-out;
}

.dark-mode [title]:hover::before {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translate(-50%, 5px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}

/* 添加导入/导出操作的反馈提示 */
.toast {
    position: fixed;
    bottom: 80px;
    right: 20px;
    padding: 12px 24px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 6px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
} 