:root {
    --brand: #165dff;
    --brand-dark: #0b3fb3;
    --brand-soft: #edf4ff;
    --ink: #172033;
    --muted: #667085;
    --line: #e4eaf2;
    --surface: #ffffff;
    --bg: #f5f8fc;
    --success: #087f5b;
    --warning: #b45309;
    --shadow: 0 18px 50px rgba(33, 60, 115, 0.09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 10% 0%, rgba(22, 93, 255, 0.09), transparent 28rem),
        var(--bg);
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    padding-top: 64px;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }

body > nav {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 1000;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid var(--line);
    box-shadow: 0 14px 28px rgba(33, 60, 115, .12);
}
.mobile-menu.active { display: block; }
.mobile-menu a {
    display: block;
    padding: 10px 12px;
    border-radius: 9px;
    color: #344054;
    text-decoration: none;
}
.mobile-menu a:hover { color: var(--brand); background: var(--brand-soft); }

.app-container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    padding: 48px 0 30px;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.6fr);
    gap: 30px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--brand-dark);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(22, 93, 255, 0.16);
    font-size: 13px;
    font-weight: 700;
}

.hero h1 {
    margin: 16px 0 12px;
    max-width: 760px;
    font-size: clamp(30px, 5vw, 52px);
    line-height: 1.12;
    letter-spacing: -0.04em;
}

.hero h1 span { color: var(--brand); }
.hero-copy {
    margin: 0;
    max-width: 750px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.85;
}

.hero-note {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    color: #475467;
    font-size: 14px;
}
.hero-note i { color: var(--success); margin-top: 4px; }

.stats-panel {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 18px;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 22px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(16px);
}

.stat-card {
    min-height: 104px;
    padding: 18px;
    border-radius: 16px;
    background: #f8faff;
    border: 1px solid var(--line);
}
.stat-card strong {
    display: block;
    color: var(--brand-dark);
    font-size: 28px;
    line-height: 1;
}
.stat-card span {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 13px;
}

.query-panel {
    position: sticky;
    top: 74px;
    z-index: 20;
    margin-bottom: 24px;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(221, 229, 241, 0.95);
    box-shadow: 0 12px 34px rgba(33, 60, 115, 0.08);
    backdrop-filter: blur(16px);
}

.search-line {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.search-control { position: relative; }
.search-control i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #98a2b3;
}
.search-control input {
    width: 100%;
    height: 50px;
    padding: 0 44px;
    border: 1px solid var(--line);
    border-radius: 14px;
    outline: none;
    color: var(--ink);
    background: #fbfcfe;
    transition: .2s ease;
}
.search-control input:focus {
    border-color: rgba(22, 93, 255, 0.65);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(22, 93, 255, 0.1);
}
.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 10px;
    color: #98a2b3;
    background: transparent;
    cursor: pointer;
}
.search-clear:hover { color: var(--brand); background: var(--brand-soft); }

.primary-btn, .secondary-btn, .text-btn {
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: .18s ease;
}
.primary-btn {
    padding: 0 20px;
    color: #fff;
    background: var(--brand);
    font-weight: 700;
    box-shadow: 0 10px 22px rgba(22, 93, 255, .2);
}
.primary-btn:hover { background: var(--brand-dark); transform: translateY(-1px); }
.secondary-btn {
    padding: 0 16px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-weight: 650;
}
.secondary-btn:hover { background: #dfeaff; }
.text-btn { padding: 0 8px; color: var(--brand); background: transparent; }

.filter-grid {
    display: grid;
    grid-template-columns: 1fr 1.15fr .72fr .78fr .82fr 1.28fr;
    gap: 12px;
    margin-top: 14px;
}
.filter-field label {
    display: block;
    margin: 0 0 6px 2px;
    color: #475467;
    font-size: 12px;
    font-weight: 650;
}
.filter-field select {
    width: 100%;
    height: 42px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
    color: #344054;
    background: #fff;
}
.filter-field select:focus { border-color: var(--brand); }

.active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 14px;
}
.active-filters:empty { display: none; }
.filter-chip {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    padding: 6px 9px 6px 11px;
    border-radius: 999px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 12px;
}
.filter-chip button {
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--brand-dark);
    background: #d6e4ff;
    cursor: pointer;
}

