/* 统一的样式定义 */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --sidebar-bg: #212529;
    --sidebar-width: 200px;
    --navbar-height: 56px;
}

/* 全局样式重置 */
* {
    box-sizing: border-box;
}

/* 覆盖Bootstrap的.row和.justify-content-center样式，避免干扰主内容布局 */
.row {
    display: block !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.justify-content-center {
    justify-content: flex-start !important;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    margin: 0;
    padding-top: var(--navbar-height);
    line-height: 1.6;
}

/* 顶部导航栏 */
.navbar.fixed-top {
    z-index: 1030;
}

.navbar.fixed-top .container-fluid {
    padding-left: calc(var(--sidebar-width) + 20px);
}

/* 侧边栏 */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1020;
    overflow-y: auto;
}

/* 主内容区域 */
.main-container {
    display: flex;
}

.content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 1.5rem;
    padding-top: 1rem;
    transition: all 0.3s ease;
}

/* 卡片样式 */
.card {
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.125);
    border-radius: 0.375rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

.card-header {
    padding: 0.75rem 1.25rem;
    background-color: var(--primary-color);
    color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.card-body {
    padding: 0;
}

/* 表格样式 */
.table {
    width: 100%;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* 按钮基础样式 - 增强可见性 */
.btn {
    display: inline-block;
    font-weight: 600;
    border-radius: 6px;
    transition: all 0.3s ease;
    text-align: center;
    vertical-align: middle;
    user-select: none;
    border: 2px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    cursor: pointer;
}

/* 主要按钮增强 */
.btn-primary {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.2);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
    transform: translateY(-1px);
}

/* 成功按钮增强 */
.btn-success {
    background-color: #198754;
    border-color: #198754;
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.2);
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
    transform: translateY(-1px);
}

/* 危险按钮增强 */
.btn-danger {
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.btn-danger:hover {
    background-color: #bb2d3b;
    border-color: #b02a37;
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
    transform: translateY(-1px);
}

/* 次要按钮增强 */
.btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

.btn-secondary:hover {
    background-color: #5c636a;
    border-color: #565e64;
    transform: translateY(-1px);
}

/* 边框按钮增强 */
.btn-outline-primary {
    border-width: 2px;
    color: #0d6efd;
    border-color: #0d6efd;
}

.btn-outline-primary:hover {
    background-color: #0d6efd;
    border-color: #0d6efd;
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.25);
}

.btn-outline-secondary {
    border-width: 2px;
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.25);
}

.btn-outline-success {
    border-width: 2px;
    color: #198754;
    border-color: #198754;
}

.btn-outline-success:hover {
    background-color: #198754;
    border-color: #198754;
    box-shadow: 0 2px 6px rgba(25, 135, 84, 0.25);
}

.btn-outline-danger {
    border-width: 2px;
    color: #dc3545;
    border-color: #dc3545;
}

.btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.25);
}

/* 小型按钮增强 */
.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 600;
}

/* 大型按钮增强 */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    line-height: 1.5;
    font-weight: 600;
}

/* 下拉菜单按钮增强 */
.dropdown-toggle {
    position: relative;
    overflow: hidden;
}

.dropdown-toggle::after {
    margin-left: 0.5em;
}

/* 汉堡菜单按钮增强 */
.navbar-toggler {
    border-width: 2px;
    padding: 0.5rem;
    border-radius: 6px;
}

.navbar-toggler:hover {
    transform: scale(1.05);
}

/* 焦点状态增强 */
.btn:focus {
    outline: 2px solid rgba(13, 110, 253, 0.5);
    outline-offset: 2px;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* 禁用状态增强 */
.btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none !important;
}

/* 按钮组样式增强 */
.btn-group > .btn {
    margin-right: 2px;
}

.btn-group > .btn:last-child {
    margin-right: 0;
}
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:active {
    transform: translateY(0);
}

/* 表单样式 */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: inline-block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--dark-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

/* 筛选表单样式优化 */
.filter-form {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.375rem;
    border: 1px solid #e9ecef;
}

.filter-form .row {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

.filter-form .row > div {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.filter-form label {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--secondary-color);
}

.filter-form .form-control,
.filter-form .form-control-sm {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    height: calc(1.5em + 0.5rem + 2px);
}

.filter-form .btn-group {
    display: flex;
    gap: 0.25rem;
}

.filter-form .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

/* 响应式调整 */
@media (min-width: 1200px) {
    .filter-form .col-xl-1 {
        flex: 0 0 auto;
        width: 8.33333333%;
    }
    
    .filter-form .col-xl-2 {
        flex: 0 0 auto;
        width: 16.66666667%;
    }
    
    .filter-form .col-xl-3 {
        flex: 0 0 auto;
        width: 25%;
    }
}

@media (max-width: 992px) {
    .filter-form {
        padding: 0.75rem;
    }
    
    .filter-form .row {
        margin-left: -0.25rem;
        margin-right: -0.25rem;
    }
    
    .filter-form .row > div {
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

.form-control:focus {
    color: var(--dark-color);
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* 状态开关 */
.status-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.status-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--success-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
    margin-right: 5px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 预设选项 */
.preset-options {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
}

.preset-option {
    padding: 3px 10px;
    background-color: #e9ecef;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.preset-option:hover {
    background-color: #dee2e6;
}

/* URL输入组 */
.url-input-group {
    margin-bottom: 10px;
    transition: all 0.3s ease;
    overflow-x: auto;
    white-space: nowrap;
}

.url-input-group > div {
    display: inline-block;
    vertical-align: middle;
}

.url-input-group:hover {
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: 4px;
    padding: 5px;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .content {
        margin-left: 0;
        padding-top: 1rem;
        padding-left: 1rem;
    }
    
    .navbar.fixed-top .container-fluid {
        padding-left: 20px;
    }
    
    .navbar.fixed-top::before {
        display: none;
    }
    
    .url-input-group > div {
        min-width: 120px !important;
    }
    
    .d-flex.flex-wrap.gap-3 > div {
        flex: 100% !important;
        min-width: 100% !important;
    }
}

@media (max-width: 768px) {
    .url-input-group > div {
        margin-right: 5px !important;
    }
}

/* 消息提示 */
.alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* 短码样式 */
.short-code {
    font-family: monospace;
    background-color: #f1f1f1;
    padding: 2px 5px;
    border-radius: 3px;
}

/* 操作按钮区域 */
.action-buttons {
    white-space: nowrap;
}

/* 链接项悬停效果 */
.link-item {
    transition: transform 0.2s;
}

.link-item:hover {
    transform: translateY(-2px);
}

/* 密码切换按钮 */
.password-toggle {
    cursor: pointer;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 模态框样式 */
.modal-content {
    border-radius: 0.375rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.modal-body {
    padding: 1rem;
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #dee2e6;
}

/* 分页样式 */
.pagination {
    display: flex;
    padding-left: 0;
    list-style: none;
    border-radius: 0.25rem;
}

.pagination .page-item .page-link {
    position: relative;
    display: block;
    padding: 0.5rem 0.75rem;
    margin-left: -1px;
    line-height: 1.25;
    color: var(--primary-color);
    background-color: #fff;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    z-index: 1;
    color: #fff;
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.pagination .page-item .page-link:hover {
    z-index: 2;
    color: #0056b3;
    text-decoration: none;
    background-color: #e9ecef;
    border-color: #dee2e6;
}