* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: #202631;
    background:
        linear-gradient(180deg, #eef5ff 0, #f7f9fc 260px, #f7f9fc 100%);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    line-height: 1.65;
}

a {
    color: #0b6bcb;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(205, 214, 229, 0.72);
    box-shadow: 0 10px 30px rgba(37, 54, 84, 0.06);
    backdrop-filter: blur(12px);
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    gap: 18px;
}

.brand {
    color: #111827;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0;
    white-space: nowrap;
}

.brand::before {
    content: "";
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-right: 9px;
    border-radius: 50%;
    background: #1b75d0;
    box-shadow: 0 0 0 5px rgba(27, 117, 208, 0.13);
    vertical-align: 1px;
}

.nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.nav a {
    color: #3e4857;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 600;
    transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav a.active,
.nav a:hover {
    background: #eaf3ff;
    color: #0d5db3;
    box-shadow: inset 0 0 0 1px rgba(42, 119, 207, 0.08);
    text-decoration: none;
}

.main {
    padding: 32px 0 48px;
}

.footer {
    color: #788393;
    border-top: 1px solid #e7e9ee;
    padding: 20px 0;
}

.panel {
    background: #fff;
    border: 1px solid rgba(217, 224, 235, 0.95);
    border-radius: 8px;
    padding: 22px;
    margin-bottom: 18px;
    box-shadow: 0 16px 36px rgba(31, 45, 71, 0.06);
}

.panel h1,
.panel h2,
.panel h3 {
    margin-top: 0;
    line-height: 1.3;
}

.panel h1 {
    color: #111827;
    font-size: 30px;
    margin-bottom: 10px;
}

.hero-panel {
    padding: 30px;
    border-color: rgba(43, 119, 207, 0.16);
    background:
        linear-gradient(135deg, rgba(234, 244, 255, 0.92), rgba(255, 255, 255, 0.96) 52%),
        #fff;
}

.hero-panel p {
    max-width: 860px;
    margin: 0;
    color: #475569;
    font-size: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.card {
    display: block;
    background: #fff;
    border: 1px solid rgba(219, 226, 237, 0.95);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 12px 28px rgba(28, 39, 61, 0.05);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.card:hover {
    border-color: rgba(39, 119, 206, 0.32);
    box-shadow: 0 18px 38px rgba(31, 69, 118, 0.11);
    transform: translateY(-2px);
    text-decoration: none;
}

.card h2,
.card h3 {
    color: #171b22;
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.35;
}

.card p:last-child,
.panel p:last-child {
    margin-bottom: 0;
}

.meta {
    color: #6b7584;
    font-size: 14px;
}

.badge {
    display: inline-block;
    color: #13599f;
    background: #e9f4ff;
    border: 1px solid #c9e2fb;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.badge.off {
    color: #66510d;
    background: #fff6d6;
    border-color: #f1df92;
}

.badge.danger {
    color: #8f1d2c;
    background: #ffe8ec;
    border-color: #f5c6cf;
}

.form {
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

.form-row {
    margin-bottom: 14px;
}

.help {
    color: #737f90;
    font-size: 13px;
    margin: 6px 0 0;
}

label {
    display: block;
    color: #303743;
    font-weight: 600;
    margin-bottom: 6px;
}

input,
select,
textarea {
    width: 100%;
    color: #20242c;
    background: #fff;
    border: 1px solid #cfd7e4;
    border-radius: 6px;
    padding: 10px 12px;
    font: inherit;
    outline: none;
    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2d7bd2;
    box-shadow: 0 0 0 3px rgba(45, 123, 210, 0.14);
}

textarea {
    min-height: 260px;
    resize: vertical;
}

.button,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    color: #fff;
    background: #176fcf;
    border: 1px solid #176fcf;
    border-radius: 6px;
    padding: 8px 15px;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(23, 111, 207, 0.18);
    transition: background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.button:hover,
button:hover {
    background: #115fb5;
    border-color: #115fb5;
    box-shadow: 0 10px 22px rgba(23, 111, 207, 0.24);
    transform: translateY(-1px);
    text-decoration: none;
}

.button.secondary,
button.secondary {
    color: #253141;
    background: #fff;
    border-color: #cbd2dd;
    box-shadow: none;
}

.button.danger,
button.danger {
    background: #c43146;
    border-color: #c43146;
}

.actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.alert {
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    box-shadow: 0 12px 26px rgba(31, 45, 71, 0.05);
}

.alert.success {
    color: #145c2d;
    background: #e8f8ee;
    border: 1px solid #bfe7cb;
}

.alert.error {
    color: #8f1d2c;
    background: #ffe8ec;
    border: 1px solid #f5c6cf;
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid #e7ebf2;
    border-radius: 8px;
}

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

th,
td {
    border-bottom: 1px solid #e8ebf0;
    padding: 12px;
    text-align: left;
    vertical-align: top;
}

th {
    color: #465163;
    background: #f4f7fb;
    font-weight: 700;
}

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

tbody tr:hover {
    background: #f8fbff;
}

.inline-form {
    display: grid;
    grid-template-columns: 120px 120px 110px auto;
    gap: 8px;
    align-items: center;
}

.sort-form {
    display: grid;
    grid-template-columns: 86px auto;
    gap: 8px;
    align-items: center;
    width: 160px;
}

.content {
    word-break: break-word;
    color: #26303d;
    font-size: 16px;
}

.content a {
    word-break: break-all;
    font-weight: 700;
}

@media (max-width: 720px) {
    .topbar-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px 0;
    }

    .nav {
        justify-content: flex-start;
    }

    .panel {
        padding: 16px;
    }

    .hero-panel {
        padding: 20px;
    }

    .panel h1 {
        font-size: 24px;
    }

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