/* ===== 督导工作平台 V3.0 全局样式 ===== */

:root {
  --c-primary: #1a56db;
  --c-primary-dark: #1e40af;
  --c-primary-light: #dbeafe;
  --c-success: #059669;
  --c-success-light: #d1fae5;
  --c-warning: #d97706;
  --c-warning-light: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-light: #fee2e2;
  --c-gray-50: #f9fafb;
  --c-gray-100: #f3f4f6;
  --c-gray-200: #e5e7eb;
  --c-gray-300: #d1d5db;
  --c-gray-500: #6b7280;
  --c-gray-700: #374151;
  --c-gray-900: #111827;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans SC", sans-serif;
  background: var(--c-gray-50);
  color: var(--c-gray-900);
  line-height: 1.6;
  font-size: 14px;
}

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

/* ===== 导航栏 ===== */
.navbar {
  background: white;
  border-bottom: 1px solid var(--c-gray-200);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand {
  font-size: 16px;
  font-weight: 600;
  color: var(--c-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.navbar-brand span { font-size: 12px; color: var(--c-gray-500); font-weight: 400; }
.navbar-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}
.navbar-menu a {
  padding: 8px 14px;
  border-radius: var(--radius);
  color: var(--c-gray-700);
  font-size: 14px;
  text-decoration: none;
  transition: all 0.15s;
}
.navbar-menu a:hover { background: var(--c-gray-100); text-decoration: none; }
.navbar-menu a.active { background: var(--c-primary-light); color: var(--c-primary-dark); }
.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}
.navbar-user .badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}
.badge-admin { background: #ddd6fe; color: #5b21b6; }
.badge-jwk { background: var(--c-primary-light); color: var(--c-primary-dark); }
.badge-xsk { background: var(--c-success-light); color: var(--c-success); }
.badge-supervisor { background: #fed7aa; color: #c2410c; }
.badge-leader { background: var(--c-gray-200); color: var(--c-gray-700); }
.badge-student_committee { background: var(--c-warning-light); color: var(--c-warning); }
.badge-student { background: #fce7f3; color: #be185d; }

/* ===== 容器 ===== */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.container-narrow { max-width: 480px; margin: 0 auto; padding: 24px; }

/* ===== 卡片 ===== */
.card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title .actions { display: flex; gap: 8px; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-gray-700);
  margin-bottom: 6px;
}
.form-label .required { color: var(--c-danger); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--c-gray-300);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.15s;
  background: white;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,0.1);
}
.form-textarea { min-height: 80px; resize: vertical; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: 12px; color: var(--c-gray-500); margin-top: 4px; }

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--c-primary); color: white; }
.btn-primary:hover { background: var(--c-primary-dark); }
.btn-success { background: var(--c-success); color: white; }
.btn-success:hover { background: #047857; }
.btn-danger { background: var(--c-danger); color: white; }
.btn-danger:hover { background: #b91c1c; }
.btn-outline {
  background: white;
  border: 1px solid var(--c-gray-300);
  color: var(--c-gray-700);
}
.btn-outline:hover { background: var(--c-gray-100); }
.btn-sm { padding: 4px 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ===== 表格 ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--c-gray-100);
  font-weight: 600;
  color: var(--c-gray-700);
  border-bottom: 2px solid var(--c-gray-200);
  white-space: nowrap;
}
.table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--c-gray-200);
  vertical-align: top;
}
.table tr:hover { background: var(--c-gray-50); }
.table-wrap { overflow-x: auto; }

