:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --ink: #0f172a;
    --text: #334155;
    --muted: #64748b;
    --faint: #94a3b8;
    --line: #e6ebf2;
    --bg: #f4f6fb;
    --danger: #dc2626;
    --danger-soft: #fef2f2;
    --success: #059669;
    --success-soft: #ecfdf5;
    --warning: #d97706;
    --warning-soft: #fffbeb;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -18px rgba(15, 23, 42, .18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
    font-family: inherit;
}

.hidden {
    display: none !important;
}

/* ---------------------------------- 登录 ---------------------------------- */

.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background:
        radial-gradient(900px 500px at 12% 0%, #dbeafe 0%, transparent 60%),
        radial-gradient(700px 500px at 100% 100%, #e0e7ff 0%, transparent 55%),
        #f4f6fb;
}

.login-card {
    width: 100%;
    max-width: 408px;
    background: #fff;
    border-radius: 20px;
    padding: 40px 36px 28px;
    box-shadow: 0 24px 60px -18px rgba(15, 23, 42, .25);
    border: 1px solid rgba(255, 255, 255, .6);
}

.login-brand {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo {
    width: 58px;
    height: 58px;
    margin: 0 auto 16px;
    border-radius: 17px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 24px -8px rgba(37, 99, 235, .65);
}

.login-brand h1 {
    font-size: 21px;
    color: var(--ink);
    letter-spacing: .5px;
}

.login-brand p {
    font-size: 12.5px;
    color: var(--faint);
    margin-top: 7px;
}

.login-card .field {
    margin-bottom: 16px;
}

.login-hint {
    text-align: center;
    font-size: 12px;
    color: var(--faint);
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--line);
}

/* ---------------------------------- 布局 ---------------------------------- */

.app {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 232px;
    background: linear-gradient(180deg, #111c33 0%, #0b1424 100%);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    z-index: 60;
    transition: transform .25s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 22px 22px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 6px 16px -6px rgba(59, 130, 246, .8);
}

.brand-name {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .5px;
}

.brand-sub {
    font-size: 11.5px;
    color: #64748b;
    margin-top: 3px;
    letter-spacing: 1.5px;
}

.nav {
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 14px;
    padding: 11px 14px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    transition: all .18s;
}

.nav-item:hover {
    background: rgba(148, 163, 184, .1);
    color: #e2e8f0;
}

.nav-item.active {
    background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .1));
    color: #fff;
    font-weight: 600;
    box-shadow: inset 3px 0 0 #3b82f6;
}

.nav-item svg {
    flex-shrink: 0;
    opacity: .9;
}

.sidebar-foot {
    padding: 16px 16px 18px;
    border-top: 1px solid rgba(148, 163, 184, .13);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #334155, #1e293b);
    border: 1px solid rgba(148, 163, 184, .28);
    color: #e2e8f0;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.user-name {
    color: #f1f5f9;
    font-size: 13.5px;
    font-weight: 600;
}

.user-role {
    color: #64748b;
    font-size: 11.5px;
    margin-top: 2px;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 36px;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, .2);
    background: rgba(148, 163, 184, .07);
    color: #94a3b8;
    font-size: 13px;
    cursor: pointer;
    transition: all .18s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, .14);
    border-color: rgba(239, 68, 68, .3);
    color: #fca5a5;
}

.main {
    margin-left: 232px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 78px;
    background: #fff;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 40;
}

.menu-btn {
    display: none;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    border: 1px solid var(--line);
    background: #fff;
    color: var(--text);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.topbar-title {
    flex: 1;
    min-width: 0;
}

.topbar-title h1 {
    font-size: 20px;
    font-weight: 650;
    color: var(--ink);
    letter-spacing: .2px;
}

.topbar-title p {
    font-size: 12.5px;
    color: var(--faint);
    margin-top: 4px;
}

.topbar-badge {
    display: inline-block;
    font-size: 12.5px;
    color: #475569;
    background: #f8fafc;
    border: 1px solid var(--line);
    padding: 7px 13px;
    border-radius: 999px;
    white-space: nowrap;
    max-width: 340px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.content {
    flex: 1;
    padding: 26px 30px 44px;
    max-width: 1500px;
    width: 100%;
}

.page {
    animation: fadeUp .25s ease;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ---------------------------------- 按钮 ---------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border-radius: 9px;
    border: 1px solid transparent;
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all .18s;
    user-select: none;
}

.btn:disabled {
    opacity: .6;
    cursor: not-allowed;
}

.btn.primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(37, 99, 235, .8);
}

.btn.primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn.ghost {
    background: #fff;
    border-color: #dbe3ee;
    color: #475569;
}

.btn.ghost:hover:not(:disabled) {
    border-color: #bfdbfe;
    background: #f8fbff;
    color: var(--primary-dark);
}

.btn.danger {
    background: var(--danger);
    color: #fff;
    box-shadow: 0 6px 16px -8px rgba(220, 38, 38, .7);
}

.btn.danger:hover:not(:disabled) {
    background: #b91c1c;
}

.btn.block {
    width: 100%;
    height: 44px;
    font-size: 15px;
    letter-spacing: 3px;
}

/* ---------------------------------- 表单 ---------------------------------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field > span {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

.field > span em {
    color: var(--danger);
    font-style: normal;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    height: 40px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    padding: 0 12px;
    font-size: 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color .18s, box-shadow .18s;
}

.field textarea {
    height: auto;
    padding: 10px 12px;
    resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.field input::placeholder {
    color: #b4bdcb;
}

.field small {
    font-size: 12px;
    color: var(--faint);
    line-height: 1.6;
}

.form-error {
    font-size: 13px;
    color: var(--danger);
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    padding: 9px 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

/* ---------------------------------- 工具栏 ---------------------------------- */

.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 230px;
    max-width: 380px;
}

