body {
    background: #f0f2f5;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
}

.layout-shell {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #fff;
    padding: 24px 16px;
}

.sidebar-brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 32px;
    color: #fff;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link {
    display: block;
    color: #94a3b8;
    text-decoration: none;
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* sidebar-brand 样式已整合到 .sidebar 中 */

.sidebar .nav-link {
    display: block;
    color: #cbd5e1;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
    background: #1d4ed8;
    color: #fff;
}

.main-content,
.public-shell {
    flex: 1;
    padding: 24px;
}

.login-card,
.password-card {
    max-width: 460px;
    margin: 70px auto 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    margin-right: 4px;
    padding: 0.25rem 0.65rem;
    font-size: 0.8125rem;
}

.table-actions .btn:last-child {
    margin-right: 0;
}

.table-responsive {
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.card {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(15, 23, 42, 0.08);
    transition: box-shadow 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 30px rgba(15, 23, 42, 0.12);
}

.card-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    font-weight: 600;
    padding: 16px 20px;
}

.card-body {
    padding: 20px;
}

.table {
    margin-bottom: 0;
}

.table thead th {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: #475569;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    padding: 14px 16px;
}

.table tbody td {
    padding: 14px 16px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: #f8fafc;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    font-weight: 500;
    padding: 0.5rem 1.25rem;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-sm {
    padding: 0.25rem 0.75rem;
}

/* 旧的alert样式已删除 */

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-label {
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-check-label {
    color: #4b5563;
}

.alert {
    border-radius: 12px;
    border: none;
    padding: 14px 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
}

body.modal-open {
    overflow: hidden;
}

.border-bottom {
    border-bottom: 1px solid #e5e7eb;
}

.simple-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 24px;
}

.simple-modal.show {
    display: flex;
    animation: modalFadeIn 0.2s ease;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.simple-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.simple-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 720px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    z-index: 1;
}

.h-100 {
    height: 100%;
}

.btn-outline-secondary {
    border-color: #94a3b8;
    color: #475569;
    background: #fff;
}

.semester-toolbar .card-body {
    padding-top: 14px;
    padding-bottom: 14px;
}

.semester-select {
    min-width: 260px;
}

.fw-bold {
    font-weight: 700;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: .5rem;
}

.evaluate-shell {
    max-width: 1120px;
    margin: 0 auto;
    padding: 24px 32px;
}

.evaluate-card {
    overflow: hidden;
}

.evaluate-card-body {
    padding: 28px;
}

.evaluate-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.evaluate-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
}

.dimension-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-bottom: 20px;
}

.dimension-card {
    padding: 22px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
}

.dimension-title {
    font-size: 16px;
    font-weight: 700;
}

.rating-group {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 14px;
}

.rating-option {
    position: relative;
    cursor: pointer;
}

.rating-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.rating-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 12px 18px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #334155;
    font-weight: 600;
    transition: all .2s ease;
}

.rating-option input:checked + span {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.rating-option:hover span {
    border-color: #2563eb;
}

.evaluate-submit {
    min-width: 160px;
}

@media (max-width: 768px) {
    .main-content,
    .public-shell {
        padding: 12px;
    }

    .evaluate-shell {
        padding: 8px;
    }

    .evaluate-card-body {
        padding: 18px;
    }

    .dimension-grid {
        grid-template-columns: 1fr;
    }

    .rating-group {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rating-option span {
        width: 100%;
        min-width: 0;
        padding: 10px 8px;
    }

    .evaluate-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .evaluate-shell {
        padding: 0;
    }

    .rating-group {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .dimension-card {
        padding: 14px;
    }
}

.analysis-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.analysis-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: #fff;
    border: 1px solid #dbe3f0;
    border-radius: 999px;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
}

.analysis-tab.active,
.analysis-tab:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.analysis-panel {
    display: none;
}

.analysis-panel.active {
    display: block;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 100%;
}

.chart-legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex: 0 0 12px;
}

.chart-legend-label {
    color: #475569;
    line-height: 1.6;
    word-break: break-all;
}

.chart-helper-text {
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.analysis-filter-form {
    margin: 0;
}

.analysis-filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.analysis-selected-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.copy-link-group {
    display: flex;
    gap: 8px;
    align-items: center;
    min-width: 280px;
}

.copy-link-group .form-control {
    min-width: 0;
}

@media (max-width: 768px) {
    .analysis-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
}
