/* ========================================
   Components - 组件样式（经典简洁版）
   ======================================== */

/* === 按钮系统 === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  line-height: 1;
  border-radius: var(--radius-md);
  border: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

/* 主要按钮 */
.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-light);
  border: none;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  box-shadow: var(--shadow-md);
  color: var(--text-light);
}

/* 轮廓按钮 */
.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--text-light);
}

/* 浅色轮廓按钮 */
.btn-outline-light {
  background: transparent;
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.6);
}

.btn-outline-light:hover {
  background: var(--text-light);
  color: var(--primary);
  border-color: var(--text-light);
}

/* 文字按钮 */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--primary-pale);
  color: var(--primary);
}

/* 按钮尺寸 */
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-lg);
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  border-radius: var(--radius-sm);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: var(--radius-md);
}

/* 按钮禁用状态 */
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* === Logo 组件 === */
.logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
}

.logo-img {
  height: 44px;
  width: auto;
  object-fit: contain;
  transition: transform var(--transition-base);
}

.logo:hover .logo-img {
  transform: scale(1.03);
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--gradient-primary);
  color: var(--text-light);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-bold);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.logo:hover .logo-icon {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.logo-text {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

/* === 区块标题 === */
.section-header {
  text-align: center;
  margin-bottom: var(--space-12);
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--primary-pale);
  color: var(--primary);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  margin-bottom: var(--space-4);
}

.section-tag::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
}

.section-title {
  font-family: var(--font-serif);
  font-size: var(--text-4xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-4);
}

.section-desc {
  font-size: var(--text-lg);
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  line-height: var(--leading-relaxed);
}

/* === 卡片系统 === */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: all var(--transition-base);
  border: 1px solid var(--border-light);
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* === 标签系统 === */
.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
  border-radius: var(--radius-full);
  background: var(--primary-pale);
  color: var(--primary);
}

.tag-course { 
  background: rgba(34, 168, 105, 0.1); 
  color: #22a868; 
}

.tag-activity { 
  background: rgba(74, 144, 217, 0.1); 
  color: #4a90d9; 
}

.tag-notice { 
  background: var(--accent-pale); 
  color: #a08030; 
}

/* === 徽章 === */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 var(--space-2);
  font-size: 11px;
  font-weight: var(--font-semibold);
  border-radius: var(--radius-full);
  background: var(--error);
  color: var(--text-light);
}

/* === 模态框 === */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: var(--z-modal-backdrop);
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xl);
  color: var(--text-muted);
  transition: all var(--transition-fast);
  cursor: pointer;
  background: transparent;
  border: none;
}

.modal-close:hover {
  background: var(--surface-alt);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  max-height: calc(90vh - 140px);
}

.modal-footer {
  padding: var(--space-6);
  border-top: 1px solid var(--border-light);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-4);
}

/* === 表单元素 === */
.form-group {
  margin-bottom: var(--space-5);
}

.form-group label {
  display: block;
  font-weight: var(--font-medium);
  margin-bottom: var(--space-2);
  color: var(--text-primary);
  font-size: var(--text-sm);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  background: var(--surface);
  color: var(--text-primary);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-pale);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
  line-height: var(--leading-relaxed);
}

/* === Toast 提示 === */
.toast {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  color: var(--text-light);
  font-weight: var(--font-medium);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.toast.success { 
  background: var(--primary); 
}

.toast.error { 
  background: #dc3545; 
}

.toast.info { 
  background: #4a90d9; 
}

/* === 加载状态 === */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
}

.loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 骨架屏 */
.skeleton {
  background: linear-gradient(90deg, var(--border-light) 25%, var(--surface-alt) 50%, var(--border-light) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* === 空状态 === */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-4);
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-4);
  opacity: 0.4;
}

/* === Divider 分隔线 === */
.divider {
  height: 1px;
  background: var(--border-light);
  margin: var(--space-6) 0;
}

/* === Avatar 头像 === */
.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm { width: 32px; height: 32px; font-size: var(--text-sm); }
.avatar-lg { width: 64px; height: 64px; font-size: var(--text-2xl); }
.avatar-xl { width: 96px; height: 96px; font-size: var(--text-3xl); }
