#themeMatrixPanel{padding:0;min-height:100%;overflow:hidden}.wtm-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px 8px}.wtm-head b{display:block;font-size:17px;color:#27364b}.wtm-head small{display:block;margin-top:3px;color:#8190a2;font-size:12px}.wtm-head button{border:1px solid #d8e0eb;background:#fff;border-radius:4px;color:#42698f;padding:4px 10px;cursor:pointer}.wtm-scroll{overflow:auto;padding:0 12px 4px}.wtm-scroll table{border-collapse:collapse;min-width:760px;width:100%;font-size:12px}.wtm-scroll th,.wtm-scroll td{border:1px solid #e1e6ee;height:30px;text-align:center;font-weight:600;white-space:nowrap}.wtm-scroll thead th{height:42px;background:#fafbfd;color:#5d6b7e}.wtm-scroll thead th small{display:block;font-size:10px;font-weight:400}.wtm-scroll th:first-child,.wtm-scroll tbody th{text-align:left;padding:0 8px;width:125px;background:#fafbfd;color:#33445a}.wtm-scroll tbody th b{display:block}.wtm-scroll tbody th small{display:block;margin-top:3px;color:#8591a0;font-size:10px;font-weight:400}.wtm-scroll td{min-width:54px;color:#263548}.wtm-cell.is-clickable{cursor:pointer}.wtm-cell.is-clickable:hover{outline:2px solid #ef4137;outline-offset:-2px}.wtm-limit th,.wtm-limit td{font-weight:700;background:#fff}.wtm-muted th,.wtm-muted td{color:#8591a0;background:#fafbfd}.wtm-note{padding:5px 14px 10px;color:#8b97a6;font-size:11px}.wtm-loading{opacity:.65}.wtm-detail{position:fixed;inset:0;margin:auto;width:min(680px,calc(100vw - 32px));max-height:min(80vh,620px);padding:0;border:1px solid #dce2eb;border-radius:18px;box-shadow:0 18px 60px #182b4729;color:#263548;z-index:10000}.wtm-detail::backdrop{background:#182b474d}.wtm-detail > header{display:flex;align-items:center;justify-content:space-between;padding:18px 24px;border-bottom:1px solid #e4e8ee}.wtm-detail h2{margin:0;font-size:22px}.wtm-detail > header button{border:0;border-radius:50%;width:38px;height:38px;font-size:26px;color:#667386;background:#f3f5f8;cursor:pointer}.wtm-detail-body{padding:20px 24px 26px}.wtm-stock-list{display:flex;flex-wrap:wrap;gap:10px;margin-top:14px}.wtm-stock-list span{padding:9px 14px;border:1px solid #dce3ee;border-radius:10px;background:#f7f9fc;font-weight:600}.wtm-stock-list small{display:block;color:#8a96a5;font-size:11px;margin-top:3px;font-weight:400}.wtm-stock-list em{color:#8a96a5}.wtm-detail-loading{padding:30px;text-align:center}.wtm-detail-loading button{display:block;margin:14px auto 0}

