/* ========== 全局重置 ========== */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: system-ui, -apple-system, sans-serif; }
body { background: #f0f3f9; padding: 40px 20px; transition: background 0.3s; min-height: 100vh; display: flex; align-items: center; justify-content: center; }
body.dark { background: #1a1b26; color: #e5e5e5; }

/* ========== 容器 ========== */
.container { max-width: 1200px; margin: 0 auto; background: #fff; border-radius: 16px; padding: 32px; position: relative; box-shadow: 0 2px 12px rgba(0,0,0,0.05); transition: background 0.3s, box-shadow 0.3s; width: 100%; }
body.dark .container { background: #242535; box-shadow: 0 2px 12px rgba(0,0,0,0.2); }

/* ========== 登录页 ========== */
#loginPage { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.login-box { background: #fff; padding: 48px 40px; border-radius: 16px; box-shadow: 0 4px 20px rgba(0,0,0,0.08); width: 100%; max-width: 400px; transition: background 0.3s; }
body.dark .login-box { background: #242535; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.login-box h2 { font-size: 24px; color: #111827; margin-bottom: 8px; text-align: center; }
body.dark .login-box h2 { color: #f9fafb; }
.login-box .sub { color: #6b7280; font-size: 14px; text-align: center; margin-bottom: 28px; }
body.dark .login-box .sub { color: #9ca3af; }
.login-box .form-item { margin-bottom: 16px; }
.login-box .form-item label { display: block; margin-bottom: 6px; color: #1f2937; font-weight: 500; font-size: 14px; }
body.dark .login-box .form-item label { color: #e5e5e5; }
.login-box .form-item input { width: 100%; padding: 12px 14px; border: 1px solid #e8f8f0; border-radius: 8px; font-size: 16px; color: #1f2937; background: #fff; transition: border-color 0.2s; }
body.dark .login-box .form-item input { background: #343541; border-color: #404258; color: #e5e5e5; }
.login-box .form-item input:focus { outline: none; border-color: #00b866; box-shadow: 0 0 0 2px rgba(0,184,102,0.1); }
body.dark .login-box .form-item input:focus { border-color: #10b981; }
.login-btn { width: 100%; padding: 12px; background: #00b866; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background 0.2s; }
.login-btn:hover { background: #00a55c; }
body.dark .login-btn { background: #10b981; }
body.dark .login-btn:hover { background: #059669; }
.login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.login-error { color: #ef4444; font-size: 14px; text-align: center; margin-top: 12px; min-height: 24px; }
body.dark .login-error { color: #f87171; }

/* ========== 主页面顶栏 ========== */
.main-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

/* ========== 搜索框 ========== */
.search-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}
.search-input {
    flex: 1;
    padding: 0 16px;
    height: 38px;
    border: 1px solid #e8f8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1f2937;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 120px;
}
body.dark .search-input {
    background: #343541;
    border-color: #404258;
    color: #e5e5e5;
}
.search-input:focus {
    outline: none;
    border-color: #00b866;
    box-shadow: 0 0 0 2px rgba(0, 184, 102, 0.1);
}
body.dark .search-input:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.clear-search-btn {
    padding: 0 16px;
    height: 38px;
    border: 1px solid #e8f8f0;
    border-radius: 8px;
    background: #f9fbfc;
    color: #6b7280;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
body.dark .clear-search-btn {
    background: #343541;
    border-color: #404258;
    color: #d1d5db;
}
.clear-search-btn:hover {
    background: #e8f8f0;
    color: #ef4444;
}
body.dark .clear-search-btn:hover {
    background: #404258;
    color: #f87171;
}
.clear-search-btn.hidden {
    display: none;
}

/* ========== 功能按钮 ========== */
.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    flex-shrink: 0;
}
.btn-group button {
    padding: 0 16px;
    height: 38px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    white-space: nowrap;
}
.add-btn {
    background: #00b866;
    color: #fff;
}
.add-btn:hover {
    background: #00a55c;
}
body.dark .add-btn {
    background: #10b981;
}
body.dark .add-btn:hover {
    background: #059669;
}
.refresh-btn {
    background: #4b5563;
    color: #fff;
}
.refresh-btn:hover {
    background: #374151;
}
body.dark .refresh-btn {
    background: #6b7280;
}
body.dark .refresh-btn:hover {
    background: #4b5563;
}
.import-json-btn {
    background: #00b866;
    color: #fff;
}
.import-json-btn:hover {
    background: #00a55c;
}
body.dark .import-json-btn {
    background: #10b981;
}
body.dark .import-json-btn:hover {
    background: #059669;
}
.export-json-btn {
    background: #2563eb;
    color: #fff;
}
.export-json-btn:hover {
    background: #1d4ed8;
}
body.dark .export-json-btn {
    background: #3b82f6;
}
body.dark .export-json-btn:hover {
    background: #2563eb;
}
.drag-lock-btn {
    background: #00b866;
    color: #fff;
    width: 38px;
    padding: 0;
}
.drag-lock-btn.locked {
    background: #ef4444;
}
.drag-lock-btn:hover {
    background: #00a55c;
}
.drag-lock-btn.locked:hover {
    background: #dc2626;
}
body.dark .drag-lock-btn {
    background: #10b981;
}
body.dark .drag-lock-btn.locked {
    background: #ef4444;
}
body.dark .drag-lock-btn:hover {
    background: #059669;
}
body.dark .drag-lock-btn.locked:hover {
    background: #b91c1c;
}
.theme-toggle-btn {
    background: #4b5563;
    color: #fff;
    width: 38px;
    padding: 0;
}
.theme-toggle-btn:hover {
    background: #374151;
}
body.dark .theme-toggle-btn {
    background: #6b7280;
}
body.dark .theme-toggle-btn:hover {
    background: #4b5563;
}
#fileInput {
    display: none;
}

/* ========== 用户下拉菜单 ========== */
.user-menu {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    flex-shrink: 0;
}

.sync-status {
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    padding: 0 16px;
    height: 38px;
    line-height: 38px;
    background: #f0f3f9;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
body.dark .sync-status {
    background: #404258;
    color: #9ca3af;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px 0 10px;
    height: 38px;
    border: 1px solid #e8f8f0;
    border-radius: 8px;
    background: #f9fbfc;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    font-weight: 500;
    color: #1f2937;
}
body.dark .user-btn {
    background: #343541;
    border-color: #404258;
    color: #e5e5e5;
}
.user-btn:hover {
    border-color: #00b866;
    background: #e8f8f0;
}
body.dark .user-btn:hover {
    border-color: #10b981;
    background: #404258;
}
.user-avatar {
    font-size: 16px;
    line-height: 1;
}
.user-name {
    font-weight: 500;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-arrow {
    font-size: 10px;
    color: #9ca3af;
    transition: transform 0.2s;
}
.user-dropdown.open .user-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 170px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8f8f0;
    padding: 6px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transition: all 0.2s ease;
    z-index: 1000;
}
body.dark .dropdown-menu {
    background: #242535;
    border-color: #404258;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}
.user-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.dropdown-item {
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    color: #1f2937;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    gap: 10px;
}
body.dark .dropdown-item {
    color: #e5e5e5;
}
.dropdown-item:hover {
    background: #f3f4f6;
}
body.dark .dropdown-item:hover {
    background: #404258;
}
.dropdown-divider {
    height: 1px;
    background: #e8f8f0;
    margin: 4px 10px;
}
body.dark .dropdown-divider {
    background: #404258;
}
.user-info-item {
    cursor: default;
}
.user-info-item:hover {
    background: transparent !important;
}
.user-info-item .user-avatar-small {
    font-size: 24px;
}
.dropdown-username {
    font-weight: 600;
    font-size: 14px;
}
.dropdown-role {
    font-size: 12px;
    color: #6b7280;
}
body.dark .dropdown-role {
    color: #9ca3af;
}
.logout-item {
    color: #ef4444;
}
body.dark .logout-item {
    color: #f87171;
}
.logout-item:hover {
    background: #fef2f2 !important;
}
body.dark .logout-item:hover {
    background: #450a0a !important;
}

/* ========== 标签筛选 ========== */
.tags-filter-wrap { margin-bottom: 24px; padding: 12px 16px; background: #f9fbfc; border-radius: 8px; border: 1px solid #e8f8f0; transition: background 0.3s, border-color 0.3s, max-height 0.3s; overflow: hidden; }
body.dark .tags-filter-wrap { background: #343541; border-color: #404258; }
.tags-filter-title { font-size: 14px; color: #6b7280; margin-bottom: 8px; transition: color 0.3s; }
body.dark .tags-filter-title { color: #9ca3af; }
.tags-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { padding: 6px 12px; border-radius: 99px; background: #e8f8f0; color: #00b866; font-size: 13px; cursor: pointer; transition: all 0.2s; }
body.dark .tag-item { background: #404258; color: #10b981; }
.tag-item.active { background: #00b866; color: #fff; }
body.dark .tag-item.active { background: #10b981; color: #fff; }
.tag-item:hover { background: #d1f0e0; }
body.dark .tag-item:hover { background: #475569; }
.tag-item.all { background: #f0f3f9; color: #4b5563; }
body.dark .tag-item.all { background: #404258; color: #d1d5db; }
.tag-item.all.active { background: #4b5563; color: #fff; }
body.dark .tag-item.all.active { background: #6b7280; color: #fff; }
.tag-item.all:hover { background: #e5e7eb; }
body.dark .tag-item.all:hover { background: #475569; }

/* ========== 链接列表 ========== */
.site-list-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 14px; }
.site-item { display: flex; flex-direction: column; align-items: center; background: #f9fbfc; border: 1px solid #e8f8f0; border-radius: 12px; padding: 16px 12px; gap: 8px; text-align: center; transition: box-shadow 0.2s, transform 0.2s; cursor: grab; min-width: 0; }
body.dark .site-item { background: #343541; border-color: #404258; }
.site-item.locked { cursor: not-allowed; }
.site-item:active { cursor: grabbing; }
.site-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); transform: translateY(-2px); }
body.dark .site-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.site-item.sortable-ghost { opacity: 0.4; background: #c7eed8; }
body.dark .site-item.sortable-ghost { background: #475569; }
.site-icon { width: 48px; height: 48px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 24px; flex-shrink: 0; overflow: hidden; }
body.dark .site-icon { background: #4b5563; }
.site-icon img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.2s; }
.site-icon img:hover { transform: scale(1.1); }
.latency-tag { background: #00b866; color: #fff; padding: 6px 10px; border-radius: 99px; font-weight: 500; min-width: 70px; text-align: center; flex-shrink: 0; font-size: 14px; transition: all 0.2s; }
body.dark .latency-tag { background: #10b981; }
.latency-loading { background: #94e0b7; }
body.dark .latency-loading { background: #34d399; }
.latency-timeout { background: #ef4444; }
body.dark .latency-timeout { background: #f87171; }
.site-info { flex: 1; overflow: hidden; width: 100%; max-width: 100%; }
.site-name { font-size: 16px; font-weight: 500; color: #1f2937; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; display: block; transition: color 0.3s; }
body.dark .site-name { color: #f9fafb; }
.site-url { color: #6b7280; font-size: 12px; word-break: break-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-height: 36px; transition: color 0.3s; }
body.dark .site-url { color: #9ca3af; }
.site-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: 4px; width: 100%; max-height: 60px; overflow: hidden; align-content: flex-start; }
.site-tag { padding: 2px 8px; background: #e8f8f0; color: #00b866; font-size: 11px; border-radius: 4px; flex: 0 0 auto; width: 50px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; transition: background 0.3s, color 0.3s; }
body.dark .site-tag { background: #404258; color: #10b981; }

/* ========== Toast ========== */
.toast { position: fixed; top: 20px; right: 20px; padding: 12px 20px; border-radius: 8px; background: #1f2937; color: #fff; font-size: 14px; opacity: 0; transition: opacity 0.3s, transform 0.3s; transform: translateX(20px); z-index: 9999; }
body.dark .toast { background: #343541; box-shadow: 0 4px 12px rgba(0,0,0,0.2); }
.toast.show { opacity: 1; transform: translateX(0); }

/* ========== 弹窗 ========== */
.modal-mask { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 10000; opacity: 0; visibility: hidden; transition: all 0.3s; }
.modal-mask.show { opacity: 1; visibility: visible; }
.modal-container { background: #fff; border-radius: 16px; padding: 30px; width: 100%; max-width: 500px; box-shadow: 0 4px 20px rgba(0,0,0,0.15); transform: translateY(-20px) scale(0.95); transition: transform 0.3s, background 0.3s; }
body.dark .modal-container { background: #242535; box-shadow: 0 4px 20px rgba(0,0,0,0.3); }
.modal-mask.show .modal-container { transform: translateY(0) scale(1); }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; border-bottom: 1px solid #f0f0f0; padding-bottom: 15px; transition: border-color 0.3s; }
body.dark .modal-header { border-color: #404258; }
.modal-title { font-size: 20px; font-weight: 600; color: #111827; transition: color 0.3s; }
body.dark .modal-title { color: #f9fafb; }
.modal-close { width: 32px; height: 32px; border-radius: 50%; background: #f5f5f5; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; color: #666; transition: all 0.2s; }
body.dark .modal-close { background: #404258; color: #d1d5db; }
.modal-close:hover { background: #eee; transform: rotate(90deg); }
body.dark .modal-close:hover { background: #475569; }
.modal-form { display: flex; flex-direction: column; gap: 15px; }
.form-item { width: 100%; }
.form-item label { display: block; margin-bottom: 6px; color: #1f2937; font-weight: 500; font-size: 14px; transition: color 0.3s; }
body.dark .form-item label { color: #e5e5e5; }
.form-item input { width: 100%; padding: 10px 14px; border: 1px solid #e8f8f0; border-radius: 8px; font-size: 16px; color: #1f2937; transition: border-color 0.2s; background: #fff; }
body.dark .form-item input { background: #343541; border-color: #404258; color: #e5e5e5; }
.form-item input:focus { outline: none; border-color: #00b866; box-shadow: 0 0 0 2px rgba(0,184,102,0.1); }
body.dark .form-item input:focus { border-color: #10b981; }
.paste-btn { padding: 8px 16px; border: 1px solid #e8f8f0; background: #f9fbfc; border-radius: 8px; cursor: pointer; font-size: 14px; color: #00b866; margin-top: 5px; transition: all 0.2s; }
body.dark .paste-btn { background: #343541; border-color: #404258; color: #10b981; }
.paste-btn:hover { background: #e8f8f0; transform: translateX(2px); }
body.dark .paste-btn:hover { background: #404258; }
.modal-footer { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.modal-cancel { padding: 8px 20px; border: 1px solid #e5e7eb; background: #fff; border-radius: 8px; cursor: pointer; color: #4b5563; transition: background 0.2s; }
body.dark .modal-cancel { background: #343541; border-color: #404258; color: #d1d5db; }
.modal-cancel:hover { background: #f3f4f6; }
body.dark .modal-cancel:hover { background: #404258; }
.modal-confirm { padding: 8px 20px; background: #00b866; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; transition: background 0.2s; }
body.dark .modal-confirm { background: #10b981; }
.modal-confirm:hover { background: #00a55c; }
body.dark .modal-confirm:hover { background: #059669; }
.modal-delete { padding: 8px 20px; background: #ef4444; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; transition: background 0.2s; }
body.dark .modal-delete { background: #f87171; }
.modal-delete:hover { background: #dc2626; }
body.dark .modal-delete:hover { background: #b91c1c; }
.tags-select-wrap { margin-top: 8px; }
.existing-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; max-height: 66px; overflow: hidden; align-content: flex-start; }
.existing-tag-item { padding: 4px 10px; border-radius: 6px; background: #f0f3f9; color: #4b5563; font-size: 13px; cursor: pointer; transition: all 0.2s; }
body.dark .existing-tag-item { background: #404258; color: #d1d5db; }
.existing-tag-item:hover { background: #e8f8f0; color: #00b866; }
body.dark .existing-tag-item:hover { background: #475569; color: #10b981; }
.selected-tags-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.selected-tag-item { padding: 4px 10px; border-radius: 6px; background: #e8f8f0; color: #00b866; font-size: 13px; display: flex; align-items: center; gap: 4px; transition: background 0.3s; }
body.dark .selected-tag-item { background: #404258; color: #10b981; }
.selected-tag-close { width: 16px; height: 16px; border-radius: 50%; background: #00b866; color: #fff; font-size: 12px; line-height: 16px; text-align: center; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: background 0.2s; }
body.dark .selected-tag-close { background: #10b981; }
.selected-tag-close:hover { background: #ef4444; }
body.dark .selected-tag-close:hover { background: #f87171; }
.tags-tips { font-size: 12px; color: #6b7280; margin-top: 4px; transition: color 0.3s; }
body.dark .tags-tips { color: #9ca3af; }

/* ========== 返回顶部 ========== */
.back-to-top { position: fixed; bottom: 30px; right: 30px; width: 50px; height: 50px; border-radius: 50%; background: #00b866; color: #fff; border: none; cursor: pointer; font-size: 20px; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 10px rgba(0,184,102,0.3); transition: all 0.3s; opacity: 0; visibility: hidden; z-index: 9998; }
body.dark .back-to-top { background: #10b981; box-shadow: 0 2px 10px rgba(16,185,129,0.4); }
.back-to-top.show { opacity: 1; visibility: visible; }
.back-to-top:hover { background: #00a55c; transform: translateY(-3px); }
body.dark .back-to-top:hover { background: #059669; }
.back-to-top:active { transform: translateY(1px); }

/* ========== 管理员用户列表 ========== */
.admin-user-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid #f0f0f0; }
body.dark .admin-user-item { border-color: #404258; }
.admin-user-item .info { display: flex; gap: 12px; align-items: center; }
.admin-user-item .info .name { font-weight: 500; color: #1f2937; }
body.dark .admin-user-item .info .name { color: #e5e5e5; }
.admin-user-item .info .role { font-size: 12px; color: #6b7280; }
body.dark .admin-user-item .info .role { color: #9ca3af; }
.admin-user-item .actions { display: flex; gap: 8px; }
.admin-user-item .actions button { padding: 4px 12px; border: none; border-radius: 6px; cursor: pointer; font-size: 12px; }
.admin-user-item .actions .reset-btn { background: #f59e0b; color: #fff; }
.admin-user-item .actions .reset-btn:hover { background: #d97706; }
.admin-user-item .actions .del-btn { background: #ef4444; color: #fff; }
.admin-user-item .actions .del-btn:hover { background: #dc2626; }

/* ========== 骨架屏 ========== */
.skeleton-item { display: flex; flex-direction: column; align-items: center; background: #f9fbfc; border: 1px solid #e8f8f0; border-radius: 12px; padding: 16px 12px; gap: 8px; text-align: center; min-width: 0; animation: skeleton-pulse 1.5s ease-in-out infinite; }
body.dark .skeleton-item { background: #343541; border-color: #404258; }
.skeleton-icon { width: 48px; height: 48px; border-radius: 10px; background: #e5e7eb; flex-shrink: 0; }
body.dark .skeleton-icon { background: #4b5563; }
.skeleton-line { height: 12px; border-radius: 6px; background: #e5e7eb; margin: 2px 0; }
body.dark .skeleton-line { background: #4b5563; }
@keyframes skeleton-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

/* ========== 拖拽强化 ========== */
.site-item.sortable-ghost { opacity: 0.3; background: #d1f0e0; border: 2px dashed #00b866; transform: scale(0.98); }
body.dark .site-item.sortable-ghost { background: #475569; border-color: #10b981; }
.site-item.sortable-drag { transform: scale(1.05) rotate(1deg); box-shadow: 0 12px 40px rgba(0,0,0,0.2); z-index: 999; opacity: 0.95; }
body.dark .site-item.sortable-drag { box-shadow: 0 12px 40px rgba(0,0,0,0.4); }

/* ========== 右键菜单 ========== */
.context-menu { user-select: none; }
.context-menu div { user-select: none; }

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
    .tags-filter-wrap { max-height: 36px; padding: 8px 16px; opacity: 0.8; }
    .tags-filter-wrap.expanded { max-height: 500px; opacity: 1; }
    .tags-filter-title { display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
    .tags-filter-title::after { content: "↓"; font-size: 12px; color: #6b7280; transition: transform 0.3s; }
    body.dark .tags-filter-title::after { color: #9ca3af; }
    .tags-filter-wrap.expanded .tags-filter-title::after { content: "↑"; }
    .tags-list { display: none; }
    .tags-filter-wrap.expanded .tags-list { display: flex; }
    .site-list-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; }
    .btn-group { position: relative; top: 0; right: 0; margin-bottom: 0; }
    .site-tag { width: 45px; }
    .container { padding: 20px 15px; }
    .site-item { padding: 12px 8px; }
    .site-icon { width: 40px; height: 40px; }
    .site-name { font-size: 14px; }
    .site-url { font-size: 11px; }
    .latency-tag { padding: 4px 8px; font-size: 12px; min-width: 60px; }
    .back-to-top { width: 45px; height: 45px; bottom: 20px; right: 20px; font-size: 18px; }
    .header-top { flex-wrap: wrap; }
    .user-menu { margin-left: auto; }
}
@media (min-width: 769px) { .tags-filter-title::after { display: none; } }
@media (max-width: 1200px) { .site-list-grid { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 992px) { .site-list-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 480px) {
    .site-list-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; }
    .btn-group { flex-wrap: wrap; gap: 8px; }
    .btn-group button { padding: 6px 12px; font-size: 13px; }
    .container { padding: 15px 10px; }
    .site-tag { width: 40px; font-size: 10px; }
    .modal-footer { flex-wrap: wrap; justify-content: stretch; }
    .modal-footer button { flex: 1; }
    .search-input { font-size: 14px; padding: 10px 12px; }
    .user-btn .user-name { max-width: 50px; font-size: 13px; }
}
