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

:root {
  /* 颜色变量定义 */
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --success-gradient: linear-gradient(135deg, #66bb6a 0%, #43a047 100%);
  --danger-gradient: linear-gradient(135deg, #ef5350 0%, #c62828 100%);
  --warning-gradient: linear-gradient(135deg, #ffb74d 0%, #ffa726 100%);
  --info-gradient: linear-gradient(135deg, #4fc3f7 0%, #29b6f6 100%);
  --card-gradient: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
  
  --text-primary: #2d3748;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  
  --border-color: #e2e8f0;
  --background-color: #f7fafc;
  --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  
  /* 圆角变量 */
  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;
  
  /* 过渡动画时间 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: var(--background-color);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* 卡片设计 */
.card {
  background: var(--card-gradient);
  border-radius: var(--border-radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.card:hover::before {
  opacity: 1;
}

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

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.card-content {
  color: var(--text-secondary);
}

.card-footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

/* 卡片网格布局 */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

/* 用户信息卡片 */
.user-card {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 20px;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
}

/* 批量添加章节样式 */
.category-input-group {
  margin-bottom: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.category-input-group:hover {
  border-color: #667eea;
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.category-input-group .input-group {
  display: flex;
  align-items: center;
  width: 100%;
  flex-wrap: nowrap;
}

.category-name-input {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 8px;
  position: relative;
}

.category-name-input .form-input {
  flex: 1;
  margin-right: 0;
}

.category-name-input .btn {
  margin: 0;
  white-space: nowrap;
}

.category-name-input .name-error {
  position: absolute;
  bottom: -20px;
  left: 0;
  width: 100%;
}

.category-input-group .input-group-text {
  background: var(--primary-gradient);
  color: white;
  border: none;
  border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  padding: 12px 16px;
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

.category-input-group .form-control {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-left: none;
  border-right: none;
  border-radius: 0;
  font-size: 0.95rem;
  transition: border-color var(--transition-fast);
}

.category-input-group .form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.category-input-group .form-control.is-invalid,
.category-input-group .form-control.error {
  border-color: #ef5350;
  background-color: rgba(239, 83, 80, 0.05);
}

.category-input-group .form-control.is-valid {
  border-color: #66bb6a;
  background-color: rgba(102, 187, 106, 0.05);
}

.category-input-group .btn {
  padding: 12px 16px;
  border: none;
  border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.95rem;
  font-weight: 500;
}

.category-input-group .btn-danger {
  background: var(--danger-gradient);
  color: white;
}

.category-input-group .btn-danger:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(239, 83, 80, 0.2);
}

.category-input-group .btn-danger:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.name-error {
  font-size: 0.85rem;
  color: #ef5350;
  margin-top: 4px;
  min-height: 20px;
}

/* 批量输入样式 */
.batch-inputs {
    margin-bottom: 20px;
}

.batch-input-item {
    margin-bottom: 10px;
}

.batch-input-item .form-input {
    flex: 1;
    min-width: 200px;
}

/* 批量操作按钮样式 */
.batch-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

.batch-actions .btn {
  padding: 10px 16px;
  border: none;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

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

.batch-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.batch-actions .btn-secondary {
  background: white;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.batch-actions .btn-secondary:hover {
  background: #f8f9fa;
  border-color: #667eea;
}

.batch-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 表单错误提示样式 */
.alert {
  padding: 16px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 16px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.alert-danger {
  background: linear-gradient(135deg, rgba(239, 83, 80, 0.1) 0%, rgba(198, 40, 40, 0.1) 100%);
  color: #c62828;
  border: 1px solid rgba(239, 83, 80, 0.3);
}

.user-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
  border-color: #667eea;
}

.user-card-header {
  display: flex;
  align-items: center;
  margin-bottom: 16px;
}

.user-avatar {
  width: 60px;
  height: 60px;
  border-radius: var(--border-radius-full);
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1.25rem;
  margin-right: 16px;
  flex-shrink: 0;
}

.user-info h4 {
  margin: 0 0 4px 0;
  color: var(--text-primary);
  font-size: 1.1rem;
}

.user-info p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.user-card-body {
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.user-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.user-status {
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-status.active {
  background: rgba(102, 187, 106, 0.1);
  color: #43a047;
}

.user-status.inactive {
  background: rgba(239, 83, 80, 0.1);
  color: #c62828;
}

/* 按钮设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.2);
  transition: left var(--transition-fast);
}

.btn:hover::before {
  left: 100%;
}

.btn:active {
  transform: scale(0.98);
}

/* 主要按钮 */
.btn-primary {
  background: var(--primary-gradient);
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 成功按钮 */
.btn-success {
  background: var(--success-gradient);
  color: white;
}

.btn-success:hover {
  box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
}

/* 危险按钮 */
.btn-danger {
  background: var(--danger-gradient);
  color: white;
}

.btn-danger:hover {
  box-shadow: 0 4px 12px rgba(239, 83, 80, 0.3);
}

/* 轮廓按钮 */
.btn-outline {
  background: transparent;
  border: 2px solid #667eea;
  color: #667eea;
}

.btn-outline:hover {
  background: #667eea;
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 按钮大小变体 */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 1rem;
}

/* 图标按钮样式 */
.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.icon-button:active {
    transform: translateY(0);
    box-shadow: none;
}

.button-icon {
    width: 16px;
    height: 16px;
    display: block;
}

/* 针对不同类型按钮的图标颜色 */
.btn-secondary.icon-button .button-icon {
    color: #6c757d; /* 与secondary按钮文字颜色一致 */
}

.btn-danger.icon-button .button-icon {
    color: #dc3545; /* 与danger按钮文字颜色一致 */
}

/* 按钮组 */
.btn-group {
  display: flex;
  gap: 8px;
}

/* 登录界面 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-gradient);
  padding: 20px;
}

.login-container {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

.login-container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-gradient);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

/* 登录页面动态标题样式 */
.login-dynamic-title {
  display: inline-block;
  background: linear-gradient(90deg, #667eea, #764ba2, #667eea);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logoShimmer 3s infinite;
  transition: transform var(--transition-normal);
}

.login-dynamic-title:hover {
  transform: scale(1.02);
}

.login-subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
}

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

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.875rem;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  background: white;
  color: var(--text-primary);
}

.form-input:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
  background: white;
  color: var(--text-primary);
  appearance: none;
  background-image: url('data:image/svg+xml;charset=US-ASCII,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z" fill="%23718096"/></svg>');
  background-repeat: no-repeat;
  background-position: right 16px center;
}

.form-select:focus {
  border-color: #667eea;
  outline: none;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-checkbox {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.form-checkbox:checked {
  background: #667eea;
  border-color: #667eea;
}

/* 查询列表样式 */
.query-container {
  background: white;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-light);
  overflow: hidden;
  transition: all var(--transition-normal);
  position: relative;
}

.query-container:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

.query-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
}

.query-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
}

/* 搜索功能区域 */
.search-container {
  background: #f8fafc;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color var(--transition-fast);
}

.search-container:hover {
  background: #f1f5f9;
}

.search-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: end;
}

.search-form .form-group {
  margin-bottom: 0;
}

/* 表格样式 */
.table, .data-table, .scores-table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
}

.table th, .data-table th, .scores-table th {
  background: #667eea;
  color: white;
  padding: 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  border-bottom: 3px solid #4a5dd9;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: nowrap;
}

.table td, .data-table td, .scores-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.table tr, .data-table tr, .scores-table tr {
  transition: background-color var(--transition-fast);
}

.table tr:hover, .data-table tr:hover, .scores-table tr:hover {
  background-color: #f8fafc;
}

.table tr:last-child td, .data-table tr:last-child td, .scores-table tr:last-child td {
  border-bottom: none;
}

/* 分页控件 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  gap: 8px;
  background: white;
  border-top: 1px solid var(--border-color);
}

.pagination-item, .pagination-btn {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  background: white;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  text-decoration: none;
}

.pagination-item:hover:not(:disabled), .pagination-btn:hover:not(:disabled) {
  border-color: #667eea;
  color: #667eea;
}

.pagination-item.active, .pagination-btn.active {
  background: var(--primary-gradient);
  border-color: #667eea;
  color: white;
}

.pagination-item:disabled, .pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 状态标识 */
.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.active {
  background: rgba(102, 187, 106, 0.1);
  color: #43a047;
}

.status-badge.inactive {
  background: rgba(239, 83, 80, 0.1);
  color: #c62828;
}

.status-badge.pending {
  background: rgba(255, 183, 77, 0.1);
  color: #ffa726;
}

/* 导航布局 */
.main-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--background-color);
}

/* 侧边栏导航 */
.sidebar {
  width: 260px;
  background: white;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  flex-shrink: 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-color);
  background: var(--primary-gradient);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sidebar-logo {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
}

/* 动态logo文字样式 */
.dynamic-logo {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  background: var(--primary-gradient);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: logoShimmer 2.5s infinite;
  transition: transform var(--transition-normal);
}

.dynamic-logo:hover {
  transform: scale(1.05);
  text-shadow: 0 0 15px rgba(255, 255, 255, 0.7);
}

@keyframes logoShimmer {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

.sidebar-nav {
  padding: 16px 0;
}

.sidebar-nav-item {
  list-style: none;
}

.sidebar-nav-link {
  display: flex;
  align-items: center;
  padding: 12px 24px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all var(--transition-fast);
  font-size: 0.875rem;
  font-weight: 500;
}

.sidebar-nav-link:hover {
  background-color: #f8fafc;
  color: #667eea;
  padding-left: 28px;
}

.sidebar-nav-link.active {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
  border-left: 4px solid #667eea;
  padding-left: 20px;
}

.sidebar-nav-icon {
  margin-right: 12px;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 文章页面主标题样式 */
.main-title {
  background: var(--primary-gradient);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* 主布局容器 */
.main-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* 侧边栏 */
.sidebar {
  width: 260px;
  background: white;
  box-shadow: 2px 0 5px rgba(0, 0, 0, 0.05);
  transition: transform var(--transition-normal);
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid var(--border-color);
    background-color: #f8f9fa; /* 浅灰色背景 */
}

.dynamic-logo {
  font-size: 1.25rem;
  font-weight: 700;
  background: linear-gradient(90deg, #667eea, #764ba2); /* 紫色渐变 */
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-fill-color: transparent;
  text-align: center;
}

.sidebar-nav {
  list-style: none;
  padding: 16px 0;
}

.sidebar-nav-item {
  padding: 0 16px;
}

.sidebar-nav-link {
  display: block;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
}

.sidebar-nav-link:hover {
  background-color: rgba(102, 126, 234, 0.05);
  color: #667eea;
}

.sidebar-nav-item.active .sidebar-nav-link {
  background-color: rgba(102, 126, 234, 0.1);
  color: #667eea;
  font-weight: 500;
}

/* 主内容区 - 同时支持content和content-area类 */
.content, .content-area {
  flex: 1;
  margin-left: 260px;
  padding: 32px;
  transition: margin-left var(--transition-normal);
  min-height: 100vh;
}

.container-fluid {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.content-wrapper {
  width: 100%;
}

/* 页面标题栏 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

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

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

.stat-card {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 24px;
  box-shadow: var(--shadow-light);
  transition: all var(--transition-normal);
  border-left: 4px solid #667eea;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-medium);
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* 消息提示 */
.message {
  padding: 16px 20px;
  border-radius: var(--border-radius-sm);
  margin-bottom: 24px;
  position: relative;
  border: 1px solid transparent;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.message.success {
  background: rgba(102, 187, 106, 0.1);
  color: #43a047;
  border-color: rgba(102, 187, 106, 0.2);
}

.message.error {
  background: rgba(239, 83, 80, 0.1);
  color: #c62828;
  border-color: rgba(239, 83, 80, 0.2);
}

.message.info {
  background: rgba(79, 195, 247, 0.1);
  color: #29b6f6;
  border-color: rgba(79, 195, 247, 0.2);
}

.message.warning {
  background: rgba(255, 183, 77, 0.1);
  color: #ffa726;
  border-color: rgba(255, 183, 77, 0.2);
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(102, 126, 234, 0.3);
  border-radius: 50%;
  border-top-color: #667eea;
  animation: spin 1s ease-in-out infinite;
}

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

/* 页面标题栏 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.page-header h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
}

.pull-right {
  margin-left: auto;
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .sidebar {
    width: 220px;
  }
  
  .content, .content-area {
    margin-left: 220px;
    padding: 24px;
  }
  
  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .content, .content-area {
    margin-left: 0;
    padding: 16px;
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  .pull-right {
    margin-left: 0;
  }
  
  .search-form {
    grid-template-columns: 1fr;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .login-container {
    padding: 32px 24px;
  }
  
  .data-table {
    display: block;
    overflow-x: auto;
  }
}

/* 打印样式 */
@media print {
  .sidebar, 
  .btn, 
  .pagination, 
  .search-container {
    display: none;
  }
  
  .content {
    margin-left: 0;
    padding: 0;
  }
  
  .card, 
  .query-container {
    box-shadow: none;
    border: 1px solid #ddd;
  }
}

/* 知识点分类选择器样式 - 层级并列显示版本 */
.cascading-selector-wrapper {
    background-color: #ffffff;
    border: 1px solid #e1e4e8;
    border-radius: 6px;
    padding: 10px;
    min-width: 600px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.selector-path {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e4e8;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 30px;
}

.cascading-path-item {
    background: none;
    border: none;
    color: #0366d6;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.cascading-path-item:hover {
    background-color: #e1e4e8;
    text-decoration: underline;
}

.cascading-path-item.first-level {
    color: #586069;
    font-weight: 600;
}

.cascading-path-separator {
    color: #6a737d;
    margin: 0 6px;
    font-size: 14px;
}

/* 层级容器样式 */
.selector-levels {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    padding-bottom: 5px;
    max-height: 350px;
}

.selector-levels::-webkit-scrollbar {
    height: 6px;
}

.selector-levels::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.selector-levels::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.selector-levels::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.cascading-level-container {
    min-width: 160px;
    border: 1px solid #e1e4e8;
    border-radius: 4px;
    background-color: #f9fafb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.cascading-level-title {
    font-weight: 600;
    padding: 8px 12px;
    background-color: #f3f4f6;
    border-bottom: 1px solid #e1e4e8;
    color: #24292e;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cascading-category-list {
    display: flex;
    flex-direction: column;
    max-height: 280px;
    overflow-y: auto;
}

.cascading-category-list::-webkit-scrollbar {
    width: 5px;
}

.cascading-category-list::-webkit-scrollbar-track {
    background: transparent;
}

.cascading-category-list::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 5px;
}

.cascading-category-list::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.cascading-category-item {
    padding: 10px 12px;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s, color 0.2s;
    border-left: 3px solid transparent;
    font-size: 14px;
}

.cascading-category-item:hover {
    background-color: #e6ebf1;
    color: #0366d6;
}

.cascading-category-item.selected {
    background-color: #dbeafe;
    border-left-color: #2563eb;
    color: #1d4ed8;
    font-weight: 500;
}

.cascading-no-data {
    color: #6a737d;
    font-style: italic;
    padding: 20px 10px;
    text-align: center;
    font-size: 13px;
}

.cascading-loading {
    color: #6a737d;
    padding: 30px;
    text-align: center;
    font-size: 14px;
}

.cascading-error {
    color: #cb2431;
    padding: 30px;
    text-align: center;
    font-size: 14px;
}

.category-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.category-has-children {
    color: #6a737d;
    margin-left: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s;
}

.cascading-category-item:hover .category-has-children {
    transform: translateX(2px);
    color: #0366d6;
}

/* 适配移动端显示 */
@media (max-width: 768px) {
    .cascading-selector-wrapper {
        min-width: auto;
        width: 100%;
    }
    
    .selector-levels {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: auto;
        max-height: 400px;
    }
    
    .cascading-level-container {
        min-width: auto;
        margin-bottom: 10px;
    }
    
    .cascading-category-list {
        max-height: 150px;
    }
}

/* 代码块样式 */
.code-block {
    background-color: #2d3748;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    margin: 1rem 0;
}

/* 数据库迁移信息样式 */
.migration-header {
    font-weight: bold;
    font-size: 1.1rem;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.migration-info {
    background-color: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}

.migration-success {
    color: #38a169;
    font-weight: bold;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background-color: #c6f6d5;
    border-radius: 0.375rem;
    display: inline-block;
}

/* ===== 状态样式规范 (status_styles.md) ===== */

/* 节点状态标签样式 */
.node-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

/* 启用状态样式 */
.node-status.active {
    background-color: #f0f9ff;
    color: #52c41a;
    border: 1px solid #d9f7be;
}

.node-status.active::before {
    content: '●';
    font-size: 8px;
    margin-right: 4px;
    animation: pulse 2s infinite;
}

/* 禁用状态样式 */
.node-status.inactive {
    background-color: #fff2f0;
    color: #ff4d4f;
    border: 1px solid #ffccc7;
}

.node-status.inactive::before {
    content: '○';
    font-size: 8px;
    margin-right: 4px;
}

/* 核心知识点状态样式 */
.core-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin: 0 10px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s ease;
}

/* 核心知识点样式 */
.core-status.core {
    background-color: #f6ffed;
    color: #52c41a;
    border: 1px solid #b7eb8f;
}

.core-status.core::before {
    content: '●';
    font-size: 8px;
    margin-right: 4px;
    animation: pulse 2s infinite;
}

/* 普通知识点样式 */
.core-status.normal {
    background-color: #f0f0f0;
    color: #8c8c8c;
    border: 1px solid #d9d9d9;
}

.core-status.normal::before {
    content: '○';
    font-size: 8px;
    margin-right: 4px;
}

/* 状态标签悬停效果 */
.node-status:hover,
.core-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 脉冲动画 */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* ===== 表格和列表相关样式 ===== */

/* 表格响应式容器 */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: white;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* 操作按钮容器 */
.action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* 小按钮 */
.btn-small {
    padding: 6px 12px;
    font-size: 0.75rem;
    min-width: auto;
}

/* 按钮变体 */
.btn-secondary {
    background: white;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #667eea;
}

/* 徽章样式 */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-primary {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.badge-success {
    background: rgba(102, 187, 106, 0.1);
    color: #43a047;
}

.badge-danger {
    background: rgba(239, 83, 80, 0.1);
    color: #c62828;
}

.badge-warning {
    background: rgba(255, 183, 77, 0.1);
    color: #ffa726;
}

.badge-info {
    background: rgba(79, 195, 247, 0.1);
    color: #29b6f6;
}

/* 难度徽章 */
.badge-difficulty-1 {
    background: rgba(102, 187, 106, 0.15);
    color: #43a047;
}

.badge-difficulty-2 {
    background: rgba(255, 183, 77, 0.15);
    color: #ffa726;
}

.badge-difficulty-3 {
    background: rgba(239, 83, 80, 0.15);
    color: #c62828;
}

/* 状态徽章 */
.badge-status-1 {
    background: rgba(158, 158, 158, 0.1);
    color: #666;
}

.badge-status-2 {
    background: rgba(255, 183, 77, 0.1);
    color: #ffa726;
}

.badge-status-3 {
    background: rgba(102, 187, 106, 0.1);
    color: #43a047;
}

.badge-status-4 {
    background: rgba(158, 158, 158, 0.1);
    color: #8c8c8c;
}

/* 内容预览 */
.content-preview {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* ===== 表单相关样式 ===== */

/* 表单行 */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    align-items: end;
}

/* 表单错误样式 */
.form-input.error,
.form-select.error {
    border-color: #c62828;
    background-color: rgba(239, 83, 80, 0.05);
}

.form-error {
    color: #c62828;
    font-size: 0.75rem;
    margin-top: 4px;
}

/* ===== 卡片表单样式 ===== */

.card-layout {
    max-width: 800px;
    margin: 0 auto;
}

.card {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-light);
    transition: all var(--transition-normal);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.card-content {
    color: var(--text-secondary);
}

.card-footer {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 12px;
    justify-content: flex-start;
}

.card-footer .btn {
    flex-shrink: 0;
}