:root {
    --primary-color: #1677ff;
    /* 智享蓝 - 现代化主色调 */
    --border-color: #f0f0f0;
    /* 非常淡的边框色，配合卡片设计 */
    --bg-body: #f4f6f8;
    /* 浅蓝灰底色，拉开卡片层次 */
    --bg-card: #ffffff;
    --text-color: #262626;
    --text-muted: #8c8c8c;
    --button-disabled-bg: #d9d9d9;
    --button-disabled-color: #ffffff;
    --page-gutter: 8px;
    /* 全局边距稍微加大，增加呼吸感 */
    /* 现代卡片弥散阴影 */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03), 0 1px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px 0 rgba(0, 0, 0, 0.02);
    --shadow-md: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
}

/* --- 1. 基础页面和字体布局 --- */
html,
body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
    padding: var(--page-gutter);
    background-color: var(--bg-body);
    color: var(--text-color);
    font-size: 14px;
    box-sizing: border-box;
}

ul {
    list-style-type: none;
    padding-left: 20px;
}

li {
    padding: 4px 0;
}

/* --- 2. 主容器和头部 --- */
.toolbox-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: none;
}

.toolbox-header {
    padding: 0 0 15px 0;
    flex-shrink: 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: 20px;
}

/* --- 3. 标签页导航与内容区 --- */
.tab-navigation {
    display: flex;
    gap: 5px;
    margin-bottom: -1px;
    flex-shrink: 0;
}

.tab-button {
    padding: 8px 16px;
    font-size: 14px;
    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;
    white-space: nowrap;
}

.tab-button.active {
    background-color: white;
    color: var(--primary-color);
    border-top: 3px solid var(--primary-color);
    padding-top: 6px;
    /* 微调以匹配边框高度 */
}

.tab-content {
    background-color: var(--bg-card);
    padding: var(--page-gutter);
    border-radius: 0 8px 8px 8px;
    border: none;
    box-shadow: var(--shadow-sm);
    /* 卡片化关键阴影 */
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    margin-bottom: var(--page-gutter);
}

.tab-panel {
    display: none;
    width: 100%;
}

.tab-panel.active {
    display: flex;
}

/* --- 4. 高校库/专业目录/招生计划页 内部布局 --- */
.app-container {
    display: flex;
    flex-direction: row;
    gap: var(--page-gutter);
    height: 100%;
    width: 100%;
}

.left-panel,
.right-panel {
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* 招生计划页面 - 保持原有40%:60%比例 */
#app-container-plans .left-panel {
    width: 40%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
}

#app-container-plans .right-panel {
    width: 60%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
}

/* 高校库和专业目录页面 - 使用新的35%:65%比例 */
#app-container-universities .left-panel,
#app-container-majors .left-panel {
    width: 35%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
}

#app-container-universities .right-panel,
#app-container-majors .right-panel {
    width: 65%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
}

/* 确保未登录状态下也使用相同的布局 */
/* 覆盖index.html中的内联样式，确保未登录状态下也使用flex布局 */
body.logged-out .tab-content {
    display: flex !important;
    flex-grow: 1 !important;
    overflow: hidden !important;
}

