/* =============================================================================
   文件路径: public/static/css/common.css
   说明: 门户 / 教师工作台 / 管理后台 公共样式（现代教育风，响应式）
   ============================================================================= */

:root {
    --edu-primary: #1d6ff2;
    --edu-accent: #38bdf8;
    --edu-bg: #f5f8ff;
    --edu-bg2: #e8f1ff;
    --edu-text: #0f172a;
    --edu-muted: #64748b;
    --edu-radius: 16px;
    --edu-shadow: 0 10px 30px rgba(15, 23, 42, .08);
    --edu-shadow-sm: 0 4px 14px rgba(15, 23, 42, .06);
    --edu-border: #e6ecf5;
    --edu-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--edu-font);
    color: var(--edu-text);
    background: #f7f9fc;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: var(--edu-primary); }
a:hover { opacity: .85; }

.text-muted-2 { color: var(--edu-muted) !important; }

/* ---------------- 顶部导航（门户） ---------------- */
.edu-nav {
    position: sticky; top: 0; z-index: 1030;
    background: rgba(255, 255, 255, .86);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--edu-border);
}
.edu-nav .navbar-brand {
    font-weight: 800; font-size: 1.15rem; letter-spacing: .3px;
    color: var(--edu-text);
    display: inline-flex; align-items: center; gap: 9px;
}
/* 站点标识：蓝色课堂徽标（内联 SVG） */
.brand-logo { display: block; flex: 0 0 auto; border-radius: 9px; }
.edu-nav .navbar-brand .brand-logo { box-shadow: 0 4px 12px rgba(47, 128, 237, .28); }
.edu-nav .nav-link { color: #46536b; font-weight: 500; }
.edu-nav .nav-link.active, .edu-nav .nav-link:hover { color: var(--edu-primary); }

/* ---------------- 按钮 ---------------- */
.btn-edu {
    background: linear-gradient(135deg, var(--edu-primary), var(--edu-accent));
    border: none; color: #fff; font-weight: 600;
    border-radius: 12px; padding: .55rem 1.25rem;
    transition: transform .18s ease, box-shadow .18s ease;
}
.btn-edu:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(29, 111, 242, .28); }
.btn-edu:active { transform: translateY(0) scale(.985); }
.btn-edu-outline {
    border: 1px solid var(--edu-primary); color: var(--edu-primary);
    border-radius: 12px; font-weight: 600; background: transparent;
}
.btn-edu-outline:hover { background: rgba(29, 111, 242, .07); color: var(--edu-primary); }
.btn-edu:disabled, .btn-edu-outline:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------------- 卡片 ---------------- */
.edu-card {
    background: #fff; border: 1px solid var(--edu-border);
    border-radius: var(--edu-radius); box-shadow: var(--edu-shadow-sm);
}
.edu-card-hover { transition: transform .2s ease, box-shadow .2s ease; }
.edu-card-hover:hover { transform: translateY(-4px); box-shadow: var(--edu-shadow); }

