:root {
  --ink: #1c1c1f;
  --muted: #817d75;
  --paper: #f5f3ed;
  --card: #fff;
  --line: #e3dfd6;
  --orange: #f47b3f;
  --orange-soft: #fff1e8;
  --green: #a6c92c;
  --blue: #638fe7;
  --sidebar: 250px;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; overflow-x: hidden; background: var(--paper); color: var(--ink); font-family: 'DM Sans', 'Noto Sans SC', sans-serif; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: #fff; border-right: 1px solid var(--line); padding: 24px 18px; display: flex; flex-direction: column; z-index: 20; overflow: hidden; }
.brand { display: flex; align-items: center; padding: 0 0 20px; border-bottom: 1px solid #eeeae2; flex: 0 0 auto; }
/* 品牌文字已移除，logo 拉满侧栏内容宽度（3:1 原图，214px 宽 -> 约 71px 高） */
.brand img { display: block; width: 100%; max-width: 100%; height: auto; }
.nav { display: flex; flex: 1; min-height: 0; flex-direction: column; gap: 5px; margin-top: 16px; padding-right: 3px; overflow-y: auto; scrollbar-width: thin; }
.nav button { flex: 0 0 auto; border: 0; background: transparent; padding: 11px 13px; border-radius: 11px; text-align: left; color: #77736d; display: flex; align-items: center; gap: 12px; }
.nav button i { width: 23px; font-style: normal; text-align: center; }
.nav button:hover, .nav button.active { background: #f1eee7; color: #161618; }
.nav button.active::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--orange); margin-left: auto; }
.sidebar-foot { flex: 0 0 auto; margin-top: 12px; border-top: 1px solid #eeeae2; padding-top: 12px; }
.admin-card { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #ff8a50, #e85e2c); color: #fff; font-weight: 900; }
.admin-card b, .admin-card small { display: block; }
.admin-card b { font-size: 18px; }
.admin-card small { font-size: 18px; color: var(--muted); }
/* 弹性子项默认不收缩，登录邮箱一长就会把侧栏撑破（字号放大后更明显）。
   允许收缩并让长地址换行，从根上避免溢出。 */
.admin-card > div { min-width: 0; }
.admin-card b, .admin-card small { overflow-wrap: anywhere; }
.main { min-width: 0; margin-left: var(--sidebar); padding: 28px 34px 48px; }
.view { display: none; }
.view.active { display: block; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 22px; }
.page-head h1 { margin: 0 0 6px; font-size: 28px; }
.page-head p { margin: 0; color: var(--muted); font-size: 18px; }
.primary, .ghost, .danger { border-radius: 10px; padding: 10px 15px; font-weight: 700; white-space: nowrap; }
.primary { border: 0; background: #202023; color: #fff; }
.ghost { border: 1px solid var(--line); background: #fff; color: #55514b; }
.danger { border: 1px solid #f2cfc0; background: #fff6f2; color: #d2582b; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.stat { position: relative; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; padding: 18px; }
.stat::after { content: ''; position: absolute; width: 74px; height: 74px; border-radius: 50%; right: -22px; top: -22px; background: var(--tint, #fff0e6); }
.stat span { font-size: 18px; color: var(--muted); }
.stat b { display: block; margin: 12px 0 7px; font-size: 29px; }
.stat small { font-size: 18px; color: #789424; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, .8fr); gap: 15px; margin-top: 15px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.panel-head h2 { margin: 0; font-size: 17px; }
.panel-head span { font-size: 18px; color: var(--muted); }
.chart { height: 210px; display: flex; align-items: flex-end; gap: 12px; padding-top: 12px; border-bottom: 1px solid #ece8df; }
.bar { position: relative; flex: 1; min-width: 20px; background: linear-gradient(#ff9d67, #f17239); border-radius: 8px 8px 0 0; }
.bar::after { content: attr(data-day); position: absolute; bottom: -25px; left: 50%; transform: translateX(-50%); font-size: 18px; color: #99938b; }
.todo { display: flex; flex-direction: column; gap: 9px; }
.todo article { display: flex; gap: 11px; align-items: center; padding: 11px; background: #faf8f3; border-radius: 11px; }
.todo i { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--orange-soft); font-style: normal; }
.todo b, .todo small, .activity b, .activity small { display: block; }
.todo b, .activity b { font-size: 18px; }
.todo small, .activity small { margin-top: 3px; font-size: 18px; color: var(--muted); }
.activity { margin-top: 38px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.activity article { padding: 14px; border: 1px solid #eee9e0; border-radius: 12px; }
.toolbar { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.toolbar > div { display: flex; gap: 8px; }
.toolbar input, .toolbar select { max-width: 100%; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 10px 12px; color: #555; }
.table-wrap { width: 100%; overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 18px; }
table { width: 100%; min-width: 680px; border-collapse: collapse; }
th, td { padding: 14px 16px; border-bottom: 1px solid #eeeae2; text-align: left; font-size: 18px; white-space: nowrap; }
th { background: #faf8f4; color: #878178; font-weight: 700; }
tbody tr:hover { background: #fffaf7; }
td strong { font-size: 18px; }
.user-cell { display: flex; align-items: center; gap: 9px; }
.mini-avatar { width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; display: grid; place-items: center; background: #f2eee6; font-weight: 800; color: #df6c36; }
.badge { display: inline-block; padding: 5px 8px; border-radius: 999px; background: #eef6d8; color: #69820d; font-size: 18px; font-weight: 800; }
.badge.orange { background: #fff0e7; color: #cf622d; }
.badge.gray { background: #f0eee9; color: #77736d; }
.row-actions { display: flex; gap: 5px; }
.row-actions button { border: 0; background: transparent; color: #ca612f; font-size: 18px; }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.manage-card { overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 17px; }
.card-cover { height: 94px; padding: 14px; background: linear-gradient(135deg, #303036, #1d1d20); color: #fff; display: flex; justify-content: space-between; align-items: flex-start; }
.manage-card:nth-child(3n+2) .card-cover { background: linear-gradient(135deg, #6d9be9, #425f96); }
.manage-card:nth-child(3n+3) .card-cover { background: linear-gradient(135deg, #f18959, #b94f32); }
.card-cover span { padding: 4px 7px; border-radius: 999px; background: rgba(0, 0, 0, .2); font-size: 18px; }
.card-cover b { font-size: 24px; opacity: .28; }
.card-body { padding: 15px; }
.card-body h3 { margin: 0 0 7px; font-size: 18px; }
.card-body p { min-height: 32px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.card-meta { display: flex; justify-content: space-between; border-top: 1px solid #eeeae2; padding-top: 11px; font-size: 18px; color: #888; }
.card-meta button { border: 0; background: transparent; color: #d56331; font-weight: 700; }
.category-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 17px; }
.category-row button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 9px 13px; color: #77736d; font-size: 18px; }
.category-row button.active { background: #202023; color: #fff; border-color: #202023; }
.setting-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.setting-card { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 22px; }
.setting-card h2 { margin: 0 0 5px; font-size: 17px; }
.setting-card > p { margin: 0 0 20px; color: var(--muted); font-size: 18px; }
.field { display: block; margin: 0 0 13px; font-size: 18px; font-weight: 700; }
.field input, .field select, .field textarea { display: block; width: 100%; margin-top: 7px; border: 1px solid var(--line); background: #faf9f6; border-radius: 10px; padding: 11px 12px; outline: none; }
.field textarea { min-height: 92px; resize: vertical; }
.switch-row { display: flex; justify-content: space-between; align-items: center; padding: 13px 0; border-bottom: 1px solid #eeeae2; }
.switch-row b, .switch-row small { display: block; }
.switch-row b { font-size: 18px; }
.switch-row small { margin-top: 3px; color: var(--muted); font-size: 18px; }
.switch { width: 42px; height: 24px; border: 0; border-radius: 999px; background: #ddd9d1; padding: 3px; }
.switch::after { content: ''; display: block; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: #f17a40; }
.switch.on::after { transform: translateX(18px); }
.pagination { display: flex; justify-content: space-between; align-items: center; margin-top: 13px; color: var(--muted); font-size: 18px; }
.pagination div { display: flex; gap: 5px; }
.pagination button { min-width: 30px; height: 30px; border: 1px solid var(--line); background: #fff; border-radius: 7px; }
.pagination button.active { background: #202023; color: #fff; }
.modal { position: fixed; inset: 0; display: none; place-items: center; padding: 20px; z-index: 50; }
.modal.open { display: grid; }
.backdrop { position: absolute; inset: 0; background: rgba(20, 18, 16, .44); backdrop-filter: blur(5px); }
.modal-card { position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 22px; padding: 28px; box-shadow: 0 28px 80px rgba(25, 20, 17, .22); }
.modal-card h2 { margin: 0 0 6px; font-size: 22px; }
.modal-card > p { margin: 0 0 20px; color: var(--muted); font-size: 18px; }
.modal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.modal-grid .full { grid-column: 1 / -1; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.toast { position: fixed; right: 24px; bottom: 24px; background: #202023; color: #fff; padding: 12px 17px; border-radius: 11px; font-size: 18px; opacity: 0; transform: translateY(12px); transition: .2s; pointer-events: none; z-index: 80; }
.toast.show { opacity: 1; transform: none; }
.mobile-menu { display: none; }
.empty { padding: 50px; text-align: center; color: var(--muted); }
.auth-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 20%, #fff7ef, #f1eee7 58%, #e8e3da); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .96); box-shadow: 0 24px 80px rgba(40, 31, 24, .13); }
.auth-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.auth-brand img { width: 72px; height: 52px; object-fit: contain; }
.auth-brand h1 { margin: 0 0 4px; font-size: 22px; }
.auth-brand p { margin: 0; color: var(--muted); font-size: 18px; }
.auth-card .field { margin-bottom: 16px; }
.auth-card .primary { width: 100%; padding: 13px; }
.auth-error { min-height: 20px; margin: 8px 0; color: #d64e3f; font-size: 18px; }
.category-edit-card { width: min(560px, 100%); }
.check-field { display: flex; align-items: center; gap: 8px; padding-top: 27px; font-size: 18px; font-weight: 700; }
.check-field input { width: 18px; height: 18px; }
#studentContents.active { display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; }
#studentContents .student-type-tabs { flex: 1 1 420px; margin-bottom: 14px; }
#studentContents .toolbar { flex: 0 1 auto; margin-left: auto; margin-bottom: 14px; }
#studentContents .toolbar > div { justify-content: flex-end; }
#studentContents .table-wrap, #studentContents .pagination { flex: 0 0 100%; }
#studentContents th, #studentContents td { font-size: 18px; }
#studentContents td strong { font-size: 16px; }
#studentContents td small, #studentContents .row-actions button { font-size: 18px; }
#studentContents .badge { font-size: 18px; }
#studentMainAction { display: none !important; }
#courseMainAction { display: none !important; }
#courseContents .toolbar { align-items: center; }
#courseContents .toolbar > div { flex: 1; }
#courseInlineAction { margin-left: auto; }

@media (max-width: 1050px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .setting-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  :root { --sidebar: 0px; }
  .sidebar { width: min(290px, 86vw); transform: translateX(-105%); transition: transform .2s ease; box-shadow: none; }
  .sidebar.open { transform: none; box-shadow: 16px 0 50px rgba(20, 18, 16, .18); }
  .main { margin-left: 0; padding: 20px 16px 82px; }
  .mobile-menu { display: block; }
  .stats, .cards, .activity { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar > div { flex-wrap: wrap; }
  .toolbar input, .toolbar select { flex: 1 1 180px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .page-head h1 { font-size: 24px; }
  .page-head .primary { width: 100%; }
  #studentContents .toolbar { width: 100%; margin-left: 0; }
  #studentContents .toolbar > div { width: 100%; justify-content: stretch; }
  .category-summary { align-items: flex-start; gap: 15px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-grid .full { grid-column: auto; }
}

/* ==========================================================================
   弹窗字体放大（全部弹窗）
   --------------------------------------------------------------------------
   此前只放大过列表与操作区（见 admin.html 内联样式），7 个弹窗仍是原始字号：
   #modal（新增提示词/Skill/资料/下载）、#categoryModal、#courseModal、
   #homeModuleModal、#studentModal、#previewModal、#noticeModal。
   选择器都带 .modal-card 前缀，特异性高于 admin.html 内联样式，能稳定生效。

   两步调整：
     1) 整体按 1.2 倍放大（标题 22→26.4、说明与各处提示文字按原值 ×1.2）。
     2) 表单区定为 17px —— 1.2 倍后标签/输入框仍只有 13.2px，偏小；
        同时把复选框行的 padding-top 同步加大，保持与输入框对齐。
   ========================================================================== */
.modal-card { font-size: 19.2px; }                       /* 16   → 19.2 */
.modal-card h2 { font-size: 26.4px; }                    /* 22   → 26.4 */
.modal-card > p { font-size: 18px; }                   /* 11   → 13.2 */
.modal-card .field { font-size: 17px; }                  /* 11 → 13.2 → 17 */
.modal-card .field input,
.modal-card .field select,
.modal-card .field textarea { font-size: 17px; }         /* 同上（原继承自 label） */
.modal-card .field textarea { min-height: 108px; }        /* 字号变大后同步加高 */
.modal-card .check-field { font-size: 17px; padding-top: 35px; }  /* 字号变大，对齐同步下移 */
.modal-card .video-upload span { font-size: 17px; }      /* 与表单标签保持一致 */
.modal-card .video-upload small { font-size: 18px; }
.modal-card .upload-progress-meta { font-size: 18px; }
.modal-card .detail-view span { font-size: 15.6px; }     /* 13   → 15.6 */
.modal-card .detail-view b,
.modal-card .detail-view p { font-size: 19.2px; }        /* 16   → 19.2 */
.modal-card .badge { font-size: 18px; }                /* 9    → 10.8 */
.modal-card .row-actions button { font-size: 18px; }     /* 10   → 12 */
.modal-card .primary,
.modal-card .ghost,
.modal-card .danger { font-size: 19.2px; padding: 12px 18px; }  /* 16 → 19.2 */
.modal-card .modal-actions { margin-top: 22px; }

/* 列表里的附件下载链接（Skill / 学习资料） */
.attachment-link { color: #d56331; font-weight: 700; text-decoration: none; }
.attachment-link:hover { text-decoration: underline; }

/* 下载资源：列表里的封皮缩略图与预览弹窗里的封皮大图 */
.cover-cell { display: flex; align-items: center; gap: 9px; }
.row-cover { width: 46px; height: 27px; flex: 0 0 46px; object-fit: cover; border-radius: 5px; border: 1px solid var(--line); background: #f2efe8; }
.preview-cover { display: block; max-width: 260px; width: 100%; border-radius: 10px; border: 1px solid var(--line); margin-top: 2px; }

/* 常见问题与通知公告：轻量富文本编辑器（contenteditable + execCommand，无外部依赖）
   含编辑器的弹窗加宽，否则工具栏会折行 */
.rich-modal-card { width: min(760px, 100%); }
.modal-card .rich-field { display: block; margin: 0 0 13px; }
.modal-card .rich-label { display: block; font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.rich-editor { border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: #faf9f6; }
.rich-toolbar { display: flex; flex-wrap: wrap; gap: 5px; padding: 9px; border-bottom: 1px solid var(--line); background: #f3f1ea; }
.rich-toolbar button { min-width: 36px; height: 32px; padding: 0 10px; border: 1px solid var(--line); background: #fff; border-radius: 8px; font-size: 18px; font-weight: 700; color: #45423e; line-height: 1; }
.rich-toolbar button:hover { border-color: #cbbfae; color: var(--orange); }
.rich-toolbar button:active { background: #fff3ea; }
.rich-body { min-height: 200px; max-height: 420px; overflow-y: auto; padding: 15px 17px; background: #fff; outline: none; font-size: 17px; line-height: 1.8; color: var(--ink); }
.rich-body:empty:before { content: attr(data-placeholder); color: #a8a49c; }
.rich-body p { margin: 0 0 11px; }
.rich-body h3 { font-size: 19px; margin: 14px 0 8px; }
.rich-body ul, .rich-body ol { margin: 0 0 11px; padding-left: 24px; }
.rich-body li { margin: 0 0 5px; }
.rich-body a { color: var(--orange); }
.rich-body blockquote { margin: 0 0 11px; padding-left: 13px; border-left: 3px solid var(--line); color: var(--muted); }
.rich-body code, .rich-body pre { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 18px; background: #f5f3ed; border-radius: 6px; padding: 2px 6px; }
.rich-body pre { display: block; padding: 12px 14px; white-space: pre-wrap; }
.rich-body > :last-child { margin-bottom: 0; }

/* 问题解答：弹窗里展示学员提交的富文本内容 */
.modal-card .question-detail { border: 1px solid var(--line); background: #faf9f6; border-radius: 11px; padding: 15px 17px; margin: 0 0 15px; }
.modal-card .question-detail > b { display: block; font-size: 18px; margin-bottom: 9px; }
.modal-card .rich-content { font-size: 17px; line-height: 1.8; color: var(--muted); max-height: 260px; overflow-y: auto; }
.modal-card .rich-content p { margin: 0 0 10px; }
.modal-card .rich-content h2, .modal-card .rich-content h3, .modal-card .rich-content h4 { font-size: 18px; color: var(--ink); margin: 12px 0 7px; }
.modal-card .rich-content ul, .modal-card .rich-content ol { margin: 0 0 10px; padding-left: 22px; }
.modal-card .rich-content li { margin: 0 0 5px; }
.modal-card .rich-content a { color: var(--orange); }
.modal-card .rich-content blockquote { margin: 0 0 10px; padding-left: 13px; border-left: 3px solid var(--line); }
.modal-card .rich-content > :last-child { margin-bottom: 0; }

