:root {
    --primary: #007bff;
    --bg: #f8f9fa;
    --card: #ffffff;
    --text: #333;
}

body {
    font-family: -apple-system, sans-serif;
    background: var(--bg);
    margin: 0;
    padding: 20px;
    color: var(--text);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.header h1 {
    margin: 0;
    font-size: 22px;
    cursor: pointer;
}

.search-row {
    display: flex;
    gap: 10px;
    flex: 1;
    max-width: 400px;
    margin: 0 20px;
}

.search-input {
    flex: 1;
    padding: 10px 18px;
    border-radius: 25px;
    border: 1px solid #ddd;
    outline: none;
    transition: 0.3s;
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.2);
}

.btn-add {
    background: linear-gradient(45deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    white-space: nowrap;
}

.btn-icon {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
}

.btn-icon:hover {
    background: #eee;
}

.tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    padding: 6px 16px;
    background: #e0e0e0;
    border-radius: 20px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 14px;
    transition: 0.2s;
}

.tab.active {
    background: var(--primary);
    color: white;
}

/* 列表与排序样式 */
#list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 6px;
}

.group-title {
    grid-column: 1/-1;
    margin: 20px 0 8px 5px;
    font-size: 15px;
    color: var(--primary);
    opacity: 0.8;
    font-weight: 600;
}

.bookmark-card {
    background: white;
    padding: 6px;
    border-radius: 10px;
    border: 1px solid #eee;
    display: flex;
    gap: 6px;
    cursor: grab;
    transition: transform 0.2s, box-shadow 0.2s;
}

.bookmark-card:active {
    cursor: grabbing;
}

.bookmark-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.bookmark-card img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: 4px;
}

.bookmark-card .info {
    flex: 1;
    min-width: 0;
}

.bookmark-card a {
    text-decoration: none;
    color: var(--text);
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 14px;
}

.tag-list {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

/* 拖拽占位符 */
.sortable-ghost {
    opacity: 0.3;
    background: var(--primary) !important;
}

/* 弹窗与右键菜单 */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal {
    background: white;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.modal label {
    display: block;
    font-size: 12px;
    color: #666;
    margin: 10px 0 5px;
}

.modal input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
    outline: none;
}

.modal-btns {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.modal-btns button {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
}

#context-menu {
    position: fixed;
    width: 140px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    display: none;
    overflow: hidden;
}

.ctx-item {
    padding: 10px 15px;
    font-size: 14px;
    cursor: pointer;
}

.ctx-item:hover {
    background: #f1f1f1;
}

.ctx-item.danger {
    color: #ff4444;
}