/* 真实场景课程资源中心 */
:root {
  --zs-primary: #5b21b6;
  --zs-primary-dark: #4c1d95;
  --zs-bg: #f5f3ff;
  --zs-surface: #fff;
  --zs-text: #1e293b;
  --zs-muted: #64748b;
  --zs-border: #e9d5ff;
  --zs-radius: 14px;
}

.zs-body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--zs-bg);
  color: var(--zs-text);
  min-height: 100vh;
  margin: 0;
}

.zs-header {
  background: #fff;
  border-bottom: 1px solid var(--zs-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.zs-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.zs-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--zs-primary-dark);
  font-weight: 800;
}

.zs-logo img {
  height: 36px;
}

.zs-nav {
  display: flex;
  gap: 1rem;
  flex: 1;
}

.zs-nav a {
  color: var(--zs-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}

.zs-nav a:hover {
  color: var(--zs-primary);
}

.zs-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

.zs-hero {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1.5rem 1rem;
}

.zs-hero h1 {
  font-size: clamp(1.4rem, 3vw, 1.85rem);
  color: var(--zs-primary-dark);
  margin: 0 0 0.65rem;
}

.zs-hero p {
  margin: 0 auto;
  max-width: 36em;
  color: var(--zs-muted);
  line-height: 1.7;
}

.zs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.zs-card {
  background: var(--zs-surface);
  border-radius: var(--zs-radius);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--zs-border);
  box-shadow: 0 8px 24px rgba(91, 33, 182, 0.08);
  transition: transform 0.15s, box-shadow 0.15s;
}

.zs-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(91, 33, 182, 0.14);
}

.zs-card-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(180deg, #f8fafc 0%, #ede9fe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.zs-card img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.zs-card-body {
  padding: 1rem 1.1rem 1.15rem;
}

.zs-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: #ede9fe;
  color: var(--zs-primary);
  margin-bottom: 0.4rem;
}

.zs-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.zs-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--zs-muted);
}

.zs-meta {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: #94a3b8;
}

.zs-panel {
  background: var(--zs-surface);
  border-radius: var(--zs-radius);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  border: 1px solid var(--zs-border);
}

.zs-panel h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--zs-primary-dark);
}

.zs-back a {
  color: var(--zs-primary);
  font-weight: 600;
  text-decoration: none;
}

.zs-course-head {
  display: grid;
  grid-template-columns: minmax(240px, 320px) 1fr;
  gap: 1.25rem;
  margin-bottom: 1rem;
  background: var(--zs-surface);
  border-radius: var(--zs-radius);
  padding: 1rem;
  border: 1px solid var(--zs-border);
}

.zs-course-head .zs-card-cover {
  border-radius: 10px;
}

.zs-course-head img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: 10px;
}

.zs-course-head h1 {
  margin: 0.35rem 0;
  font-size: 1.35rem;
}

.zs-resources {
  display: grid;
  gap: 1rem;
}

.zs-resource-item {
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  overflow: hidden;
  background: #faf5ff;
}

.zs-resource-head {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
}

.zs-resource-meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.zs-resource-meta strong {
  font-size: 0.95rem;
}

.zs-resource-fname {
  font-size: 0.8rem;
  word-break: break-all;
}

.zs-resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.2rem;
}

.zs-resource-preview {
  border-top: 1px solid #ede9fe;
  background: #fff;
  padding: 0.65rem;
}

.zs-resource-player {
  display: block;
  width: 100%;
  max-height: min(420px, 55vh);
  border-radius: 8px;
  background: #0f172a;
}

.zs-resource-frame {
  display: block;
  width: 100%;
  height: min(520px, 68vh);
  border: none;
  border-radius: 8px;
  background: #f8fafc;
}

.zs-resource-text {
  max-height: min(360px, 50vh);
  overflow: auto;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  padding: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.zs-resource-office-note {
  padding: 0.65rem 0.75rem;
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.5;
}

.zs-resource-office-note p {
  margin: 0 0 0.5rem;
}

.zs-resource-preview-gate {
  text-align: center;
  padding: 1.25rem 1rem;
}

.zs-resource-preview-gate p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #64748b;
}

.zs-resource {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.75rem;
  background: #faf5ff;
  border-radius: 10px;
}

.zs-resource-icon {
  font-size: 1.35rem;
}

.zs-resource-link {
  display: inline-block;
  margin-top: 0.25rem;
  color: var(--zs-primary);
  font-weight: 600;
  font-size: 0.88rem;
}

.zs-resource-missing {
  font-size: 0.85rem;
  color: #94a3b8;
}

.zs-resource-hint {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
  color: #5b21b6;
  background: #f5f3ff;
  border-radius: 8px;
  border: 1px solid #ede9fe;
}

.zs-resource-gate {
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-align: left;
}

