:root {
    --primary-color: #007bff; --border-color: #dee2e6;
    --background-light: #f8f9fa; --text-color: #212529;
    --button-disabled-bg: #adb5bd; --button-disabled-color: #f8f9fa;
}
html, body { height: 100%; margin: 0; overflow: hidden; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; padding: 15px; background-color: #f0f2f5; color: var(--text-color); font-size: 14px; box-sizing: border-box; }
.toolbox-container { display: flex; flex-direction: column; height: 100%; max-width: none; }
.toolbox-header { padding: 0 0 15px 0; }
.toolbox-header .title-version { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.toolbox-header h1 { font-size: 22px; margin: 0; color: #333; }
#version-info { font-size: 12px; color: #6c757d; background-color: #e9ecef; padding: 3px 8px; border-radius: 5px; }
.toolbox-header .description { font-size: 14px; color: #555; margin: 0; margin-left: 5px; align-self: flex-end; padding-bottom: 2px; }
.title-version > .description { margin-left: 20px; }
.tab-navigation { display: flex; gap: 5px; margin-bottom: -1px; flex-shrink: 0; }
.tab-button { padding: 10px 20px; font-size: 16px; font-weight: 500; border: 1px solid var(--border-color); border-bottom: none; background-color: #f8f9fa; cursor: pointer; border-radius: 8px 8px 0 0; transition: all 0.2s ease-in-out; }
.tab-button.active { background-color: white; color: var(--primary-color); border-top: 3px solid var(--primary-color); padding-top: 8px;}
.tab-content { background-color: white; padding: 20px; border-radius: 0 8px 8px 8px; border: 1px solid var(--border-color); flex-grow: 1; overflow: hidden; display: flex; }
.tab-panel { display: none; width: 100%; }
.tab-panel.active { display: flex; }
.app-container { display: flex; flex-direction: row; gap: 20px; height: 100%; width: 100%; }
.left-panel { width: 40%; flex-shrink: 0; display: flex; flex-direction: column; }
.right-panel { width: 60%; flex-shrink: 0; overflow-y: auto; display: flex; flex-direction: column; box-sizing: border-box; gap: 15px; }
.details-content { flex-grow: 1; }
.controls-toolbar { display: flex; justify-content: space-between; align-items: center; margin: 10px 0; flex-shrink: 0; }
.filter-controls { display: flex; flex-wrap: wrap; gap: 10px; }
.filter-group { border: 1px solid #ddd; border-radius: 5px; padding: 5px 8px; position: relative; background-color: #fff; }
.filter-group summary { font-weight: 500; cursor: pointer; padding: 3px 20px 3px 5px; list-style: none; transition: all 0.2s; border-radius: 4px; }
.filter-group summary.filter-active { background-color: var(--primary-color); color: white; }
.filter-group summary.filter-active::after { color: white; }
.filter-group summary::-webkit-details-marker { display: none; }
.filter-group summary::after { content: ' ▼'; font-size: 0.8em; color: #666; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
.filter-group[open] summary::after { content: ' ▲'; }
.filter-group .filter-options { position: absolute; background-color: white; border: 1px solid #ccc; box-shadow: 0 4px 8px rgba(0,0,0,0.1); border-radius: 5px; padding: 10px; margin-top: 5px; z-index: 10; display: flex; flex-direction: column; gap: 8px; max-height: 250px; overflow-y: auto; }
.filter-options label { display: flex; align-items: center; gap: 5px; white-space: nowrap; font-weight: normal; }
.major-tree-container { border: 1px solid var(--border-color); padding: 10px; border-radius: 8px; overflow: auto; flex-grow: 1; min-height: 200px; position: relative; }
.header-controls { display: flex; align-items: center; flex-wrap: nowrap; gap: 10px; flex-shrink: 0; margin-bottom: 10px; }
.header-controls .search-container { display: flex; gap: 8px; flex-grow: 0.8; min-width: 150px; }
.header-controls .search-container input { flex-grow: 1; }
.header-controls > .switcher, .header-controls > .switcher-group { flex-shrink: 0; }
.switcher { display: flex; border: 1px solid var(--primary-color); border-radius: 8px; overflow: hidden; }
.switcher input[type="radio"] { display: none; }
.switcher label { padding: 8px 12px; font-size: 14px; cursor: pointer; transition: all 0.2s ease-in-out; color: var(--primary-color); user-select: none; white-space: nowrap; }
.switcher input[type="radio"]:checked + label { background-color: var(--primary-color); color: white; }
.switcher label:not(:last-of-type) { border-right: 1px solid var(--primary-color); }
.query-button { padding: 8px 18px; font-size: 14px; background-color: var(--primary-color); color: white; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; white-space: nowrap; }
.query-button:hover { background-color: #0056b3; }
ul { list-style-type: none; padding-left: 20px; }
li { padding: 4px 0; }
.tree-label, .major-label, .uni-label { cursor: pointer; user-select: none; transition: background-color 0.2s; padding: 2px 4px; border-radius: 3px; }
.tree-label:hover, .major-label:hover, .uni-label:hover { color: var(--primary-color); background-color: #e9f5ff; }
.caret::before { content: "+"; color: black; display: inline-block; margin-right: 8px; font-weight: bold; width: 14px; transition: transform 0.2s; }
.caret-down::before { transform: rotate(45deg); }
.nested { display: none; }
.active { display: block; }
.output-container { border-top: 1px solid var(--border-color); padding-top: 15px; flex-shrink: 0; }
.output-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.output-header h3 { margin: 0; display: flex; align-items: center; }
.output-button { padding: 8px 12px; font-size: 14px; background-color: var(--primary-color); color: white; border: none; border-radius: 8px; cursor: pointer; transition: background-color 0.2s; white-space: nowrap; }
.output-button:hover { background-color: #0056b3; }
.output-button.disabled { background-color: var(--button-disabled-bg); color: var(--button-disabled-color); cursor: not-allowed; pointer-events: none; }
textarea { width: 100%; box-sizing: border-box; flex-grow: 1; font-size: 13px; padding: 10px; border-radius: 5px; border: 1px solid var(--border-color); resize: vertical; min-height: 150px; }
.details-content p { margin: 0 0 4px 0; line-height: 1.5; }
.details-content .compact-row-container { margin-bottom: 4px; line-height: 1.6; }
.details-content h3 { margin-top: 0; font-size: 18px; color: var(--primary-color);}
@media (max-width: 1024px) { body { overflow-y: auto; padding: 10px; } .toolbox-container { height: auto; } .app-container { flex-direction: column; } .left-panel, .right-panel { width: 100%; height: auto; max-height: 80vh; } .right-panel { position: static; margin-top: 20px; } .header-controls { flex-direction: column; align-items: stretch; } }
.plan-filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.plan-interactive-controls { display: flex; gap: 10px; margin-bottom: 10px; align-items: stretch; }
.input-column { display: flex; flex-direction: column; gap: 5px; flex-grow: 1; }
.input-column input, .input-column textarea { padding: 8px 12px; font-size: 14px; font-family: inherit; border: 1px solid var(--border-color); border-radius: 8px; box-sizing: border-box; width: 100%; }
.input-column textarea { resize: vertical; }
.button-column { display: flex; flex-direction: column; justify-content: space-between; flex-shrink: 0; gap: 5px; }
.button-column .query-button, .button-column .switcher, .button-column .output-button { width: 100%; box-sizing: border-box; display: flex; justify-content: center; }
.plan-details-section, .plan-chart-section { border: 1px solid var(--border-color); border-radius: 8px; padding: 15px; background-color: var(--background-light); flex-shrink: 1; min-height: 0; display: flex; flex-direction: column; }
#plan-details-content { flex: 40; overflow-y: auto; }
#plan-chart-area { flex: 35; }
#plan-output-container { flex: 25; }
.plan-details-section h3, .plan-chart-section h3 { margin: 0 0 10px 0; flex-shrink: 0; }
.content-placeholder { display: flex; align-items: center; justify-content: center; min-height: 80px; color: #6c757d; }
#plan-output-container.output-container { border-top: none; }
#plan-output-container .output-header { padding: 0; }
#query-results-message { color: var(--primary-color); margin-bottom: 10px; font-weight: 500; }

/* --- 基础表格布局 --- */
.plan-list-view { display: table; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.plan-list-view .list-header { display: table-header-group; font-weight: 600; }
.plan-list-view .list-header .list-cell { background-color: #f8f9fa; position: sticky; top: -1px; z-index: 2; }
.plan-list-view .list-body { display: table-row-group; }
.plan-list-view .list-row { display: table-row; }
.plan-list-view .list-cell { display: table-cell; padding: 8px 10px; border-bottom: 1px solid #dee2e6; vertical-align: middle; font-size: 13px; }
.plan-list-view .list-row:hover .list-cell:not(.sticky-col) { background-color: #f1f3f5; }
.plan-list-view .list-cell input[type="checkbox"] { vertical-align: middle; }

/* --- 固定定位核心代码 --- */
.plan-list-view .list-cell:first-child, .plan-list-view .list-cell:nth-child(2) { position: sticky; left: 0; background-color: white; border-right: 1px solid #dee2e6; z-index: 1; }
.plan-list-view .list-row:hover .list-cell:first-child, .plan-list-view .list-row:hover .list-cell:nth-child(2) { background-color: #f1f3f5; }
.plan-list-view .list-header .list-cell:first-child, .plan-list-view .list-header .list-cell:nth-child(2) { z-index: 3; }
.plan-list-view .list-header .list-cell:first-child { z-index: 4; }
.plan-list-view .list-cell:nth-child(2) { left: 8px; }

/* --- 自定义列宽 (最关键的部分) --- */
.plan-list-view .list-cell.col-select { width: 8px; } /* 选择 */
.plan-list-view .list-cell.col-uni-major { width: 280px; white-space: normal; word-break: break-all; } /* 院校专业 */
.plan-list-view .list-cell:nth-child(3) { width: 20px; } /* 省份 */
.plan-list-view .list-cell:nth-child(4) { width: 20px; } /* 城市 */
.plan-list-view .list-cell:nth-child(5) { width: 50px; white-space: normal; word-break: break-all; } /* 学费 */
.plan-list-view .list-cell:nth-child(6) { width: 55px; white-space: normal; word-break: break-all; } /* 选科要求 */
.plan-list-view .list-cell:nth-child(7) { width: 30px; } /* 分数线 */
.plan-list-view .list-cell:nth-child(8) { width: 45px; } /* 位次号 */
.plan-list-view .list-cell.col-notes { width: 350px; white-space: normal; word-break: break-all; } /* 专业简注 */

#plan-details-content .detail-group { margin-bottom: 8px; }
#plan-details-content .detail-group h4 { margin: 0 0 6px 0; font-size: 15px; border-bottom: 1px solid var(--border-color); padding-bottom: 4px; }
#plan-details-content .detail-row, #plan-details-content .detail-item { display: flex; margin-bottom: 1px; line-height: 1.4; font-size: 13px; }
#plan-details-content .detail-multi-row { display: flex; flex-wrap: wrap; }
#plan-details-content .detail-item { margin-right: 20px; }
#plan-details-content .detail-label { flex-shrink: 0; width: 95px; font-weight: 600; color: #333; }
#plan-details-content .detail-value { word-break: break-all; }
#plan-details-content a { color: var(--primary-color); text-decoration: none; }
#plan-details-content a:hover { text-decoration: underline; }
#filter-range .filter-options { width: auto; align-items: center; }
/* 只修改“招生计划”标签页内、位于“输入区域”(.input-column)的 textarea 高度。
  这可以精确地指向“院校名称关键字”和“专业名称关键字”下方的输入框，
  而不会影响到右侧的“意向计划”输出框。*/
#app-container-plans .input-column textarea { min-height: 80px; /* 设置一个较小的最小高度 */ flex-grow: 0; /* 取消其在垂直方向上的弹性增长 */ }