.section-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 22px 0 16px;
}
.result-title h2 { margin: 0; font-size: 24px; }
.result-title p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.tabs {
    display: inline-flex;
    gap: 4px;
    padding: 4px;
    border-radius: 12px;
    background: #eaf0f8;
}
.tab-btn {
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    color: #475467;
    background: transparent;
    font-weight: 650;
    cursor: pointer;
}
.tab-btn.active { color: var(--brand-dark); background: #fff; box-shadow: 0 3px 10px rgba(33,60,115,.08); }

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}
.major-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 288px;
    padding: 20px;
    border-radius: 18px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(33, 60, 115, .05);
    transition: .2s ease;
}
.major-card:hover { transform: translateY(-3px); border-color: rgba(22, 93, 255, .38); box-shadow: var(--shadow); }
.major-card.featured { border-color: rgba(245, 158, 11, .34); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.school-name { margin: 0; font-size: 13px; color: #475467; font-weight: 650; }
.badge-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}
.badge-blue { color: #155eef; background: #eff4ff; }
.badge-green { color: #067647; background: #ecfdf3; }
.badge-amber { color: #b54708; background: #fffaeb; }
.badge-gray { color: #475467; background: #f2f4f7; }
.major-name {
    margin: 13px 0 16px;
    font-size: 21px;
    line-height: 1.35;
    letter-spacing: -.02em;
}
.price-line {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
    padding: 13px 0;
    border-top: 1px solid #eef1f5;
    border-bottom: 1px solid #eef1f5;
}
.price-line small, .course-count small { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.price-line strong { color: var(--brand-dark); font-size: 17px; line-height: 1.45; }
.course-count { text-align: right; }
.price-line-single { grid-template-columns: minmax(0, 1fr); }
.filter-field[hidden] { display: none; }
.info-row[hidden], .detail-card[hidden] { display: none; }
.course-count strong { font-size: 18px; }
.meta-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
    margin: 13px 0 0;
    color: #475467;
    font-size: 12px;
}
.meta-list span { overflow-wrap: anywhere; }
.meta-list i { width: 17px; color: #98a2b3; }
.recommend-reason {
    margin: 13px 0 0;
    padding: 10px 12px;
    border-radius: 11px;
    color: #7a2e0e;
    background: #fffbeb;
    font-size: 12px;
    line-height: 1.55;
}
.degree-advantage {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 13px 0 0;
    padding: 10px 12px;
    border: 1px solid #a7f3d0;
    border-radius: 11px;
    color: #065f46;
    background: linear-gradient(135deg, #ecfdf5 0%, #f0fdfa 100%);
    font-size: 12px;
    line-height: 1.45;
}
.degree-advantage i { color: #059669; font-size: 15px; }
.degree-advantage strong { display: block; margin-bottom: 1px; color: #047857; font-size: 11px; }
.card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    margin-top: auto;
    padding-top: 16px;
}
.card-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 44px;
    color: var(--brand);
    font-size: 13px;
    font-weight: 750;
    text-decoration: none;
}
.exam-subject-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid #c7d8ff;
    border-radius: 10px;
    color: var(--brand-dark);
    background: var(--brand-soft);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}
.exam-subject-link:hover { border-color: var(--brand); background: #e2edff; }
.exam-subject-link:focus-visible, .card-link:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }
.exam-subjects-action { margin-top: 18px; }
.exam-subjects-action[hidden] { display: none; }

.load-more-wrap { display: flex; justify-content: center; padding: 26px 0 46px; }
.load-more-wrap .secondary-btn { min-width: 180px; }

.state-panel {
    grid-column: 1 / -1;
    padding: 56px 20px;
    text-align: center;
    border: 1px dashed #cbd5e1;
    border-radius: 18px;
    background: rgba(255,255,255,.65);
    color: var(--muted);
}
.state-panel i { display: block; margin-bottom: 12px; color: #aab5c5; font-size: 30px; }
.skeleton { animation: pulse 1.2s infinite ease-in-out; }
@keyframes pulse { 0%,100% { opacity:.45; } 50% { opacity:1; } }

.disclaimer {
    margin: 10px 0 44px;
    padding: 16px 18px;
    border-left: 4px solid #f59e0b;
    border-radius: 10px;
    color: #7a4b10;
    background: #fffbeb;
    font-size: 13px;
    line-height: 1.7;
}

.back-to-top {
    position: fixed;
    right: 20px;
    bottom: 20px;
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: var(--brand);
    box-shadow: 0 12px 24px rgba(22,93,255,.24);
    opacity: 0;
    visibility: hidden;
    cursor: pointer;
    transition: .2s ease;
    z-index: 50;
}
.back-to-top.visible { opacity: 1; visibility: visible; }

/* 详情页 */
.detail-page { padding: 34px 0 52px; }
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 18px;
    color: var(--muted);
    font-size: 13px;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.detail-hero {
    padding: 26px;
    border-radius: 22px;
    color: #fff;
    background: linear-gradient(135deg, #0b3fb3, #165dff 58%, #4387ff);
    box-shadow: 0 20px 44px rgba(22,93,255,.2);
}
.detail-hero .badge { background: rgba(255,255,255,.16); color: #fff; }
.detail-hero h1 { margin: 16px 0 8px; font-size: clamp(28px,5vw,42px); }
.detail-hero p { margin: 0; color: rgba(255,255,255,.8); }
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
    gap: 18px;
    margin-top: 18px;
}
.detail-main, .detail-aside { display: flex; flex-direction: column; gap: 18px; }
.detail-card {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 22px rgba(33,60,115,.04);
}
.detail-card h2 { margin: 0 0 16px; font-size: 18px; }
.fee-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.fee-item { min-height: 106px; padding: 15px; border-radius: 13px; background: #f8faff; border: 1px solid #e8eef8; }
.fee-item small { display: block; margin-bottom: 8px; color: var(--muted); }
.fee-item strong { display: block; color: var(--brand-dark); line-height: 1.55; }
.fee-item p { margin: 6px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.info-list { display: grid; gap: 0; margin: 0; }
.info-row { display: grid; grid-template-columns: 116px minmax(0,1fr); gap: 15px; padding: 13px 0; border-top: 1px solid #eef1f5; }
.info-row:first-child { border-top: 0; padding-top: 0; }
.info-row:last-child { padding-bottom: 0; }
.info-row dt { color: var(--muted); }
.info-row dd { margin: 0; line-height: 1.75; white-space: pre-line; overflow-wrap: anywhere; }
.recommend-card { border-color: rgba(245,158,11,.35); background: #fffcf2; }
.recommend-card h2 { color: #92400e; }
.recommend-card p { margin: 0; color: #7c4b13; line-height: 1.75; }
.similar-list { display: grid; gap: 9px; }
.similar-link { display: block; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; text-decoration: none; transition: .18s; }
.similar-link:hover { border-color: var(--brand); background: var(--brand-soft); }
.similar-link strong { display: block; font-size: 13px; }
.similar-link span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

@media (max-width: 960px) {
    .hero-grid, .detail-grid { grid-template-columns: 1fr; }
    .stats-panel { max-width: 560px; }
    .filter-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
    .query-panel { position: static; }
}

@media (max-width: 720px) {
    body { padding-top: 58px; }
    .app-container { width: min(100% - 22px, 1180px); }
    .hero { padding: 30px 0 22px; }
    .hero-grid { gap: 20px; }
    .hero h1 { margin-top: 13px; }
    .hero-copy { font-size: 14px; line-height: 1.75; }
    .stats-panel { padding: 12px; }
    .stat-card { min-height: 88px; padding: 14px; }
    .stat-card strong { font-size: 24px; }
    .query-panel { padding: 14px; border-radius: 16px; }
    .search-line { grid-template-columns: 1fr; }
    .search-line .primary-btn { display: none; }
    .filter-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
    .filter-field:first-child { grid-column: 1 / -1; }
    .section-toolbar { align-items: flex-start; flex-direction: column; }
    .tabs { width: 100%; }
    .tab-btn { flex: 1; padding: 0 8px; }
    .result-grid { grid-template-columns: 1fr; }
    .major-card { min-height: 0; padding: 17px; }
    .major-name { font-size: 19px; }
    .price-line { align-items: center; }
    .price-line strong { font-size: 15px; }
    .detail-page { padding-top: 18px; }
    .detail-hero { padding: 21px; border-radius: 18px; }
    .detail-card { padding: 18px; }
    .fee-grid { grid-template-columns: 1fr; }
    .info-row { grid-template-columns: 96px minmax(0,1fr); gap: 10px; font-size: 13px; }
}

@media (max-width: 390px) {
    .filter-grid { grid-template-columns: 1fr; }
    .filter-field:first-child { grid-column: auto; }
    .card-top { display: block; }
    .badge-row { justify-content: flex-start; margin-top: 9px; }
    .price-line { grid-template-columns: 1fr; }
    .course-count { text-align: left; }
}