/* ===== 状态标签 ===== */
.status-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.status-registered { background: var(--c-gray-200); color: var(--c-gray-700); }
.status-feedback { background: var(--c-primary-light); color: var(--c-primary-dark); }
.status-rectifying { background: var(--c-warning-light); color: var(--c-warning); }
.status-reviewed { background: #ddd6fe; color: #5b21b6; }
.status-closed { background: var(--c-success-light); color: var(--c-success); }
.status-pending { background: var(--c-danger-light); color: var(--c-danger); }

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  text-align: center;
}
.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--c-primary);
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--c-gray-500);
  margin-top: 4px;
}
.stat-card.success .stat-value { color: var(--c-success); }
.stat-card.warning .stat-value { color: var(--c-warning); }
.stat-card.danger .stat-value { color: var(--c-danger); }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 200;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  overflow-y: auto;
}
.modal-overlay.show { display: flex; }
.modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 640px;
  box-shadow: 0 20px 25px rgba(0,0,0,0.15);
  margin-bottom: 40px;
}
.modal-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--c-gray-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--c-gray-500);
  padding: 4px 8px;
}
.modal-body { padding: 24px; max-height: 60vh; overflow-y: auto; }
.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--c-gray-200);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* ===== 提示消息 ===== */
.alert {
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-info { background: var(--c-primary-light); color: var(--c-primary-dark); }
.alert-success { background: var(--c-success-light); color: var(--c-success); }
.alert-warning { background: var(--c-warning-light); color: var(--c-warning); }
.alert-danger { background: var(--c-danger-light); color: var(--c-danger); }

/* ===== 首页英雄区 ===== */
.hero {
  background: linear-gradient(135deg, #1a56db 0%, #3730a3 100%);
  color: white;
  padding: 60px 24px;
  text-align: center;
  border-radius: 0 0 24px 24px;
}
.hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 12px; }
.hero p { font-size: 15px; opacity: 0.9; max-width: 600px; margin: 0 auto 24px; }
.hero .btn { font-size: 15px; padding: 12px 32px; }

/* ===== 功能卡片网格 ===== */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 24px;
}
.feature-card {
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.feature-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}
.feature-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 12px;
}
.feature-card h3 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
.feature-card p { font-size: 12px; color: var(--c-gray-500); }

/* ===== 台账打印样式 ===== */
.ledger {
  background: white;
  padding: 40px;
  max-width: 800px;
  margin: 0 auto;
}
.ledger-section {
  margin-bottom: 20px;
  border: 1px solid var(--c-gray-300);
  border-radius: var(--radius);
  overflow: hidden;
}
.ledger-section-title {
  background: var(--c-gray-100);
  padding: 8px 14px;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid var(--c-gray-300);
}
.ledger-section-body { padding: 14px; }
.ledger-row {
  display: flex;
  gap: 16px;
  margin-bottom: 8px;
  font-size: 13px;
}
.ledger-row .label { color: var(--c-gray-500); min-width: 80px; }
.ledger-row .value { flex: 1; }

@media print {
  .navbar, .no-print { display: none !important; }
  body { background: white; }
  .ledger { box-shadow: none; padding: 0; max-width: 100%; }
  .ledger-section { page-break-inside: avoid; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .navbar { padding: 0 12px; flex-wrap: wrap; height: auto; }
  .navbar-menu { flex-wrap: wrap; gap: 2px; }
  .navbar-menu a { padding: 6px 10px; font-size: 13px; }
  .container { padding: 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 22px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--c-gray-500); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.gap-8 { gap: 24px; }
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* ===== 页面头部 ===== */
.page-header { margin-bottom: 20px; }
.page-header h1 { font-size: 22px; font-weight: 600; color: var(--c-gray-900); }
.page-header .subtitle { font-size: 13px; color: var(--c-gray-500); margin-top: 4px; }

/* ===== 角色标签 ===== */
.role-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.role-tag.role-teacher { background: var(--c-gray-200); color: var(--c-gray-700); }
.role-tag.role-student { background: var(--c-primary-light); color: var(--c-primary-dark); }

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--c-gray-500);
  font-size: 14px;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 24px;
  font-size: 12px;
  color: var(--c-gray-500);
  border-top: 1px solid var(--c-gray-200);
  margin-top: 40px;
}

/* ===== 督导听课类型标签 ===== */
.suptype-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: var(--c-gray-100);
  color: var(--c-gray-700);
}

/* ===== 台账详情样式 ===== */
.ledger-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ledger-table th {
  text-align: right;
  padding: 6px 12px;
  color: var(--c-gray-500);
  font-weight: 500;
  white-space: nowrap;
  width: 100px;
  vertical-align: top;
}
.ledger-table td {
  padding: 6px 12px;
  border-bottom: 1px solid var(--c-gray-100);
}

/* ===== 文件项卡片 ===== */
.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--c-gray-100);
}
.file-item:last-child { border-bottom: none; }
.file-item:hover { background: var(--c-gray-50); }
