:root {
    --bg: #f6f7f3;
    --bg-soft: #eef4f0;
    --surface: #ffffff;
    --surface-muted: #f8faf7;
    --surface-strong: #eef7f3;
    --line: #d8e0d9;
    --line-strong: #b9c8be;
    --text: #1d2528;
    --text-muted: #667276;
    --text-soft: #879196;
    --primary: #0f766e;
    --primary-strong: #0b5f59;
    --primary-soft: #dff3ee;
    --accent: #2563eb;
    --accent-soft: #dbeafe;
    --success: #16803a;
    --success-soft: #dcfce7;
    --warning: #b7791f;
    --warning-soft: #fef3c7;
    --danger: #b91c1c;
    --danger-soft: #fee2e2;
    --dark: #25323a;
    --radius: 8px;
    --shadow-sm: 0 1px 2px rgba(18, 32, 26, 0.06);
    --shadow-md: 0 12px 28px rgba(18, 32, 26, 0.08);
    --focus: 0 0 0 0.22rem rgba(15, 118, 110, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body,
body.bg-light,
.app-body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(238, 244, 240, 0.72) 0, rgba(246, 247, 243, 0) 260px),
        var(--bg) !important;
    color: var(--text);
    font-family: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: 0;
}

a {
    color: var(--primary);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

a:hover {
    color: var(--primary-strong);
}

p {
    line-height: 1.65;
}

.text-muted,
.form-text {
    color: var(--text-muted) !important;
}

.text-primary {
    color: var(--primary) !important;
}

.text-info {
    color: var(--accent) !important;
}

.text-success {
    color: var(--success) !important;
}

.text-warning {
    color: var(--warning) !important;
}

.text-danger {
    color: var(--danger) !important;
}

/* Layout */
.app-navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom: 1px solid rgba(216, 224, 217, 0.92);
    backdrop-filter: blur(14px);
    box-shadow: 0 1px 0 rgba(18, 32, 26, 0.04);
}

.app-navbar-inner {
    min-height: 64px;
}

.app-brand,
.navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text) !important;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-mark,
.icon-tile {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(15, 118, 110, 0.18);
}

.icon-tile-muted {
    background: #eef2f7;
    color: #475569;
    border-color: #d6dde6;
}

.icon-tile-dark {
    background: #e8edf0;
    color: var(--dark);
    border-color: #cad4da;
}

.nav-link {
    color: var(--text-muted) !important;
    font-weight: 650;
    border-radius: 6px;
    padding-inline: 0.75rem !important;
}

.nav-link:hover,
.nav-link:focus {
    color: var(--primary) !important;
    background: var(--primary-soft);
}

.dropdown-menu {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.dropdown-item {
    color: var(--text);
    font-weight: 500;
}

.dropdown-item:hover {
    background: var(--primary-soft);
    color: var(--primary-strong);
}

.navbar-toggler {
    border: 1px solid var(--line-strong);
    border-radius: 6px;
}

.navbar-toggler:focus {
    box-shadow: var(--focus);
}

.navbar-toggler-icon,
.navbar-dark .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2830, 41, 45, 0.82%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.app-container {
    max-width: 1420px;
    padding-top: 28px;
    padding-bottom: 48px;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.page-header-compact {
    margin-bottom: 1.15rem;
}

.page-header h1,
.chat-header h1,
.auth-header h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.65rem, 2.6vw, 2.35rem);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: 0;
}

.page-subtitle {
    max-width: 760px;
    margin: 0.45rem 0 0;
    color: var(--text-muted);
    font-size: 1rem;
}