body.logged-out .left-panel {
    width: 40% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

body.logged-out .right-panel {
    width: 60% !important;
    height: 100% !important;
    display: flex !important;
    flex-direction: column !important;
    flex-shrink: 0 !important;
    overflow: hidden !important;
}

/* 左侧筛选结果滚动框 */
.major-tree-container {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding: 10px;
    border-radius: 8px;
    overflow-y: auto;
    flex-grow: 1;
    min-height: 0;
    height: 100%;
    box-sizing: border-box;
}

/* 确保未登录状态下左侧面板也有滚动条 */
body.logged-out .major-tree-container {
    overflow-y: auto !important;
    height: 100% !important;
    flex-grow: 1 !important;
    min-height: 0 !important;
}

/* 右侧详情框 - 高校库和专业目录标签页共用 */
.details-content {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    padding: 10px;
    overflow-y: auto;
    height: 75%;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* 右侧输出框 - 高校库和专业目录标签页共用 */
.output-container {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    padding: 10px;
    border-radius: 8px;
    height: 25%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

/* 统一调整所有容器标题的边距为5px */
.details-content h3,
.output-header h3,
#plan-details-content h3,
#plan-chart-area h3,
#plan-output-container h3 {
    margin-top: 5px !important;
    margin-bottom: 5px !important;
    font-size: 18px;
    color: var(--primary-color);
}

/* 确保未登录状态下右侧面板也使用固定高度比例 */
body.logged-out .details-content {
    height: 75% !important;
    flex-shrink: 0 !important;
    overflow-y: auto !important;
}

body.logged-out .output-container {
    height: 25% !important;
    flex-shrink: 0 !important;
}

/* --- 5. 招生计划页 专属独立布局 --- */
/* 恢复原始布局 */
#app-container-plans {
    display: flex;
    flex-direction: row;
    gap: var(--page-gutter);
    height: 100%;
    width: 100%;
}

#app-container-plans .right-panel {
    display: flex;
    flex-direction: column;
    gap: var(--page-gutter);
    height: 100%;
}

/* 右侧上中下三部分高度比例 - 适配720P为33:42:25 */
#plan-details-content {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    padding-top: 5px;
    padding-right: 10px;
    padding-bottom: 10px;
    padding-left: 10px;
    overflow-y: hidden;
    height: 37%;
    min-height: 0;
    box-sizing: border-box;
}

#plan-chart-area {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    padding-top: 5px;
    padding-right: 15px;
    padding-bottom: 15px;
    padding-left: 15px;
    height: 40%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

#plan-output-container {
    border: 1px solid var(--border-color);
    background-color: var(--bg-card);
    box-shadow: var(--shadow-sm);
    border-radius: 8px;
    padding-top: 5px;
    padding-right: 10px;
    padding-bottom: 10px;
    padding-left: 10px;
    height: 23%;
    min-height: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* 确保图表自适应显示比例，不越界 */
#plan-chart-area canvas {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain;
}

/* --- 6. 通用组件样式 --- */
.controls-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    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[open] {
    z-index: 100;
}

/* 确保展开的菜单能够遮挡后面的其它 filter-group */
.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;
}

.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: 1;
}

/* 头部用户信息及按钮样式 */
.top-user-bar {
    font-size: 16px;
    margin-top: 5px;
    color: #666;
}

.visitor-text {
    margin-right: 15px;
}

.auth-btn {
    margin-left: 20px;
    padding: 5px 10px;
    cursor: pointer;
}

.switcher {
    display: flex;
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    overflow: hidden;
}

.switcher input[type="radio"] {
    display: none;
}

.switcher label {
    padding: 6px 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: 6px 18px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--primary-color), #4096ff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(22, 119, 255, 0.2);
    white-space: nowrap;
}

.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: #e6f4ff;
}

.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-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-shrink: 0;
    flex-wrap: wrap;
    row-gap: 4px;
}

.output-header h3 {
    margin: 0;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.quick-region-select {
    max-width: 120px;
    flex-shrink: 1;
    min-width: 0;
}

.output-button {
    padding: 6px 12px;
    font-size: 14px;
    background: linear-gradient(135deg, var(--primary-color), #4096ff);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(22, 119, 255, 0.2);
    white-space: nowrap;
}

.query-button.disabled,
.output-button.disabled {
    background: var(--button-disabled-bg);
    box-shadow: none;
    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: none;
}

.details-content p {
    margin: 0 0 4px 0;
    line-height: 1.5;
}

.details-content h3 {
    margin-top: 5px;
    margin-bottom: 5px;
    font-size: 18px;
    color: var(--primary-color);
}

/* 确保容器内第一行文本与容器边距保持5px */
.details-content> :first-child,
.output-header> :first-child,
#plan-details-content> :first-child,
#plan-chart-area> :first-child,
#plan-output-container> :first-child {
    margin-top: 5px !important;
}

.plan-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
    flex-shrink: 0;
}