.search-box svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 38px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    padding: 0 12px 0 36px;
    font-size: 13.5px;
    outline: none;
    color: var(--ink);
    transition: border-color .18s, box-shadow .18s;
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.search-box input::placeholder {
    color: #a8b2c1;
}

.select {
    height: 38px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    padding: 0 30px 0 12px;
    font-size: 13.5px;
    color: #475569;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
    cursor: pointer;
}

.select:focus {
    border-color: var(--primary);
}

.select.small {
    height: 34px;
    font-size: 13px;
}

.toolbar-spacer {
    flex: 1;
}

/* ---------------------------------- 表格 ---------------------------------- */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.table th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--muted);
    background: #f8fafc;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.table th.th-actions {
    text-align: right;
}

.table td {
    padding: 13px 14px;
    font-size: 13.5px;
    color: var(--text);
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table tbody tr {
    transition: background .15s;
}

.table tbody tr:hover {
    background: #fafcff;
}

.table tbody tr:last-child td {
    border-bottom: 0;
}

.cell-report-no {
    font-weight: 600;
    color: var(--ink);
    word-break: break-all;
}

.cell-clip {
    display: block;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cell-time {
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.badge::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
}

.badge.success {
    color: var(--success);
    background: var(--success-soft);
}

.badge.danger {
    color: var(--danger);
    background: var(--danger-soft);
}

.badge.warning {
    color: var(--warning);
    background: var(--warning-soft);
}

.badge.neutral {
    color: var(--muted);
    background: #f1f5f9;
}

.file-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    white-space: nowrap;
}

.file-chip.pdf {
    color: #b91c1c;
    background: #fef2f2;
}

.file-chip.image {
    color: #047857;
    background: #ecfdf5;
}

.file-chip.empty {
    color: #94a3b8;
    background: #f8fafc;
    font-weight: 400;
}

.row-actions {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.icon-btn {
    width: 31px;
    height: 31px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all .16s;
    text-decoration: none;
}

.icon-btn:hover {
    background: var(--primary-soft);
    border-color: #dbeafe;
    color: var(--primary-dark);
}

.icon-btn.danger:hover {
    background: var(--danger-soft);
    border-color: #fee2e2;
    color: var(--danger);
}

.table-loading,
.table-empty {
    padding: 52px 16px;
    text-align: center;
    color: var(--faint);
    font-size: 13.5px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    flex-direction: column;
}

.table-empty .empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #cbd5e1;
    margin-bottom: 2px;
}

.table-empty strong {
    color: #475569;
    font-size: 14px;
    font-weight: 600;
}

/* ---------------------------------- 分页 ---------------------------------- */

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 20px;
    border-top: 1px solid var(--line);
    background: #fcfdff;
}

.pagination-info {
    font-size: 13px;
    color: var(--faint);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pager {
    display: flex;
    align-items: center;
    gap: 4px;
}

.page-btn {
    min-width: 33px;
    height: 33px;
    padding: 0 8px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 13px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all .16s;
}

.page-btn:hover:not(:disabled) {
    border-color: #bfdbfe;
    color: var(--primary-dark);
    background: #f8fbff;
}

.page-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.page-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.page-ellipsis {
    color: #cbd5e1;
    padding: 0 3px;
    font-size: 13px;
}

/* ---------------------------------- 设置页 ---------------------------------- */

.settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 20px;
    align-items: start;
}

.card-head {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--line);
}

.card-head h2 {
    font-size: 16px;
    font-weight: 650;
    color: var(--ink);
}

.card-head p {
    font-size: 12.5px;
    color: var(--faint);
    margin-top: 5px;
    line-height: 1.6;
}

