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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    color: #333;
    line-height: 1.6;
}

/* 布局容器 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部样式 - 纯蓝色背景 */
.header {
    background: #1890ff;
    color: white;
    padding: 0;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.mobile-menu-btn:hover {
    background: rgba(255,255,255,0.1);
}

.logo {
    font-size: 20px;
    font-weight: 500;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-info span {
    color: rgba(255,255,255,0.85);
    font-size: 14px;
}

.logout-btn {
    background: rgba(255,255,255,0.15);
    color: white;
    padding: 6px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.logout-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* 侧边栏样式 - 完全按照图片的深色风格 */
.sidebar {
    position: fixed;
    left: 0;
    top: 64px;
    width: 200px;
    height: calc(100vh - 64px);
    background: #2f3349;
    box-shadow: 2px 0 8px rgba(0,0,0,0.15);
    overflow-y: auto;
    z-index: 999;
}

.sidebar-menu {
    list-style: none;
    padding: 8px 0;
}

.sidebar-menu li {
    margin: 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #a0a0a0;
    text-decoration: none;
    transition: all 0.3s ease;
    border-right: 3px solid transparent;
    font-size: 14px;
    font-weight: 400;
}

.sidebar-menu a:hover {
    background: rgba(24, 144, 255, 0.1);
    color: #1890ff;
    border-right-color: #1890ff;
}

.sidebar-menu a.active {
    background: rgba(24, 144, 255, 0.15);
    color: #1890ff;
    border-right-color: #1890ff;
    font-weight: 500;
}

/* 二级菜单样式 */
.has-submenu {
    position: relative;
}

.submenu-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.submenu-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.submenu-toggle.expanded .submenu-arrow {
    transform: rotate(90deg);
}

.submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
    list-style: none;
    padding: 0;
    margin: 0;
}

.submenu.show {
    max-height: 500px;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 8px 24px 8px 40px;
    font-size: 13px;
    color: #8c8c8c;
    border-right: none;
}

.submenu a:hover {
    background: rgba(24, 144, 255, 0.08);
    color: #40a9ff;
}

.submenu a.active {
    background: rgba(24, 144, 255, 0.12);
    color: #1890ff;
    font-weight: 500;
}

/* 侧边栏遮罩层 */
.sidebar-overlay {
    position: fixed;
    top: 64px;
    left: 0;
    width: 100%;
    height: calc(100vh - 64px);
    background: rgba(0,0,0,0.45);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

body.sidebar-open {
    overflow: hidden;
}

/* 主内容区域 */
.main-content {
    margin-left: 200px;
    margin-top: 64px;
    padding: 24px;
    min-height: calc(100vh - 64px);
    background: #f0f2f5;
}

/* 页面头部 */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
}

.page-title {
    font-size: 20px;
    font-weight: 500;
    color: #262626;
    margin: 0;
}

.page-actions {
    display: flex;
    gap: 8px;
}

/* 卡片样式 - 白色背景 */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 16px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
    width: 100%;
    box-sizing: border-box;
}

.card-header {
    background: #fafafa;
    padding: 16px 24px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-title {
    font-size: 16px;
    font-weight: 500;
    color: #262626;
    margin: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* 统计卡片容器 */
.stats-container {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

/* 统计卡片 */
.stat-card {
    flex: 1;
    min-width: 200px;
    background: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.02);
    text-align: center;
    border: 1px solid #f0f0f0;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* 统计卡片标题 */
.stat-title {
    font-size: 14px;
    color: #8c8c8c;
    font-weight: 400;
    margin-bottom: 8px;
}

/* 统计卡片数值 */
.stat-value {
    font-size: 30px;
    font-weight: 600;
    margin-bottom: 8px;
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 不同类型的统计卡片颜色 */
.stat-card.primary .stat-value {
    color: #1890ff;
}

.stat-card.success .stat-value {
    color: #52c41a;
}

.stat-card.danger .stat-value {
    color: #ff4d4f;
}

.stat-card.warning .stat-value {
    color: #faad14;
}

/* 统计卡片顶部边框 */
.stat-card.primary {
    border-top: 3px solid #1890ff;
}

.stat-card.success {
    border-top: 3px solid #52c41a;
}

.stat-card.danger {
    border-top: 3px solid #ff4d4f;
}

.stat-card.warning {
    border-top: 3px solid #faad14;
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 15px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 4px;
    min-height: 32px;
    line-height: 1.5715;
}

.btn-primary {
    background: #1890ff;
    color: white;
    border-color: #1890ff;
}

.btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(24, 144, 255, 0.2);
}

.btn-secondary {
    background: white;
    color: #595959;
    border-color: #d9d9d9;
}

.btn-secondary:hover {
    background: #fafafa;
    border-color: #40a9ff;
    color: #40a9ff;
}

.btn-success {
    background: #52c41a;
    color: white;
    border-color: #52c41a;
}

.btn-success:hover {
    background: #73d13d;
    border-color: #73d13d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(82, 196, 26, 0.2);
}

.btn-danger {
    background: #ff4d4f;
    color: white;
    border-color: #ff4d4f;
}

.btn-danger:hover {
    background: #ff7875;
    border-color: #ff7875;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(255, 77, 79, 0.2);
}

.btn-warning {
    background: #faad14;
    color: white;
    border-color: #faad14;
}

.btn-warning:hover {
    background: #ffc53d;
    border-color: #ffc53d;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(250, 173, 20, 0.2);
}

.btn-sm {
    padding: 0 7px;
    font-size: 12px;
    min-height: 24px;
}

.action-btn {
    margin-right: 8px;
    margin-bottom: 4px;
}

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

.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
    color: #262626;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 4px 11px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
    min-height: 32px;
    line-height: 1.5715;
}

.form-control:focus {
    outline: none;
    border-color: #40a9ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.form-control.is-invalid {
    border-color: #ff4d4f;
}

.form-control.is-invalid:focus {
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.2);
}

.form-row {
    display: flex;
    gap: 16px;
    align-items: end;
}

.form-col {
    flex: 1;
}

.search-form .form-row {
    align-items: end;
}

/* 搜索表单内联布局 */
.search-form-inline .search-form-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.search-form-inline .search-input {
    flex: 1;
    min-width: 200px;
    max-width: 400px;
}

.search-form-inline .search-select {
    min-width: 120px;
    max-width: 150px;
}

.search-form-inline .search-btn,
.search-form-inline .reset-btn {
    white-space: nowrap;
    min-width: 80px;
}

.invalid-feedback {
    color: #ff4d4f;
    font-size: 12px;
    margin-top: 4px;
}

/* 表格样式 - 白色清爽风格 */
.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    background: white;
    border: 1px solid #f0f0f0;
    margin-top: 24px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03), 0 1px 6px -1px rgba(0,0,0,0.02), 0 2px 4px rgba(0,0,0,0.02);
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    margin: 0;
}