/* ---------------- 页头 ---------------- */
.edu-hero {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #eef5ff 0%, #f6fbff 45%, #eafaf3 100%);
    padding: 88px 0 72px;
}
.edu-hero::after {
    content: ""; position: absolute; right: -120px; top: -120px;
    width: 420px; height: 420px; border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(56, 189, 248, .35), rgba(29, 111, 242, 0));
}
.edu-hero h1 { font-weight: 850; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.25; }
.edu-hero p.lead { color: #4a5a72; font-size: 1.06rem; }

.edu-badge {
    display: inline-flex; align-items: center; gap: .4rem;
    background: #fff; border: 1px solid var(--edu-border);
    color: var(--edu-primary); font-weight: 600; font-size: .85rem;
    padding: .35rem .8rem; border-radius: 999px; box-shadow: var(--edu-shadow-sm);
}

.edu-section { padding: 72px 0; }
.edu-section-title { font-weight: 800; font-size: 1.85rem; margin-bottom: .5rem; }
.edu-section-sub { color: var(--edu-muted); margin-bottom: 2.25rem; }

/* 功能亮点 */
.edu-feature-icon {
    width: 52px; height: 52px; border-radius: 14px; display: flex;
    align-items: center; justify-content: center; font-size: 1.5rem;
    color: #fff; background: linear-gradient(135deg, var(--edu-primary), var(--edu-accent));
    margin-bottom: 1rem;
}

/* 价格卡 */
.edu-price-card {
    background: #fff; border: 1px solid var(--edu-border); border-radius: 20px;
    padding: 28px 24px; height: 100%; position: relative;
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s;
}
.edu-price-card:hover { transform: translateY(-6px); box-shadow: var(--edu-shadow); border-color: #cfe0ff; }
.edu-price-card.featured { border: 2px solid var(--edu-primary); box-shadow: 0 14px 40px rgba(29, 111, 242, .16); }
.edu-price-card .price { font-size: 2.4rem; font-weight: 850; color: var(--edu-primary); line-height: 1; }
.edu-price-card .price small { font-size: .95rem; font-weight: 600; color: var(--edu-muted); }
.edu-price-card .tag-featured {
    position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(135deg, var(--edu-primary), var(--edu-accent));
    color: #fff; font-size: .75rem; font-weight: 700; padding: .25rem .8rem; border-radius: 999px;
}

/* 页脚 */
.edu-footer { background: #0f1a2b; color: #9fb0c7; padding: 44px 0 26px; font-size: .9rem; }
.edu-footer a { color: #c9d6e8; }
.edu-footer .icp { color: #7e8fa6; }

/* ---------------- 工作台布局 ---------------- */
.edu-console { display: flex; min-height: 100vh; background: #f4f7fb; }
.edu-sidebar {
    width: 232px; flex: 0 0 232px; background: #0f1a2b; color: #b9c7db;
    padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.edu-sidebar .side-brand {
    font-weight: 800; color: #fff; font-size: 1.02rem; padding: 6px 10px 18px;
    display: flex; align-items: center; gap: 9px;
}
.edu-sidebar .side-group { font-size: .72rem; letter-spacing: .12em; color: #62748e; padding: 14px 12px 6px; text-transform: uppercase; }
.edu-sidebar .side-link {
    display: flex; align-items: center; gap: .65rem; padding: .6rem .75rem;
    border-radius: 10px; color: #b9c7db; font-size: .93rem; margin-bottom: 2px;
}
.edu-sidebar .side-link:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.edu-sidebar .side-link.active { background: linear-gradient(135deg, rgba(29, 111, 242, .95), rgba(56, 189, 248, .9)); color: #fff; font-weight: 600; }
.edu-sidebar .side-link i { font-size: 1.02rem; }
.edu-sidebar .lock-tip { font-size: .68rem; background: rgba(255, 255, 255, .12); padding: 1px 6px; border-radius: 6px; margin-left: auto; }

.edu-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.edu-topbar {
    background: #fff; border-bottom: 1px solid var(--edu-border);
    padding: 12px 22px; display: flex; align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20;
}
.edu-content { padding: 22px; flex: 1 1 auto; }

.edu-trial-banner {
    background: linear-gradient(135deg, #fff7e6, #fff1d6);
    border: 1px solid #ffe1a8; color: #8a5a00;
    border-radius: 12px; padding: 10px 16px; font-size: .92rem;
    display: flex; align-items: center; gap: .6rem; margin-bottom: 18px;
}
.edu-trial-banner.danger { background: linear-gradient(135deg, #fff1f1, #ffe4e4); border-color: #ffc9c9; color: #a02525; }
.edu-vip-banner { background: linear-gradient(135deg, #eefaf3, #e2f6ec); border: 1px solid #b9e8d2; color: #12734f;
    border-radius: 12px; padding: 10px 16px; font-size: .92rem; display: flex; align-items: center; gap: .6rem; margin-bottom: 18px; }

/* 统计卡 */
.edu-stat { background: #fff; border: 1px solid var(--edu-border); border-radius: 14px; padding: 18px; height: 100%; }
.edu-stat .label { color: var(--edu-muted); font-size: .84rem; }
.edu-stat .value { font-size: 1.8rem; font-weight: 800; line-height: 1.2; margin-top: 4px; }
.edu-stat .unit { font-size: .85rem; font-weight: 600; color: var(--edu-muted); margin-left: 3px; }
.edu-stat .icon { float: right; font-size: 1.7rem; opacity: .18; }

/* 表格 */
.edu-table thead th { background: #f7f9fc; color: #4a5a72; font-weight: 600; font-size: .86rem; border-bottom: 1px solid var(--edu-border); white-space: nowrap; }
.edu-table td { vertical-align: middle; font-size: .9rem; }
.edu-table tbody tr:hover { background: #fafcff; }

/* 表单 */
.form-label { font-weight: 600; font-size: .88rem; color: #33415c; }
.form-control, .form-select { border-radius: 10px; border-color: #dfe6f0; }
.form-control:focus, .form-select:focus { border-color: var(--edu-primary); box-shadow: 0 0 0 .18rem rgba(29, 111, 242, .12); }

/* 登录/注册卡片 */
.edu-auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 28px;
    background: radial-gradient(1200px 600px at 15% -10%, #e6f0ff 0%, rgba(255, 255, 255, 0) 60%),
                radial-gradient(900px 500px at 110% 10%, #e5fbf1 0%, rgba(255, 255, 255, 0) 60%), #f7f9fc;
}
.edu-auth-card { width: 100%; max-width: 460px; background: #fff; border-radius: 20px; box-shadow: var(--edu-shadow); padding: 34px 30px; }
.edu-auth-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: .35rem; }

/* 拖拽排序 */
.sortable-ghost { opacity: .45; background: #eef5ff !important; }
.sortable-chosen { box-shadow: 0 8px 24px rgba(29, 111, 242, .2); }
.drag-handle { cursor: grab; color: #9aa8bd; }
.drag-handle:active { cursor: grabbing; }

/* 加载遮罩 */
.edu-loading {
    position: fixed; inset: 0; background: rgba(255, 255, 255, .72); z-index: 2000;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
}
.edu-loading .spinner-border { color: var(--edu-primary); }

/* Toast */
.edu-toast-wrap { position: fixed; top: 18px; right: 18px; z-index: 3000; display: flex; flex-direction: column; gap: 10px; }
.edu-toast {
    min-width: 260px; max-width: 420px; background: #fff; border-left: 4px solid var(--edu-primary);
    border-radius: 10px; box-shadow: var(--edu-shadow); padding: 12px 16px; font-size: .9rem;
    animation: eduToastIn .22s ease;
}
.edu-toast.success { border-left-color: #22b07d; }
.edu-toast.error { border-left-color: #e0483d; }
.edu-toast.warn { border-left-color: #e79a1f; }
@keyframes eduToastIn { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }

/* 代码块 / 富文本兜底渲染 */
.edu-rich img { max-width: 100%; height: auto; border-radius: 10px; }
.edu-rich table { width: 100%; border-collapse: collapse; }
.edu-rich td, .edu-rich th { border: 1px solid #e2e8f0; padding: 6px 10px; }
.edu-rich blockquote { border-left: 4px solid var(--edu-primary); padding-left: 12px; color: #5a6a80; margin: 10px 0; }

/* 二维码 */
.edu-qrcode { width: 220px; height: 220px; border: 1px solid var(--edu-border); border-radius: 14px; padding: 8px; background: #fff; }

/* 空状态 */
.edu-empty { text-align: center; padding: 56px 16px; color: var(--edu-muted); }
.edu-empty i { font-size: 2.6rem; opacity: .35; display: block; margin-bottom: 12px; }

/* 富文本只读预览（管理后台内容审核用） */
.edu-rich-preview { line-height: 1.75; color: #26313f; word-break: break-word; }
.edu-rich-preview img { max-width: 100%; height: auto; border-radius: 10px; }
.edu-rich-preview table { width: 100%; border-collapse: collapse; margin: 8px 0; }
.edu-rich-preview td, .edu-rich-preview th { border: 1px solid #e2e8f0; padding: 6px 10px; }
.edu-rich-preview blockquote { border-left: 3px solid var(--edu-primary); padding-left: 12px; color: #5a6a80; margin: 8px 0; }
.edu-rich-preview pre { background: #f6f8fb; padding: 10px; border-radius: 8px; overflow: auto; }
.edu-rich-preview iframe { max-width: 100%; border-radius: 10px; }
.edu-rich-preview h1, .edu-rich-preview h2, .edu-rich-preview h3 { font-size: 1.05rem; font-weight: 700; margin: 10px 0 6px; }

/* ---------------- 首页预览：5 步自动轮播 ---------------- */
.home-stepbar { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.home-stepbar .step-dot {
    width: 26px; height: 6px; border-radius: 99px; background: #e3eaf4;
    cursor: pointer; transition: width .28s ease, background .28s ease;
}
.home-stepbar .step-dot:hover { background: #cfdcee; }
.home-stepbar .step-dot.on {
    width: 40px; background: linear-gradient(90deg, var(--edu-primary), var(--edu-accent));
}
.home-stepbar .step-tip { margin-left: auto; font-size: .76rem; color: var(--edu-muted); white-space: nowrap; }

/* 步骤切换：内容自下而上逐层浮现 */
@keyframes eduStepIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.edu-stage .stage-inner.step-in > * { animation: eduStepIn .52s cubic-bezier(.22, 1, .36, 1) both; }
.edu-stage .stage-inner.step-in > *:nth-child(2) { animation-delay: .08s; }
.edu-stage .stage-inner.step-in > *:nth-child(3) { animation-delay: .16s; }
@media (prefers-reduced-motion: reduce) {
    .edu-stage .stage-inner.step-in > * { animation: none; }
}

/* 首页预览：风格 / 配色同一行的两个下拉框 */
.home-theme-select {
    flex: 1 1 0; width: auto; min-width: 132px;
    border-radius: 10px; border-color: var(--edu-border);
    background-color: #fff; cursor: pointer;
}
.home-theme-select:focus {
    border-color: var(--edu-primary);
    box-shadow: 0 0 0 .2rem rgba(29, 111, 242, .12);
}

/* 首页预览区：内容垂直居中，与左侧文案视觉齐平 */
.edu-stage.home-stage {
    display: flex; flex-direction: column; justify-content: center;
}
@media (max-width: 575.98px) {
    .home-theme-select { min-width: 100px; }
}

/* 响应式 */
@media (max-width: 991.98px) {
    .edu-sidebar { position: fixed; left: -240px; z-index: 1050; transition: left .22s ease; }
    .edu-sidebar.show { left: 0; box-shadow: 0 0 40px rgba(0, 0, 0, .3); }
    .edu-content { padding: 16px; }
    .edu-hero { padding: 56px 0 44px; }
}
@media (max-width: 575.98px) {
    .home-stepbar .step-tip { display: none; }
    .home-stepbar { justify-content: center; }
}

/* -----------------------------------------------------------------------------
   教师预览大屏 —— 网站名称平铺水印
   由服务端渲染瓦片，铺满整个视口（含全屏状态），pointer-events:none 不拦截操作
   -------------------------------------------------------------------------- */
.edu-wm-layer {
    position: fixed;
    inset: -30% -30%;
    z-index: 9998;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 16px 30px;
    transform: rotate(-22deg);
    transform-origin: center center;
    overflow: hidden;
}
.edu-wm-item {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .1em;
    white-space: nowrap;
    /* 中灰 + 低透明度：浅色大屏与深色大屏上都能看到，但不干扰阅读 */
    color: rgba(138, 148, 164, .32);
}
@media (max-width: 767.98px) {
    .edu-wm-item { font-size: 12px; }
    .edu-wm-layer { gap: 12px 18px; }
}

/* -----------------------------------------------------------------------------
   课堂大屏 —— 音乐环节播放器（原生 audio 外壳）
   -------------------------------------------------------------------------- */
.edu-audio-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--edu-primary, #1d6ff2) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--edu-primary, #1d6ff2) 18%, transparent);
}
.edu-audio-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    color: #fff;
    background: var(--edu-primary, #1d6ff2);
    box-shadow: 0 6px 16px color-mix(in srgb, var(--edu-primary, #1d6ff2) 34%, transparent);
}
.edu-audio-card audio {
    height: 38px;
    accent-color: var(--edu-primary, #1d6ff2);
}
.edu-media-warn {
    padding: 14px 16px;
    border-radius: 14px;
    font-size: .95rem;
    line-height: 1.7;
    color: #8a5a00;
    background: #fff8e6;
    border: 1px solid #ffe2a8;
}

/* -----------------------------------------------------------------------------
   教师预览大屏 —— 网站名称平铺水印
   由服务端渲染瓦片，铺满整个视口（含全屏状态），pointer-events:none 不拦截操作
   -------------------------------------------------------------------------- */
.edu-wm-layer {
    position: fixed;
    inset: -30% -30%;
    z-index: 9998;
    pointer-events: none;
    user-select: none;
    display: flex;
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    gap: 16px 30px;
    transform: rotate(-22deg);
    transform-origin: center center;
    overflow: hidden;
}
.edu-wm-item {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .1em;
    white-space: nowrap;
    color: rgba(138, 148, 164, .32);
}
@media (max-width: 767.98px) {
    .edu-wm-item { font-size: 12px; }
    .edu-wm-layer { gap: 12px 18px; }
}

/* -----------------------------------------------------------------------------
   教师端富文本编辑器（wangEditor 5）容器 —— 位于 Bootstrap 弹窗内
   注意：编辑区不要设 overflow，wangEditor 内部 .w-e-scroll 已负责滚动；
   外层加 overflow 会让编辑区高度计算异常，表现为内容区不可见（一片空白）。
   -------------------------------------------------------------------------- */
.edu-editor-toolbar {
    border: 1px solid #dfe6f0;
    border-bottom: none;
    border-radius: 10px 10px 0 0;
    background: #fbfcfe;
    overflow: visible;
}
.edu-editor-toolbar .w-e-bar.w-e-toolbar {
    background: transparent;
    flex-wrap: wrap;
    row-gap: 2px;
}
.edu-editor-body {
    border: 1px solid #dfe6f0;
    border-radius: 0 0 10px 10px;
    height: 340px;
    min-height: 240px;
    background: #fff;
}
.edu-editor-body textarea.form-control {
    height: 100%;
    min-height: 240px;
    border: none;
    border-radius: 0 0 10px 10px;
}

/* 弹窗内层级保险：wangEditor 的下拉面板 / 弹窗 / 全屏必须盖在 Bootstrap modal(1055) 之上 */
.modal .w-e-dropdown-panel,
.modal .w-e-modal,
.modal .w-e-select-list {
    z-index: 2000 !important;
}
.w-e-full-screen-container {
    z-index: 3000 !important;
}
/* 工具栏图标统一尺寸，避免缺少尺寸时图标被压扁到看不见 */
.edu-editor-toolbar .w-e-bar-item button svg {
    width: 1em;
    height: 1em;
    vertical-align: -0.15em;
}