.eyebrow,
.card-kicker {
    margin: 0 0 0.28rem;
    color: var(--primary);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.header-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 36px;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.status-dot {
    width: 0.55rem;
    height: 0.55rem;
    display: inline-block;
    border-radius: 50%;
}

.status-dot-ok {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(22, 128, 58, 0.12);
}

.header-actions,
.chat-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* Bootstrap component reset */
.card,
.data-panel,
.decision-card,
.tool-card,
.auth-panel,
.chat-panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.card {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-header,
.card-footer,
.bg-white {
    background: var(--surface) !important;
}

.card-header {
    border-bottom-color: var(--line);
}

.hover-card:hover,
.tool-card:hover,
.decision-card:hover {
    border-color: var(--line-strong);
    box-shadow: var(--shadow-md);
}

.btn {
    border-radius: 6px;
    font-weight: 750;
    letter-spacing: 0;
}

.btn-lg {
    padding: 0.72rem 1rem;
    font-size: 1rem;
}

.btn-sm {
    border-radius: 6px;
}

.btn-primary,
.btn-info {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-info:hover,
.btn-info:focus {
    background: var(--primary-strong);
    border-color: var(--primary-strong);
    color: #fff;
}

.btn-dark {
    background: var(--dark);
    border-color: var(--dark);
}

.btn-dark:hover,
.btn-dark:focus {
    background: #172329;
    border-color: #172329;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-danger {
    background: var(--danger);
    border-color: var(--danger);
}

.btn-outline-primary {
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.46);
}

.btn-outline-primary:hover,
.btn-outline-primary:focus,
.btn-check:checked + .btn-outline-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    color: #52606a;
    border-color: #c8d2d7;
}

.btn-outline-secondary:hover,
.btn-outline-secondary:focus {
    background: #52606a;
    border-color: #52606a;
    color: #fff;
}

.btn-outline-success {
    color: var(--success);
    border-color: rgba(22, 128, 58, 0.44);
}

.btn-outline-success:hover,
.btn-outline-success:focus {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
}

.btn-outline-warning {
    color: var(--warning);
    border-color: rgba(183, 121, 31, 0.48);
}

.btn-outline-warning:hover,
.btn-outline-warning:focus {
    background: var(--warning);
    border-color: var(--warning);
    color: #fff;
}

.btn-outline-danger {
    color: var(--danger);
    border-color: rgba(185, 28, 28, 0.42);
}

.btn-outline-danger:hover,
.btn-outline-danger:focus {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}

.form-control,
.form-select {
    min-height: 42px;
    border-color: #cbd6cf;
    border-radius: 6px;
    background-color: #fff;
    color: var(--text);
    font-weight: 500;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: var(--focus);
}

.form-label {
    margin-bottom: 0.35rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 750;
}

.form-check-input {
    border-color: #aebbb4;
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

.form-check-input:focus {
    border-color: var(--primary);
    box-shadow: var(--focus);
}

.input-group .btn {
    min-height: 42px;
}

.alert {
    border-radius: var(--radius);
    border-width: 1px;
}

.alert-info {
    background: var(--accent-soft);
    border-color: #bfdbfe;
    color: #1e3a8a;
}

.alert-success {
    background: var(--success-soft);
    border-color: #bbf7d0;
    color: #14532d;
}

.alert-warning {
    background: var(--warning-soft);
    border-color: #fde68a;
    color: #78350f;
}

.alert-danger {
    background: var(--danger-soft);
    border-color: #fecaca;
    color: #7f1d1d;
}

.badge {
    border-radius: 4px;
    font-weight: 800;
}

.text-bg-info,
.bg-info,
.badge.bg-info {
    background-color: var(--accent-soft) !important;
    color: #1d4ed8 !important;
}

.text-bg-secondary,
.bg-secondary,
.badge.bg-secondary {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
}

.text-bg-warning,
.bg-warning,
.badge.bg-warning {
    background-color: var(--warning-soft) !important;
    color: #78350f !important;
}

.text-bg-success,
.bg-success,
.badge.bg-success {
    background-color: var(--success-soft) !important;
    color: #14532d !important;
}

.text-bg-danger,
.bg-danger,
.badge.bg-danger {
    background-color: var(--danger-soft) !important;
    color: #7f1d1d !important;
}

.bg-primary,
.badge.bg-primary {
    background-color: var(--primary) !important;
    color: #fff !important;
}

.border-info,
.border-info-subtle {
    border-color: #bfdbfe !important;
}

.border-success {
    border-color: #bbf7d0 !important;
}

.border-dark,
.border-dark-subtle {
    border-color: #cbd5e1 !important;
}

.progress {
    height: 8px;
    border-radius: 999px;
    background-color: #dbe5df;
    overflow: hidden;
}

.progress-bar {
    background-color: var(--primary);
}

/* Dashboard */
.dashboard-shell {
    width: 100%;
}

.decision-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
    gap: 1rem;
}

.decision-card {
    padding: 1.25rem;
}

.decision-card-primary {
    min-height: 260px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(180deg, rgba(223, 243, 238, 0.88), rgba(255, 255, 255, 0.96)),
        var(--surface);
}

.decision-card-head,
.tool-card-top,
.profile-readout-head,
.data-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.decision-card h2,
.data-panel h2,
.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: 1.25rem;
    font-weight: 800;
}