.plan-interactive-controls {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: stretch;
    flex-shrink: 0;
}

.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;
}

.content-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #6c757d;
}

#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: auto;
}

.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 {
    max-width: 280px;
    min-width: 150px;
    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 {
    max-width: 350px;
    min-width: 150px;
    white-space: normal;
    word-break: break-all;
}

/* 专业简注 */

/* 自定义文字截断，限制最多显示3行，配合 title 属性展示完整内容 */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    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;
    /* 取消其在垂直方向上的弹性增长 */
}

/* 平板设备优化 */
@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 {
        margin-top: 10px;
    }

    .tab-navigation {
        overflow-x: auto;
        padding-bottom: 5px;
    }
}

/* 手机设备优化 */
@media (max-width: 768px) {
    body {
        padding: 4px;
        font-size: 12px;
    }

    .description {
        display: none;
    }

    /* 在手机端隐藏描述文本 */
    .toolbox-header h1 {
        font-size: 16px;
        margin-top: 2px;
    }

    .tab-button {
        padding: 6px 10px;
        font-size: 12px;
    }

    /* 确保招生计划标签页的所有容器在手机端都能正确显示 */
    #app-container-plans {
        flex-direction: column;
    }

    #app-container-plans .right-panel {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        margin-top: 8px;
        flex-grow: 1;
    }

    /* 为右侧面板的三个主要容器设置明确的显示属性和高度，解除硬性 max-height 限制 */
    #plan-details-content,
    #plan-chart-area,
    #plan-output-container {
        display: flex !important;
        flex-direction: column;
        height: auto !important;
        min-height: 180px !important;
        max-height: none;
    }

    /* 为图表区域设置合适的最小高度，手机端进一步拔高以容纳底部滑动条和横坐标文字 */
    #plan-chart-area {
        min-height: 360px !important;
    }

    /* 数据表格字体与内边距极度压缩 */
    .plan-list-view .list-cell {
        padding: 5px 6px;
        font-size: 11px;
    }

    #plan-details-content .detail-row,
    #plan-details-content .detail-item {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 2px;
    }

    #plan-details-content .detail-label,
    #plan-details-content .detail-value {
        font-size: 12px;
    }

    /* 解决宽表格在手机端的横向溢出问题 */
    .major-tree-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-controls {
        flex-wrap: wrap;
        gap: 6px;
    }

    .controls-toolbar {
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
    }

    .header-controls {
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 4px;
        overflow: hidden;
    }

    .top-user-bar {
        font-size: 13px !important;
        margin-top: 2px;
        width: 100%;
    }

    .welcome-text {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        flex: 1;
    }

    .visitor-text {
        margin-right: 5px !important;
        display: none;
    }

    /* 在手机端空间局促时隐藏访客数字 */
    .auth-btn {
        margin-left: 4px !important;
        padding: 4px 8px !important;
        font-size: 12px;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .header-controls .search-container {
        flex-wrap: wrap;
        gap: 6px;
    }

    .plan-interactive-controls {
        flex-wrap: wrap;
        gap: 6px;
        align-items: center;
    }

    .button-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .button-column .query-button,
    .button-column .switcher,
    .button-column .output-button {
        width: auto;
        flex-shrink: 0;
    }

    .switcher {
        margin: 0 4px;
    }

    .switcher label {
        padding: 5px 10px;
        font-size: 12px;
    }

    .input-column input,
    .input-column textarea {
        padding: 6px 8px;
        font-size: 12px;
    }

    .query-button,
    .output-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .details-content h3,
    .output-header h3,
    #plan-details-content h3,
    #plan-chart-area h3,
    #plan-output-container h3 {
        font-size: 15px;
    }

    /* 解决详情面板过度挤压换行的问题，强制应用样式 */
    #plan-details-content .detail-multi-row {
        flex-direction: column !important;
        gap: 4px !important;
    }

    #plan-details-content .detail-item {
        width: 100% !important;
        margin-right: 0 !important;
        margin-bottom: 2px !important;
    }

    #plan-details-content .detail-label {
        width: 80px !important;
        flex-shrink: 0 !important;
    }

    /* 解决三个图表挤成一团的问题（改为可左右滑动的大图） */
    #plan-chart-area .charts-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
        justify-content: flex-start !important;
    }

    /* 仅针对专业对比的三图表设置固定宽度，避免影响学校单张大图 */
    #plan-chart-area .charts-wrapper .chart-container {
        flex: 0 0 280px !important;
        min-width: 280px !important;
    }

    /* 解决底部意向城市与意向计划被压扁（字变竖排）的问题，改为上下排列 */
    #plan-output-container>div {
        flex-direction: column !important;
        gap: 10px !important;
        height: auto !important;
    }

    #plan-output-container>div>div {
        flex: none !important;
        width: 100% !important;
    }

    #intended-cities-list {
        min-height: 60px;
        max-height: 120px;
    }

    #plan-output-textarea {
        min-height: 120px;
    }

    /* 确保所有内容在小屏幕上正确显示，解除全屏高度锁定允许页面整体滚动 */
    html,
    body {
        overflow-y: auto;
        height: auto;
        min-height: 100%;
    }

    .tab-content {
        height: auto;
        min-height: 80vh;
        overflow: visible;
    }

    body.logged-out .left-panel,
    body.logged-out .right-panel,
    body:not(.logged-out) .left-panel,
    body:not(.logged-out) .right-panel {
        display: flex !important;
        flex-direction: column;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
}

