/* 书签管理系统样式 */

/* 书签下拉菜单 */
.bookmark-menu {
    position: relative;
    display: inline-block;
}

/* 上回看到容器 */
#historyMini {
    display: inline-block;
    margin-right: 10px;
}

#historyMini a {
    padding: 8px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s ease;
}

#historyMini a:hover {
    background: #e8e8e8;
    border-color: #999;
    text-decoration: none;
}

.bookmark-header {
    cursor: pointer;
    padding: 8px 15px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    transition: all 0.3s ease;
}

.bookmark-header:hover {
    background: #e8e8e8;
    border-color: #999;
}

.bookmark-header:after {
    content: ' ▼';
    font-size: 12px;
}

/* 书签下拉内容 */
.bookmark-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 5px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-width: 500px;
    z-index: 1000;
}

.bookmark-dropdown.show {
    display: block;
}

/* 书签管理窗口 */
.bookmark-window {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    display: none;
    z-index: 2000;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.bookmark-window.show {
    display: block;
}

/* 窗口遮罩 */
.bookmark-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    margin: 0;
    padding: 0;
}

.bookmark-overlay.show {
    display: block;
}

/* 窗口头部 */
.bookmark-window-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bookmark-window-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    flex: 1;
}

.bookmark-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.bookmark-window-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.bookmark-window-close:hover {
    color: #333;
}

/* 窗口内容区 */
.bookmark-window-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 80px);
}

/* 书签分区 */
.bookmark-section {
    margin-bottom: 30px;
}

.bookmark-section:last-child {
    margin-bottom: 0;
}

.bookmark-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
}

.bookmark-section-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.config-display {
    display: inline-block;
    padding: 4px 12px;
    margin: 0 5px;
    font-size: 14px;
    background: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: normal;
}

.config-display:hover {
    background: #dee2e6;
    border-color: #adb5bd;
    color: #212529;
}

/* 分隔线 */
.bookmark-divider {
    border-top: 2px solid #e9ecef;
    margin: 30px 0;
}

/* 工具栏 */
.bookmark-toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.bookmark-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.bookmark-btn:hover {
    background: #f8f9fa;
    border-color: #999;
}