.decision-card p,
.tool-card p {
    margin: 0.75rem 0 1rem;
    color: var(--text-muted);
}

.decision-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0.75rem 0 1.1rem;
}

.decision-meta-row span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.55rem;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 650;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin-bottom: 1rem;
}

.profile-summary-grid div {
    min-width: 0;
    padding: 0.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.profile-summary-grid span,
.report-summary-grid span {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.profile-summary-grid strong,
.report-summary-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 0.96rem;
}

.meter-group {
    display: grid;
    gap: 0.8rem;
    margin: 0.75rem 0 1.1rem;
}

.meter-label {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
    font-size: 0.86rem;
    font-weight: 750;
}

.meter-track {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #dfe7e2;
}

.meter-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.meter-fill-secondary {
    background: var(--accent);
}

.empty-panel {
    display: grid;
    justify-items: center;
    align-content: center;
    min-height: 180px;
    padding: 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface-muted);
    text-align: center;
}

.empty-panel i {
    margin-bottom: 0.75rem;
    color: var(--primary);
    font-size: 1.75rem;
}

.empty-panel h3 {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 800;
}

.empty-panel p {
    max-width: 460px;
    margin: 0.35rem 0 1rem;
    color: var(--text-muted);
}

.empty-panel-large {
    min-height: 360px;
    border: 0;
    border-radius: 0;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin: 1.35rem 0 0.8rem;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.tool-card {
    padding: 1.1rem;
}

.tool-card h3 {
    margin: 0.9rem 0 0;
    color: var(--text);
    font-size: 1.2rem;
    font-weight: 800;
}

.tool-card-strict .icon-tile {
    background: #edf1f3;
    color: var(--dark);
    border-color: #d3dde2;
}

.tool-stack {
    display: grid;
    gap: 1rem;
}

.compact-tool {
    padding: 1rem;
}

.preview-mode-note {
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.75rem;
    border: 1px solid #fde68a;
    border-radius: 6px;
    background: var(--warning-soft);
    color: #78350f;
    font-size: 0.9rem;
    font-weight: 750;
}

.tool-icon {
    width: 76px;
    height: 76px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background: var(--primary-soft);
    color: var(--primary);
    border: 1px solid rgba(15, 118, 110, 0.18);
    font-size: 2.15rem;
}

.tool-icon-sm {
    width: 58px;
    height: 58px;
    font-size: 1.55rem;
}

.tool-icon-dark {
    background: #e8edf0;
    color: var(--dark);
    border-color: #cad4da;
}

.major-choice-entry-card,
.major-choice-panel {
    border-radius: var(--radius);
}

.major-choice-shell {
    padding-bottom: 2rem;
}

.card .display-1,
.card .display-4 {
    color: var(--primary);
}

/* Data panels and tables */
.data-panel {
    overflow: hidden;
}

.data-panel-header {
    align-items: center;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.data-panel-header .eyebrow {
    margin-bottom: 0.18rem;
}

.app-table {
    --bs-table-bg: var(--surface);
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: #f2f7f4;
    margin: 0;
}

.app-table thead,
.table-light {
    --bs-table-bg: #edf5f1;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
}

.app-table th {
    color: #42515a;
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.app-table td {
    color: var(--text);
}

/* Major choice */
.major-layout {
    display: grid;
    grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.major-sidebar {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 108px);
    overflow: auto;
    scrollbar-width: thin;
}

.major-sidebar .data-panel {
    overflow: visible;
}

.major-choice-panel {
    border-radius: var(--radius);
}

.major-results .data-panel {
    min-height: 640px;
}

.results-header {
    position: sticky;
    top: 65px;
    z-index: 5;
}

.stacked-form {
    padding: 1rem;
}

.stacked-form fieldset {
    min-width: 0;
    margin: 0 0 1rem;
    padding: 0 0 1rem;
    border: 0;
    border-bottom: 1px solid var(--line);
}

.stacked-form fieldset:last-of-type {
    border-bottom: 0;
}

.stacked-form legend {
    float: none;
    width: auto;
    margin-bottom: 0.75rem;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 850;
}

.mode-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.mode-toggle .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: normal;
}

.subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 0.55rem;
}

.subject-grid .form-check {
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem 0.35rem 1.7rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.subject-grid .form-check-input {
    margin-left: -1.2rem;
}

.riasec-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.45rem;
}

.riasec-grid .form-label {
    margin-bottom: 0.25rem;
    font-weight: 850;
}

.major-filter-picker {
    position: relative;
}

.major-filter-details {
    width: 100%;
}

.major-filter-details[open] .major-filter-trigger {
    border-color: #8cb9a7;
    box-shadow: 0 0 0 0.2rem rgba(67, 122, 96, 0.12);
}

.major-filter-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: calc(1.5em + 0.75rem + 2px);
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: #fff;
    color: var(--text);
    cursor: pointer;
    list-style: none;
}