.zs-resource-gate:hover {
  text-decoration: underline;
}

.zs-login-gate {
  margin-bottom: 1rem;
  padding: 1rem;
  background: linear-gradient(135deg, #f5f3ff 0%, #ecfeff 100%);
  border: 1px dashed #c4b5fd;
  border-radius: 12px;
  text-align: center;
}

.zs-login-gate p {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  color: #475569;
}

.zs-form label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.zs-form input,
.zs-form select,
.zs-form textarea {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font: inherit;
  box-sizing: border-box;
}

.zs-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.zs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.15rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
}

.zs-btn-primary {
  background: linear-gradient(135deg, #7c3aed, #5b21b6);
  color: #fff;
}

.zs-btn-outline {
  background: #fff;
  border-color: var(--zs-border);
  color: var(--zs-primary);
}

.zs-btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.zs-btn-block {
  width: 100%;
}

.zs-muted {
  color: var(--zs-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.zs-q {
  border-top: 1px solid #f1f5f9;
  padding-top: 1rem;
  margin-top: 1rem;
}

.zs-q h4 {
  margin: 0 0 0.35rem;
}

.zs-replies {
  margin: 0.65rem 0;
  padding-left: 0.75rem;
  border-left: 3px solid #c4b5fd;
}

.zs-reply {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.zs-reply-details summary {
  cursor: pointer;
  color: var(--zs-primary);
  font-weight: 600;
  font-size: 0.85rem;
}

.zs-empty {
  text-align: center;
  padding: 2rem;
  color: var(--zs-muted);
}

.zs-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: #94a3b8;
}

.zs-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: #5b21b6;
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: 999px;
  z-index: 100;
  font-size: 0.9rem;
}

/* 管理后台 · 嵌入统一后台时隐藏本地侧栏（用户/退出与父级左下角同步） */
.zs-admin-embed .zs-header {
  display: none;
}

.zs-admin-embed .zs-sidebar,
.zs-admin-embed #zs-admin-nav {
  display: none !important;
}

.zs-admin-embed .zs-admin-layout {
  display: block;
  max-width: none;
  min-height: 100vh;
  grid-template-columns: none;
}

.zs-admin-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 56px);
}

.zs-sidebar {
  background: #fff;
  border-right: 1px solid #e2e8f0;
  padding: 1rem 0.75rem;
}

.zs-sidebar a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  color: var(--zs-muted);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.zs-sidebar a.active,
.zs-sidebar a:hover {
  background: #f5f3ff;
  color: var(--zs-primary);
}

#zs-admin-app {
  padding: 1.25rem 1.5rem 2rem;
}

.zs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.zs-table th,
.zs-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
}

.zs-api-badge {
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
  background: #ecfdf5;
  color: #047857;
  border-radius: 8px;
  margin-bottom: 1rem;
}

.zs-api-badge--warn {
  background: #fffbeb;
  color: #b45309;
}

.zs-api-badge code {
  font-size: 0.8em;
}

.zs-cover-block {
  margin-bottom: 1.25rem;
  padding: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fafafa;
}

.zs-cover-block h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.zs-cover-preview {
  margin-bottom: 0.75rem;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, #f8fafc 0%, #ede9fe 100%);
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 480px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zs-cover-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.zs-cover-preview--empty {
  color: #64748b;
  font-size: 0.88rem;
  padding: 2rem 1rem;
  text-align: center;
}

.zs-cover-choose {
  display: inline-block;
  position: relative;
  margin-top: 0.35rem;
  cursor: pointer;
}

.zs-cover-file-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.zs-file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0 1rem;
}

.zs-file-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 0.88rem;
}

.zs-file-choose {
  display: inline-block;
  position: relative;
  margin-top: 0.4rem;
  cursor: pointer;
}

.zs-file-input-hidden,
.zs-cover-file-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.zs-file-hint {
  display: block;
  font-size: 0.78rem;
  color: #64748b;
}

.zs-file-hint--empty {
  color: #94a3b8;
  font-style: italic;
}

.zs-resource-missing {
  color: #94a3b8;
  font-size: 0.88rem;
}

.zs-cat-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.5rem;
}

.zs-cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--zs-surface);
  border: 1px solid #e2e8f0;
  color: var(--zs-text);
  font-size: 0.88rem;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.zs-cat-pill:hover {
  border-color: var(--zs-primary);
  color: var(--zs-primary);
}

.zs-cat-pill--active {
  background: var(--zs-primary);
  border-color: var(--zs-primary);
  color: #fff;
}

.zs-cat-count {
  font-size: 0.78rem;
  opacity: 0.85;
}

.zs-cat-section {
  margin-bottom: 2.5rem;
}

