/**
 * B 教研深层 T03: 课件管理 · 样式表
 * 前缀: cw- (coursewares)
 * 与 research-plans.css 风格一致
 */

/* ── 页面容器 ────────────────────────────────────────── */
.cw-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  font-family: inherit;
  color: #333;
}

/* ── 页面标题 ────────────────────────────────────────── */
.cw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.cw-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

/* ── 工具栏 ──────────────────────────────────────────── */
.cw-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: #f8f9fa;
  border-radius: 8px;
  flex-wrap: wrap;
}
.cw-toolbar-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.cw-toolbar-right {
  display: flex;
  gap: 8px;
}

/* ── 搜索/下拉 ──────────────────────────────────────── */
.cw-search {
  width: 220px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}
.cw-search:focus {
  border-color: #F18D24;
}
.cw-select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  min-width: 120px;
  font-size: 14px;
  outline: none;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}
.cw-select:focus {
  border-color: #F18D24;
}

/* ── 按钮 ────────────────────────────────────────────── */
.cw-btn {
  padding: 8px 16px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.cw-btn:hover {
  border-color: #F18D24;
  color: #F18D24;
}
.cw-btn-primary {
  background: #F18D24;
  border-color: #F18D24;
  color: #fff;
}
.cw-btn-primary:hover {
  background: #e07d1a;
}
.cw-btn-sm {
  padding: 4px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s;
}
.cw-btn-sm:hover {
  border-color: #F18D24;
  color: #F18D24;
}
.cw-btn-sm[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}
.cw-btn-sm.cw-btn-danger {
  color: #e74c3c;
  border-color: #e74c3c;
  background: #fff;
}
.cw-btn-sm.cw-btn-danger:hover {
  background: #fff1f0;
  color: #e04343;
}
.cw-btn-sm.cw-btn-success {
  color: #27ae60;
  border-color: #27ae60;
  background: #fff;
}
.cw-btn-sm.cw-btn-success:hover {
  background: #f0fff4;
  color: #219a52;
}
.cw-btn-sm.cw-btn-info {
  color: #3498db;
  border-color: #3498db;
  background: #fff;
}
.cw-btn-sm.cw-btn-info:hover {
  background: #ebf5fb;
  color: #2980b9;
}

/* ── 表格 ────────────────────────────────────────────── */
.cw-table-wrapper {
  overflow-x: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.cw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.cw-table th {
  background: #f1f3f5;
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #dee2e6;
  white-space: nowrap;
}
.cw-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}
.cw-table tbody tr:hover {
  background: #f8f9fa;
  cursor: pointer;
}
.cw-table .cw-cell-title {
  font-weight: 500;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cw-table .cw-cell-actions {
  white-space: nowrap;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ── 状态徽标 ────────────────────────────────────────── */
.cw-status-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.cw-status-draft {
  background: #e9ecef;
  color: #6c757d;
}
.cw-status-reviewed {
  background: #d4edda;
  color: #155724;
}
.cw-status-published {
  background: #cce5ff;
  color: #004085;
}

/* ── 文件类型徽标 ────────────────────────────────────── */
.cw-type-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  background: #f0f0f0;
  color: #666;
}

/* ── 弹窗 ────────────────────────────────────────────── */
.cw-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}
.cw-modal {
  background: #fff;
  border-radius: 12px;
  width: 720px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
.cw-modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
  border-radius: 12px 12px 0 0;
}
.cw-modal-header h3 {
  margin: 0;
  font-size: 18px;
}
.cw-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #999;
  padding: 0 4px;
  line-height: 1;
}
.cw-modal-close:hover {
  color: #333;
}
.cw-modal-body {
  padding: 24px;
}
.cw-modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: #fff;
}

/* ── 表单 ────────────────────────────────────────────── */
.cw-form-group {
  margin-bottom: 16px;
}
.cw-form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 13px;
  color: #495057;
}
.cw-form-group input,
.cw-form-group select,
.cw-form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  box-sizing: border-box;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.cw-form-group input:focus,
.cw-form-group select:focus,
.cw-form-group textarea:focus {
  border-color: #F18D24;
}
.cw-form-group textarea {
  min-height: 80px;
  resize: vertical;
}
.cw-form-row {
  display: flex;
  gap: 12px;
}
.cw-form-row .cw-form-group {
  flex: 1;
}
.cw-required {
  color: #ff4d4f;
}

/* ── 空状态 / 加载 ───────────────────────────────────── */
.cw-empty {
  text-align: center;
  padding: 60px 20px;
  color: #adb5bd;
  font-size: 15px;
}
.cw-loading {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 15px;
}

/* ── 分页 ────────────────────────────────────────────── */
.cw-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}
.cw-page-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}
.cw-page-btn:hover:not([disabled]) {
  border-color: #F18D24;
  color: #F18D24;
}
.cw-page-btn.active {
  background: #F18D24;
  color: #fff;
  border-color: #F18D24;
}
.cw-page-info {
  color: #6c757d;
  font-size: 13px;
}

/* ── 隐藏 ────────────────────────────────────────────── */
.cw-hidden {
  display: none !important;
}

/* ── 响应式 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .cw-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .cw-toolbar-left {
    flex-direction: column;
  }
  .cw-toolbar-right {
    flex-direction: column;
  }
  .cw-search {
    width: 100%;
  }
  .cw-modal {
    width: 95vw;
  }
}