/* 选考科目要求表格样式 */
.table-container {
    overflow-x: auto;
    margin-top: 10px;
    border-radius: 5px;
    border: 1px solid #ddd;
}

.subject-requirements-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.subject-requirements-table th {
    background-color: #f2f2f2;
    padding: 10px;
    text-align: left;
    border-bottom: 2px solid #ddd;
    font-weight: bold;
}

.subject-requirements-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: top;
}

.subject-requirements-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.subject-requirements-table tr:hover {
    background-color: #f5f5f5;
}

/* Premium CSS Toggle Switch and Results Alignment */
.results-message-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.toggle-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #4b5563;
    cursor: pointer;
    user-select: none;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 38px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle-switch input:checked + .toggle-slider {
    background-color: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(18px);
}

/* 防止2026当年招生计划多列列表在低分辨率下拥挤，支持优雅的横向滚动 */
#plans-current-tab .plan-list-view {
    min-width: 1550px;
}

/* 7选科折叠网格布局 */
.subject-grid-current {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
    padding: 10px;
    background-color: #f8fafc;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}
.subject-grid-current .subject-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
    user-select: none;
}
.subject-grid-current .subject-item input[type="checkbox"] {
    transform: scale(1.15);
    cursor: pointer;
}

/* 后台导出配置样式 */
.export-config-table-container {
    max-height: none;
    overflow-y: auto;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    background-color: white;
}
.export-config-table-container table {
    width: 100%;
    border-collapse: collapse;
}
.export-config-table-container th {
    position: sticky;
    top: 0;
    background-color: #f1f5f9;
    color: #334155;
    font-weight: 600;
    border-bottom: 2px solid #cbd5e1;
    padding: 10px;
    text-align: left;
    font-size: 13px;
}
.export-config-table-container td {
    padding: 8px 12px;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
}
.export-config-table-container tr:hover {
    background-color: #f8fafc;
}
.export-config-table-container input[type="text"] {
    width: 90%;
    padding: 6px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 13px;
    color: #1e293b;
    transition: all 0.2s;
}
.export-config-table-container input[type="text"]:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

/* 导出 Excel 按钮 */
.export-button {
    padding: 6px 14px;
    border: 1px solid #28a745;
    background-color: #28a745;
    color: white;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.export-button:hover:not(:disabled) {
    background-color: #218838;
    border-color: #1e7e34;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.export-button:active:not(:disabled) {
    transform: translateY(0);
}
.export-button:disabled {
    background-color: #e2e8f0 !important;
    border-color: #cbd5e1 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}