:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --text-primary: #333;
    --text-secondary: #666;
    --text-muted: #999;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --bg-white: #fff;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #f8fafc;
    color: var(--text-primary);
    line-height: 1.6;
    padding-left: 220px;
    padding-bottom: 40px;
}

/* ==================== 左侧侧边栏 ==================== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    background: #ffffff;
    border-right: 1px solid rgba(59, 130, 246, 0.15);
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.06);
    z-index: 999;
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

/* Logo区域 */
.sidebar-logo {
    padding: 12px 10px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-logo .logo-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sidebar-logo .logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

/* ==================== 筛选区块 ==================== */
.filter-section {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 4px;
}

.category-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.filter-label.sub-label {
    font-weight: 500;
    color: #64748b;
    font-size: 12px;
    margin-top: 10px;
    margin-bottom: 4px;
}

/* 通用输入框 */
input.form-control-sm, select.form-select-sm {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
    color: #334155;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

input.form-control-sm:focus, select.form-select-sm:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input.form-control-sm::placeholder {
    color: #94a3b8;
}

/* 省份下拉选择器 */
.region-combobox {
    position: relative;
}

.region-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 200px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 10;
}

.region-dropdown.open {
    display: block;
}

.region-option {
    padding: 8px 10px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.15s;
}

.region-option:hover, .region-option.highlighted {
    background: #eff6ff;
    color: #3b82f6;
}

.region-group-label {
    padding: 6px 10px;
    font-size: 11px;
    color: #94a3b8;
    font-weight: 600;
    background: #f8fafc;
    border-top: 1px solid #f0f0f0;
}

.region-no-result {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.mode-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 500;
}

.mode-tag.blue { background: #eff6ff; color: #3b82f6; }
.mode-tag.gold { background: #fffbeb; color: #f59e0b; }
.mode-tag.gray { background: #f3f4f6; color: #6b7280; }

.match-highlight {
    color: #2563eb;
    font-weight: 600;
}

/* ==================== 分数/位次切换按钮 ==================== */
.score-mode-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 6px;
}

.toggle-btn {
    flex: 1;
    padding: 4px 3px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-family: inherit;
}

.toggle-btn:hover {
    color: #3b82f6;
}

.toggle-btn.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* ==================== 分数区间输入框 ==================== */
.range-input-group {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
}

.range-input-group .range-num {
    flex: 1;
    text-align: center;
    font-weight: 600;
    padding: 5px 3px;
}

.range-input-group .range-num::placeholder {
    font-weight: 400;
    font-size: 10px;
}

.range-input-group .range-sep {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 600;
}

/* ==================== 选科区域 ==================== */
.subject-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.subject-tag {
    padding: 4px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fff;
    user-select: none;
}

.subject-tag:hover {
    border-color: #3b82f6;
    color: #3b82f6;
}

.subject-tag.selected {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.subject-tag[data-type="required"].selected {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.subject-label {
    font-size: 12px;
    color: #64748b;
    margin-bottom: 4px;
    display: block;
}

/* ==================== 专业类复选框 ==================== */
.search-box-sm {
    position: relative;
    margin-bottom: 8px;
}

.search-box-sm input {
    width: 100%;
    padding: 6px 28px 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    background: #f8fafc;
    color: #334155;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.search-box-sm input:focus {
    border-color: #3b82f6;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-box-sm input::placeholder {
    color: #94a3b8;
}

.search-icon-sm {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    color: #94a3b8;
    pointer-events: none;
}

.checkbox-all-row {
    padding: 2px 0 6px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 4px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #334155;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 13px;
    height: 13px;
}

.checkbox-list {
    max-height: 420px;
    overflow-y: auto;
    padding-right: 2px;
}

.checkbox-list::-webkit-scrollbar {
    width: 4px;
}
.checkbox-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 2px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    font-size: 11px;
    color: #64748b;
    cursor: pointer;
}

.checkbox-item:hover {
    color: #3b82f6;
}

.checkbox-item input[type="checkbox"] {
    accent-color: #3b82f6;
    width: 12px;
    height: 12px;
    flex-shrink: 0;
}


.loading-sm {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 10px;
}

/* ==================== 院校属性筛选 - 折叠面板 ==================== */
.attr-collapse {
    margin-bottom: 4px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    overflow: hidden;
}

.attr-collapse-header {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 8px;
    background: #f8fafc;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s;
}

.attr-collapse-header:hover {
    background: #f1f5f9;
}

.attr-arrow {
    font-size: 10px;
    color: #94a3b8;
    transition: transform 0.2s ease;
    width: 12px;
    text-align: center;
    flex-shrink: 0;
}

.attr-arrow.collapsed {
    transform: rotate(-90deg);
}

.attr-title {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
    flex: 1;
}

.attr-all {
    flex-shrink: 0;
    font-size: 11px;
}

.attr-all input[type="checkbox"] {
    width: 12px;
    height: 12px;
}

.attr-list {
    max-height: 150px;
    padding: 2px 8px 4px 8px;
}

.attr-list.collapsed {
    display: none;
}

/* ==================== 显示模式切换 ==================== */
.display-mode-toggle {
    display: flex;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px;
    margin-bottom: 8px;
}

.dm-btn {
    flex: 1;
    padding: 5px 4px;
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 12px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
    font-family: inherit;
}

.dm-btn:hover {
    color: #3b82f6;
}

.dm-btn.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* ==================== 查询按钮 ==================== */
.btn-search {
    width: 100%;
    padding: 8px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-family: inherit;
}

.btn-search:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-search:active {
    transform: translateY(0);
}

/* ==================== 右侧主内容区 ==================== */
.main-content {
    padding: 16px 20px;
}

/* 结果统计栏 - sticky 固定在顶部 */
.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #ffffff;
    border-radius: 6px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-wrap: wrap;
    gap: 8px;
}

.stats-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.stats-text {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
}

.stats-text strong {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
}

/* 选择操作区 */
.selection-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.selection-count {
    font-size: 13px;
    font-weight: 600;
    color: #3b82f6;
    white-space: nowrap;
}

.btn-generate-rec {
    padding: 6px 14px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
    font-family: inherit;
    white-space: nowrap;
}

.btn-generate-rec:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.btn-generate-rec.generating {
    background: #94a3b8;
    cursor: not-allowed;
    opacity: 0.85;
    pointer-events: none;
}
.btn-generate-rec.generating:hover {
    background: #94a3b8;
    box-shadow: none;
    transform: none;
}
.rec-spin {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: recSpin .6s linear infinite;
    vertical-align: middle;
    margin-right: 5px;
}
@keyframes recSpin {
    to { transform: rotate(360deg); }
}

.btn-clear-rec {
    padding: 6px 12px;
    background: #fff;
    color: #64748b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.btn-clear-rec:hover {
    border-color: #ef4444;
    color: #ef4444;
    background: #fef2f2;
}

/* ==================== 结果卡片 ==================== */
.result-card {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 6px;
    padding: 10px 14px;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border: 1px solid #f0f0f0;
    transition: all 0.2s ease;
}

.result-card:hover {
    box-shadow: var(--shadow);
    border-color: #e2e8f0;
}

/* 左侧序号 */
.card-left {
    flex-shrink: 0;
    width: 32px;
    text-align: center;
}

.card-num {
    width: 24px;
    height: 24px;
    line-height: 24px;
    border-radius: 5px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* 中间主信息 */
.card-main {
    flex: 1;
    min-width: 0;
    padding: 0 12px;
}

.card-school {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1px;
    cursor: pointer;
}

.card-school:hover {
    color: #3b82f6;
}

.card-major-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.card-major {
    font-size: 12px;
    color: #334155;
}

.card-group {
    font-size: 10px;
    color: #64748b;
    background: #f1f5f9;
    padding: 1px 5px;
    border-radius: 3px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #94a3b8;
}

.meta-item {
    white-space: nowrap;
}

.meta-divider {
    color: #e2e8f0;
}

.tag-batch {
    color: #3b82f6;
    font-weight: 500;
}

/* 右侧数据列 */
.card-data {
    flex-shrink: 0;
    display: flex;
    gap: 18px;
    text-align: center;
}

.data-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 52px;
}

.data-label {
    font-size: 10px;
    color: #94a3b8;
    margin-bottom: 1px;
}

.data-value {
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.data-value.score {
    color: #3b82f6;
}

.data-value.rank {
    color: #334155;
}

.data-value.good {
    color: #10b981;
}

.data-value.bad {
    color: #ef4444;
}

/* ==================== 分页 ==================== */
.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 14px;
    padding: 8px 0;
}

.pagination-wrapper .page-btn {
    padding: 5px 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #334155;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.pagination-wrapper .page-btn:hover:not(:disabled) {
    border-color: #3b82f6;
    color: #3b82f6;
}

.pagination-wrapper .page-btn.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}

.pagination-wrapper .page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-wrapper .page-info {
    font-size: 12px;
    color: #64748b;
    padding: 0 6px;
}

/* ==================== 院校合并卡片 ==================== */
.school-group-card {
    display: block;
    padding: 10px 14px 8px 14px;
}

.school-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.school-header .card-num {
    flex-shrink: 0;
}

.school-title {
    cursor: pointer;
}

.school-title:hover {
    color: #3b82f6;
}

.school-college-code {
    font-size: 11px;
    font-weight: 500;
    color: #475569;
    background: #f1f5f9;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.school-type-tag {
    font-size: 11px;
    font-weight: 500;
    color: #059669;
    background: #ecfdf5;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.school-level-tag {
    font-size: 11px;
    font-weight: 500;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.school-feature-tag {
    font-size: 11px;
    font-weight: 500;
    color: #d97706;
    background: #fffbeb;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.school-location {
    font-size: 11px;
    font-weight: 400;
    color: #64748b;
    margin-left: 6px;
}

.school-city-level {
    font-size: 11px;
    font-weight: 500;
    color: #2563eb;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 4px;
    margin-left: 4px;
}

.school-major-count {
    font-size: 11px;
    font-weight: 400;
    color: #94a3b8;
    margin-left: 4px;
}

/* 专业子行 */
.major-sub-row {
    display: flex;
    align-items: center;
    padding: 5px 0 5px 34px;
    border-top: 1px solid #e8ecf0;
    font-size: 12px;
    gap: 8px;
    flex-wrap: wrap;
    transition: background 0.15s ease;
}

.major-sub-row:hover {
    background: #eff6ff;
}

.major-sub-row:first-of-type {
    margin-top: 2px;
}

/* 不同专业组之间的分隔线 */
.major-sub-row.group-start {
    border-top-color: #94a3b8;
}

.major-sub-name {
    font-weight: 500;
    color: #334155;
    width: 140px;
    flex-shrink: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 学科评估等级徽章 */
.disc-level-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    padding: 0 4px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
    flex-shrink: 0;
}

.disc-level-badge.level-a-plus { background: #dc2626; color: #fff; }
.disc-level-badge.level-a      { background: #ef4444; color: #fff; }
.disc-level-badge.level-a-minus { background: #f97316; color: #fff; }
.disc-level-badge.level-b-plus { background: #eab308; color: #fff; }
.disc-level-badge.level-b      { background: #22c55e; color: #fff; }
.disc-level-badge.level-b-minus { background: #14b8a6; color: #fff; }
.disc-level-badge.level-c-plus { background: #3b82f6; color: #fff; }
.disc-level-badge.level-c      { background: #6366f1; color: #fff; }
.disc-level-badge.level-c-minus { background: #8b5cf6; color: #fff; }
.disc-level-badge.level-d-plus { background: #94a3b8; color: #fff; }
.disc-level-badge.level-d      { background: #64748b; color: #fff; }

.major-sub-group {
    font-size: 11px;
    color: #3b82f6;
    background: #eff6ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    width: 90px;
    flex-shrink: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.major-sub-code {
    font-size: 11px;
    color: #8b5cf6;
    background: #f5f3ff;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 500;
    width: 90px;
    flex-shrink: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.major-sub-meta {
    font-size: 11px;
    color: #94a3b8;
    white-space: nowrap;
    flex-shrink: 0;
}

.major-sub-remark {
    font-size: 11px;
    color: #f59e0b;
    margin-left: 4px;
    cursor: pointer;
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.major-sub-remark .remark-red {
    color: #ef4444;
    font-weight: 600;
}

.major-sub-remark .remark-green {
    color: #059669;
    font-weight: 600;
}

.major-sub-spacer {
    flex: 1;
    min-width: 8px;
}

.major-sub-scores {
    display: flex;
    gap: 14px;
    flex-shrink: 0;
    text-align: center;
    align-items: center;
}

.score-year {
    font-size: 11px;
    color: #334155;
    min-width: 90px;
    text-align: center;
    white-space: nowrap;
}

.score-sep {
    color: #cbd5e1;
    font-weight: 400;
}

.sub-score {
    font-weight: 600;
    color: #1e293b;
    min-width: 36px;
}

.sub-rank {
    color: #64748b;
    min-width: 40px;
}

.sub-diff {
    font-weight: 600;
    min-width: 30px;
}

.sub-diff.good {
    color: #10b981;
}

.sub-diff.bad {
    color: #ef4444;
}

/* ==================== 行选中复选框 ==================== */
.major-select-check {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    margin-left: auto;
    padding-left: 8px;
}

.major-select-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.major-select-check input[type="checkbox"]:hover {
    border-color: #3b82f6;
    background: #eff6ff;
}

.major-select-check input[type="checkbox"]:checked {
    background: #3b82f6;
    border-color: #3b82f6;
}

.major-select-check input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 4px;
    top: 1px;
    width: 6px;
    height: 10px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* ==================== 推荐单弹窗 ==================== */
.rec-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.rec-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 1000px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.25s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.rec-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.rec-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 6px;
}

.rec-modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.rec-modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.rec-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.rec-modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
}

.rec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.rec-table th {
    background: #f8fafc;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    color: #475569;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
    position: sticky;
    top: -16px;
    z-index: 1;
}

.rec-table td {
    padding: 7px 10px;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    vertical-align: middle;
}

.rec-table tr:hover td {
    background: #f8fafc;
}

.rec-table .rec-school {
    font-weight: 600;
    color: #1e293b;
}

.rec-table .rec-score {
    font-weight: 600;
    color: #3b82f6;
}

.rec-table .rec-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.rec-badge.good {
    background: #ecfdf5;
    color: #059669;
}

.rec-badge.bad {
    background: #fef2f2;
    color: #dc2626;
}

/* 推荐单 - 院校信息内联标签 */
.rec-table .rec-code {
    font-size: 10px;
    color: #475569;
    background: #f1f5f9;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 4px;
    font-weight: 500;
}

.rec-table .rec-type-tag {
    font-size: 10px;
    color: #059669;
    background: #ecfdf5;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 3px;
    font-weight: 500;
}

.rec-table .rec-level-tag {
    font-size: 10px;
    color: #7c3aed;
    background: #f5f3ff;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 3px;
    font-weight: 500;
}

.rec-table .rec-feature-tag {
    font-size: 10px;
    color: #d97706;
    background: #fffbeb;
    padding: 0 4px;
    border-radius: 3px;
    margin-left: 2px;
    white-space: nowrap;
    font-weight: 500;
}

.rec-table .rec-city-level {
    font-size: 10px;
    color: #2563eb;
    background: #eff6ff;
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 500;
    white-space: nowrap;
}

.rec-table .rec-major-name {
    font-weight: 500;
    color: #1e293b;
    white-space: nowrap;
}

.rec-table .td-school-info {
    white-space: nowrap;
    min-width: 160px;
}

.rec-table .td-features {
    max-width: 120px;
    white-space: nowrap;
}

.rec-table .td-remark {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.rec-table .td-city-level {
    white-space: nowrap;
}

/* 推荐单备注颜色 */
.rec-table .remark-red {
    color: #ef4444;
    font-weight: 600;
}

.rec-table .remark-green {
    color: #059669;
    font-weight: 600;
}

/* 推荐单表头居中 */
.rec-table th {
    text-align: center;
}

/* ==================== 导出Excel按钮 ==================== */
.btn-export-excel {
    padding: 6px 14px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
    font-family: inherit;
    white-space: nowrap;
}

.btn-export-excel:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

/* ==================== 智能填报按钮 ==================== */
.btn-smart-fill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 6px rgba(139, 92, 246, 0.25);
    font-family: inherit;
    white-space: nowrap;
    margin-left: 10px;
}

.btn-smart-fill:hover {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    box-shadow: 0 4px 10px rgba(139, 92, 246, 0.35);
    transform: translateY(-1px);
}

/* ==================== 智能填报对话框 ==================== */
.smart-fill-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.smart-fill-dialog {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    width: 420px;
    max-width: 90%;
    animation: slideUp 0.25s ease;
}

.smart-fill-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
}

.smart-fill-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.smart-fill-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.smart-fill-body {
    padding: 20px;
}

.sf-field {
    margin-bottom: 14px;
}

.sf-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.sf-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    color: #334155;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
}

.sf-field input:focus {
    border-color: #8b5cf6;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.sf-hint {
    margin-top: 16px;
    padding: 12px;
    background: #f5f3ff;
    border-radius: 8px;
    font-size: 12px;
    color: #7c3aed;
    line-height: 1.8;
}

.smart-fill-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #e2e8f0;
}

/* 智能填报结果 - 冲/稳/保 标签 */
.sf-level-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.sf-level-tag.rush { background: #ef4444; }
.sf-level-tag.steady { background: #f59e0b; }
.sf-level-tag.safe { background: #10b981; }

/* 省份规则信息卡片 */
.sf-rule-card {
    background: linear-gradient(135deg, #eff6ff 0%, #eef2ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 16px;
}

.sf-rule-card.sf-rule-unknown {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border-color: #fcd34d;
}

.sf-rule-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e40af;
    margin-bottom: 8px;
}

.sf-rule-unknown .sf-rule-title {
    color: #92400e;
}

.sf-rule-mode {
    font-size: 13px;
    color: #475569;
    margin-bottom: 6px;
}

.sf-rule-mode strong {
    color: #3b82f6;
}

.sf-rule-detail {
    font-size: 14px;
    color: #1e293b;
    margin-bottom: 6px;
    padding: 8px 12px;
    background: rgba(59, 130, 246, 0.08);
    border-radius: 6px;
}

.sf-rule-detail strong {
    color: #3b82f6;
    font-size: 16px;
}

.sf-rule-note {
    font-size: 12px;
    color: #64748b;
    line-height: 1.6;
}

.sf-rule-unknown .sf-rule-note {
    color: #92400e;
}

/* 手动设置切换链接 */
.sf-manual-link {
    display: inline-block;
    font-size: 12px;
    color: #64748b;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
    margin-left: 12px;
}

.sf-manual-link:hover {
    color: #3b82f6;
}

/* ==================== 加载动画 ==================== */
.loading {
    text-align: center;
    padding: 60px;
}

.spinner-border {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--primary-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 40px;
    margin-bottom: 12px;
}

/* ==================== 返回顶部 ==================== */
#backToTop {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    background: #3b82f6;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(59, 130, 246, 0.35);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

#backToTop.show {
    opacity: 1;
    visibility: visible;
}

#backToTop:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.45);
}

/* ==================== 响应式 ==================== */
@media (max-width: 768px) {
    body {
        padding-left: 0;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        max-height: 50vh;
        border-right: none;
        border-bottom: 1px solid rgba(59, 130, 246, 0.15);
    }

    .main-content {
        padding: 12px;
    }

    .data-table {
        font-size: 12px;
    }

    .data-table th, .data-table td {
        padding: 6px 4px;
    }

    .data-table .col-college {
        min-width: 80px;
    }

    .data-table .col-major {
        min-width: 100px;
    }
}

/* ==================== 专业名称悬浮卡片 ==================== */
.major-name-tooltip {
    position: fixed;
    z-index: 99999;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease;
    white-space: nowrap;
    max-width: none;
    line-height: 1.4;
}

.major-name-tooltip.visible {
    opacity: 1;
}

/* 卡片小三角箭头 */
.major-name-tooltip::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
}

.major-name-tooltip.arrow-top::before {
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-bottom: 8px solid #ffffff;
}

.major-name-tooltip.arrow-bottom::before {
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    border-top: 8px solid #ffffff;
}

@media (max-width: 576px) {
    .data-table {
        font-size: 11px;
    }

    .btn-search {
        font-size: 13px;
        padding: 8px 12px;
    }
}

/* ==================== 访问口令弹框 ==================== */
.access-password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.access-password-dialog {
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    width: 380px;
    max-width: 90%;
    overflow: hidden;
    animation: slideUp 0.25s ease;
}

.access-password-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 22px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
}

.access-password-header svg {
    flex-shrink: 0;
}

.access-password-body {
    padding: 22px;
}

.access-password-desc {
    margin: 0 0 14px 0;
    font-size: 13px;
    color: #64748b;
    line-height: 1.5;
}

.access-password-input-wrap {
    position: relative;
    width: 100%;
}

.access-password-input {
    width: 100%;
    padding: 11px 14px;
    padding-right: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    outline: none;
    transition: all 0.25s ease;
    font-family: inherit;
    letter-spacing: 2px;
}

.access-password-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.access-password-display {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: none;
    background: transparent;
}

.access-password-real {
    position: relative;
    z-index: 2;
    color: transparent;
    background: transparent;
    caret-color: #3b82f6;
}

.access-password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    z-index: 3;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #64748b;
    cursor: pointer;
    transition: all 0.2s ease;
}

.access-password-toggle:hover {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}




.access-password-error {
    min-height: 20px;
    margin-top: 10px;
    font-size: 12px;
    color: #ef4444;
    font-weight: 500;
}

.access-password-attempts {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.access-password-attempts.attempts-danger {
    color: #ef4444;
    font-weight: 600;
}

.access-password-footer {
    padding: 0 22px 22px 22px;
    display: flex;
    justify-content: flex-end;
}

.access-password-btn {
    padding: 9px 24px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
    font-family: inherit;
}

.access-password-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.35);
    transform: translateY(-1px);
}

.access-password-btn:disabled {
    background: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ==================== 院校卡片折叠 ==================== */
.school-group-card.collapsed .major-sub-row {
    display: none;
}

/* ==================== 折叠开关（右侧顶部） ==================== */
.collapse-toggle-group {
    display: flex;
    align-items: center;
}

.collapse-switch {
    position: relative;
    display: inline-block;
    width: 64px;
    height: 24px;
    flex-shrink: 0;
    cursor: pointer;
}

.collapse-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.collapse-slider {
    position: absolute;
    inset: 0;
    background-color: #94a3b8;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}

.collapse-slider::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 3px;
    width: 18px;
    height: 18px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    z-index: 1;
}

.collapse-slider::after {
    content: '关闭';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 11px;
    color: #fff;
    font-weight: 500;
    letter-spacing: 0.5px;
    white-space: nowrap;
    line-height: 1;
}

.collapse-switch input:not(:checked) + .collapse-slider {
    background-color: #3b82f6;
}

.collapse-switch input:not(:checked) + .collapse-slider::before {
    transform: translateX(40px);
}

.collapse-switch input:not(:checked) + .collapse-slider::after {
    content: '展开';
    right: auto;
    left: 8px;
    color: #fff;
}

/* ==================== 院校搜索框 ==================== */
.school-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.school-search-input {
    width: 160px;
    height: 28px;
    padding: 0 28px 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 14px;
    font-size: 12px;
    color: #374151;
    background: #f9fafb;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.school-search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.15);
    background: #fff;
}

.school-search-input::placeholder {
    color: #9ca3af;
}

.school-search-icon {
    position: absolute;
    right: 8px;
    display: flex;
    align-items: center;
    color: #9ca3af;
    pointer-events: none;
    line-height: 1;
}

.collapse-toggle {
    flex-shrink: 0;
    font-size: 11px;
    color: #94a3b8;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    margin-left: auto;
    padding-left: 8px;
}

.school-group-card:not(.collapsed) .collapse-toggle {
    transform: rotate(90deg);
    color: #3b82f6;
}

