/* =============================================================================
   文件路径: 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);
}
.edu-nav .navbar-brand .brand-dot {
    display: inline-block; width: 10px; height: 10px; border-radius: 50%;
    background: linear-gradient(135deg, var(--edu-primary), var(--edu-accent));
    margin-right: 8px; vertical-align: middle;
}
.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: block;
}
.edu-sidebar .side-brand .brand-dot {
    display: inline-block; width: 9px; height: 9px; border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #22d3a0); margin-right: 8px;
}
.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; }

/* 响应式 */
@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; }
}
