:root {
    --bg: #0b0f17;
    --bg-soft: #111725;
    --panel: #141b2b;
    --border: #23304a;
    --text: #e8edf7;
    --muted: #8b97ad;
    --primary: #4f8bff;
    --primary-2: #7c5cff;
    --ok: #22c55e;
    --fail: #ef4444;
    --radius: 14px;
    --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: radial-gradient(1200px 600px at 20% -10%, rgba(79, 139, 255, .18), transparent 60%),
    radial-gradient(1000px 500px at 90% 0%, rgba(124, 92, 255, .14), transparent 60%), var(--bg);
    color: var(--text);
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    line-height: 1.65;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    opacity: .85;
}

code {
    font-family: var(--mono);
    background: rgba(255, 255, 255, .06);
    padding: 2px 6px;
    border-radius: 6px;
    font-size: 13px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(12px);
    background: rgba(11, 15, 23, .78);
    border-bottom: 1px solid var(--border);
}

.topbar-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 14px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-weight: 700;
    font-size: 18px;
}

.brand-mark {
    width: 12px;
    height: 24px;
    border-radius: 5px;
    background: linear-gradient(160deg, var(--primary), var(--primary-2));
    box-shadow: 0 0 20px rgba(79, 139, 255, .55);
}

.brand-text em {
    font-style: normal;
    font-size: 12px;
    color: var(--muted);
    margin-left: 4px;
    letter-spacing: .08em;
}

.topnav {
    display: flex;
    align-items: center;
    gap: 22px;
    font-size: 14px;
}

.topnav a {
    color: var(--muted);
}

.topnav a:hover {
    color: var(--text);
}

.topnav-admin {
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.foot {
    border-top: 1px solid var(--border);
    background: rgba(17, 23, 37, .6);
}

.foot-inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    color: var(--muted);
}

.muted {
    color: var(--muted);
}

.small {
    font-size: 12px;
}

.hero {
    padding: 56px 0 40px;
    text-align: center;
}

.pill {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(79, 139, 255, .08);
    color: #a8c1ff;
    font-size: 12px;
    letter-spacing: .04em;
}

.hero h1 {
    font-size: 46px;
    line-height: 1.2;
    margin: 18px 0 14px;
    letter-spacing: -.02em;
}