.major-filter-trigger::-webkit-details-marker {
    display: none;
}

.major-filter-trigger::after {
    content: "\f078";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.major-filter-trigger-label {
    font-weight: 700;
}

.major-filter-trigger-text {
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.major-filter-dropdown {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    right: 0;
    z-index: 20;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.5rem;
    background: var(--surface);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
}

.major-filter-dropdown-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.45rem;
}

.major-filter-options {
    display: grid;
    gap: 0.35rem;
    max-height: 220px;
    margin-top: 0.65rem;
    overflow-y: auto;
}

.major-filter-option {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.5rem;
    border-radius: 0.35rem;
    cursor: pointer;
}

.major-filter-option:hover {
    background: var(--surface-muted);
}

.major-filter-empty {
    padding: 0.75rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.88rem;
    text-align: center;
}

.major-choice-table-toolbar {
    display: grid;
    gap: 0.45rem;
}

.major-choice-table {
    min-width: 1550px;
}

.major-choice-table-fixed {
    table-layout: fixed;
}

.major-choice-table-fixed .col-seq {
    width: 3.125%;
    max-width: 3.125%;
}

.major-choice-table-fixed th:not(.col-seq),
.major-choice-table-fixed td:not(.col-seq) {
    width: calc(96.875% / 7);
}

.major-choice-table tbody tr {
    cursor: pointer;
    border-bottom: 1px solid #e5e7eb;
}

.major-choice-table td {
    vertical-align: top;
    font-size: 0.92rem;
}

.major-choice-table .col-seq {
    text-align: center;
    white-space: nowrap;
}

.match-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.55rem;
    align-items: center;
    margin-bottom: 0.35rem;
}

.match-bar-track {
    height: 0.5rem;
    overflow: hidden;
    border-radius: 999px;
    background: #eceff1;
}

.match-bar-fill {
    height: 100%;
    border-radius: inherit;
    min-width: 0.2rem;
}

.match-bar-label {
    min-width: 2.3rem;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 800;
}

/* Sparkline mini chart */
.sparkline {
    display: inline-block;
    vertical-align: middle;
    cursor: help;
}
.sparkline circle {
    transition: r 0.15s ease;
}
.sparkline:hover circle {
    r: 3.5;
}