.table th {
    background: #fafafa;
    padding: 12px 16px;
    text-align: center;
    font-weight: 500;
    color: #262626;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
    background: white;
    color: #262626;
    text-align: center;
    word-break: keep-all;
    white-space: nowrap;
}

/* 备注列特殊处理 - 允许换行和截断 */
.table td:has(.notes-cell) {
    white-space: normal;
    text-align: left;
}

.table tbody tr {
    transition: all 0.2s ease;
}

.table tbody tr:hover {
    background: #fafafa;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    height: 20px;
}

.badge-info {
    background: #e6f7ff;
    color: #1890ff;
    border: 1px solid #91d5ff;
}

.badge-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.badge-warning {
    background: #fffbe6;
    color: #faad14;
    border: 1px solid #ffe58f;
}

.badge-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* 状态标签 */
.status-tag {
    padding: 0 8px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 400;
    line-height: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
}

.status-success {
    background: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.status-failed {
    background: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

/* 复制和密码字段样式 */
.copy-field, .password-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.copy-text, .password-mask {
    flex: 1;
    min-width: 0;
    word-break: keep-all;
    white-space: nowrap;
}

/* 可点击复制的文本，防止换行 */
.clickable-copy {
    white-space: nowrap;
    word-break: keep-all;
    display: inline-block;
}

/* 备注列样式 - 长文本部分隐藏，悬停显示完整 */
.notes-cell {
    width: 100%;
    max-width: 200px;
    position: relative;
    cursor: help;
    overflow: hidden;
}

.notes-text {
    display: block;
    width: 100%;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap !important;
    word-break: keep-all;
    vertical-align: middle;
    line-height: 1.5;
}

/* 悬停时显示完整备注 */
.notes-cell:hover::after {
    content: attr(data-full-text);
    position: absolute;
    left: 0;
    top: 100%;
    z-index: 1000;
    background: #fff;
    padding: 8px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    white-space: normal;
    word-break: break-word;
    max-width: 300px;
    min-width: 200px;
    margin-top: 4px;
    display: block;
    overflow: visible;
    color: #262626;
}

.password-actions {
    display: flex;
    gap: 4px;
}

/* 图标按钮样式 - 白色风格 */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 1px solid #d9d9d9;
    background: white;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: #595959;
}

.btn-icon:hover {
    background: #fafafa;
    border-color: #40a9ff;
    color: #40a9ff;
}

.btn-icon.success {
    background: #52c41a;
    border-color: #52c41a;
    color: white;
}

/* 分组链接样式 */
.group-link {
    color: #1890ff;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.3s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.group-link:hover {
    background: #e6f7ff;
    color: #40a9ff;
    text-decoration: none;
}

/* 信息网格样式 */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.info-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #fafafa;
    border-radius: 6px;
    border-left: 3px solid #1890ff;
}

