/* 基础样式 */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --light: #f8fafc;
    --dark: #1e293b;
    --border: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 头部 */
.header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
}

.header-left .logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
}

.logo i {
    color: var(--primary);
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 0.5rem;
    font-weight: 500;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-teacher { background: var(--success); }
.badge-student { background: var(--primary); }
.badge-root { background: #8b5cf6; }

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

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

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--secondary);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-warning {
    background: var(--warning);
    color: white;
}

.btn-link {
    background: transparent;
    color: var(--primary);
    padding: 0.5rem 0.75rem;
}

.btn-link:hover {
    background: var(--light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-icon {
    width: 2rem;
    height: 2rem;
    padding: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--secondary);
}

.btn-icon:hover {
    background: var(--light);
}

/* 卡片 */
.card {
    background: white;
    border-radius: 1rem;
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* 表格 */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background: var(--light);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
}

.table tr:hover {
    background: var(--light);
}

.table tr.inactive td {
    opacity: 0.6;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

/* 表单 */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-group input[type="file"] {
    cursor: pointer;
    padding: 0.5rem;
}

.form-group input[type="file"]::file-selector-button {
    margin-right: 1rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 0.375rem;
    background: var(--light);
    color: var(--dark);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.form-group input[type="file"]::file-selector-button:hover {
    background: var(--border);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--secondary);
}

.propagate-section {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.5rem;
}

.propagate-section .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    color: var(--dark);
}

.propagate-section .checkbox-label input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary);
}

.propagate-section .form-hint {
    margin: 0.5rem 0 0;
    font-size: 0.8rem;
    color: #64748b;
}

.propagate-section .form-hint strong {
    color: #0284c7;
}

.form-error {
    color: var(--danger);
    padding: 0.75rem;
    background: #fef2f2;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.form-success {
    color: var(--success);
    padding: 0.75rem;
    background: #f0fdf4;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

/* 登录页面 */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 2rem;
}

.login-box {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.login-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--secondary);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: var(--secondary);
    font-size: 0.875rem;
}

/* 聊天页面 */
.chat-page {
    display: flex;
    height: calc(100vh - 4rem);
}

.sidebar {
    width: 300px;
    background: white;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.conversation-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.conversation-item {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.conversation-item:hover {
    background: var(--light);
}

.conversation-item.active {
    background: rgba(59, 130, 246, 0.1);
    border-left: 3px solid var(--primary);
}

.conv-content {
    flex: 1;
    overflow: hidden;
}

.conv-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 0.25rem;
}

.conv-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

.delete-btn {
    opacity: 0;
    transition: opacity 0.2s;
}

.conversation-item:hover .delete-btn {
    opacity: 1;
}

/* 聊天主区域 */
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--light);
}

.chat-header {
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 1rem 2rem;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.message {
    display: flex;
    gap: 1rem;
    max-width: 80%;
}

.message.user-message {
    margin-left: auto;
    flex-direction: row-reverse;
}

.message.assistant-message {
    margin-right: auto;
}

.message-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background: #dbeafe;
    color: var(--primary);
}

.assistant-message .message-avatar {
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.message-content {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: var(--shadow);
}

.user-message .message-content {
    background: var(--primary);
    color: white;
    border-top-right-radius: 0.25rem;
}

.assistant-message .message-content {
    background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 50%, #f0fdf4 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-top-left-radius: 0.25rem;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1), var(--shadow);
    position: relative;
}

.assistant-message .message-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(to bottom, var(--success), #059669);
    border-radius: 3px 0 0 3px;
}

.message-text {
    margin-bottom: 0.5rem;
}

.message-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.8);
}

/* 聊天输入 */
.chat-input-area {
    background: white;
    border-top: 1px solid var(--border);
    padding: 1.5rem 2rem;
}

.chat-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.chat-form textarea {
    flex: 1;
    resize: none;
    min-height: 3rem;
    max-height: 8rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.chat-form textarea::placeholder {
    color: var(--secondary);
}

.input-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary);
    font-size: 0.875rem;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--secondary);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--border);
}

.empty-state.small {
    padding: 1.5rem;
}

.empty-state.small i {
    font-size: 2rem;
}

/* 聊天空状态 */
.chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    text-align: center;
}

.empty-icon {
    font-size: 4rem;
    color: var(--border);
    margin-bottom: 2rem;
}

.chat-empty h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.chat-empty p {
    color: var(--secondary);
    max-width: 400px;
    margin-bottom: 2rem;
}

.features {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature i {
    font-size: 1.5rem;
    color: var(--primary);
}

/* 教师后台 */
.teacher-page {
    padding: 2rem;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.page-header h1 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
}

.header-actions {
    display: flex;
    gap: 1rem;
}

.filter-bar {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.filter-form select,
.filter-form input {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 120px;
}

.filter-form select:focus,
.filter-form input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.filter-form select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.filter-form input::placeholder {
    color: var(--secondary);
}

/* 统计卡片 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
}

.stat-icon {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-card.online .stat-icon { background: #dbeafe; color: var(--primary); }
.stat-card.questions .stat-icon { background: #dcfce7; color: var(--success); }
.stat-card.conversations .stat-icon { background: #fef3c7; color: var(--warning); }
.stat-card.users .stat-icon { background: #f3e8ff; color: #8b5cf6; }

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    color: var(--secondary);
    font-size: 0.875rem;
}

/* 仪表板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* 在线用户列表 */
.online-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.online-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
}

.user-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
}

.user-meta {
    font-size: 0.875rem;
    color: var(--secondary);
}

.user-time {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* 概览列表 */
.overview-list {
    display: grid;
    gap: 1rem;
}

.overview-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
}

/* 快速操作 */
.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.quick-action {
    flex: 1;
    min-width: 120px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    transition: all 0.2s;
}

