:root {
    --blue: #2a67fe;
    --blue-hover: #1f53e6;
    --heading: #0d1a39;
    --text: #333;
    --muted: #7a889f;
    --line: #d7d7d7;
    --table-border: #ebedf5;
    --table-header: #f5f7ff;
    --bg: #f4f6fb;
    font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
}

.layout {
    display: grid;
    grid-template-columns: 220px auto;
    grid-template-rows: 60px auto;
    grid-template-areas:
        "topbar topbar"
        "sidebar content";
    min-height: 100vh;
}

.topbar {
    grid-area: topbar;
    background: var(--blue);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    color: #fff;
}

.brand {
    font-size: 22px;
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    cursor: pointer;
}

.user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.sidebar {
    grid-area: sidebar;
    background: #fff;
    border-right: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 20px;
}

.nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: block;
    padding: 14px 32px;
    font-size: 16px;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-item:hover {
    color: var(--blue);
}

.nav-item.active {
    font-weight: 600;
    color: var(--blue);
}

.content {
    grid-area: content;
    padding: 20px 20px 40px;
}

.section-header {
    margin-bottom: 20px;
}

.section-header.secondary {
    margin-top: 30px;
}

.section-header h2 {
    font-size: 14px;
    color: var(--heading);
    margin-bottom: 8px;
}

.divider {
    height: 1px;
    background: var(--line);
    margin: 0 0 10px;
}

.filters {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 20px;
}

.filters .filter {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filters span {
    font-size: 14px;
    color: var(--muted);
    white-space: nowrap;
}

.filters select {
    width: 120px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--line);
    padding: 0 10px;
    background: #fff;
}

.search-group {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-left: 30px;
}

.search-group input {
    width: 200px;
    height: 34px;
    border-radius: 6px;
    border: 1px solid var(--line);
    padding: 0 12px;
}

.btn {
    height: 34px;
    padding: 0 18px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--blue) 0%, #5d8bff 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--blue-hover) 0%, #4f7cf3 100%);
}

.btn-outline {
    background: linear-gradient(135deg, #eff4ff 0%, #f7faff 100%);
    border: 1px solid rgba(42, 103, 254, 0.3);
    color: var(--blue);
}

.btn-outline:hover {
    background: linear-gradient(135deg, #e2ecff 0%, #f1f6ff 100%);
}

.table-block {
    background: #fff;
    border: 1px solid var(--table-border);
    border-radius: 12px;
    margin-bottom: 10px;
}

.block-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--table-border);
    font-size: 14px;
    font-weight: 600;
    color: var(--heading);
}

.table-wrapper {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--table-header);
}

th,
td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--table-border);
    text-align: left;
}

tbody tr:hover {
    background: #f9fbff;
}

.sortable::after {
    content: "⇅";
    margin-left: 6px;
    font-size: 12px;
    color: var(--muted);
}

.actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.actions .link {
    padding: 0;
    border: none;
    background: none;
    color: var(--blue);
    font-size: 13px;
    cursor: pointer;
}

.actions .link:hover {
    text-decoration: underline;
}

.actions .divider {
    color: var(--muted);
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 16px;
    font-size: 13px;
    color: var(--muted);
}

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
}

.pager button {
    min-width: 36px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--line);
    background: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pager button:hover {
    border-color: var(--blue);
    color: var(--blue);
}

.pager button.active {
    background: var(--blue);
    color: #fff;
    border-color: var(--blue);
}

.pager input[type="number"] {
    width: 48px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid var(--line);
    text-align: center;
}

.modal {
    position: fixed;
    inset: 0;
    background: rgba(9, 17, 33, 0.4);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    z-index: 99;
}

.modal[aria-hidden="false"] {
    display: flex;
}

.modal-dialog {
    width: 480px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 24px 48px rgba(13, 26, 57, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header,
.modal-footer {
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--table-border);
}

.modal-footer {
    border-top: 1px solid var(--table-border);
    border-bottom: none;
    gap: 12px;
    justify-content: flex-end;
}

.modal-body {
    padding: 20px 24px 24px;
    display: grid;
    gap: 18px;
}

.modal-header h3 {
    font-size: 16px;
    color: var(--heading);
    font-weight: 600;
}

.modal-close {
    border: none;
    background: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--muted);
}

.modal-tip {
    font-size: 13px;
    line-height: 1.7;
    color: var(--muted);
}

.modal-tip code {
    font-family: "Consolas", "Source Code Pro", monospace;
    background: #f4f6fb;
    padding: 2px 4px;
    border-radius: 4px;
}

.field {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text);
}

.field label {
    min-width: 96px;
    color: var(--muted);
}

.field-value {
    font-weight: 600;
    color: var(--heading);
}

.field-hint {
    font-size: 12px;
    color: var(--muted);
}

.toast {
    position: fixed;
    right: 32px;
    bottom: 32px;
    min-width: 220px;
    max-width: 320px;
    padding: 14px 18px;
    background: rgba(13, 26, 57, 0.9);
    color: #fff;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 12px 24px rgba(13, 26, 57, 0.25);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 99;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: rgba(220, 53, 69, 0.92);
}

