/* ============================================
   高中物理教学AI仿真平台 — 样式表
   
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --danger: #dc2626;
  --success: #16a34a;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --radius: 10px;
  --radius-sm: 6px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* --- Header --- */
.header {
  background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #1e40af 100%);
  color: #fff;
  padding: 18px 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px 0 60px; display: flex; justify-content: space-between; align-items: center; gap: 40px; }

.header-left { text-align: center; flex: 1; }

.site-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.site-subtitle {
  font-size: 1.1rem;
  opacity: 0.9;
  margin-top: 6px;
}

.notice-bar { background: rgba(255,255,255,0.25); backdrop-filter: blur(8px); border-radius: 14px; padding: 24px 36px; border: 1px solid rgba(255,255,255,0.35); font-size: 1.5rem; line-height: 1.7; min-width: 460px; max-width: 680px; display: flex; flex-direction: column; justify-content: flex-start; }

/* --- Notice Bar --- */
.header-right { flex-shrink: 0; }


.notice-title-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.notice-body {
  font-size: 1rem;
  opacity: 0.95;
  overflow: hidden;
  white-space: nowrap;
}
.notice-body marquee {
  display: block;
  padding: 4px 0;
}

.icon-btn {
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.icon-btn:hover { background: rgba(255,255,255,0.35); }

/* --- Header Buttons --- */
.header-btns {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}
.header-btns .btn-upload { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
.header-btns .btn-upload:hover { background: rgba(255,255,255,0.35); }
.header-btns .btn-approve { background: rgba(255,255,255,0.2); color: #fff; border: 1px solid rgba(255,255,255,0.3); position: relative; }
.header-btns .btn-approve:hover { background: rgba(255,255,255,0.35); }

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-action:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }

.btn-upload {
  background: var(--primary);
  color: #fff;
}

.btn-approve {
  background: #fff;
  color: var(--primary);
  border: 2px solid var(--primary);
  position: relative;
}

.badge {
  background: var(--danger);
  color: #fff;
  font-size: 0.7rem;
  padding: 1px 7px;
  border-radius: 10px;
  position: absolute;
  top: -8px;
  right: -8px;
}

/* --- Nav Bar --- */
.nav-bar {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.nav-btn {
  padding: 8px 16px;
  border: 2px solid var(--border);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn:hover { border-color: var(--primary-light); color: var(--primary); }

.nav-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* --- Search Bar --- */
.search-bar {
  max-width: 1200px;
  margin: 12px auto 0;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.search-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  width: 300px;
  max-width: 400px;
  padding: 8px 14px;
  border: 2px solid var(--border);
  border-radius: 20px;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.search-input:focus { border-color: var(--primary-light); }

.search-clear {
  cursor: pointer;
  color: var(--text-light);
  font-size: 1.1rem;
  padding: 4px 8px;
}

.search-clear:hover { color: var(--danger); }

/* --- Main Content --- */
.main-content {
  max-width: 1200px;
  margin: 6px auto 0;
  padding: 0 20px 40px;
}

.category-header {
  text-align: left;
  margin-bottom: 0;
}
.category-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 6px;
}

.category-title { font-size: 1.5rem; font-weight: 700; }

.program-count {
  color: var(--text-light);
  font-size: 0.85rem;
}

/* --- Card Grid --- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.program-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.program-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-thumb {
  width: 100%;
  height: 200px;
  position: relative;
  overflow: hidden;
  background: #f0f0f0;
}

.card-thumb iframe {
  width: 400px;
  height: 350px;
  border: none;
  transform: scale(0.66);
  transform-origin: 0 0;
  pointer-events: none;
}
.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }

.card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-meta {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 8px;
}

.card-meta span { margin-right: 10px; }

.card-actions {
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.card-btn {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.15s;
}

.card-btn:hover { background: var(--bg); }

.card-btn.download { color: var(--primary); border-color: var(--primary-light); }
.card-btn.download:hover { background: #eff6ff; }

.card-btn.comment { color: #0891b2; }
.card-btn.rename { color: #7c3aed; border-color: #c4b5fd; }
.card-btn.rename:hover { background: #f5f3ff; }
.card-btn.move { color: #f59e0b; }
.card-btn.delete { color: var(--danger); }
.card-btn.delete:hover { background: #fef2f2; }

.card-question {
  margin-top: 4px;
  font-size: 0.7rem;
  color: #0891b2;
}

/* --- Empty State --- */
.empty-state {
  text-align: right;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-icon { font-size: 4rem; margin-bottom: 12px; }

.empty-state h3 { font-size: 1.2rem; margin-bottom: 6px; color: var(--text); }

/* --- Footer --- */
.footer {
  text-align: center;
  padding: 20px;
  font-size: 0.8rem;
  color: var(--text-light);
  border-top: 1px solid var(--border);
  background: #fff;
}

.footer-stats { margin-top: 4px; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-panel {
  background: #fff;
  border-radius: var(--radius);
  width: 520px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-panel-sm { width: 400px; }

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.modal-header h2 { font-size: 1.1rem; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light);
  padding: 0 4px;
  line-height: 1;
}

.modal-close:hover { color: var(--text); }

.modal-body { padding: 20px; }

/* --- Form --- */
.form-label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; margin-top: 14px; }
.form-label:first-child, .form-label:first-of-type { margin-top: 0; }
.required { color: var(--danger); }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary-light);
}

.form-textarea { resize: vertical; }

.file-drop {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 20px;
  text-align: right;
  color: var(--text-light);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-size: 0.85rem;
}

.file-drop:hover, .file-drop.dragover {
  border-color: var(--primary-light);
  background: #eff6ff;
}

.file-name { display: block; font-size: 0.8rem; color: var(--success); margin-top: 4px; }

/* --- Buttons --- */
.btn-submit {
  width: 100%;
  margin-top: 16px;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-submit:hover { background: #1e3a8a; }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-row { display: flex; gap: 8px; margin-top: 16px; }

.upload-group { border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-top: 8px; background: #f8fafc; }
.upload-group .file-drop { padding: 12px; }
.btn-add-question { margin-top: 10px; padding: 8px 16px; border: 1px dashed #2563eb; color: #2563eb; background: #eff6ff; border-radius: 6px; cursor: pointer; font-size: 0.9rem; width: 100%; }
.btn-add-question:hover { background: #dbeafe; }
.btn-remove-group { background: none; border: 1px solid #ef4444; color: #ef4444; border-radius: 4px; cursor: pointer; padding: 4px 12px; font-size: 0.8rem; }

.btn-cancel {
  width: 300px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  font-size: 0.75rem;
}

.btn-cancel:hover { background: var(--bg); }

.btn-danger {
  width: 300px;
  padding: 8px;
  background: var(--danger);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
}

.btn-danger:hover { background: #b91c1c; }
.btn-danger:disabled { opacity: 0.6; cursor: not-allowed; }

.delete-warning { margin-bottom: 4px; }
.delete-hint { font-size: 0.8rem; color: var(--text-light); margin-bottom: 12px; }

/* --- Status Messages --- */
.status-msg {
  margin-top: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.status-msg.success { background: #dcfce7; color: #166534; }
.status-msg.error { background: #fef2f2; color: #991b1b; }

/* --- Pending List --- */
.pending-list { margin-top: 12px; }

.pending-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  gap: 8px;
}

.pending-info { flex: 1; min-width: 0; }
.pending-info strong { font-size: 0.9rem; }
.pending-meta { font-size: 0.75rem; color: var(--text-light); margin-top: 2px; }

.pending-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn-sm {
  padding: 4px 12px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-pass { background: #dcfce7; color: #166534; }
.btn-pass:hover { background: #bbf7d0; }

.btn-reject { background: #fef2f2; color: #991b1b; }
.btn-reject:hover { background: #fecaca; }

.btn-rename-pending { background: #f3e8ff; color: #7c3aed; }
.btn-rename-pending:hover { background: #e9d5ff; }

.approve-count { font-size: 0.9rem; margin-bottom: 8px; }
.approve-empty { text-align: center; padding: 20px; color: var(--text-light); }

/* --- Comments --- */

  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}




/* --- Responsive --- */
@media (max-width: 768px) {
  .header-inner { flex-direction: column; gap: 12px; }
  .header-right { max-width: 100%; min-width: auto; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .nav-btn { padding: 6px 12px; font-size: 0.8rem; }
  .modal-panel { width: 95vw; }
}

@media (max-width: 480px) {
  .site-title { font-size: 1.2rem; }
  .action-bar { flex-direction: column; }
  .btn-action { justify-content: center; }
  .card-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
}

.footer-beian { margin-top: 6px; font-size: 0.75rem; }
.footer-beian a { color: var(--text-light); text-decoration: none; }
.footer-beian a:hover { text-decoration: underline; }
.footer-gongan img { flex-shrink: 0; }