.row-menu-btn {
    width: 2rem;
    height: 2rem;
    flex: 0 0 2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.major-choice-context-menu {
    position: fixed;
    z-index: 1080;
    width: 176px;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.major-choice-context-menu button {
    width: 100%;
    min-height: 36px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--text);
    text-align: left;
    font-size: 0.9rem;
}

.major-choice-context-menu button:hover {
    background: var(--surface-muted);
}

.major-choice-tutorial-copy {
    max-width: 760px;
    margin: 0 auto 1rem;
    text-align: center;
}

.major-choice-tutorial-copy h4,
.major-choice-tutorial-copy div {
    text-align: center;
}

.major-choice-tutorial-image-wrap {
    display: flex;
    justify-content: center;
}

.major-choice-tutorial-image {
    max-height: 62vh;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.preference-list {
    display: grid;
    gap: 0.65rem;
}

.preference-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.8rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

/* 学校详情弹窗 */
.detail-section-title {
    font-size: 1rem;
    font-weight: 750;
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.detail-qa-block {
    margin-bottom: 0.8rem;
}

.detail-question {
    font-weight: 650;
    color: var(--primary-strong);
    margin-bottom: 0.3rem;
    font-size: 0.92rem;
}

.detail-answer {
    padding: 0.35rem 0.65rem;
    margin-bottom: 0.25rem;
    border-left: 3px solid var(--primary-soft);
    background: var(--surface-muted);
    border-radius: 0 4px 4px 0;
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text);
}

.detail-frag-group {
    margin-bottom: 0.8rem;
}

.detail-frag-question {
    font-weight: 650;
    color: var(--text);
    margin-bottom: 0.3rem;
    font-size: 0.88rem;
}

.detail-frag-text {
    padding: 0.3rem 0.65rem;
    margin-bottom: 0.2rem;
    border-left: 3px solid var(--line-strong);
    background: var(--surface);
    border-radius: 0 4px 4px 0;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
}

.detail-frag-text .badge {
    font-size: 0.7rem;
    font-weight: 500;
    vertical-align: middle;
    margin-left: 0.3rem;
}

.detail-feature-table {
    font-size: 0.88rem;
}

.detail-feature-table th {
    white-space: nowrap;
    font-size: 0.78rem;
    font-weight: 750;
    color: var(--text-muted);
    text-transform: none;
    letter-spacing: normal;
}

.detail-feature-table td {
    vertical-align: middle;
}

#schoolDetailModal .modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

.risk-badge {
    display: inline-flex;
    min-width: 2.5rem;
    justify-content: center;
    padding: 0.22rem 0.45rem;
    border-radius: 4px;
    color: #fff;
    font-weight: 850;
    font-size: 0.8rem;
}

.risk-冲 {
    background: var(--danger);
}

.risk-稳 {
    background: var(--success);
}

.risk-保 {
    background: var(--accent);
}

.risk-未知 {
    background: #64748b;
}

.sem-chip {
    display: inline-block;
    margin: 0.13rem 0.08rem;
    padding: 0.12rem 0.38rem;
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 800;
    white-space: nowrap;
    cursor: help;
}

.sem-chip-pos {
    background: var(--success-soft);
    color: #14532d;
}

.sem-chip-neg {
    background: var(--danger-soft);
    color: #7f1d1d;
}

.sem-chip-warn {
    background: var(--warning-soft);
    color: #78350f;
}

.sem-chip-rare {
    background: var(--accent-soft);
    color: #1d4ed8;
}

/* Resume */
.resume-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.75fr);
    gap: 1rem;
}

.resume-layout .data-panel {
    padding-bottom: 1rem;
}

.resume-layout .data-panel > :not(.data-panel-header) {
    margin-left: 1rem;
    margin-right: 1rem;
}

.notice-box,
.profile-readout {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
    color: var(--text-muted);
}

