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

html {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    background: #f0f4f8;
    color: #333;
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    background: linear-gradient(135deg, #1a3a6b 0%, #2b5ea7 50%, #1a3a6b 100%);
    color: #fff;
    padding: 7px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    flex-shrink: 0;
}

.header-logo {
    width: 4.2em;
    height: 4.2em;
    flex-shrink: 0;
    display: block;
}

.header-sep {
    width: 2px;
    height: 3em;
    background: currentColor;
    opacity: 0.4;
    margin: 0 0.6em 0 0.6em;
    flex-shrink: 0;
}

.header-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-left: 0.8em;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 26px;
}

.header h1 {
    font-size: 26px;
    font-weight: 600;
    letter-spacing: 2px;
}

.header .subtitle {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 6px;
}

.nav-bar {
    background: #fff;
    border-bottom: 1px solid #e0e4ea;
    display: flex;
    flex-shrink: 0;
}

.nav-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 20px;
}

.nav-link {
    padding: 15px 16px;
    white-space: nowrap;
    text-decoration: none;
    color: #444;
    font-size: 15px;
    font-weight: 600;
    position: relative;
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #2b5ea7;
    transition: width 0.25s ease;
    border-radius: 2px;
}

.nav-link:hover {
    color: #1a3a6b;
    background: #eef3fc;
}

.nav-link.active {
    color: #2b5ea7;
    font-weight: 700;
    background: #e6edf7;
}

.nav-link.active::after {
    width: 100%;
    height: 3px;
    background: #1a3a6b;
}

.main-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-gutter: stable;
}

.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 26px;
}

.filter-card {
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    width: 160px;
    height: 38px;
    background: #fff;
    transition: border-color 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: #2b5ea7;
    box-shadow: 0 0 0 3px rgba(43,94,167,0.1);
}

.filter-group input {
    width: 200px;
}

.btn-primary, .btn-secondary {
    padding: 8px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    height: 38px;
}

.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 12px;
    align-items: center;
    min-height: 38px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 3px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: #2b5ea7;
}

