/* 链接管理界面样式 */
.link-management-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 800px;
    height: 80%;
    max-height: 600px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.link-management-panel.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

/* 管理面板头部 */
.management-header {
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

.management-header h3 {
    color: white;
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

/* 管理面板内容 */
.management-content {
    height: calc(100% - 80px);
    display: flex;
    flex-direction: column;
}

/* 标签页导航 */
.management-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-button {
    flex: 1;
    padding: 15px 20px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.tab-button:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.tab-button.active {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #4CAF50;
}

/* 标签页内容 */
.tab-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: none;
}

.tab-content.active {
    display: block;
}

/* 链接列表 */
.link-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link-item-management {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.link-item-management:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.link-info {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
}

.link-info i {
    color: #4CAF50;
    font-size: 20px;
    min-width: 20px;
    text-align: center;
}

.link-details {
    flex: 1;
    min-width: 0;
}

.link-title {
    color: white;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 4px;
}

.link-url {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    word-break: break-all;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-actions {
    display: flex;
    gap: 8px;
}

.link-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.move-btn {
    background: #9c27b0;
    color: white;
    padding: 6px 10px;
}

.move-btn:disabled {
    background: #666;
    cursor: not-allowed;
    opacity: 0.5;
}

.move-btn:not(:disabled):hover {
    background: #7b1fa2;
    transform: translateY(-1px);
}

.toggle-btn.enabled {
    background: #4CAF50;
    color: white;
}

.toggle-btn.disabled {
    background: #f44336;
    color: white;
}

.edit-btn {
    background: #2196F3;
    color: white;
}

.delete-btn {
    background: #ff5722;
    color: white;
}

.link-actions button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* 表单样式 */
.add-link-form,
.settings-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: white;
    font-weight: 500;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="url"] {
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="url"]:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.form-group input[type="text"]::placeholder,
.form-group input[type="url"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group input[type="checkbox"] {
    margin-right: 8px;
}

.form-group small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
}

/* 按钮样式 */
.add-button,
.save-button,
.export-button,
.import-button,
.reset-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.add-button,
.save-button {
    background: #4CAF50;
    color: white;
}

.export-button {
    background: #2196F3;
    color: white;
}

.import-button {
    background: #FF9800;
    color: white;
}

.reset-button {
    background: #f44336;
    color: white;
}

.add-button:hover,
.save-button:hover,
.export-button:hover,
.import-button:hover,
.reset-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.3);
}

/* 备份部分 */
.backup-section {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.backup-group {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.backup-group h4 {
    color: white;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.backup-group small {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    display: block;
    margin-top: 8px;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .link-management-panel {
        width: 95%;
        height: 90%;
        max-height: none;
    }
    
    .management-header {
        padding: 15px;
    }
    
    .management-header h3 {
        font-size: 18px;
    }
    
    .tab-button {
        padding: 12px 15px;
        font-size: 13px;
    }
    
    .tab-content {
        padding: 15px;
    }
    
    .link-item-management {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .link-info {
        width: 100%;
    }
    
    .link-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .backup-section {
        gap: 20px;
    }
    
    .backup-group {
        padding: 15px;
    }
}

/* 超小屏幕适配 */
@media (max-width: 480px) {
    .link-management-panel {
        width: 98%;
        height: 95%;
        border-radius: 10px;
    }
    
    .management-tabs {
        flex-wrap: wrap;
    }
    
    .tab-button {
        flex: 1 1 50%;
        min-width: 50%;
    }
    
    .link-actions {
        flex-wrap: wrap;
        gap: 6px;
    }
    
    .link-actions button {
        flex: 1;
        min-width: 60px;
    }
}

/* 滚动条样式 */
.tab-content::-webkit-scrollbar {
    width: 6px;
}

.tab-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.tab-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 无障碍访问支持 */
.tab-button:focus,
.link-actions button:focus,
.add-button:focus,
.save-button:focus,
.export-button:focus,
.import-button:focus,
.reset-button:focus {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    .link-management-panel {
        background: #000;
        border: 2px solid #fff;
    }
    
    .link-item-management {
        background: #333;
        border: 1px solid #fff;
    }
    
    .form-group input[type="text"],
    .form-group input[type="url"] {
        background: #333;
        border-color: #fff;
        color: #fff;
    }
}

/* 动画禁用模式支持 */
@media (prefers-reduced-motion: reduce) {
    .link-management-panel,
    .tab-button,
    .link-item-management,
    .link-actions button,
    .add-button,
    .save-button,
    .export-button,
    .import-button,
    .reset-button {
        transition: none;
    }
    
    .link-management-panel.show {
        transform: translate(-50%, -50%);
    }
}