/**
 * 学员管理 · 样式表
 * 前缀: as- (academic-students)
 */

/* ── 页面容器 ────────────────────────────────────────── */
.as-page { padding: 20px; font-family: inherit; color: #333; }

/* ── Header ──────────────────────────────────────────── */
.as-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.as-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.as-header-icon { margin-right: 6px; }
.as-actions { display: flex; gap: 8px; }

/* ── 统计栏 ──────────────────────────────────────────── */
.as-stats { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.as-stat-item {
  flex: 1; min-width: 100px; background: #fafafa; border: 1px solid #f0f0f0;
  border-radius: 8px; padding: 14px 16px; text-align: center; transition: all 0.2s;
}
.as-stat-item:hover { border-color: #F18D24; box-shadow: 0 2px 8px rgba(241,141,36,0.1); }
.as-stat-num { display: block; font-size: 26px; font-weight: 700; color: #333; line-height: 1.2; }
.as-stat-label { display: block; font-size: 13px; color: #999; margin-top: 4px; }

/* ── 工具栏 ──────────────────────────────────────────── */
.as-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.as-input, .as-select {
  padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 14px; outline: none; transition: border-color 0.2s; background: #fff;
}
.as-input:focus, .as-select:focus { border-color: #F18D24; }
.as-input { flex: 1; min-width: 200px; }
.as-select { min-width: 120px; }
.as-textarea {
  width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 14px; resize: vertical; min-height: 80px; outline: none; font-family: inherit;
  box-sizing: border-box;
}
.as-textarea:focus { border-color: #F18D24; }
.as-textarea-code { font-family: 'Consolas', 'Monaco', monospace; font-size: 13px; }

/* ── 按钮 ────────────────────────────────────────────── */
.as-btn {
  padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.as-btn:hover { border-color: #F18D24; color: #F18D24; }
.as-btn-primary { background: #F18D24; border-color: #F18D24; color: #fff; }
.as-btn-primary:hover { background: #e07d1a; color: #fff; border-color: #e07d1a; }
.as-btn-primary:disabled { background: #f5b776; border-color: #f5b776; cursor: not-allowed; }
.as-btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.as-btn-danger:hover { background: #e04343; color: #fff; }
.as-btn-outline { border-color: #d9d9d9; background: #fff; }
.as-btn-sm {
  padding: 4px 10px; border: 1px solid #d9d9d9; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.as-btn-sm:hover { border-color: #F18D24; color: #F18D24; }
.as-btn-sm[disabled] { opacity: 0.5; cursor: not-allowed; }
.as-btn-sm[disabled]:hover { border-color: #d9d9d9; color: inherit; }
.as-btn-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #999; padding: 0 8px; line-height: 1;
}
.as-btn-close:hover { color: #333; }

/* ── 主内容区（左右双栏） ────────────────────────────── */
.as-content { display: flex; gap: 16px; min-height: 500px; }

/* ── 左栏：列表面板 ──────────────────────────────────── */
.as-list-panel {
  width: 380px; flex-shrink: 0; border: 1px solid #f0f0f0; border-radius: 8px;
  background: #fff; display: flex; flex-direction: column;
}
.as-list-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid #f0f0f0;
}
.as-list-title { font-size: 15px; font-weight: 600; }
.as-list-count { font-size: 12px; color: #999; }
.as-list-body { flex: 1; overflow-y: auto; max-height: 580px; }

/* ── 学员卡片 ────────────────────────────────────────── */
.as-card {
  display: flex; gap: 12px; padding: 12px 16px; cursor: pointer;
  transition: all 0.15s; border-bottom: 1px solid #f5f5f5;
}
.as-card:hover { background: #fff8f0; }
.as-card-selected { background: #fff3e0; border-left: 3px solid #F18D24; }
.as-card-avatar {
  width: 44px; height: 44px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; background: #f5f5f5;
}
.as-card-avatar img { width: 100%; height: 100%; object-fit: cover; }
.as-avatar-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; background: #F18D24; color: #fff;
  font-size: 18px; font-weight: 600;
}
.as-avatar-lg { font-size: 28px; }
.as-card-body { flex: 1; min-width: 0; }
.as-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.as-card-name { font-size: 15px; font-weight: 600; color: #333; }
.as-card-info { font-size: 12px; color: #666; display: flex; gap: 8px; margin-bottom: 2px; }
.as-card-meta { font-size: 11px; color: #999; display: flex; gap: 8px; }

/* ── 右栏：详情面板 ──────────────────────────────────── */
.as-detail-panel {
  flex: 1; border: 1px solid #f0f0f0; border-radius: 8px;
  background: #fff; min-height: 500px;
}
.as-detail-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 400px; color: #bbb;
}
.as-empty-icon { font-size: 60px; margin-bottom: 12px; }
.as-detail-empty p { margin: 0; font-size: 15px; }

.as-detail-content { padding: 20px; }

/* ── 详情头 ────────────────────────────────────────── */
.as-detail-header {
  display: flex; gap: 20px; align-items: flex-start; margin-bottom: 20px;
  padding-bottom: 16px; border-bottom: 1px solid #f0f0f0;
}
.as-detail-avatar {
  width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
  flex-shrink: 0; background: #f5f5f5;
}
.as-detail-avatar img { width: 100%; height: 100%; object-fit: cover; }
.as-detail-info { flex: 1; }
.as-detail-name-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.as-detail-name-row h3 { margin: 0; font-size: 18px; font-weight: 600; }
.as-detail-sub { font-size: 13px; color: #888; display: flex; gap: 12px; flex-wrap: wrap; }

/* ── 徽标 ────────────────────────────────────────────── */
.as-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
}
.as-badge-green  { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.as-badge-orange { background: #fff7e6; color: #fa8c16; border: 1px solid #ffd9a8; }
.as-badge-gray   { background: #f5f5f5; color: #999; border: 1px solid #e8e8e8; }
.as-badge-red    { background: #fff1f0; color: #ff4d4f; border: 1px solid #ffa39e; }

/* ── 标签 ────────────────────────────────────────────── */
.as-tag {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px;
  background: #f0f5ff; color: #2f54eb; border: 1px solid #d6e4ff; margin: 2px;
}

/* ── 选项卡 ────────────────────────────────────────── */
.as-tabs {
  display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #f0f0f0;
}
.as-tab {
  padding: 10px 18px; border: none; background: none; cursor: pointer;
  font-size: 14px; color: #666; transition: all 0.2s; border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}
.as-tab:hover { color: #F18D24; }
.as-tab-active { color: #F18D24; font-weight: 600; border-bottom-color: #F18D24; }

/* ── 信息网格 ──────────────────────────────────────── */
.as-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: #f5f5f5; }
.as-info-row {
  display: flex; background: #fff; padding: 10px 14px;
}
.as-info-row-full { grid-column: 1 / -1; }
.as-info-label {
  width: 100px; flex-shrink: 0; font-size: 13px; color: #888;
  font-weight: 500;
}
.as-info-value { font-size: 14px; color: #333; }

/* ── 表格 ────────────────────────────────────────────── */
.as-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.as-table th {
  background: #fafafa; padding: 10px 12px; text-align: left;
  font-weight: 600; border-bottom: 1px solid #f0f0f0; white-space: nowrap;
}
.as-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.as-table tr:hover { background: #fafafa; }
.as-cell-name { font-weight: 500; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── 汇总卡片 ──────────────────────────────────────── */
.as-summary-cards { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.as-summary-card {
  flex: 1; min-width: 100px; padding: 16px 20px; background: #fafafa;
  border: 1px solid #f0f0f0; border-radius: 8px; text-align: center;
}
.as-summary-num { font-size: 28px; font-weight: 700; color: #333; line-height: 1.2; }
.as-summary-label { font-size: 13px; color: #999; margin-top: 4px; }
.as-summary-card-green .as-summary-num { color: #52c41a; }
.as-summary-card-orange .as-summary-num { color: #fa8c16; }
.as-summary-card-red .as-summary-num { color: #ff4d4f; }
.as-summary-card-blue .as-summary-num { color: #1890ff; }

/* ── 操作日志 ────────────────────────────────────── */
.as-log-list { max-height: 400px; overflow-y: auto; }
.as-log-item {
  padding: 10px 0; border-bottom: 1px solid #f5f5f5;
}
.as-log-item:last-child { border-bottom: none; }
.as-log-header { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.as-log-action {
  background: #f0f5ff; color: #2f54eb; padding: 2px 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500;
}
.as-log-operator { color: #666; }
.as-log-time { color: #999; margin-left: auto; font-size: 12px; }
.as-log-detail { font-size: 12px; color: #999; margin-top: 4px; padding-left: 4px; }

/* ── 状态提示 ────────────────────────────────────────── */
.as-loading, .as-empty {
  text-align: center; padding: 60px 20px; color: #999; font-size: 15px;
}
.as-loading { color: #F18D24; }

/* ── 分页 ────────────────────────────────────────────── */
.as-pagination {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 1px solid #f0f0f0; font-size: 13px;
}
.as-pg-info { color: #999; margin-right: 8px; }
.as-pg-current {
  display: inline-block; padding: 3px 10px; background: #F18D24; color: #fff;
  border-radius: 4px; font-size: 13px; font-weight: 600;
}

/* ── 右键菜单 ────────────────────────────────────────── */
.as-context-menu {
  position: fixed; z-index: 10000; background: #fff; border: 1px solid #e8e8e8;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); overflow: hidden;
  min-width: 120px;
}
.as-context-item {
  padding: 8px 16px; font-size: 13px; cursor: pointer; transition: background 0.15s;
}
.as-context-item:hover { background: #fff3e0; }

/* ── 隐藏 ────────────────────────────────────────────── */
.as-hidden { display: none !important; }

/* ── 弹窗 ────────────────────────────────────────────── */
.as-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; z-index: 9999;
}
.as-modal {
  background: #fff; border-radius: 10px; width: 620px; max-width: 95vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 6px 30px rgba(0,0,0,0.15);
}
.as-modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid #f0f0f0;
}
.as-modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.as-modal-content { padding: 20px; }
.as-modal-footer {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid #f0f0f0;
}

/* ── 表单 ────────────────────────────────────────────── */
.as-form-group { margin-bottom: 14px; }
.as-form-group label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: #555; }
.as-form-row { display: flex; gap: 12px; }
.as-form-row .as-form-group { flex: 1; }
.as-required { color: #ff4d4f; }

/* ── 导入预览 ────────────────────────────────────────── */
.as-import-preview-table { margin-top: 8px; max-height: 300px; overflow-y: auto; }
.as-status-current { padding: 4px 0; }

/* ── 响应式 ──────────────────────────────────────────── */
@media (max-width: 1024px) {
  .as-content { flex-direction: column; }
  .as-list-panel { width: 100%; max-height: 400px; }
  .as-list-body { max-height: 300px; }
  .as-detail-panel { min-height: 300px; }
}

@media (max-width: 768px) {
  .as-page { padding: 12px; }
  .as-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .as-toolbar { flex-direction: column; }
  .as-form-row { flex-direction: column; }
  .as-modal { width: 95vw; }
  .as-stats { gap: 8px; }
  .as-stat-item { min-width: 80px; padding: 10px 12px; }
  .as-stat-num { font-size: 22px; }
  .as-info-grid { grid-template-columns: 1fr; }
  .as-info-label { width: 80px; }
  .as-summary-card { min-width: 80px; }
}

/* ── 自定义滚动条 ──────────────────────────────────── */
.as-list-body::-webkit-scrollbar { width: 6px; }
.as-list-body::-webkit-scrollbar-track { background: transparent; }
.as-list-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }
.as-list-body::-webkit-scrollbar-thumb:hover { background: #bbb; }
.as-log-list::-webkit-scrollbar { width: 5px; }
.as-log-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; }

/* ── 表单校验状态 ──────────────────────────────────── */
.as-input-error { border-color: #ff4d4f !important; }
.as-input-error:focus { box-shadow: 0 0 0 2px rgba(255,77,79,0.2); }
.as-form-error { color: #ff4d4f; font-size: 12px; margin-top: 2px; }

/* ── 加载动画 ────────────────────────────────────────── */
@keyframes as-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.as-loading::before {
  content: ''; display: inline-block; width: 20px; height: 20px;
  border: 2px solid #f0f0f0; border-top-color: #F18D24; border-radius: 50%;
  animation: as-spin 0.8s linear infinite; margin-right: 8px; vertical-align: middle;
}
.as-loading { display: flex; align-items: center; justify-content: center; }

/* ── 选中状态动画 ────────────────────────────────────── */
.as-card-selected { animation: as-fade-in 0.2s ease; }
@keyframes as-fade-in {
  from { opacity: 0.8; }
  to { opacity: 1; }
}

/* ── 弹出动画 ────────────────────────────────────────── */
.as-modal-overlay { animation: as-overlay-in 0.2s ease; }
@keyframes as-overlay-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
.as-modal { animation: as-modal-in 0.25s ease; }
@keyframes as-modal-in {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

/* ── 详情面板悬停提示 ────────────────────────────────── */
.as-card[data-id]:active { opacity: 0.85; }

/* ── 打印样式 ────────────────────────────────────────── */
@media print {
  .as-page { padding: 0; }
  .as-toolbar, .as-pagination, .as-actions, .as-btn, .as-btn-sm,
  .as-modal-overlay, .as-context-menu, #as-btn-change-status, #as-btn-edit-student { display: none !important; }
  .as-content { flex-direction: column; }
  .as-list-panel { width: 100%; max-height: none; border: none; }
  .as-detail-panel { border: none; page-break-before: always; }
  .as-stats { break-inside: avoid; }
  .as-detail-header { break-inside: avoid; }
}

/* ── 高DPI 适配 ──────────────────────────────────────── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .as-card-avatar, .as-detail-avatar { box-shadow: 0 0 0 1px rgba(0,0,0,0.05); }
}

/* ── 小屏更紧凑布局 ──────────────────────────────────── */
@media (max-width: 480px) {
  .as-header h2 { font-size: 17px; }
  .as-stat-item { min-width: 60px; padding: 8px 6px; }
  .as-stat-num { font-size: 18px; }
  .as-stat-label { font-size: 11px; }
  .as-card { padding: 8px 12px; }
  .as-card-name { font-size: 14px; }
  .as-detail-header { flex-direction: column; align-items: center; text-align: center; }
  .as-detail-name-row { justify-content: center; flex-wrap: wrap; }
  .as-detail-sub { justify-content: center; }
  .as-table th, .as-table td { padding: 6px 8px; font-size: 12px; }
  .as-tab { padding: 8px 12px; font-size: 13px; }
  .as-summary-card { min-width: 60px; padding: 10px; }
  .as-summary-num { font-size: 20px; }
}
