/* ============================================================
   教学空间样式（teaching.php 筛选工作台 + teaching_view.php 大屏授课）
   命名前缀：tsp-（Teaching Space Page）
   页面主体样式复用 common.css（page-banner / filter-bar / course-grid）
   ============================================================ */

/* ---------- 顶部欢迎提示 ---------- */
.tsp-hint {
    background: var(--primary-bg, #eff6ff);
    border: 1px solid var(--primary-light, #93c5fd);
    color: #1e40af;
    border-radius: var(--radius-md, 10px);
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 22px;
}

/* ---------- 学段选择卡片 ---------- */
.tsp-stage-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 22px;
    margin-top: 6px;
}
.tsp-stage-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: var(--bg-primary, #ffffff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: var(--radius-lg, 16px);
    padding: 38px 24px 30px;
    text-align: center;
    text-decoration: none;
    transition: var(--transition, all .3s ease);
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));
}
.tsp-stage-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary-light, #93c5fd);
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgba(0,0,0,.1));
}
.tsp-stage-card-icon {
    font-size: 52px;
    line-height: 1;
    margin-bottom: 6px;
}
.tsp-stage-card-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary, #1f2937);
}
.tsp-stage-card-desc {
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}
.tsp-stage-card-count {
    font-size: 13px;
    color: var(--primary, #3b82f6);
    background: var(--primary-bg, #eff6ff);
    padding: 4px 14px;
    border-radius: 20px;
    margin-top: 8px;
}

/* ---------- 课程卡片内的资源徽标 ---------- */
.tsp-res-tag {
    display: inline-block;
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    white-space: nowrap;
}
.tsp-res-tag.tag-ok { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.tsp-res-tag.tag-no { background: #f1f5f9; color: #9ca3af; border-color: #e5e7eb; }

/* ---------- 课程卡片操作按钮 ---------- */
.tsp-course-card { display: flex; flex-direction: column; }
.tsp-course-card .course-card-meta { flex-wrap: wrap; gap: 6px; }
.tsp-card-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--border-light, #f3f4f6);
}
.tsp-btn-mini {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 0;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--transition, all .3s ease);
}
.tsp-btn-primary {
    color: #fff !important;
    background: var(--primary, #3b82f6);
}
.tsp-btn-primary:hover {
    background: var(--primary-dark, #2563eb);
}
.tsp-btn-outline {
    color: var(--primary, #3b82f6) !important;
    background: transparent;
    border: 1px solid var(--primary-light, #93c5fd);
}
.tsp-btn-outline:hover {
    background: var(--primary-bg, #eff6ff);
}
.tsp-btn-disabled {
    color: #b0b7c3 !important;
    background: #f1f5f9;
    border: 1px dashed #e5e7eb;
    cursor: not-allowed;
}

/* ============================================================
   大屏授课界面（teaching_view.php）
   ============================================================ */
html, body { margin: 0; padding: 0; }
.tspv-body {
    height: 100%;
    overflow: hidden;
    background: #0f172a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
.tspv-wrap { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

/* 顶部工具条 */
.tspv-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: #1e293b;
    border-bottom: 1px solid #334155;
    flex-shrink: 0;
    z-index: 20;
}
.tspv-topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.tspv-topbar-right { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.tspv-title {
    font-size: 16px;
    font-weight: 600;
    color: #f1f5f9;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40vw;
}
.tspv-badge {
    font-size: 12px;
    color: #93c5fd;
    background: #0f172a;
    border: 1px solid #334155;
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
}
.tspv-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #e2e8f0;
    background: #334155;
    border: 1px solid #475569;
    padding: 7px 14px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s ease;
}
.tspv-btn:hover { background: #475569; }
.tspv-btn-primary { background: #3b82f6; border-color: #3b82f6; color: #fff; }
.tspv-btn-primary:hover { background: #2563eb; }
.tspv-pageinfo { font-size: 13px; color: #cbd5e1; display: inline-flex; align-items: center; gap: 6px; }
.tspv-pageinput {
    width: 56px;
    padding: 6px 8px;
    font-size: 13px;
    color: #f1f5f9;
    background: #0f172a;
    border: 1px solid #475569;
    border-radius: 6px;
    text-align: center;
}
.tspv-pageinput:focus { outline: none; border-color: #3b82f6; }

/* 舞台 */
.tspv-stage {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}
.tspv-stage:active { cursor: grabbing; }
.tspv-frame {
    position: relative;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    overflow: hidden;
    line-height: 0;
}
.tspv-canvas { display: block; user-select: none; -webkit-user-drag: none; transition: opacity 0.25s ease; }
.tspv-frame.rendering .tspv-canvas { opacity: 0.55; }

/* 加载指示 */
.tspv-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    font-size: 14px;
    color: #64748b;
    line-height: 1.5;
    transition: opacity 0.3s ease;
    z-index: 5;
}
.tspv-loading.busy { opacity: 0.35; pointer-events: none; background: rgba(255,255,255,0.6); }
.tspv-spinner {
    width: 36px; height: 36px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: tspv-spin 0.8s linear infinite;
}
@keyframes tspv-spin { to { transform: rotate(360deg); } }

/* 翻页热区 */
.tspv-hotspot {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 15%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: rgba(255,255,255,0.55);
    cursor: pointer;
    user-select: none;
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 10;
    text-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.tspv-stage:hover .tspv-hotspot { opacity: 1; }
.tspv-hotspot:hover { background: linear-gradient(to right, rgba(0,0,0,0.12), transparent); }
.tspv-hotspot-right:hover { background: linear-gradient(to left, rgba(0,0,0,0.12), transparent); }
.tspv-hotspot-left { left: 0; }
.tspv-hotspot-right { right: 0; }

/* 操作提示 */
.tspv-hint {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 13px;
    color: #e2e8f0;
    background: rgba(15,23,42,0.78);
    border: 1px solid #334155;
    padding: 8px 18px;
    border-radius: 24px;
    white-space: nowrap;
    z-index: 15;
    transition: opacity 0.8s ease;
    pointer-events: none;
}
.tspv-hint.fade { opacity: 0; }

/* 错误提示 */
.tspv-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    background: #0f172a;
    color: #f87171;
    font-size: 16px;
    z-index: 30;
}

/* 底部进度条 */
.tspv-progress { height: 4px; background: #1e293b; flex-shrink: 0; }
.tspv-progress-bar {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #3b82f6, #8b5cf6);
    transition: width 0.3s ease;
}

/* 移动端授课 */
@media (max-width: 768px) {
    .tspv-topbar { flex-wrap: wrap; padding: 8px 10px; }
    .tspv-title { max-width: 60vw; font-size: 14px; }
    .tspv-btn { padding: 6px 10px; font-size: 12px; }
    .tspv-pageinfo { font-size: 12px; }
    .tspv-hint { font-size: 11px; padding: 6px 12px; bottom: 10px; }
}