.notice-box {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.profile-readout-head {
    align-items: center;
    margin-bottom: 0.75rem;
}

.upload-form {
    padding-top: 0.25rem;
}

/* Auth */
.auth-shell {
    min-height: calc(100vh - 150px);
    display: grid;
    place-items: center;
    padding: 2rem 0;
}

.auth-panel {
    width: min(100%, 430px);
    padding: 1.35rem;
}

.auth-panel-wide {
    width: min(100%, 480px);
}

.auth-header {
    margin-bottom: 1.2rem;
    text-align: center;
}

.auth-header .icon-tile {
    margin-bottom: 0.8rem;
}

.auth-header .eyebrow {
    margin-bottom: 0.25rem;
}

.captcha-row {
    display: grid;
    grid-template-columns: minmax(0, 170px) 42px;
    gap: 0.55rem;
    align-items: stretch;
}

.captcha-image {
    width: 170px;
    height: 54px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.captcha-refresh {
    min-width: 42px;
    padding-inline: 0;
}

/* Chat */
.chat-shell {
    min-height: calc(100vh - 112px);
}

.chat-panel {
    position: relative;
    min-height: calc(100vh - 128px);
    display: grid;
    grid-template-rows: auto minmax(360px, 1fr) auto;
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.chat-header h1 {
    font-size: 1.18rem;
}

.chat-box {
    min-height: 0;
    overflow-y: auto;
    padding: 1.15rem;
    background:
        linear-gradient(180deg, rgba(248, 250, 247, 0.88), rgba(255, 255, 255, 0.94)),
        var(--surface-muted);
    display: flex;
    flex-direction: column;
}

.chat-footer {
    padding: 0.95rem 1rem;
    border-top: 1px solid var(--line);
    background: var(--surface);
}

.chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.55rem;
    align-items: end;
}

.chat-input-row textarea {
    max-height: 150px;
}

.chat-message {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    max-width: min(88%, 820px);
    margin-bottom: 1rem;
}

.chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-assistant {
    align-self: flex-start;
}

.chat-message .avatar {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.chat-user .avatar {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.message-container {
    min-width: 0;
}

.chat-message .content {
    overflow-wrap: anywhere;
    padding: 0.8rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--text);
    line-height: 1.65;
    box-shadow: var(--shadow-sm);
}

.chat-user .content {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chat-assistant .content {
    background: #fff;
}

.message-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.35rem;
    padding-left: 0.15rem;
}

.message-actions .btn-link {
    color: var(--text-muted);
}

.message-actions .btn-link:hover {
    color: var(--primary);
}

.function-progress-wrap {
    max-width: min(92%, 760px);
}

.thinking-indicator-wrap {
    max-width: min(72%, 420px);
}

.thinking-indicator-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.thinking-indicator-label {
    font-weight: 750;
    color: var(--text-muted);
}

.thinking-indicator-dots {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.thinking-indicator-dots span {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.28;
    animation: thinkingPulse 1.2s infinite ease-in-out;
}

.thinking-indicator-dots span:nth-child(2) {
    animation-delay: 0.18s;
}

.thinking-indicator-dots span:nth-child(3) {
    animation-delay: 0.36s;
}

@keyframes thinkingPulse {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.28;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.function-progress-card {
    width: 100%;
    min-width: 280px;
}

.function-progress-title {
    font-weight: 850;
    margin-bottom: 0.45rem;
}

.function-progress-status {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin-bottom: 0.55rem;
}

.function-progress-track {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #dbe5df;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.function-progress-fill {
    height: 100%;
    width: 0;
    background: var(--primary);
    transition: width 0.25s ease;
}

.function-progress-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}

.progress-step {
    font-size: 0.88rem;
    padding: 0.25rem 0;
}

.progress-running {
    color: var(--accent);
}

.progress-done {
    color: var(--success);
}

.progress-failed {
    color: var(--danger);
}

.report-debug-wrap {
    max-width: min(92%, 860px);
}

.report-partial-wrap {
    max-width: min(92%, 760px);
}

.report-partial-card {
    border-color: #bfdbfe !important;
    background: #f7fbff !important;
}

.report-partial-title {
    margin-bottom: 0.7rem;
    color: #1d4ed8;
    font-weight: 850;
}

.report-partial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.65rem;
}

.report-partial-item {
    padding: 0.7rem;
    border: 1px solid #dbeafe;
    border-radius: 6px;
    background: #fff;
}

.report-partial-item span {
    display: block;
    margin-bottom: 0.2rem;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 800;
}

.report-partial-item strong {
    color: var(--text);
    font-size: 0.92rem;
}

.report-debug-card {
    border-color: #fecaca !important;
    background: #fff7f7 !important;
}

.report-debug-title {
    margin-bottom: 0.35rem;
    color: var(--danger);
    font-weight: 850;
}

.report-debug-summary {
    color: #7f1d1d;
    font-size: 0.92rem;
}

.report-debug-details {
    margin-top: 0.85rem;
}

.report-debug-details summary {
    cursor: pointer;
    color: var(--text);
    font-weight: 750;
}

.report-debug-details pre {
    margin: 0.7rem 0 0;
    padding: 0.9rem;
    overflow: auto;
    border: 1px solid #f5c2c7;
    border-radius: 6px;
    background: #fff;
    color: #1f2937;
    font-size: 0.82rem;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

.init-overlay {
    position: absolute;
    inset: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: rgba(246, 247, 243, 0.96);
    backdrop-filter: blur(5px);
}

.init-content {
    width: min(100%, 420px);
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    text-align: center;
    box-shadow: var(--shadow-md);
}

/* Reports */
.chat-report {
    width: 100%;
    max-width: 100%;
    align-self: center;
    margin: 1rem 0;
}

.report-container {
    width: min(100%, 980px);
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow-md);
}

.report-header {
    padding: 1.15rem 1.25rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text);
}

.report-header h4 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 850;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.report-actions .btn-light {
    background: #fff;
    border: 1px solid var(--line-strong);
    color: var(--text);
    font-weight: 750;
}

.report-actions .btn-light:hover {
    background: var(--primary-soft);
    border-color: rgba(15, 118, 110, 0.28);
    color: var(--primary-strong);
}

.report-content,
.report-body {
    padding: 1.15rem;
}

.report-page-shell {
    width: 100%;
}

.report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.48fr);
    gap: 1rem;
    align-items: start;
}