.card-body {
    padding: 20px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-actions {
    padding-top: 2px;
}

/* ---------------------------------- 弹窗 ---------------------------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .48);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
    z-index: 100;
}

.modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 540px;
    max-height: calc(100vh - 44px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .45);
    animation: modalIn .2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-lg {
    max-width: 800px;
}

.modal-sm {
    max-width: 460px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--line);
    flex-shrink: 0;
}

.modal-head h2 {
    font-size: 17px;
    font-weight: 650;
    color: var(--ink);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 0;
    background: #f1f5f9;
    color: #64748b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: all .16s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: var(--ink);
}

.modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1;
}

.modal form {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}

.modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 22px;
    border-top: 1px solid var(--line);
    background: #fcfdff;
    flex-shrink: 0;
    border-radius: 0 0 16px 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}

/* ---------------------------------- 上传 ---------------------------------- */

.upload-section {
    margin-top: 22px;
    padding-top: 18px;
    border-top: 1px dashed var(--line);
}

.section-label {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 10px;
}

.section-tip {
    font-size: 12px;
    font-weight: 400;
    color: var(--faint);
}

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 20px;
    border: 1.5px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    text-align: center;
    transition: all .18s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.dz-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 3px;
}

.dz-title {
    font-size: 13.5px;
    font-weight: 500;
    color: #475569;
}

.dz-sub {
    font-size: 12px;
    color: var(--faint);
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: #fff;
    animation: fadeUp .18s ease;
}

.file-badge {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .4px;
    padding: 3px 6px;
    border-radius: 5px;
    color: #fff;
    background: #ef4444;
}

.file-badge.image {
    background: #10b981;
}

.file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #334155;
}

.file-size {
    flex-shrink: 0;
    font-size: 11.5px;
    color: var(--faint);
}

.file-remove {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 0;
    border-radius: 7px;
    background: #f8fafc;
    color: #94a3b8;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .16s;
}

.file-remove:hover {
    background: var(--danger-soft);
    color: var(--danger);
}

.file-row.removed {
    opacity: .5;
}

.file-row.removed .file-name {
    text-decoration: line-through;
}

/* ---------------------------------- 二维码 ---------------------------------- */

.qr-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 24px 22px 26px;
}

.qr-frame {
    width: 228px;
    height: 228px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 26px -16px rgba(15, 23, 42, .3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.qr-report-no {
    font-size: 14px;
    font-weight: 600;
    color: var(--ink);
}

.qr-url-row {
    display: flex;
    gap: 8px;
    width: 100%;
}

.qr-url-row input {
    flex: 1;
    min-width: 0;
    height: 38px;
    border: 1px solid #dbe3ee;
    border-radius: 9px;
    padding: 0 12px;
    font-size: 12.5px;
    color: var(--muted);
    background: #f8fafc;
    outline: none;
}

.qr-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.qr-actions .btn {
    flex: 1;
}

.qr-hint {
    font-size: 11.5px;
    color: var(--faint);
    line-height: 1.65;
    text-align: center;
    margin-top: 2px;
}

.delete-text {
    font-size: 14px;
    color: var(--text);
    line-height: 1.7;
}

.delete-text strong {
    color: var(--ink);
}

.delete-warn {
    margin-top: 8px;
    font-size: 12.5px;
    color: var(--danger);
    background: var(--danger-soft);
    border-radius: 8px;
    padding: 10px 12px;
    line-height: 1.65;
}

/* ---------------------------------- 其他 ---------------------------------- */

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #dbeafe;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .7s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.toast-wrap {
    position: fixed;
    right: 22px;
    bottom: 22px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    z-index: 200;
    pointer-events: none;
}

.toast {
    min-width: 200px;
    max-width: 340px;
    background: #0f172a;
    color: #f8fafc;
    font-size: 13.5px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 10px;
    box-shadow: 0 16px 36px -14px rgba(15, 23, 42, .6);
    animation: toastIn .22s ease;
    display: flex;
    align-items: center;
    gap: 9px;
}

.toast.success {
    background: #064e3b;
}

.toast.error {
    background: #7f1d1d;
}

.toast::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    flex-shrink: 0;
    opacity: .9;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sidebar-overlay {
    display: none;
}

/* ---------------------------------- 响应式 ---------------------------------- */

@media (max-width: 1180px) {
    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 20px 0 50px rgba(15, 23, 42, .2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-overlay.visible {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(15, 23, 42, .4);
        z-index: 55;
    }

    .main {
        margin-left: 0;
    }

    .menu-btn {
        display: inline-flex;
    }

    .topbar {
        padding: 0 18px;
        height: 70px;
    }

    .topbar-badge {
        display: none;
    }

    .content {
        padding: 20px 18px 36px;
    }
}

@media (max-width: 680px) {
    .topbar-title h1 {
        font-size: 17px;
    }

    .topbar-title p {
        display: none;
    }

    .toolbar {
        padding: 14px;
    }

    .search-box {
        max-width: none;
        min-width: 100%;
        order: -1;
    }

    .toolbar-spacer {
        display: none;
    }

    #addBtn {
        margin-left: auto;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .modal-backdrop {
        padding: 10px;
        align-items: flex-end;
    }

    .modal {
        max-height: calc(100vh - 20px);
        border-radius: 16px;
    }

    .pagination {
        justify-content: center;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
    }

    .toast-wrap {
        left: 14px;
        right: 14px;
        bottom: 14px;
    }

    .toast {
        max-width: none;
    }
}