/* Standalone entry in 板块精选轮动; the workspace keeps its compact sizing. */
.theme-library-page #themeMatrixPanel{min-height:0;height:calc(100dvh - 114px);padding:12px 8px;background:#fff;display:flex;flex-direction:column;box-sizing:border-box}
.theme-library-page #themeMatrixPanel[hidden]{display:none}
.theme-library-page #themeMatrixPanel .wtm-head{flex:none;padding:12px 14px 18px;gap:12px}
.theme-library-page #themeMatrixPanel .wtm-scroll{flex:1;min-height:0}
.theme-library-page #themeMatrixPanel .wtm-scroll th,.theme-library-page #themeMatrixPanel .wtm-scroll td{height:48px;font-size:14px}
.theme-library-page #themeMatrixPanel .wtm-scroll thead th{position:sticky;top:0;z-index:2;height:56px}
.theme-library-page #themeMatrixPanel .wtm-scroll th:first-child{position:sticky;left:0;z-index:1;min-width:140px}
.theme-library-page #themeMatrixPanel .wtm-scroll thead th:first-child{z-index:3}
.theme-library-page #themeMatrixPanel .wb-empty{padding:32px;text-align:center;color:#8190a2}
@media(max-width:600px){.theme-library-page #themeMatrixPanel{height:calc(100dvh - 160px);padding:4px 0}.theme-library-page #themeMatrixPanel .wtm-head small{max-width:240px}.theme-library-page #themeMatrixPanel .wtm-head button{flex-shrink:0}}

.wtm-head{flex-wrap:wrap;gap:10px}
.wtm-actions{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.wtm-sort{display:flex;gap:4px;padding:3px;border:1px solid #e3e7ed;border-radius:7px;background:#f7f8fa}
.wtm-head .wtm-sort button{border-color:transparent;background:transparent;color:#6b788a;min-height:30px}
.wtm-head .wtm-sort button[aria-pressed="true"]{background:#fff0ee;color:#b63830;border-color:#f1c4bf;font-weight:700}
.wtm-legend{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;padding:0 14px 14px;font-size:12px;color:#66758a;flex:none}
.wtm-legend-title{font-weight:600;white-space:nowrap}
.wtm-legend-scale{width:min(580px,100%);padding:6px 10px 7px;border:1px solid #e4e8ee;border-radius:10px;background:#fff;box-shadow:0 2px 7px #2635480a;box-sizing:border-box}
.wtm-legend-bar{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));height:18px;border:1px solid #d6dce5;border-radius:5px;overflow:hidden}
.wtm-legend-bar i{display:block}
.wtm-legend-labels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));padding-top:4px;text-align:center;color:#646c78;font-size:12px}
.wtm-legend small{font-size:11px;color:#8994a3}
.wtm-other th,.wtm-other td{border-top:2px solid #cbd3df}
.wtm-cell:focus-visible{outline:2px solid #c3352b;outline-offset:-2px}
@media(max-width:600px){.wtm-actions{gap:6px}.wtm-legend{gap:6px 10px}.wtm-head .wtm-sort button{font-size:11px;padding:4px 7px}}

/* Fit the standalone desktop matrix above the persistent composer, without hiding rows. */
@media(min-width:1025px){
  body.theme-library-page:has(#themeMatrixPanel:not([hidden])){height:100dvh;overflow:hidden;padding-bottom:0!important}
  .theme-library-page #themeMatrixPanel{padding:4px 8px 0;min-height:0}
  .theme-library-page #themeMatrixPanel .wtm-head{padding:4px 12px 6px;gap:6px;flex-wrap:nowrap}
  .theme-library-page #themeMatrixPanel .wtm-head b{font-size:15px;line-height:20px}
  .theme-library-page #themeMatrixPanel .wtm-head small{font-size:10px;line-height:14px;margin-top:0}
  .theme-library-page #themeMatrixPanel .wtm-head button{font-size:11px;padding:3px 8px}
  .theme-library-page #themeMatrixPanel .wtm-sort{padding:2px}
  .theme-library-page #themeMatrixPanel .wtm-sort button{min-height:26px}
  .theme-library-page #themeMatrixPanel .wtm-actions{flex-wrap:nowrap;gap:8px}
  .theme-library-page #themeMatrixPanel .wtm-legend{padding:0 12px 6px;gap:8px;font-size:10px;flex-wrap:nowrap}
  .theme-library-page #themeMatrixPanel .wtm-legend-scale{width:360px;padding:3px 6px 4px;border-radius:6px;box-shadow:none}
  .theme-library-page #themeMatrixPanel .wtm-legend-bar{height:10px;border-radius:3px}
  .theme-library-page #themeMatrixPanel .wtm-legend-labels{font-size:10px;line-height:12px;padding-top:2px}
  .theme-library-page #themeMatrixPanel .wtm-legend small{font-size:10px}
  .theme-library-page #themeMatrixPanel .wtm-scroll{padding:0 12px;overflow:auto;min-height:0}
  .theme-library-page #themeMatrixPanel .wtm-scroll table{height:100%;min-width:0;table-layout:fixed}
  .theme-library-page #themeMatrixPanel .wtm-scroll th,.theme-library-page #themeMatrixPanel .wtm-scroll td{height:var(--wtm-row-height,24px);padding:0 4px!important;font-size:var(--wtm-cell-font,12px);line-height:1.1;min-width:0;box-sizing:border-box}
  .theme-library-page #themeMatrixPanel .wtm-scroll thead th{height:32px;font-size:11px;line-height:14px}
  .theme-library-page #themeMatrixPanel .wtm-scroll th:first-child{width:144px;min-width:0;padding-left:7px!important}
  .theme-library-page #themeMatrixPanel .wtm-scroll tbody th b{font-size:var(--wtm-cell-font,12px);line-height:1.1}
  .theme-library-page #themeMatrixPanel .wtm-scroll tbody th small{font-size:9px;line-height:10px;margin-top:1px}
  .theme-library-page #themeMatrixPanel .wtm-scroll thead th small{font-size:9px;line-height:10px}
  .theme-library-page #themeMatrixPanel .wtm-note{flex:none;font-size:9px;line-height:13px;padding:4px 12px 0}
}

@media(min-width:1025px){
  .theme-library-page #themeMatrixPanel.wtm-dense .wtm-scroll th:first-child{width:235px}
  .theme-library-page #themeMatrixPanel.wtm-dense .wtm-scroll tbody th b{display:inline-block;min-width:84px;font-size:14px;line-height:17px}
  .theme-library-page #themeMatrixPanel.wtm-dense .wtm-scroll tbody th small{display:inline;margin:0 0 0 5px;font-size:9px;line-height:16px}
}

/* Keep row labels and counts equally legible, including the compact single-line layout. */
#themeMatrixPanel .wtm-scroll tbody td,
#themeMatrixPanel .wtm-scroll tbody th b{font-size:14px!important;line-height:17px}
#themeMatrixPanel .wtm-scroll tbody th b{font-weight:700}
#themeMatrixPanel .wtm-scroll tbody td{font-weight:600}

/* Small consecutive-limit ladder in the detail dialog. */
.wtm-detail > header{position:sticky;top:0;background:#fff;z-index:1}
.wtm-detail .wtm-detail-body{padding:16px 20px 20px;max-height:calc(min(80vh,620px) - 96px);overflow:auto;box-sizing:border-box}
.wtm-ladder-note{margin:5px 0 14px;color:#8994a3;font-size:11px}
.wtm-ladder{border:1px solid #e2e7ee;border-radius:10px;overflow:hidden}
.wtm-ladder-row{display:grid;grid-template-columns:64px minmax(0,1fr);border-bottom:1px solid #e2e7ee}
.wtm-ladder-row:last-child{border-bottom:0}
.wtm-ladder-level{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;padding:12px 4px;background:#fff0ee;border-right:1px solid #f0d6d2;color:#b33a32}
.wtm-ladder-level strong{font-size:16px}
.wtm-ladder-level small{font-size:11px;color:#a97873}
.wtm-ladder-stocks{display:grid;grid-template-columns:repeat(auto-fill,minmax(108px,1fr));gap:8px;padding:10px;background:#fff}
.wtm-ladder-stock{padding:9px 10px;border:1px solid #e3e8f0;border-radius:7px;background:#f8fafc;min-width:0}
.wtm-ladder-stock b{display:block;font-size:14px;color:#263548;line-height:20px}
.wtm-ladder-stock small{display:block;font-size:11px;color:#8994a3;margin-top:2px}
.wtm-ladder-status{display:inline-block;font-size:10px;color:#b56131;background:#fff2e5;border-radius:3px;margin-top:5px;padding:2px 4px}
@media(max-width:600px){.wtm-detail > header{padding:12px 16px}.wtm-detail h2{font-size:18px}.wtm-detail .wtm-detail-body{padding:12px}.wtm-ladder-row{grid-template-columns:52px minmax(0,1fr)}.wtm-ladder-stocks{grid-template-columns:repeat(auto-fill,minmax(95px,1fr));padding:8px;gap:6px}.wtm-ladder-level strong{font-size:14px}}
.wtm-detail{width:min(820px,calc(100vw - 32px))}
.wtm-ladder-stocks{grid-template-columns:repeat(auto-fill,minmax(102px,1fr));gap:6px;padding:8px}
.wtm-ladder-stock{padding:6px 8px}
.wtm-ladder-stock b{line-height:18px}

#themeMatrixPanel .wtm-head{justify-content:flex-end}
#themeMatrixPanel .wtm-head .wtm-sort button{font-size:10px!important;line-height:16px;min-height:22px;padding:2px 7px;font-weight:500}
#themeMatrixPanel .wtm-head .wtm-sort button[aria-pressed="true"]{font-weight:600}

#themeMatrixPanel .wtm-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:4px 12px 8px;flex:none;min-width:0;overflow-x:auto}
#themeMatrixPanel .wtm-toolbar .wtm-legend{order:1;flex:1;min-width:0;padding:0;flex-wrap:nowrap;white-space:nowrap}
#themeMatrixPanel .wtm-toolbar .wtm-head{order:2;flex:none;padding:0;flex-wrap:nowrap}
#themeMatrixPanel .wtm-toolbar .wtm-legend-scale{width:360px;max-width:40vw;flex-shrink:1;min-width:200px}
#themeMatrixPanel .wtm-toolbar .wtm-legend small{white-space:nowrap}

.wtm-choice{display:flex;align-items:center;gap:4px;white-space:nowrap;font-size:10px;color:#8190a2}
#themeMatrixPanel .wtm-choice select{
  appearance:none;-webkit-appearance:none;box-sizing:border-box;
  font-family:inherit;font-size:10px!important;font-weight:500;line-height:16px;
  height:28px;min-height:28px!important;min-width:58px;margin:0;padding:4px 22px 4px 8px;
  color:#6b788a!important;border:1px solid #e3e7ed!important;border-radius:7px!important;box-shadow:none!important;
  background:#f7f8fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4.5 3 3 3-3' fill='none' stroke='%23818b99' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 7px center!important;
  cursor:pointer;
}
#themeMatrixPanel .wtm-choice select:hover{border-color:#cbd4df!important;background-color:#fff!important}
#themeMatrixPanel .wtm-choice select:focus-visible{outline:2px solid #d99da1;outline-offset:2px}
.wtm-ladder-stock{text-align:left;font-family:inherit;cursor:pointer}
.wtm-ladder-stock:hover,.wtm-ladder-stock:focus-visible{border-color:#d48b83;background:#fff4f1;outline:1px solid #d48b83}
#themeMatrixPanel .wtm-toolbar .wtm-legend-scale{width:280px;min-width:160px}
@media(min-width:1025px) and (max-width:1400px){#themeMatrixPanel .wtm-toolbar .wtm-legend small{display:none}}

/* Workspace thumbnail; the standalone matrix retains its full controls and table. */
#themeMatrixPanel.wtm-preview{min-height:0;height:100%;display:flex;flex-direction:column;padding:8px 10px;box-sizing:border-box;background:#fff;overflow:auto}
#themeMatrixPanel .wtm-preview-head{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:none;margin-bottom:6px;font-size:10px;color:#737b87}
#themeMatrixPanel .wtm-preview-head a{flex:none;color:#d92d32;font-size:11px;text-decoration:none;padding:4px;border-radius:4px}
#themeMatrixPanel .wtm-preview-head a:hover{background:#fff1f1}
#themeMatrixPanel .wtm-preview-head a:focus-visible{outline:2px solid #d92d32;outline-offset:2px}

@media (max-width:1024px) {
  #themeMatrixPanel .wtm-preview-head { font-size:11px; line-height:1.5; align-items:flex-start; }
  #themeMatrixPanel .wtm-preview-head a { font-size:12px; min-height:32px; display:inline-flex; align-items:center; box-sizing:border-box; }
}
#themeMatrixPanel .wtm-preview-scroll{min-height:0;flex:1;overflow:auto}
#themeMatrixPanel .wtm-preview-table{width:100%;min-width:360px;height:100%;border-collapse:separate;border-spacing:4px;table-layout:fixed;font-variant-numeric:tabular-nums}
#themeMatrixPanel .wtm-preview-table th,#themeMatrixPanel .wtm-preview-table td{border:0;padding:0;text-align:center;font-size:14px;font-weight:400;line-height:20px;background:transparent}
#themeMatrixPanel .wtm-preview-table thead th{height:26px;color:#737b87;font-size:12px;white-space:nowrap}
#themeMatrixPanel .wtm-preview-table th:first-child{width:88px}
#themeMatrixPanel .wtm-preview-table tbody th{color:#272b33;overflow-wrap:anywhere;padding:2px 3px}
#themeMatrixPanel .wtm-preview-table td{height:32px}
#themeMatrixPanel .wtm-preview-table td span{display:flex;align-items:center;justify-content:center;min-height:32px;height:100%;border-radius:6px}

#workspaceHome #themeMatrixPanel .wtm-preview-table tbody th,#workspaceHome #themeMatrixPanel .wtm-preview-table tbody td{font-size:14px!important;font-weight:400!important}

/* Per-day reason marker stays distinct from the cell's stock-detail action. */
#themeMatrixPanel .wtm-cell,#themeMatrixPanel .wtm-preview-table td{position:relative}
#themeMatrixPanel .wtm-boom{position:absolute;top:2px;right:2px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:18px;height:18px;padding:0;border:1px solid #d92d32;border-radius:2px;background:#fff;color:#d92d32;font-family:inherit;font-size:11px!important;font-weight:500;line-height:1;cursor:pointer}
#themeMatrixPanel .wtm-boom:hover{background:#fff1f1}
#themeMatrixPanel .wtm-boom:focus-visible{outline:2px solid #272b33;outline-offset:1px}
.wtm-reason{border-radius:12px}
.wtm-reason h2{font-size:16px}
.wtm-reason h3{font-size:14px;line-height:1.6;margin:12px 0}
.wtm-reason .wtm-reason-meta{font-size:12px;color:#737b87;margin:0}
.wtm-reason .wtm-reason-text{font-size:14px;line-height:1.8;white-space:pre-wrap;overflow-wrap:anywhere}

/* Keep mobile reason actions within their own cells, beside the count. */
@media (max-width: 880px) {
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll table { min-width:max-content; width:100%; }
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll th:first-child { width:112px; min-width:112px; max-width:112px; }
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll tbody th b { white-space:normal; overflow-wrap:anywhere; }
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll td,
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll thead th:not(:first-child) { min-width:64px; font-variant-numeric:tabular-nums; }
  #themeMatrixPanel#themeMatrixPanel .wtm-scroll .wtm-boom {
    position:static; display:inline-flex; vertical-align:middle;
    width:22px; min-width:22px; height:24px; min-height:24px !important;
    margin:0 0 0 4px; padding:0; line-height:1 !important;
  }
}

/* Compact workspace preview: rows size to their content, not the panel height. */
#themeMatrixPanel.wtm-preview { padding:4px; }
#themeMatrixPanel .wtm-preview-scroll { flex:0 1 auto; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table { height:auto; min-width:296px; border:0; border-radius:0; border-spacing:2px 3px; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table :is(th,td) { height:34px !important; padding:0 2px !important; font-size:13px !important; line-height:18px !important; font-weight:400 !important; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table thead th { height:26px !important; color:#818894; font-size:11px !important; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table th:first-child { width:80px; text-align:left; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table tbody th { color:#404651; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table td > span { display:inline-flex; vertical-align:middle; box-sizing:border-box; width:100%; min-height:26px; height:26px; border-radius:4px; }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table td:has(.wtm-boom) > span { width:calc(100% - 20px); }
#themeMatrixPanel#themeMatrixPanel .wtm-preview-table .wtm-boom { position:static; display:inline-flex; vertical-align:middle; width:18px; min-width:18px; height:26px; min-height:26px !important; margin:0 0 0 2px; padding:0 !important; border:0; border-radius:3px; background:#fff1f1; font-size:11px !important; line-height:1 !important; }
#workspaceHome#workspaceHome#workspaceHome .wc-workspace:not(.is-editing) .wc-panel[data-panel="theme_matrix"] { height:auto !important; max-height:360px; }
#workspaceHome#workspaceHome#workspaceHome .wc-workspace:not(.is-editing) .wc-panel[data-panel="theme_matrix"] .wc-panel-body { flex:0 1 auto; }
#workspaceHome#workspaceHome#workspaceHome .wc-workspace:not(.is-editing) #themeMatrixPanel.wtm-preview { height:auto; }

.wtm-theme-open { border:0; background:transparent; padding:0; color:inherit; font:inherit; text-align:left; cursor:pointer; }
.wtm-theme-open:hover { color:#d92d32; }
.wtm-theme-open:focus-visible { outline:2px solid #d92d32; outline-offset:2px; border-radius:2px; }