.report-main-panel,
.report-editor-panel {
    overflow: hidden;
}

.report-editor-panel {
    position: sticky;
    top: 88px;
    padding-bottom: 1rem;
}

.report-editor-panel > :not(.data-panel-header) {
    margin-left: 1rem;
    margin-right: 1rem;
}

.code-editor {
    min-height: 480px;
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 0.86rem;
    line-height: 1.55;
}

.report-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.report-summary-grid div {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface-muted);
}

.report-section {
    margin-bottom: 1.15rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
}

.report-section:last-child {
    margin-bottom: 0;
}

.report-section h3,
.report-section h4 {
    margin: 0 0 0.75rem;
    color: var(--text);
    font-weight: 850;
}

.report-section h3 {
    font-size: 1.12rem;
}

.report-section h4 {
    font-size: 1rem;
}

.report-section p {
    margin-bottom: 0.65rem;
}

.report-section.high-risk {
    border-color: #fecaca;
    background: #fff7f7;
}

.report-section.high-risk h3 {
    color: var(--danger);
}

.report-section.advice {
    border-color: #bbf7d0;
    background: #f3fbf6;
}

.holland-code-display {
    padding: 1.25rem;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: var(--radius);
    background: var(--surface-strong);
    text-align: center;
}

.holland-code-display h3 {
    justify-content: center;
}

.code-box {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 1rem 0;
}

.code-letter {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: var(--radius);
    background: #fff;
    color: var(--primary);
    font-size: 2.25rem;
    font-weight: 900;
}

.holland-code-note {
    max-width: 640px;
    margin: 0.75rem auto 0;
    color: var(--text-muted);
}

.holland-code-meta,
.secondary-code,
.interview-rounds {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.code-meaning,
.code-meaning-full {
    padding: 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    background: var(--surface-muted);
    color: var(--text);
    line-height: 1.75;
}

.dimension-grid,
.evidence-grid,
.matched-jobs-list,
.location-ranking-list,
.job-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.9rem;
}

.dimension-item,
.evidence-item,
.job-card,
.job-card-mini,
.path-card,
.location-rank-item,
.location-accordion-item {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.dimension-label,
.job-card .job-title,
.job-card-mini .job-title,
.path-card .path-job,
.gap-analysis .gap-label {
    color: var(--text);
    font-weight: 850;
}

.dimension-bar-container,
.location-score-bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #dbe5df;
    margin: 0.65rem 0;
}

