html {
    font-size: 13px;
}

/* Giảm kích thước gốc của trình duyệt (mặc định thường là 16px) */

:root {
    --app-text: #0f172a;
    --app-muted: #475569;
    --app-border: #d7e3f5;
    --app-surface: #ffffff;
    --app-surface-soft: #f8fbff;
    --app-primary: #1d4ed8;
}

body {
    background-color: #f8f9fa;
    color: var(--app-text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    line-height: 1.5;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--app-text);
}

.text-muted {
    color: var(--app-muted) !important;
}

.card {
    border-radius: 12px;
    border-color: var(--app-border);
}

.card-header {
    font-weight: 700;
}

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.2px;
}

.system-info-footer {
    position: relative;
    z-index: 1020;
    background-color: #fff;
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
    margin-top: auto;
}

.system-info-footer .footer-inner {
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
}

.system-clock-badge {
    background: rgba(15, 23, 42, 0.08);
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.15);
    border-radius: 10px;
    padding: 0.2rem 0.5rem;
    min-width: 210px;
    text-align: right;
    font-size: 0.78rem;
    line-height: 1.2;
    margin-left: 0.75rem;
}

.system-clock-line-1 {
    color: #1d4ed8;
    font-weight: 700;
}

.system-clock-line-2 {
    color: #111827;
    font-weight: 600;
}

@media (max-width: 576px) {
    .system-info-footer .footer-inner {
        font-size: 0.8rem;
        line-height: 1.3;
        text-align: left;
        flex-wrap: wrap;
        gap: 6px;
    }

    .system-clock-badge {
        min-width: 100%;
        font-size: 0.72rem;
        margin-left: 0;
    }
}

.table td,
.table th {
    padding: 0.5rem;
    /* Thu hẹp khoảng cách các ô trong bảng */
    vertical-align: middle;
}

.table {
    color: var(--app-text);
}

.table thead th {
    white-space: nowrap;
}

.btn {
    font-weight: 500;
}

.btn-sm {
    min-height: 34px;
}

.btn,
.form-control,
.form-select,
.input-group-text {
    border-radius: 10px;
}

.form-control,
.form-select,
.input-group-text {
    min-height: 40px;
    font-size: 0.98rem;
}

.badge {
    font-weight: 600;
}

.table-responsive {
    border-radius: 10px;
}

.pagination .page-link {
    min-width: 36px;
    text-align: center;
}

@media (max-width: 991.98px) {
    html {
        font-size: 14px;
    }

    .container,
    .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    .card {
        border-radius: 12px;
    }

    .card-body,
    .card-header,
    .card-footer {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .btn {
        min-height: 42px;
        font-size: 1rem;
        font-weight: 700;
    }

    .btn-sm {
        min-height: 38px;
        font-size: 0.94rem;
    }

    .form-control,
    .form-select,
    .input-group-text {
        min-height: 42px;
        font-size: 1rem;
    }

    .navbar .navbar-brand {
        font-size: 1rem;
    }

    .navbar .navbar-text {
        display: block;
        margin-top: 8px;
        margin-bottom: 8px;
        line-height: 1.45;
    }

    .navbar .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .table {
        font-size: 0.95rem;
    }

    .table td,
    .table th {
        padding: 0.6rem;
    }

    .alert {
        font-size: 0.96rem;
        border-radius: 10px;
    }

    .modal-dialog {
        margin: 0.75rem;
    }
}

@media (max-width: 576px) {
    html {
        font-size: 14.5px;
    }

    .table {
        font-size: 0.92rem;
    }

    .system-info-footer .footer-left {
        width: 100%;
    }
}

.question-content .katex-display,
.answer-content .katex-display,
.options-content .katex-display,
.latex-content .katex-display {
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    margin: 0;
    text-align: left;
    display: inline-block;
    vertical-align: baseline;
}

.question-content .katex-display > .katex,
.answer-content .katex-display > .katex,
.options-content .katex-display > .katex,
.latex-content .katex-display > .katex {
    text-align: left;
}

.mobile-answer-text .katex {
    font-size: 1em;
}