.site-footer{ margin:18px auto 10px; text-align:center; font-size:12px; color:#8a8a8a; line-height:1.7; }
    .site-footer .ft-sep{ margin:0 8px; opacity:.45; }
    [data-theme="night"] .site-footer{ color:#9a9ac0; }
    [data-theme="ink"] .site-footer{ color:#8a7a5a; }
    #langToggle{ font-weight:600; }

/* ============ 主题变量 ============ */
  :root, [data-theme="candy"]{
    --bg1:#fff0f5; --bg2:#e6f7ff;
    --app-fg:#ff5c8a;
    --sheet-bg:#ffffff;
    --title:#ff5c8a;
    --hd-bg:#ffd1e8; --hd-fg:#7a2e4a;
    --sec-bg:#ffe0b2; --sec-fg:#7a4b00;
    --rest-bg:linear-gradient(90deg,#ffe082,#ffcc80,#ffab91); --rest-fg:#8a4b00;
    --time-bg:#f3e5f5; --time-fg:#5e357a;
    --cell:#ffffff; --cell-alt:#fffaf3;
    --subj:#2b2b2b; --teacher:#6d4c41;
    --line:#ffd0e0; --accent:#ff8fb1;
    --btn:#ff8fb1; --btn-fg:#fff;
    --rm:#ff7a9c;
  }
  [data-theme="mint"]{
    --bg1:#e8f8f0; --bg2:#e3f2fd;
    --app-fg:#1f9d6b;
    --sheet-bg:#ffffff;
    --title:#138a5e;
    --hd-bg:#c8f0dc; --hd-fg:#0d5a3c;
    --sec-bg:#d7f0ff; --sec-fg:#155e75;
    --rest-bg:linear-gradient(90deg,#bff0d6,#a8e6cf,#d4f1f4); --rest-fg:#1b6b4a;
    --time-bg:#e0f7fa; --time-fg:#00695c;
    --cell:#ffffff; --cell-alt:#f4fbf8;
    --subj:#1c2b26; --teacher:#3f6b58;
    --line:#bfe9d4; --accent:#34c98a;
    --btn:#34c98a; --btn-fg:#fff;
    --rm:#e25b6b;
  }
  [data-theme="night"]{
    --bg1:#1b1f3b; --bg2:#2a2350;
    --app-fg:#ffd86b;
    --sheet-bg:#232845;
    --title:#ffd86b;
    --hd-bg:#3a3a66; --hd-fg:#ffe9a8;
    --sec-bg:#2f4a6b; --sec-fg:#bfe3ff;
    --rest-bg:linear-gradient(90deg,#3a3a66,#4a3a6b,#2f4a6b); --rest-fg:#ffe9a8;
    --time-bg:#33294f; --time-fg:#cdb6ff;
    --cell:#2a2f52; --cell-alt:#272c4d;
    --subj:#f3f3ff; --teacher:#b9b3d6;
    --line:#454a78; --accent:#ffd86b;
    --btn:#ffd86b; --btn-fg:#232845;
    --rm:#ff8a9c;
  }
  [data-theme="paper"]{
    --bg1:#f4f5f7; --bg2:#eceef1;
    --app-fg:#333;
    --sheet-bg:#ffffff;
    --title:#222;
    --hd-bg:#e9edf2; --hd-fg:#222;
    --sec-bg:#eef1f5; --sec-fg:#444;
    --rest-bg:#f0f1f3; --rest-fg:#555;
    --time-bg:#f2f4f7; --time-fg:#444;
    --cell:#ffffff; --cell-alt:#fafbfc;
    --subj:#222; --teacher:#555;
    --line:#dcdfe4; --accent:#4a90d9;
    --btn:#4a90d9; --btn-fg:#fff;
    --rm:#cc4b4b;
  }

  /* ===== 办公·沉稳（老师适用）===== */
  [data-theme="ink"]{
    --bg1:#f5f2ea; --bg2:#eae6db;
    --app-fg:#3a3a3a;
    --sheet-bg:#fdfcf8;
    --title:#2b2b2b;
    --hd-bg:#e8e2d4; --hd-fg:#3a3a3a;
    --sec-bg:#efe9da; --sec-fg:#5a4a3a;
    --rest-bg:linear-gradient(90deg,#efe7d8,#e8dcc8,#efe7d8); --rest-fg:#7a5a2a;
    --time-bg:#f0ece2; --time-fg:#4a4438;
    --cell:#ffffff; --cell-alt:#faf7f0;
    --subj:#2b2b2b; --teacher:#8a7a66;
    --line:#d8cfbe; --accent:#9c3a2e;
    --btn:#9c3a2e; --btn-fg:#fdfcf8;
    --rm:#b5563f;
  }
  [data-theme="navy"]{
    --bg1:#eef2f7; --bg2:#e3eaf3;
    --app-fg:#1f3a5f;
    --sheet-bg:#ffffff;
    --title:#16335c;
    --hd-bg:#1f3a5f; --hd-fg:#ffffff;
    --sec-bg:#dde6f2; --sec-fg:#1f3a5f;
    --rest-bg:linear-gradient(90deg,#dce6f2,#cdddf0,#dce6f2); --rest-fg:#2a4a73;
    --time-bg:#e9eef6; --time-fg:#27496f;
    --cell:#ffffff; --cell-alt:#f4f7fb;
    --subj:#1c2b3a; --teacher:#5a6b80;
    --line:#c4d2e4; --accent:#2f6fb0;
    --btn:#2f6fb0; --btn-fg:#fff;
    --rm:#c0504d;
  }
  [data-theme="plain"]{
    --bg1:#f4f4f4; --bg2:#ececec;
    --app-fg:#111111;
    --sheet-bg:#ffffff;
    --title:#111111;
    --hd-bg:#f0f0f0; --hd-fg:#111111;
    --sec-bg:#f7f7f7; --sec-fg:#333333;
    --rest-bg:#fafafa; --rest-fg:#444444;
    --time-bg:#f3f3f3; --time-fg:#333333;
    --cell:#ffffff; --cell-alt:#fcfcfc;
    --subj:#111111; --teacher:#555555;
    --line:#cfcfcf; --accent:#333333;
    --btn:#333333; --btn-fg:#ffffff;
    --rm:#999999;
  }
  [data-theme="morandi"]{
    --bg1:#e9e6e1; --bg2:#e2ddd6;
    --app-fg:#6b6358;
    --sheet-bg:#fbfaf7;
    --title:#5b5347;
    --hd-bg:#cdc6ba; --hd-fg:#4a4339;
    --sec-bg:#d8d2c6; --sec-fg:#5b5347;
    --rest-bg:linear-gradient(90deg,#d6cfc2,#c9c1b2,#d6cfc2); --rest-fg:#6b6253;
    --time-bg:#e6e1d8; --time-fg:#5b5347;
    --cell:#ffffff; --cell-alt:#f6f3ee;
    --subj:#4a4339; --teacher:#8a8175;
    --line:#d2ccc0; --accent:#9a8c7a;
    --btn:#9a8c7a; --btn-fg:#fff;
    --rm:#b08a8a;
  }

  /* ===== 小学·活泼 ===== */
  [data-theme="rainbow"]{
    --bg1:#fde9f3; --bg2:#e6f0ff;
    --app-fg:#7b4fd0;
    --sheet-bg:#ffffff;
    --title:#ff6aa0;
    --hd-bg:#ffe0ef; --hd-fg:#a83b6b;
    --sec-bg:#e0f0ff; --sec-fg:#2a6aa8;
    --rest-bg:linear-gradient(90deg,#ffe0ef,#fff3d6,#e0f0ff); --rest-fg:#b06a2a;
    --time-bg:#f0e6ff; --time-fg:#6a3fb0;
    --cell:#ffffff; --cell-alt:#fffafc;
    --subj:#4a2b5a; --teacher:#a06aa0;
    --line:#ffd6ea; --accent:#ff7fb0;
    --btn:#ff7fb0; --btn-fg:#fff;
    --rm:#ff6a8a;
  }

  /* ===== 中学·青春 ===== */
  [data-theme="youth"]{
    --bg1:#e6f7ef; --bg2:#e3f2fd;
    --app-fg:#15895a;
    --sheet-bg:#ffffff;
    --title:#0f7a4e;
    --hd-bg:#c8f0dc; --hd-fg:#0d5a3c;
    --sec-bg:#d7f0e6; --sec-fg:#155e44;
    --rest-bg:linear-gradient(90deg,#c8f0dc,#bfe6f0,#d7f0e6); --rest-fg:#1b6b4a;
    --time-bg:#e0f7ee; --time-fg:#0d6a4c;
    --cell:#ffffff; --cell-alt:#f4fbf8;
    --subj:#1c3a2a; --teacher:#3f7a5a;
    --line:#bfe9d4; --accent:#1faa6b;
    --btn:#1faa6b; --btn-fg:#fff;
    --rm:#e25b6b;
  }
  [data-theme="geo"]{
    --bg1:#eef0f3; --bg2:#e6e9ee;
    --app-fg:#e8732a;
    --sheet-bg:#ffffff;
    --title:#222222;
    --hd-bg:#2bb1c4; --hd-fg:#ffffff;
    --sec-bg:#ffe2cf; --sec-fg:#b5571a;
    --rest-bg:linear-gradient(90deg,#ffe2cf,#d6f0f4,#ffe2cf); --rest-fg:#b5571a;
    --time-bg:#e7f6f8; --time-fg:#1d7e8c;
    --cell:#ffffff; --cell-alt:#f7f9fb;
    --subj:#222222; --teacher:#6a6a6a;
    --line:#d6dae0; --accent:#e8732a;
    --btn:#2bb1c4; --btn-fg:#fff;
    --rm:#e25b6b;
  }
  [data-theme="sky"]{
    --bg1:#e3f1fb; --bg2:#eaf3fb;
    --app-fg:#2a78c2;
    --sheet-bg:#ffffff;
    --title:#1f6fb0;
    --hd-bg:#cfe6fb; --hd-fg:#1d5a93;
    --sec-bg:#dceefb; --sec-fg:#2a6aa8;
    --rest-bg:linear-gradient(90deg,#cfe6fb,#dceefb,#cfe6fb); --rest-fg:#2a6aa8;
    --time-bg:#e3f1fb; --time-fg:#2a6aa8;
    --cell:#ffffff; --cell-alt:#f5fafe;
    --subj:#1c3a52; --teacher:#5a7a93;
    --line:#c4dbf0; --accent:#3a8fd0;
    --btn:#3a8fd0; --btn-fg:#fff;
    --rm:#e25b6b;
  }

  /* ===== 高中·沉稳 ===== */
  [data-theme="deepblue"]{
    --bg1:#e6ebf2; --bg2:#dfe6f0;
    --app-fg:#1b2a4a;
    --sheet-bg:#ffffff;
    --title:#16233f;
    --hd-bg:#1b2a4a; --hd-fg:#dfe6f0;
    --sec-bg:#d6deea; --sec-fg:#1b2a4a;
    --rest-bg:linear-gradient(90deg,#d6deea,#c6d0e0,#d6deea); --rest-fg:#2a3a5a;
    --time-bg:#e3e9f2; --time-fg:#24375a;
    --cell:#ffffff; --cell-alt:#f5f7fb;
    --subj:#16233f; --teacher:#5a6478;
    --line:#c2ccdb; --accent:#34507f;
    --btn:#34507f; --btn-fg:#fff;
    --rm:#b04a4a;
  }
  [data-theme="dark"]{
    --bg1:#15171c; --bg2:#1d2026;
    --app-fg:#7fd1c0;
    --sheet-bg:#1e2128;
    --title:#e6edf3;
    --hd-bg:#2a2f3a; --hd-fg:#cfe0e8;
    --sec-bg:#262b36; --sec-fg:#9fb4c4;
    --rest-bg:linear-gradient(90deg,#2a2f3a,#323845,#2a2f3a); --rest-fg:#cfe0e8;
    --time-bg:#23272f; --time-fg:#9fb4c4;
    --cell:#23272f; --cell-alt:#20242b;
    --subj:#e6edf3; --teacher:#9aa6b4;
    --line:#343a47; --accent:#7fd1c0;
    --btn:#7fd1c0; --btn-fg:#15171c;
    --rm:#e07a8a;
  }
  [data-theme="warmgray"]{
    --bg1:#efedea; --bg2:#e8e5e0;
    --app-fg:#6b5d4f;
    --sheet-bg:#fbfaf8;
    --title:#4a3f35;
    --hd-bg:#d9d2c8; --hd-fg:#4a3f35;
    --sec-bg:#e2dbd2; --sec-fg:#5b4f43;
    --rest-bg:linear-gradient(90deg,#e2dbd2,#d4ccc0,#e2dbd2); --rest-fg:#6b5d4f;
    --time-bg:#ece8e1; --time-fg:#5b4f43;
    --cell:#ffffff; --cell-alt:#f7f4ef;
    --subj:#3a322a; --teacher:#8a7d6f;
    --line:#d2ccc2; --accent:#a8856a;
    --btn:#a8856a; --btn-fg:#fff;
    --rm:#b08a8a;
  }

  /* ===== 大学·潮流 ===== */
  [data-theme="trendy"]{
    --bg1:#15151a; --bg2:#1f1f2b;
    --app-fg:#ff2e63;
    --sheet-bg:#1e1e1e;
    --title:#ff2e63;
    --hd-bg:#ff2e63; --hd-fg:#ffffff;
    --sec-bg:#2a2a2a; --sec-fg:#ffd23f;
    --rest-bg:linear-gradient(90deg,#2a2a2a,#333333,#2a2a2a); --rest-fg:#ffd23f;
    --time-bg:#262626; --time-fg:#e0e0e0;
    --cell:#1e1e1e; --cell-alt:#242424;
    --subj:#f5f5f5; --teacher:#b0b0b0;
    --line:#3a3a3a; --accent:#ff2e63;
    --btn:#ff2e63; --btn-fg:#ffffff;
    --rm:#ff5c5c;
  }
  [data-theme="literary"]{
    --bg1:#f6efe2; --bg2:#efe6d6;
    --app-fg:#8a5a2a;
    --sheet-bg:#fdf9f0;
    --title:#7a4a20;
    --hd-bg:#ece0c8; --hd-fg:#6a4520;
    --sec-bg:#f0e6d2; --sec-fg:#7a4a20;
    --rest-bg:linear-gradient(90deg,#f0e6d2,#e8dcc4,#f0e6d2); --rest-fg:#8a5a2a;
    --time-bg:#f4ecdc; --time-fg:#6a4520;
    --cell:#ffffff; --cell-alt:#fdf9f0;
    --subj:#4a3a28; --teacher:#9a7a5a;
    --line:#e0d4be; --accent:#b07a3a;
    --btn:#b07a3a; --btn-fg:#fff;
    --rm:#c08a6a;
  }
  [data-theme="cyber"]{
    --bg1:#0d0221; --bg2:#190b3a;
    --app-fg:#00f0ff;
    --sheet-bg:#14082e;
    --title:#ff2bd6;
    --hd-bg:#1f0d4a; --hd-fg:#00f0ff;
    --sec-bg:#1a0a3e; --sec-fg:#ff2bd6;
    --rest-bg:linear-gradient(90deg,#1a0a3e,#2a0d5a,#1a0a3e); --rest-fg:#00f0ff;
    --time-bg:#150a32; --time-fg:#7af0ff;
    --cell:#14082e; --cell-alt:#1a0f3a;
    --subj:#e8e0ff; --teacher:#9a7af0;
    --line:#3a1d6a; --accent:#00f0ff;
    --btn:#ff2bd6; --btn-fg:#fff;
    --rm:#ff5c8a;
  }
  [data-theme="wood"]{
    --bg1:#efe6d8; --bg2:#e6d8c4;
    --app-fg:#8a5a2a;
    --sheet-bg:#fbf5ea;
    --title:#6a4220;
    --hd-bg:#d8c2a0; --hd-fg:#4a2e18;
    --sec-bg:#e0cdb0; --sec-fg:#5a3a1e;
    --rest-bg:linear-gradient(90deg,#e0cdb0,#d2bb98,#e0cdb0); --rest-fg:#6a4220;
    --time-bg:#ece0cc; --time-fg:#5a3a1e;
    --cell:#ffffff; --cell-alt:#fbf5ea;
    --subj:#3a2818; --teacher:#8a6a4a;
    --line:#d8c4a4; --accent:#a87a4a;
    --btn:#a87a4a; --btn-fg:#fff;
    --rm:#c08a5a;
  }

  *{ box-sizing:border-box; margin:0; padding:0; }
  body{
    font-family:"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
    background:linear-gradient(135deg,var(--bg1),var(--bg2));
    color:var(--subj);
    min-height:100vh; padding:18px;
  }
  .hint{ max-width:1080px; margin:0 auto 10px; font-size:12px; color:var(--teacher); text-align:center; }

  /* 工具栏 */
  .toolbar{
    max-width:1080px; margin:0 auto 14px; display:flex; flex-wrap:wrap; gap:10px;
    align-items:center; justify-content:space-between;
  }
  .app-title{ font-size:22px; font-weight:800; color:var(--app-fg); letter-spacing:2px; padding:2px 6px; border-radius:8px; }
  .tb-group{ display:flex; flex-wrap:wrap; gap:6px; align-items:center; padding:6px 12px; background:#fff; border:1px solid var(--line); border-radius:16px; box-shadow:0 2px 8px rgba(0,0,0,.05); }
  .tb-group.theme-group{ background:rgba(255,255,255,.55); }
  .tb-label{ font-size:13px; color:var(--teacher); }
  .theme-btn,.tbtn{
    border:none; cursor:pointer; border-radius:18px; padding:6px 12px; font-size:13px;
    background:var(--btn); color:var(--btn-fg); font-weight:600; transition:transform .12s;
  }
  .theme-btn:hover,.tbtn:hover{ transform:translateY(-1px); }
  .theme-btn.active{ box-shadow:0 0 0 3px rgba(0,0,0,.12); }
  .tbtn.ghost{ background:#fff; color:var(--accent); border:1.5px solid var(--accent); }

  /* 课表卡片 */
  .sheet{
    max-width:1080px; margin:0 auto; background:var(--sheet-bg); border-radius:20px;
    padding:18px; box-shadow:0 10px 30px rgba(0,0,0,.12);
  }
  .sheet-head{ text-align:center; margin-bottom:12px; }
  .cls{ font-size:24px; font-weight:800; color:var(--title); display:inline-block; padding:2px 8px; border-radius:8px; }
  .ht{ font-size:14px; color:var(--teacher); margin-top:4px; }
  .ht span{ font-weight:700; }

  table{ width:100%; border-collapse:separate; border-spacing:0; }
  th,td{ border:1px solid var(--line); }
  .hd-row th{
    background:var(--hd-bg); color:var(--hd-fg); font-size:16px; font-weight:800;
    padding:10px 4px; position:relative;
  }
  .corner{ background:var(--hd-bg); color:var(--hd-fg); width:96px; font-size:14px; }
  .day-hd .rm-day{
    position:absolute; top:3px; right:4px; width:18px; height:18px; line-height:16px;
    border:none; border-radius:50%; background:var(--rm); color:#fff; cursor:pointer; font-size:12px;
  }
  .sec-row td{
    background:var(--sec-bg); color:var(--sec-fg); font-weight:800; text-align:center;
    padding:6px; letter-spacing:3px; font-size:14px;
  }
  .rest-row td{
    background:var(--rest-bg); color:var(--rest-fg); font-weight:700; text-align:center;
    padding:9px; font-size:15px;
  }
  .time-cell{
    background:var(--time-bg); color:var(--time-fg); text-align:center; width:96px;
    vertical-align:middle; position:relative; padding:8px 4px; cursor:pointer;
  }
  .period-label{ font-weight:800; font-size:14px; }
  .period-time{ font-size:12px; opacity:.85; margin-top:2px; }
  .rm-row{
    position:absolute; top:2px; right:3px; width:16px; height:16px; line-height:14px;
    border:none; border-radius:50%; background:var(--rm); color:#fff; cursor:pointer; font-size:11px;
  }
  .cell{ background:var(--cell); padding:6px 6px; text-align:center; vertical-align:middle; cursor:pointer; }
  .cell:nth-child(even){ background:var(--cell-alt); }
  .cell:hover{ box-shadow: inset 0 0 0 2px var(--accent); }
  .cell-inner{ display:flex; flex-direction:column; align-items:center; gap:3px; }
  .subj-line{ display:flex; align-items:center; justify-content:center; gap:4px; }
  .icon-show{ font-size:15px; line-height:1; }
  /* 一键隐藏课程图标 */
  body.hide-icons .icon-show{ display:none !important; }
  .subj{ font-size:14px; font-weight:700; color:var(--subj); min-width:36px; min-height:18px; }
  .teacher{ font-size:12px; color:var(--teacher); min-width:28px; min-height:15px; }
  /* 可编辑提示：虚线，一眼能看出哪里能改（点击弹出编辑框） */
  .editable{ border-bottom:1px dashed var(--accent); border-radius:2px; padding:0 2px; cursor:pointer; }
  .editable:hover{ background:rgba(255,255,255,.5); }
  .add-row-tr td{ background:transparent; border:none; padding:4px; }
  .add-row{
    width:100%; border:1.5px dashed var(--accent); background:transparent; color:var(--accent);
    border-radius:10px; padding:6px; cursor:pointer; font-weight:700; font-size:13px;
  }
  .add-row:hover{ background:var(--line); }
  #addCols{ max-width:1080px; margin:12px auto 0; display:none; align-items:center; gap:8px; flex-wrap:wrap; }
  .ac-label{ font-size:13px; color:var(--teacher); }
  .ac-btn{ border:none; cursor:pointer; border-radius:14px; padding:5px 12px; background:var(--btn); color:var(--btn-fg); font-weight:600; font-size:13px; }

  body.exporting .exp-hide{ display:none !important; }
  body.exporting .editable{ border-bottom:none !important; background:transparent !important; box-shadow:none !important; }
  body.exporting .cell:hover{ box-shadow:none !important; }

  /* ===== 编辑弹窗（点击单元格弹出）===== */
  /* 居中对话框：不依赖 getBoundingClientRect，兼容内置预览的 transform 容器 */
  .pop-backdrop{ position:fixed; inset:0; z-index:999; background:rgba(0,0,0,0); display:none; }
  .popover{
    position:fixed; z-index:1000; width:272px; max-width:92vw; background:#fff; border:1px solid #eee;
    border-radius:14px; padding:14px; box-shadow:0 12px 40px rgba(0,0,0,.28); display:none;
    top:50%; left:50%; transform:translate(-50%,-50%);
  }
  .pop-title{ font-size:15px; font-weight:800; color:#333; margin-bottom:10px; }
  .pop-icons{ display:grid; grid-template-columns:repeat(8,1fr); gap:6px; margin-bottom:12px; max-height:156px; overflow:auto; }
  .ic-btn{ border:1px solid #eee; background:#fafafa; border-radius:8px; font-size:18px; line-height:1; padding:5px 0; cursor:pointer; }
  .ic-btn:hover{ background:#fff3f7; }
  .ic-btn.sel{ border-color:var(--accent); background:#fff0f6; box-shadow:0 0 0 2px var(--accent); }
  .pop-field{ display:flex; align-items:center; gap:8px; margin-bottom:8px; }
  .pop-field label{ width:44px; font-size:13px; color:#666; flex:none; }
  .pop-field input{ flex:1; min-width:0; border:1px solid #ddd; border-radius:8px; padding:6px 8px; font-size:14px; font-family:inherit; }
  .pop-field input:focus{ outline:none; border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
  .pop-actions{ display:flex; gap:8px; justify-content:flex-end; margin-top:6px; }

  /* ===== 主题库弹窗（按人群分组）===== */
  #themeGallery{ position:fixed; z-index:1001; width:560px; max-width:92vw; max-height:72vh; overflow:auto; background:#fff; border:1px solid #eee; border-radius:16px; padding:14px; box-shadow:0 16px 50px rgba(0,0,0,.3); display:none; }
  .tg-group{ margin-bottom:10px; }
  .tg-group-title{ font-size:12px; font-weight:800; color:#8a8a8a; margin:10px 2px 6px; letter-spacing:1px; }
  .tg-grid{ display:grid; grid-template-columns:repeat(4,1fr); gap:8px; }
  .tg-item{ cursor:pointer; text-align:center; border:1.5px solid #f0f0f0; border-radius:10px; padding:6px 4px; background:#fff; transition:transform .1s, box-shadow .1s; }
  .tg-item:hover{ transform:translateY(-2px); box-shadow:0 4px 12px rgba(0,0,0,.12); }
  .tg-item.active{ border-color:var(--accent); box-shadow:0 0 0 2px var(--accent); }
  .tg-swatch{ display:block; height:34px; border-radius:8px; border:1px solid #eee; position:relative; overflow:hidden; }
  .tg-swatch::after{ content:""; position:absolute; left:0; right:0; bottom:0; height:8px; background:var(--sw-ac); }
  .tg-name{ font-size:11px; color:#555; margin-top:5px; display:block; }

  /* ===== 导出预览弹窗 ===== */
  .modal{ position:fixed; inset:0; background:rgba(0,0,0,.55); display:none; align-items:center; justify-content:center; z-index:999; padding:2vh 2vw; }
  /* 弹窗：屏幕自适应宽高（不写死像素），缩放只作用于内部预览图 */
  .modal-box{ background:#fff; border-radius:16px; width:96vw; height:94vh; max-width:none; max-height:none; display:flex; flex-direction:column; overflow:hidden; box-shadow:0 20px 60px rgba(0,0,0,.4); }
  .modal-head{ display:flex; justify-content:space-between; align-items:center; padding:12px 16px; font-weight:800; color:#333; border-bottom:1px solid #eee; flex:none; }
  .modal-head button{ border:none; background:#eee; width:30px; height:30px; border-radius:50%; cursor:pointer; font-size:16px; }
  .modal-bar{ display:flex; gap:8px; align-items:center; padding:10px 16px; border-bottom:1px solid #eee; flex:none; flex-wrap:wrap; }
  .orient-btn{ border:1px solid #ddd; background:#fff; border-radius:14px; padding:5px 14px; cursor:pointer; font-size:13px; font-weight:600; color:#444; }
  .orient-btn.active{ border-color:var(--accent); background:var(--accent); color:#fff; }
  .zoom-group{ margin-left:auto; display:flex; gap:8px; align-items:center; }
  .zbtn{ border:1px solid #ddd; background:#fff; border-radius:14px; padding:5px 10px; cursor:pointer; font-size:13px; font-weight:600; color:#444; min-width:30px; }
  .zbtn:hover{ background:#f4f5f7; }
  /* 预览滚动区：只滚动内部课程表图，弹窗框/工具栏固定不动 */
  .modal-body{ padding:14px; overflow:auto; background:#f4f5f7; flex:1; min-height:0; }
  .modal-body canvas{ display:block; margin:0 auto; box-shadow:0 4px 16px rgba(0,0,0,.15); background:#fff; }
  .modal-foot{ display:flex; gap:10px; justify-content:center; padding:12px; border-top:1px solid #eee; flex:none; }
  /* 弹窗打开时锁定背景滚动 */
  body.modal-open{ overflow:hidden; }
  @media print{ .toolbar,#addCols,.popover{ display:none; } }