.hero h1 em {
    font-style: normal;
    background: linear-gradient(120deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.hero-sub {
    max-width: 680px;
    margin: 0 auto;
    color: var(--muted);
    font-size: 15px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 26px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
    background: #1c2740;
    color: var(--text);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn.primary {
    background: linear-gradient(120deg, var(--primary), var(--primary-2));
    color: #fff;
    box-shadow: 0 10px 26px rgba(79, 139, 255, .28);
}

.btn.ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.btn.danger {
    background: rgba(239, 68, 68, .12);
    border-color: rgba(239, 68, 68, .35);
    color: #ff9d9d;
}

.btn.tiny {
    padding: 5px 12px;
    font-size: 12px;
    border-radius: 8px;
    box-shadow: none;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin: 42px 0 10px;
}

.card {
    background: linear-gradient(180deg, rgba(255, 255, 255, .035), transparent), var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 20px 18px;
}

.card h3 {
    margin: 0 0 8px;
    font-size: 15px;
}

.card p {
    margin: 0;
    color: var(--muted);
    font-size: 13.5px;
}

.panel {
    margin: 22px 0;
    padding: 22px 24px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.panel.narrow {
    max-width: 460px;
    margin: 22px auto;
}

.panel h2 {
    font-size: 17px;
    margin: 0 0 14px;
}

.panel h3 {
    font-size: 14px;
    margin: 20px 0 10px;
    color: #c3cee6;
}

.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.panel-head h2 {
    margin: 0;
}

.spread {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

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

.chip {
    padding: 6px 16px;
    border-radius: 999px;
    border: 1px solid rgba(79, 139, 255, .3);
    background: rgba(79, 139, 255, .08);
    font-size: 13px;
}

.code {
    margin: 0;
    padding: 16px 18px;
    background: #0a0f1a;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: auto;
    font-family: var(--mono);
    font-size: 13px;
    line-height: 1.7;
    color: #cfe0ff;
}

.code code {
    background: none;
    padding: 0;
    font-size: 13px;
    display: block;
    white-space: pre;
    color: inherit;
}

.steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 10px;
}

.steps li b {
    display: block;
}

.steps li span {
    color: var(--muted);
    font-size: 13.5px;
}

.page-head {
    margin-bottom: 6px;
}

.page-head h1 {
    font-size: 30px;
    margin: 0 0 6px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
}

.table th, .table td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.table thead th {
    color: var(--muted);
    font-weight: 600;
    font-size: 12.5px;
    white-space: nowrap;
}

.table tbody tr:hover {
    background: rgba(255, 255, 255, .02);
}

.table th[style] {
    color: var(--muted);
    font-weight: 600;
    font-size: 13px;
}

.table-wrap {
    overflow-x: auto;
}

.nowrap {
    white-space: nowrap;
}

.truncate {
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag {
    font-size: 12px;
    font-family: var(--mono);
    color: #a8c1ff;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 8px;
    margin-left: 8px;
    vertical-align: middle;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.tab {
    padding: 6px 14px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    cursor: pointer;
}

.tab.active {
    color: var(--text);
    border-color: rgba(79, 139, 255, .5);
    background: rgba(79, 139, 255, .12);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.note ul {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 13.5px;
}

.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    color: #c3cee6;
}

input, textarea, select {
    width: 100%;
    padding: 11px 14px;
    background: #0a0f1a;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}

input:focus, textarea:focus {
    outline: none;
    border-color: rgba(79, 139, 255, .6);
    box-shadow: 0 0 0 3px rgba(79, 139, 255, .12);
}

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

.status {
    font-size: 13px;
    color: var(--muted);
}

.inline-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.inline-form input {
    flex: 1;
    min-width: 160px;
}

.inline-form input[type=number] {
    max-width: 140px;
    flex: 0 0 auto;
}

.form .btn {
    width: 100%;
}

.alert {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid rgba(239, 68, 68, .35);
    background: rgba(239, 68, 68, .1);
    color: #ffb4b4;
    font-size: 13.5px;
    margin-bottom: 14px;
    word-break: break-all;
}

.alert.success {
    border-color: rgba(34, 197, 94, .35);
    background: rgba(34, 197, 94, .1);
    color: #a7f3c4;
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--border);
    color: var(--muted);
}

.badge.ok {
    border-color: rgba(34, 197, 94, .4);
    background: rgba(34, 197, 94, .1);
    color: #86efac;
}

.badge.off {
    border-color: rgba(148, 163, 184, .35);
    background: rgba(148, 163, 184, .1);
}

.badge.fail {
    border-color: rgba(239, 68, 68, .4);
    background: rgba(239, 68, 68, .1);
    color: #fca5a5;
}

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 18px 0 6px;
}

.stat {
    padding: 16px 18px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.stat-label {
    display: block;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 6px;
}

.stat b {
    font-size: 24px;
    letter-spacing: -.02em;
}

.row-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.row-actions form {
    margin: 0;
}

.key-chip {
    font-family: var(--mono);
    font-size: 12px;
    background: rgba(255, 255, 255, .05);
    border: 1px solid var(--border);
    color: #cfe0ff;
    padding: 4px 8px;
    border-radius: 7px;
    cursor: pointer;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.key-chip:hover {
    border-color: rgba(79, 139, 255, .5);
}

.pager {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

.preview {
    display: grid;
    gap: 14px;
}

.preview-cover {
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #060a12;
    border-radius: 12px;
    border: 1px solid var(--border);
}

.preview-title {
    font-weight: 600;
    font-size: 15px;
    margin: 0;
}

.preview-meta {
    color: var(--muted);
    font-size: 13px;
    margin: 0;
}

.preview-links {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.preview-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.preview-images img {
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.hidden {
    display: none;
}

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

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

    .hero h1 {
        font-size: 34px;
    }

    .topnav {
        gap: 14px;
        font-size: 13px;
    }
}

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

    .topnav a:nth-child(1) {
        display: none;
    }
}