.quick-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--primary);
}

.quick-action i {
    font-size: 2rem;
    color: var(--primary);
}

/* 状态指示器 */
.status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status.active {
    background: #dcfce7;
    color: #166534;
}

.status.inactive {
    background: #fee2e2;
    color: #991b1b;
}

/* 图表 */
.chart-container {
    padding: 1rem 0;
}

.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    height: 200px;
    padding: 0 1rem;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bar {
    width: 100%;
    background: linear-gradient(to top, var(--primary), var(--primary-dark));
    border-radius: 0.25rem 0.25rem 0 0;
    min-height: 1px;
    position: relative;
    transition: height 0.3s ease;
}

.bar:hover {
    opacity: 0.9;
}

.bar-value {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--dark);
}

.bar-label {
    font-size: 0.75rem;
    color: var(--secondary);
}

/* 排名列表 */
.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--light);
    border-radius: 0.5rem;
}

.rank {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--secondary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.rank.top-1 { background: #f59e0b; }
.rank.top-2 { background: #94a3b8; }
.rank.top-3 { background: #d97706; }

/* 模态框 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--secondary);
    cursor: pointer;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.modal-close:hover {
    background: var(--light);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

/* 响应式 */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .chat-page {
        flex-direction: column;
        height: auto;
    }
    
    .sidebar {
        width: 100%;
        height: 300px;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .teacher-page {
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .header-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .modal-content {
        max-width: 100%;
    }
}

/* 个人设置页面 */
.profile-page {
    padding: 2rem;
    max-width: 800px;
    margin: 0 auto;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light);
    border-radius: 0.5rem;
}

.info-item .label {
    color: var(--secondary);
    font-weight: 500;
}

.info-item .value {
    font-weight: 600;
    color: var(--dark);
}

/* 工具类 */
.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

/* Rate limit提示 */
.rate-limit-hint {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--warning);
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.rate-limit-hint i {
    font-size: 0.875rem;
}

/* 按钮文字显示控制 */
.action-cell {
    white-space: nowrap;
}

.action-cell .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.action-cell .btn-text {
    display: none;
}

@media (min-width: 1200px) {
    .action-cell .btn-text {
        display: inline;
    }
}

/* Tooltip 样式增强 */
.btn[title]:hover {
    position: relative;
}

/* 作业管理页面按钮组 */
.action-cell .btn:last-child {
    margin-right: 0;
}

/* 登录日志异常高亮样式 */
.row-suspicious {
    background-color: #fef3c7 !important;
}

.row-suspicious:hover {
    background-color: #fde68a !important;
}

.status-success {
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-anomaly {
    background: linear-gradient(135deg, #ef4444, #f97316);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin: 0.125rem;
    animation: pulse-anomaly 2s infinite;
}

.badge-anomaly i {
    font-size: 0.7rem;
}

@keyframes pulse-anomaly {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.anomaly-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.stats-grid-sm {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stats-grid-sm .stat-card {
    padding: 1rem;
}

.stats-grid-sm .stat-card.success {
    border-left: 4px solid var(--success);
}

.stats-grid-sm .stat-card.warning {
    border-left: 4px solid var(--warning);
}

.stats-grid-sm .stat-card.danger {
    border-left: 4px solid var(--danger);
}

.time-display {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.8rem;
    color: var(--dark);
}

.user-cell {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.user-cell .user-name {
    font-weight: 600;
    color: var(--dark);
}

.user-cell .user-login {
    font-size: 0.75rem;
    color: var(--secondary);
}

.ip-address {
    background: var(--light);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-family: 'Monaco', 'Menlo', monospace;
}

.device-info {
    font-size: 0.75rem;
    color: var(--secondary);
    cursor: help;
}

.text-muted {
    color: var(--secondary);
    font-size: 0.875rem;
}
/* Markdown 内容样式 */
.markdown-content {
    line-height: 1.6;
    color: var(--dark);
    word-wrap: break-word;
}

.markdown-content h1 {
    font-size: 1.5rem;
    margin: 1rem 0;
    border-bottom: 2px solid var(--border);
}

.markdown-content h2 {
    font-size: 1.25rem;
    margin: 0.75rem 0;
    border-bottom: 1px solid var(--border);
}

.markdown-content h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
}

.markdown-content h4 {
    font-size: 0.875rem;
    margin: 0.5rem 0;
}

.markdown-content h5,    font-size: 0.75rem;
    margin: 0.5rem 0;
}

.markdown-content h6 {
    font-size: 0.75rem;
    margin: 0.25rem 0;
}

.markdown-content p {
    margin: 0.5rem 0;
}

.markdown-content ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
}

.markdown-content ol {
    margin: 0.5rem 0 1rem;
    padding-left: 1.5rem;
}

.markdown-content li {
    margin: 0.25rem 0;
}

.markdown-content blockquote {
    border-left: 4px solid #ddd;
    padding: 0.5rem 0 1rem;
    background: #f8f9fa;
    color: var(--secondary);
}

.markdown-content blockquote p {
    margin: 0;
}

.markdown-content code {
    background: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.85rem;
}

.markdown-content pre {
    background: #f5f5f5;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    overflow-x: auto;
    line-height: 1.4;
}

.markdown-content pre code {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 0;
}

.markdown-content a {
    color: var(--primary);
    text-decoration: none;
}

.markdown-content a:hover {
    text-decoration: underline;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 0.5rem 0;
}

.markdown-content table th,
    background: #f5f5f5;
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.markdown-content table td {
    padding: 0.5rem;
    border: 1px solid var(--border);
}

.markdown-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.markdown-content hr {
    border: none;
    height: 2px solid var(--border);
    margin: 1rem 0;
}

