html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 0;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

/* ============================================================
   移动端适配（≤767.98px）
   ============================================================ */
@media (max-width: 767.98px) {
    .app-main {
        padding: 0.85rem 0.75rem 2rem;
    }

    .page-header {
        margin-bottom: 0.9rem;
    }

    .page-title {
        font-size: 1.1rem;
    }

    .surface {
        padding: 0.75rem;
    }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .search-form {
        max-width: none;
        width: 100%;
        min-width: 0;
        flex: 1 1 auto;
        align-items: center;
    }

    .search-form .form-control {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
    }

    .search-form .btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 3.75rem;
    }

    .toolbar-end {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .toolbar-end > .btn {
        width: 100%;
    }

    .toolbar-end > form {
        width: 100%;
    }

    .upload-form {
        display: grid !important;
        grid-template-columns: 1fr auto;
        width: 100%;
    }

    .upload-form .form-control {
        width: 100% !important;
    }

    .upload-form .btn {
        width: auto;
        min-width: 4.5rem;
    }

    .table-responsive {
        border: none;
        background: transparent;
        overflow: visible;
        border-radius: 0;
    }

    table.table thead {
        display: none;
    }

    table.table,
    table.table tbody {
        display: block;
        width: 100%;
    }

    table.table tbody tr {
        display: block;
        background: hsl(var(--card));
        border: 1px solid hsl(var(--border));
        border-radius: var(--radius);
        margin-bottom: 0.55rem;
        padding: 0.55rem 0.75rem;
    }

    table.table > :not(caption) > * > * {
        padding: 0.35rem 0;
    }

    table.table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 0.75rem;
        text-align: right;
        border: none;
        word-break: break-word;
        font-size: 0.875rem;
        line-height: 1.45;
    }

    table.table tbody tr:last-child > * {
        border-bottom: none;
    }

    table.table tbody td::before {
        content: attr(data-label);
        font-weight: 500;
        text-align: left;
        flex: 0 0 42%;
        color: hsl(var(--muted-foreground));
        font-size: 0.75rem;
        line-height: 1.45;
    }

    table.table tbody td[colspan] {
        justify-content: center;
        text-align: center;
    }

    table.table tbody td[colspan]::before {
        display: none;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination .page-num {
        display: none;
    }

    .btn {
        min-height: 2.25rem;
    }

    .form-control,
    .form-select {
        font-size: 16px;
        min-height: 2.5rem;
    }

    .nav-pills .nav-link,
    .nav-tabs .nav-link {
        font-size: 0.8125rem;
        padding: 0.45rem 0.55rem;
    }

    .login-card {
        margin: 1.5rem auto;
    }

    .modal-dialog {
        margin: 0.75rem;
    }
}

@media (max-width: 380px) {
    .toolbar-end .btn {
        width: 100%;
    }
}
