/**
 * P3-B 教案库 · 样式表
 * 前缀: tlp- (teaching-lesson-plans)
 */

/* ── 页面容器 ────────────────────────────────────────── */
.tlp-page { padding: 20px; font-family: inherit; color: #333; }

/* ── Header ──────────────────────────────────────────── */
.tlp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.tlp-header h2 { margin: 0; font-size: 20px; font-weight: 600; }
.tlp-actions { display: flex; gap: 8px; }

/* ── 工具栏 ──────────────────────────────────────────── */
.tlp-toolbar { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.tlp-input, .tlp-select {
  padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px;
  font-size: 14px; outline: none; transition: border-color 0.2s; background: #fff;
}
.tlp-input:focus, .tlp-select:focus { border-color: #F18D24; }
.tlp-input { flex: 1; min-width: 200px; }
.tlp-select { min-width: 120px; }
.tlp-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;
}
.tlp-textarea:focus { border-color: #F18D24; }

/* ── 按钮 ────────────────────────────────────────────── */
.tlp-btn {
  padding: 8px 16px; border: 1px solid #d9d9d9; border-radius: 6px;
  background: #fff; cursor: pointer; font-size: 14px; transition: all 0.2s;
}
.tlp-btn:hover { border-color: #F18D24; color: #F18D24; }
.tlp-btn-primary { background: #F18D24; border-color: #F18D24; color: #fff; }
.tlp-btn-primary:hover { background: #e07d1a; }
.tlp-btn-danger { background: #ff4d4f; border-color: #ff4d4f; color: #fff; }
.tlp-btn-danger:hover { background: #e04343; }
.tlp-btn-sm {
  padding: 4px 10px; border: 1px solid #d9d9d9; border-radius: 4px;
  background: #fff; cursor: pointer; font-size: 12px; transition: all 0.2s;
}
.tlp-btn-sm:hover { border-color: #F18D24; color: #F18D24; }
.tlp-btn-sm[disabled] { opacity: 0.5; cursor: not-allowed; }
.tlp-btn-outline { border-color: #d9d9d9; background: #fff; }
.tlp-btn-danger-text { color: #ff4d4f; border-color: transparent; }
.tlp-btn-danger-text:hover { color: #e04343; background: #fff1f0; }
.tlp-btn-close {
  background: none; border: none; font-size: 22px; cursor: pointer; color: #999; padding: 0 8px; line-height: 1;
}
.tlp-btn-close:hover { color: #333; }

/* ── 表格 ────────────────────────────────────────────── */
.tlp-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.tlp-table th { background: #fafafa; padding: 10px 12px; text-align: left; font-weight: 600; border-bottom: 1px solid #f0f0f0; white-space: nowrap; }
.tlp-table td { padding: 10px 12px; border-bottom: 1px solid #f5f5f5; vertical-align: middle; }
.tlp-table tr:hover { background: #fafafa; }
.tlp-cell-name { font-weight: 500; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlp-cell-meta { font-size: 12px; color: #999; }
.tlp-cell-actions { white-space: nowrap; display: flex; gap: 4px; }

/* ── 徽标 ────────────────────────────────────────────── */
.tlp-badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500;
}
.tlp-badge-success { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; }
.tlp-badge-warning { background: #fffbe6; color: #faad14; border: 1px solid #ffe58f; }
.tlp-badge-muted   { background: #f5f5f5; color: #999; border: 1px solid #e8e8e8; }

/* ── 状态提示 ────────────────────────────────────────── */
.tlp-loading, .tlp-empty {
  text-align: center; padding: 60px 20px; color: #999; font-size: 15px;
}

/* ── 分页 ────────────────────────────────────────────── */
.tlp-pagination { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 16px; font-size: 14px; color: #666; }

/* ── 隐藏 ────────────────────────────────────────────── */
.tlp-hidden { display: none !important; }

/* ── 弹窗 ────────────────────────────────────────────── */
.tlp-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex;
  align-items: center; justify-content: center; z-index: 9999;
}
.tlp-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);
}
.tlp-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid #f0f0f0; }
.tlp-modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.tlp-modal-content { padding: 20px; }
.tlp-modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid #f0f0f0; }

/* ── 表单 ────────────────────────────────────────────── */
.tlp-form-group { margin-bottom: 14px; }
.tlp-form-group label { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 500; color: #555; }
.tlp-form-row { display: flex; gap: 12px; }
.tlp-form-row .tlp-form-group { flex: 1; }
.tlp-required { color: #ff4d4f; }

/* ── 详情 ────────────────────────────────────────────── */
.tlp-detail { padding: 4px 0; }
.tlp-detail-fields { margin-bottom: 12px; }
.tlp-detail-row { display: flex; padding: 8px 0; border-bottom: 1px solid #f5f5f5; font-size: 14px; }
.tlp-detail-label { width: 80px; flex-shrink: 0; color: #999; }
.tlp-detail-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid #f0f0f0; }
.tlp-detail-section strong { font-size: 13px; color: #555; display: block; margin-bottom: 6px; }
.tlp-detail-pre {
  background: #f9f9f9; border: 1px solid #f0f0f0; border-radius: 6px;
  padding: 10px 14px; font-size: 13px; line-height: 1.7; white-space: pre-wrap;
  margin: 0; font-family: inherit;
}
.tlp-detail-text {
  font-size: 14px; color: #444; line-height: 1.7; padding: 4px 0;
}

/* ── 响应式 ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .tlp-toolbar { flex-direction: column; }
  .tlp-form-row { flex-direction: column; }
  .tlp-modal { width: 95vw; }
}
