/* 密码协同管理系统 - 自定义样式 */

/* 全局样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* 卡片样式 */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* 密码条目卡片 */
.password-card {
    cursor: pointer;
    transition: transform 0.15s ease-in-out;
}

.password-card:hover {
    transform: translateY(-2px);
}

.password-card .card-body {
    padding: 1.25rem;
}

/* 系统图标样式 */
.system-icon {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: 8px;
    background: #f8f9fa;
    padding: 4px;
}

.system-icon-small {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
    background: #f8f9fa;
    padding: 2px;
}

/* 链接样式 */
.link-item {
    display: flex;
    align-items: center;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease-in-out;
}

.link-item:hover {
    background: #e9ecef;
    color: inherit;
}

/* 账号密码项样式 */
.account-item {
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1rem;
    margin-bottom: 1rem;
    background: #fff;
}

.account-item:last-child {
    margin-bottom: 0;
}

.password-display {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    letter-spacing: 2px;
}

/* 权限设置样式 */
.permission-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

.permission-item:last-child {
    margin-bottom: 0;
}

/* 历史记录样式 */
.history-item {
    border-left: 3px solid #0d6efd;
    padding-left: 1rem;
    margin-bottom: 1rem;
}

.history-item.history-create {
    border-left-color: #198754;
}

.history-item.history-update {
    border-left-color: #0d6efd;
}

.history-item.history-view {
    border-left-color: #ffc107;
}

.history-item.history-delete {
    border-left-color: #dc3545;
}

/* 日志样式 */
.log-success {
    color: #198754;
}

.log-failure {
    color: #dc3545;
}

/* 搜索框样式 */
.search-container {
    position: relative;
}

.search-container .bi-search {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
}

.search-container input {
    padding-left: 2.5rem;
}

/* 表格样式 */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* 模态框样式 */
.modal-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

.modal-footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

/* 按钮样式 */
.btn-icon {
    padding: 0.375rem 0.5rem;
    line-height: 1;
}

/* 表单样式 */
.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* 管理员标识 */
.admin-badge {
    background: linear-gradient(45deg, #dc3545, #fd7e14);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
}

/* 加载动画 */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0d6efd;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 响应式调整 */
@media (max-width: 768px) {
    .password-card .row {
        text-align: center;
    }
    
    .password-card .col-md-2 {
        margin-bottom: 1rem;
    }
    
    .account-item .row {
        text-align: left;
    }
    
    .permission-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .permission-item .form-check {
        margin-top: 0.5rem;
    }
}

/* 打印样式 */
@media print {
    .navbar,
    .btn,
    .modal,
    footer {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* 无障碍样式 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* 焦点样式 */
*:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}