.bookmark-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bookmark-btn.primary {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.bookmark-btn.primary:hover {
    background: #0056b3;
}

.bookmark-btn.danger {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

.bookmark-btn.danger:hover {
    background: #c82333;
}

/* 书签表格 */
.bookmark-table-container {
    overflow-x: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}

.bookmark-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.bookmark-table th,
.bookmark-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.select-th {
    width: 40px;
}

.bookmark-table th {
    background: #f8f9fa;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    transition: background 0.3s;
}

.bookmark-table th:hover {
    background: #e9ecef;
}

.bookmark-table tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

.bookmark-table tbody tr:nth-child(odd) {
    background-color: #fff;
}

.bookmark-table tbody tr:hover {
    background-color: #e7f3ff !important;
}

.bookmark-table tr.selected {
    background-color: #d0e4ff !important;
}

/* 排序图标 */
.sort-icon {
    display: inline-block;
    margin-left: 5px;
    color: #666;
    font-size: 12px;
}

.sort-icon::before {
    content: '⇅';
}

.bookmark-table th.sort-asc .sort-icon::before {
    content: '↑';
}

.bookmark-table th.sort-desc .sort-icon::before {
    content: '↓';
}

/* 书签链接 */
.bookmark-link {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
    word-break: break-all;
    white-space: normal;
}

.bookmark-link:hover {
    text-decoration: underline;
    color: #0056b3;
}

.bookmark-url {
    color: #6c757d;
    font-size: 12px;
    text-decoration: none;
    word-break: break-all;
    white-space: normal;
}

.bookmark-url:hover {
    color: #007bff;
    text-decoration: underline;
}

/* 小按钮 */
.btn-small {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px;
    cursor: pointer;
    margin-right: 3px;
    transition: all 0.2s;
}

.btn-small:hover {
    background: #f8f9fa;
    border-color: #999;
}

.btn-edit {
    background: #ffc107;
    border-color: #ffc107;
}

.btn-edit:hover {
    background: #e0a800;
    border-color: #d39e00;
}

.btn-delete {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.btn-delete:hover {
    background: #c82333;
    border-color: #bd2130;
}

/* 分页 */
.bookmark-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.bookmark-pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.bookmark-pagination button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #999;
}

.bookmark-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    padding: 0 10px;
    font-size: 14px;
    color: #666;
}

.bookmark-pagination input {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

/* 快捷书签列表 */
.quick-bookmark-list {
    padding: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.quick-bookmark-item {
    padding: 8px 10px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.quick-bookmark-item:hover {
    background: #f8f9fa;
}

.quick-bookmark-item:last-child {
    border-bottom: none;
}

.quick-bookmark-link {
    color: #333;
    text-decoration: none;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quick-bookmark-link:hover {
    color: #007bff;
}

.quick-bookmark-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
}

/* 复选框样式 */
.bookmark-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.auto-bookmark-checkbox,
.manual-bookmark-checkbox {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .bookmark-window {
        width: 100%;
        height: 100%;
    }

    .bookmark-table-container {
        overflow-x: auto;
    }

    .bookmark-table {
        min-width: 600px;
    }

    .bookmark-toolbar {
        flex-direction: column;
    }

    .bookmark-btn {
        width: 100%;
    }

    .bookmark-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .bookmark-header-actions {
        flex-direction: column;
        align-items: flex-end;
    }
}

/* 空状态 */
.bookmark-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.bookmark-empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

/* 文件上传 */
.bookmark-file-input {
    display: none;
}

/* 提示信息 */
.bookmark-tip {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

/* 表格排序指示器 */
.bookmark-table th.sort-asc .sort-icon::after {
    content: ' ↑';
}

.bookmark-table th.sort-desc .sort-icon::after {
    content: ' ↓';
}

/* 选中状态 */
.bookmark-item.selected {
    background-color: #d0e4ff !important;
}

/* 统计信息 */
.bookmark-stats {
    display: none;
    padding: 10px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 14px;
    color: #666;
}

/* 滚动条样式 */
.bookmark-window-body::-webkit-scrollbar,
.quick-bookmark-list::-webkit-scrollbar {
    width: 8px;
}

.bookmark-window-body::-webkit-scrollbar-track,
.quick-bookmark-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.bookmark-window-body::-webkit-scrollbar-thumb,
.quick-bookmark-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.bookmark-window-body::-webkit-scrollbar-thumb:hover,
.quick-bookmark-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 消息提示样式 */
.bookmark-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    color: #fff;
    z-index: 9999;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.bookmark-message-success {
    background-color: #28a745;
}

.bookmark-message-warning {
    background-color: #ffc107;
    color: #333;
}

.bookmark-message-error {
    background-color: #dc3545;
}

.bookmark-message-info {
    background-color: #17a2b8;
}

.bookmark-message-hide {
    opacity: 0;
    transform: translateX(-50%) translateY(-20px);
}

/* 配置编辑对话框 */
.config-edit-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2001;
    margin: 0;
    padding: 0;
}

.config-edit-overlay.show {
    display: block;
}

.config-edit-dialog {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    width: 400px;
    max-width: 90%;
    z-index: 2002;
}

.config-edit-dialog.show {
    display: block;
}

.config-edit-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.config-edit-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.config-edit-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.config-edit-close:hover {
    color: #333;
}

.config-edit-body {
    padding: 20px;
}

.config-edit-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.config-edit-row:last-child {
    margin-bottom: 0;
}

.config-edit-label {
    width: 120px;
    font-size: 14px;
    color: #333;
}

.config-edit-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.config-edit-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.1);
}

.config-edit-tip {
    margin-top: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #6c757d;
}

.config-edit-footer {
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