.dimension-bar,
.score-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
}

.dimension-score,
.job-card .job-company,
.job-card-mini .job-company,
.job-card .job-company-meta,
.job-card-mini .job-company-meta,
.job-card .job-summary,
.job-card-mini .job-summary,
.path-card .path-item,
.gap-target {
    color: var(--text-muted);
}

.dimension-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dimension-summary span,
.career-tag,
.job-card .match-score,
.job-card-mini .match-score,
.job-card .dim-tag,
.job-card-mini .dim-tag,
.path-card .path-level,
.job-count {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.55rem;
    border-radius: 4px;
    background: var(--primary-soft);
    color: var(--primary-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.career-tag.atypical,
.job-card .dim-tag,
.job-card-mini .dim-tag {
    background: #e2e8f0;
    color: #334155;
}

.driver-item {
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    border-left: 4px solid var(--primary);
    border-radius: 6px;
    background: var(--surface-muted);
}

.career-tags,
.job-card .job-tags,
.job-card-mini .job-tags,
.job-card-mini .job-resource-links,
.job-card .job-resource-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.job-card .job-meta,
.job-card-mini .job-meta,
.path-card .path-header,
.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.job-card .job-resource-link,
.job-card-mini .job-resource-link {
    display: inline-flex;
    max-width: 100%;
    padding: 0.24rem 0.5rem;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 4px;
    background: #fff;
    color: var(--primary);
    font-size: 0.78rem;
    font-weight: 750;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gap-analysis {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-muted);
}

.gap-analysis .gap-strengths,
.gap-analysis .gap-improvements,
.gap-overall,
.gap-summary {
    margin-bottom: 0.65rem;
    padding: 0.65rem;
    border-radius: 6px;
    background: #fff;
}

.accordion-header {
    margin: -1rem -1rem 0;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    user-select: none;
}

.accordion-header.expanded {
    background: var(--surface-strong);
}

.accordion-content {
    padding-top: 1rem;
}

.rank-number {
    width: 42px;
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 900;
}

.location-info {
    flex: 1;
}

.location-name {
    color: var(--text);
    font-weight: 850;
}

/* Admin compatibility */
.border-left-primary,
.border-left-success,
.border-left-info,
.border-left-warning {
    border-left: 4px solid var(--primary) !important;
}

/* Responsive */
@media (max-width: 1199.98px) {
    .decision-grid,
    .resume-layout,
    .report-layout {
        grid-template-columns: 1fr;
    }

    .major-layout {
        grid-template-columns: 1fr;
    }

    .major-sidebar,
    .report-editor-panel {
        position: static;
        max-height: none;
    }

    .results-header {
        top: 65px;
    }
}

@media (max-width: 767.98px) {
    .app-container {
        padding-top: 18px;
        padding-bottom: 32px;
    }

    .page-header,
    .chat-header {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions,
    .chat-actions {
        justify-content: flex-start;
    }

    .tool-grid,
    .profile-summary-grid,
    .report-summary-grid {
        grid-template-columns: 1fr;
    }

    .chat-panel {
        min-height: calc(100vh - 104px);
    }

    .chat-message {
        max-width: 100%;
    }

    .chat-input-row {
        grid-template-columns: 1fr;
    }

    .riasec-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .subject-grid,
    .mode-toggle {
        grid-template-columns: 1fr;
    }

    .data-panel-header,
    .decision-card-head,
    .tool-card-top {
        align-items: flex-start;
    }
}

@media (max-width: 575.98px) {
    .app-navbar-inner {
        min-height: 58px;
    }

    .page-header h1,
    .auth-header h1 {
        font-size: 1.5rem;
    }

    .decision-card,
    .tool-card,
    .auth-panel {
        padding: 1rem;
    }

    .riasec-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resume-layout .data-panel > :not(.data-panel-header),
    .report-editor-panel > :not(.data-panel-header) {
        margin-left: 0.85rem;
        margin-right: 0.85rem;
    }

    .code-letter {
        width: 58px;
        height: 58px;
        font-size: 1.8rem;
    }
}