.zs-cat-section h2 {
  font-size: 1.25rem;
  margin: 0 0 0.35rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.zs-cat-section h2 a {
  color: inherit;
  text-decoration: none;
}

.zs-cat-section h2 a:hover {
  color: var(--zs-primary);
}

.zs-cat-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #ede9fe;
  color: var(--zs-primary-dark);
}

.zs-subj-band {
  margin-bottom: 1.75rem;
}

.zs-subj-band:last-child {
  margin-bottom: 0;
}

.zs-subj-band-title {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--zs-primary);
  padding-left: 0.65rem;
  border-left: 4px solid var(--zs-primary);
}

.zs-cat-desc {
  font-size: 0.9rem;
  color: #64748b;
  margin: 0 0 1rem;
}

.zs-scenario-intro {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.zs-scenario-block {
  padding: 1rem 1.1rem;
  border-radius: 10px;
  border-left: 4px solid #cbd5e1;
}

.zs-scenario-block h3 {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #475569;
}

.zs-scenario-block p {
  margin: 0;
  line-height: 1.65;
}

.zs-scenario-pain {
  background: #fff7ed;
  border-left-color: #f97316;
}

.zs-scenario-solution {
  background: #f0fdf4;
  border-left-color: #22c55e;
}

.zs-lab-panel {
  border: 2px solid #bfdbfe;
  background: linear-gradient(180deg, #f8fbff 0%, #fff 120px);
}

.zs-lab-lead {
  margin: 0 0 1rem;
  color: #475569;
  line-height: 1.65;
  font-size: 0.95rem;
}

.zs-lab-grade-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.25rem;
  padding: 0.4rem;
  background: #eef2ff;
  border-radius: 12px;
}

.zs-lab-grade-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  font-size: 0.88rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.zs-lab-grade-btn:hover {
  background: #fff;
  color: var(--zs-primary);
}

.zs-lab-grade-btn.is-active {
  background: #fff;
  border-color: #93c5fd;
  color: var(--zs-primary);
  box-shadow: 0 1px 3px rgba(59, 130, 246, 0.15);
}

.zs-lab-grade-count {
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #e2e8f0;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
}

.zs-lab-grade-btn.is-active .zs-lab-grade-count {
  background: #dbeafe;
  color: #2563eb;
}

.zs-lab-grade-empty {
  margin: 0 0 1rem;
  padding: 1.5rem 1rem;
  text-align: center;
  color: #64748b;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  font-size: 0.92rem;
}

.zs-lab-unit.is-hidden,
.zs-lab-embed-wrap.is-hidden,
.zs-lab-grade-empty.is-hidden {
  display: none !important;
}

.zs-lab-units {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.zs-lab-unit {
  padding: 1rem 1.1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
}

.zs-lab-unit-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.zs-lab-unit-head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--zs-primary);
}

.zs-lab-tag {
  font-size: 0.78rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

.zs-lab-unit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
  .zs-lab-unit-grid {
    grid-template-columns: 1fr;
  }
}

.zs-lab-aspect {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.zs-lab-aspect strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.zs-lab-aspect p {
  margin: 0;
  line-height: 1.55;
  color: #334155;
}

.zs-lab-ai {
  background: #eff6ff;
}

.zs-lab-exp {
  background: #f0fdf4;
}

.zs-lab-block {
  background: #faf5ff;
}

.zs-lab-jump {
  font-size: 0.85rem;
}

.zs-lab-embed-wrap {
  margin-top: 0.5rem;
}

.zs-lab-embed-label {
  margin: 0 0 0.5rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #334155;
}

.zs-lab-embed {
  width: 100%;
  min-height: 720px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
}

.zs-lab-embed-foot {
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.zs-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.zs-toolbar h2 {
  margin: 0;
}

.zs-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.zs-search {
  min-width: 12rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}

.zs-table-actions {
  white-space: nowrap;
}

.zs-empty-cell {
  text-align: center;
  color: #64748b;
  padding: 1.5rem !important;
}

.zs-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow: auto;
}

.zs-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.zs-modal-panel {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100vh - 3rem);
  overflow: auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.22);
  margin: auto;
}

.zs-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
}

.zs-modal-head h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #0f172a;
}

.zs-modal-close {
  border: none;
  background: #f1f5f9;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  color: #475569;
}

.zs-modal-close:hover {
  background: #e2e8f0;
}

.zs-modal-body {
  padding: 1rem 1.25rem 1.25rem;
}

.zs-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.zs-view-files {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 0.9rem;
}

.zs-view-files p {
  margin: 0.35rem 0;
}

@media (max-width: 768px) {
  .zs-course-head {
    grid-template-columns: 1fr;
  }
  .zs-form-row {
    grid-template-columns: 1fr;
  }
  .zs-admin-layout {
    grid-template-columns: 1fr;
  }
  .zs-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .zs-search {
    min-width: 0;
    width: 100%;
  }
}
