/* Content surface themes (schedule sheet / checklist / timeline) */
  #sheet[data-theme="candy"], .content-themed[data-theme="candy"]{
    --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;
  }
  #sheet[data-theme="mint"], .content-themed[data-theme="mint"]{
    --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;
  }
  #sheet[data-theme="night"], .content-themed[data-theme="night"]{
    --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;
  }
  #sheet[data-theme="paper"], .content-themed[data-theme="paper"]{
    --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;
  }

  /* ===== 办公·沉稳（老师适用）===== */
  #sheet[data-theme="ink"], .content-themed[data-theme="ink"]{
    --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;
  }
  #sheet[data-theme="navy"], .content-themed[data-theme="navy"]{
    --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;
  }
  #sheet[data-theme="plain"], .content-themed[data-theme="plain"]{
    --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;
  }
  #sheet[data-theme="morandi"], .content-themed[data-theme="morandi"]{
    --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;
  }

  /* ===== 小学·活泼 ===== */
  #sheet[data-theme="rainbow"], .content-themed[data-theme="rainbow"]{
    --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;
  }

  /* ===== 中学·青春 ===== */
  #sheet[data-theme="youth"], .content-themed[data-theme="youth"]{
    --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;
  }
  #sheet[data-theme="geo"], .content-themed[data-theme="geo"]{
    --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;
  }
  #sheet[data-theme="sky"], .content-themed[data-theme="sky"]{
    --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;
  }

  /* ===== 高中·沉稳 ===== */
  #sheet[data-theme="deepblue"], .content-themed[data-theme="deepblue"]{
    --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;
  }
  #sheet[data-theme="dark"], .content-themed[data-theme="dark"]{
    --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;
  }
  #sheet[data-theme="warmgray"], .content-themed[data-theme="warmgray"]{
    --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;
  }

  /* ===== 大学·潮流 ===== */
  #sheet[data-theme="trendy"], .content-themed[data-theme="trendy"]{
    --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;
  }
  #sheet[data-theme="literary"], .content-themed[data-theme="literary"]{
    --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;
  }
  #sheet[data-theme="cyber"], .content-themed[data-theme="cyber"]{
    --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;
  }
  #sheet[data-theme="wood"], .content-themed[data-theme="wood"]{
    --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;
  }
/* Shared content theme gallery (schedule / timeline / checklist) */
#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, 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 0.1s, box-shadow 0.1s;
}
.tg-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}
.tg-item.active {
  border-color: var(--accent, #ff8fb1);
  box-shadow: 0 0 0 2px var(--accent, #ff8fb1);
}
.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;
}

/* Checklist / timeline surfaces inherit schedule theme tokens */
.content-themed.checklist-sheet,
.export-block-inner.content-themed {
  --checklist-thead-bg: var(--hd-bg);
  --checklist-corner-bg: var(--sec-bg);
  --checklist-rowhead-bg: var(--time-bg);
  --checklist-hover-bg: var(--cell-alt);
  --checklist-title-hover-bg: color-mix(in srgb, var(--accent) 12%, transparent);
}
.content-themed .checklist-title {
  color: var(--title);
}
.content-themed .checklist-table thead th,
.content-themed .checklist-colhead {
  color: var(--hd-fg);
}
.content-themed .checklist-corner {
  color: var(--sec-fg);
}
.content-themed .checklist-rowhead {
  color: var(--time-fg);
}
.content-themed .checklist-table th,
.content-themed .checklist-table td {
  border-color: var(--line);
}
.content-themed .checklist-cell {
  background: var(--cell, #fff);
  color: var(--subj, var(--title));
}
/* Timeline: keep white grid; theme only weekday header + time axis */
#calendar-container.content-themed {
  background: var(--panel-bg, #fff);
  --line: unset;
  --sheet-bg: unset;
  --cell: unset;
  --cell-alt: unset;
}
#calendar-container.content-themed .fc .fc-col-header-cell:not(.fc-timegrid-axis),
#calendar-container.content-themed .fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky .fc-col-header-cell:not(.fc-timegrid-axis) {
  background: var(--hd-bg) !important;
}
#calendar-container.content-themed .fc .fc-col-header-cell {
  background: var(--hd-bg) !important;
  color: var(--hd-fg) !important;
}
#calendar-container.content-themed .fc .fc-col-header-cell-cushion {
  color: inherit;
}
#calendar-container.content-themed .fc .fc-timegrid-axis-chunk,
#calendar-container.content-themed .fc .fc-scrollgrid-section-header .fc-timegrid-axis,
#calendar-container.content-themed .fc .fc-timegrid-axis,
#calendar-container.content-themed .fc .fc-timegrid-slot-label {
  background: var(--time-bg) !important;
  color: var(--time-fg) !important;
}
#calendar-container.content-themed .fc .fc-timegrid-axis-cushion,
#calendar-container.content-themed .fc .fc-timegrid-slot-label-cushion {
  color: inherit;
}