/* Dropdown multi-select (科目要求 style) */
.dropdown-multi{position:relative;min-width:200px}
.dropdown-multi-trigger{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;border:1px solid #d0d5dd;border-radius:6px;font-size:14px;height:38px;background:#fff;cursor:pointer;transition:border-color .2s;gap:8px;user-select:none;box-sizing:border-box}
.dropdown-multi-trigger:hover,.dropdown-multi-trigger.open{border-color:#2b5ea7;box-shadow:0 0 0 3px rgba(43,94,167,.1)}
.dropdown-multi-text{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#333;flex:1}
.dropdown-multi-text.placeholder{color:#999}
.dropdown-multi-arrow{font-size:12px;color:#888;transition:transform .2s;flex-shrink:0}
.dropdown-multi-trigger.open .dropdown-multi-arrow{transform:rotate(180deg)}
.dropdown-multi-panel{display:none;position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #d0d5dd;border-radius:6px;box-shadow:0 4px 16px rgba(0,0,0,.12);z-index:100;padding:6px;max-height:260px;overflow-y:auto}
.dropdown-multi-panel.open{display:block}
.dropdown-multi-item{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:4px;cursor:pointer;font-size:13px;color:#555;transition:background .1s;user-select:none}
.dropdown-multi-item:hover{background:#f0f4ff}
.dropdown-multi-item input[type=checkbox]{width:15px;height:15px;accent-color:#2b5ea7;cursor:pointer}
.dropdown-multi-item input:checked+.subject-label{color:#1a3a6b;font-weight:600}
.dropdown-multi-item input[value="不限"]:checked+.subject-label{color:#00acc1;font-weight:700}
.dropdown-multi-item input[value="历史"]:checked+.subject-label{color:#8e44ad}
.dropdown-multi-item input[value="地理"]:checked+.subject-label{color:#2980b9}
.dropdown-multi-item input[value="政治"]:checked+.subject-label{color:#c0392b}
.dropdown-multi-item input[value="物理"]:checked+.subject-label{color:#e74c3c}
.dropdown-multi-item input[value="化学"]:checked+.subject-label{color:#e67e22}
.dropdown-multi-item input[value="生物"]:checked+.subject-label{color:#27ae60}

/* Multi-select dropdown (original, deprecated) */
.msel {
    position: relative;
    min-width: 200px;
    max-width: 200px;
}

.msel-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 8px;
    border: 1px solid #d0d5dd;
    border-radius: 6px;
    font-size: 14px;
    height: 38px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
    user-select: none;
}

.msel-trigger:hover {
    border-color: #a0a8b4;
}

.msel.open .msel-trigger {
    border-color: #2b5ea7;
    box-shadow: 0 0 0 3px rgba(43,94,167,0.1);
}

.msel-label {
    color: #999;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.msel-label.has-value {
    color: #333;
}

.msel-arrow {
    font-size: 12px;
    color: #888;
    margin-left: 8px;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.msel.open .msel-arrow {
    transform: rotate(180deg);
}

.msel-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: #fff;
    border: 1px solid #d0d5dd;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    padding: 4px 0;
}

.msel.open .msel-menu {
    display: block;
}

.msel-item {
    cursor: pointer;
}

.msel-item label {
    display: inline-block;
    padding: 3px 6px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    user-select: none;
    border-radius: 3px;
    white-space: nowrap;
}

.msel-item label:hover {
    background: #e8edf5;
}

.msel-item input[type="checkbox"] {
    width: 12px;
    height: 12px;
    accent-color: #2b5ea7;
    margin: 0;
    vertical-align: middle;
}

.btn-primary {
    background: #2b5ea7;
    color: #fff;
}

.btn-primary:hover {
    background: #1a4a8a;
}

.btn-secondary {
    background: #e8ecf1;
    color: #555;
}

.btn-secondary:hover {
    background: #d5dbe3;
}

.result-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    overflow: hidden;
}

.result-header, .result-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: #f8f9fb;
    border-bottom: 1px solid #e8ecf1;
}

.result-footer {
    border-bottom: none;
    border-top: 1px solid #e8ecf1;
}

#resultCount {
    font-size: 14px;
    color: #666;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    background: #f0f4f8;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #d5dbe3;
    white-space: nowrap;
    font-size: 13px;
}

thead th:first-child {
    padding-left: 16px;
}

tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
    color: #555;
    font-size: 13px;
}

td.empty {
    text-align: center;
    color: #999;
    padding: 48px 16px;
    font-size: 15px;
}

/* Tree table rows */
.tree-row {
    cursor: pointer;
}

.tree-row:hover {
    background: #f0f3ff;
}

.college-row td {
    background: #e8edf5;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid #d0d8e6;
}

.college-row .college-name {
    color: #1a3a6b;
    font-size: 14px;
}

.record-row td {
    background: #f5f7fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e4e8ef;
}

.record-row .col-year,
.record-row .col-batch {
    color: #555;
    font-size: 13px;
}

.major-row td {
    background: #fff;
    padding: 6px 12px;
}

.major-row .col-major-code {
    color: #888;
    font-size: 12px;
}

.major-row .col-major-name {
    color: #333;
}

.major-row .col-plan,
.major-row .col-admitted {
    text-align: center;
    font-weight: 500;
}

.col-year { text-align: center; width: 60px; }
.col-batch { width: 140px; }
.col-score { text-align: center; font-weight: 600; color: #2b5ea7; }
.col-rank { text-align: right; }

.toggle-icon {
    display: inline-block;
    width: 16px;
    font-size: 10px;
    color: #888;
    margin-right: 4px;
    transition: transform 0.15s;
}

.badge {
    display: inline-block;
    background: #d5e0f0;
    color: #2b5ea7;
    font-size: 11px;
    font-weight: 500;
    padding: 1px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

.indent-dot {
    display: inline-block;
    width: 12px;
}

.major-row td {
    font-size: 13px;
    color: #555;
}

.major-row .col-major-name {
    color: #333;
    padding-left: 52px !important;
}

.major-row .col-plan,
.major-row .col-admitted {
    text-align: center;
    font-weight: 500;
}

.record-row .col-major-group {
    padding-left: 28px !important;
}

.pagination {
    display: flex;
    gap: 4px;
    align-items: center;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid #d0d5dd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    transition: all 0.2s;
}

.pagination button:hover {
    background: #e8ecf1;
    border-color: #b0b8c4;
}

.pagination button.active {
    background: #2b5ea7;
    color: #fff;
    border-color: #2b5ea7;
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: default;
}

.pagination .page-info {
    font-size: 13px;
    color: #666;
    padding: 0 8px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding-top: 60px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #fff;
    border-radius: 10px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e8ecf1;
    background: #f8f9fb;
    border-radius: 10px 10px 0 0;
}

.modal-header h2 {
    font-size: 18px;
    color: #1a3a6b;
}

.close {
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.close:hover {
    color: #333;
}

.modal-body {
    padding: 20px 24px;
}

/* Detail table in modal */
.detail-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}

.detail-table th {
    background: #f0f4f8;
    padding: 8px 12px;
    text-align: left;
    font-weight: 600;
    color: #444;
    border-bottom: 2px solid #d5dbe3;
    white-space: nowrap;
}

.detail-table td {
    padding: 8px 12px;
    border-bottom: 1px solid #f0f2f5;
    color: #555;
}

.detail-table tbody tr:hover {
    background: #f0f3ff;
}

.score-highlight {
    font-weight: 600;
    color: #2b5ea7;
}

@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
    }

    .filter-group select,
    .filter-group input {
        min-width: 100%;
        width: 100%;
    }

    .btn-primary, .btn-secondary {
        flex: 1;
    }
}

.footer {
    background: #fff;
    border-top: 1px solid #e0e4ea;
    padding: 12px 0;
    flex-shrink: 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 26px;
    text-align: center;
    font-size: 13px;
    color: #999;
}

/* Floating notification box */
.notification-float {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 360px;
    max-width: calc(100vw - 48px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 32px rgba(0,0,0,0.18);
    z-index: 9999;
    padding: 18px 20px;
    animation: notifFadeIn .35s ease;
    border-left: 4px solid #2b5ea7;
}

@keyframes notifFadeIn {
    from { opacity: 0; transform: translate(-50%, -50%) scale(.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.notification-float-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.notification-float-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a3a6b;
}

.notification-float-close {
    cursor: pointer;
    font-size: 22px;
    color: #bbb;
    line-height: 1;
    transition: color .2s;
}

.notification-float-close:hover {
    color: #555;
}

.notification-float-body {
    font-size: 14px;
    color: #333;
    line-height: 1.7;
    margin-bottom: 14px;
    max-height: 300px;
    overflow-y: auto;
    word-break: break-word;
}

.notification-float-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #f0f2f5;
    padding-top: 12px;
}

.notification-float-btn {
    font-size: 12px;
    cursor: pointer;
    color: #888;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 5px 14px;
    transition: all .2s;
}

.notification-float-btn:hover {
    background: #eee;
    color: #555;
}

/* Device suggestion floating bar */
.device-float {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 6px 30px rgba(0,0,0,0.2);
    z-index: 9998;
    padding: 24px 36px;
    animation: deviceFadeIn .4s ease;
    border: 1px solid #e0e4ea;
    min-width: 320px;
    max-width: calc(100vw - 32px);
}

.device-float-body {
    display: flex;
    align-items: center;
    gap: 12px;
}

.device-float-icon {
    font-size: 28px;
    flex-shrink: 0;
}

.device-float-text {
    font-size: 15px;
    color: #333;
    line-height: 1.5;
    font-weight: 500;
}

.device-float-countdown {
    font-size: 13px;
    color: #999;
    margin-left: 4px;
    white-space: nowrap;
}

@keyframes deviceFadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@media (max-width: 480px) {
    .notification-float {
        top: 50%;
        left: 12px;
        right: 12px;
        width: auto;
        max-width: none;
        transform: translateY(-50%);
    }
    @keyframes notifFadeIn {
        from { opacity: 0; transform: translateY(-50%) scale(.95); }
        to { opacity: 1; transform: translateY(-50%) scale(1); }
    }
}