.info-item label {
    font-weight: 500;
    margin-right: 12px;
    min-width: 80px;
    color: #262626;
    font-size: 14px;
}

.info-item span {
    color: #595959;
    font-weight: 400;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: #8c8c8c;
}

.empty-state p {
    margin-bottom: 16px;
    font-size: 14px;
    color: #8c8c8c;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border: 1px solid #d9d9d9;
    background: white;
    color: #595959;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s ease;
    min-width: 32px;
    height: 32px;
    line-height: 1.5715;
}

.page-link:hover {
    background: #fafafa;
    border-color: #40a9ff;
    color: #40a9ff;
}

.page-link.active {
    background: #1890ff;
    border-color: #1890ff;
    color: white;
}

/* 批量操作样式 */
.batch-controls {
    background: #f6ffed;
    border: 1px solid #b7eb8f;
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
}

.batch-column {
    width: 48px;
    text-align: center;
}

.selected-count {
    color: #52c41a;
    font-weight: 500;
}

.selected-count strong {
    color: #389e0d;
}

/* 消息提示样式 */
.alert {
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 16px;
    border: 1px solid;
    font-weight: 400;
    font-size: 14px;
}

.alert-success {
    background: #f6ffed;
    color: #52c41a;
    border-color: #b7eb8f;
}

.alert-danger {
    background: #fff2f0;
    color: #ff4d4f;
    border-color: #ffccc7;
}

.alert-info {
    background: #e6f7ff;
    color: #1890ff;
    border-color: #91d5ff;
}

/* 文本样式 */
.text-muted {
    color: #8c8c8c;
}

.text-center {
    text-align: center;
}

/* 登录页面样式 */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1890ff;
    padding: 24px;
}

.login-form {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 100%;
    max-width: 368px;
    animation: fadeInUp 0.6s ease-out;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 24px;
    color: #262626;
    font-size: 20px;
    font-weight: 500;
}

.login-form .btn {
    width: 100%;
    height: 40px;
    font-size: 14px;
    font-weight: 400;
    margin-top: 8px;
}

.login-form .form-control {
    height: 40px;
    padding: 4px 11px;
    font-size: 14px;
}

.login-form .form-label {
    font-weight: 500;
    color: #262626;
    margin-bottom: 4px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 16px;
    }
    
    .page-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }
    
    .page-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .stats-container {
        flex-direction: column;
    }
    
    .stat-card {
        min-width: auto;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .table-responsive {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
    
    .action-btn {
        padding: 0 7px;
        font-size: 12px;
        min-height: 24px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

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

::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #d9d9d9;
    border-radius: 3px;
}

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