body {
    margin: 0;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    background: #edf0f5;
    color: #1f2329;
}

a {
    color: inherit;
    text-decoration: none;
}

.admin-shell {
    min-height: 100vh;
    position: relative;
}

.admin-sidebar {
    position: fixed;
    z-index: 1000;
    left: 0;
    right: 0;
    top: 0;
    height: 54px;
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    background: #2b2f3a;
    color: #d9dee7;
    border-bottom: 1px solid #1f232c;
}

.admin-brand {
    flex: 0 0 auto;
    height: 54px;
    line-height: 54px;
    padding: 0 20px;
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    border-right: 1px solid #3a3f4d;
    background: #252934;
}

.admin-group {
    position: relative;
    flex: 0 0 auto;
}

.admin-group h3 {
    margin: 0;
    padding: 0 18px;
    height: 54px;
    line-height: 54px;
    font-size: 14px;
    font-weight: 500;
    color: #d7dce6;
    cursor: pointer;
    user-select: none;
    border-right: 1px solid #3a3f4d;
}

.admin-group h3:hover {
    background: #3a3f4d;
}

.admin-group.is-current-group h3 {
    background: #4f79d8;
    color: #ffffff;
}

.admin-group ul {
    list-style: none;
    margin: 0;
    padding: 10px 0;
    position: fixed;
    z-index: 900;
    top: 55px;
    left: 0;
    width: 220px;
    height: calc(100vh - 55px);
    overflow-y: auto;
    overflow-x: hidden;
    display: none;
    background: #3f4759;
    border-right: 1px solid #323949;
}

.admin-group li {
    margin: 0;
    padding: 0;
}

.admin-group li a {
    display: block;
    padding: 9px 16px;
    font-size: 13px;
    color: #e8ecf3;
    border-left: 3px solid transparent;
}

.admin-group li a:hover {
    background: #4a5266;
}

.admin-group li.is-active {
    background: transparent;
}

.admin-group li.is-active a {
    background: #56617a;
    color: #ffffff;
    border-left-color: #8fb3ff;
}

.admin-group.is-current-group ul {
    display: block;
}

.admin-main {
    margin-left: 220px;
    padding: 70px 18px 18px;
    min-height: calc(100vh - 88px);
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 16px;
    background: #ffffff;
    border: 1px solid #d9dee7;
    padding: 12px 16px;
}

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

.btn-link {
    border: 1px solid #4f79d8;
    border-radius: 2px;
    padding: 7px 12px;
    background: #4f79d8;
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    line-height: 1;
}

.btn-link.btn-soft {
    background: #f7f9fc;
    border-color: #cfd6e3;
    color: #2f3645;
}

.btn-link.btn-danger {
    background: #e34d59;
    border-color: #e34d59;
}

.admin-title {
    font-size: 18px;
    font-weight: 600;
}

.admin-subtitle {
    color: #7b8494;
    margin-top: 2px;
    font-size: 12px;
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 22px;
}

.admin-card {
    background: #fff;
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

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

.module-filters input,
.module-filters select,
.module-filters button,
.module-form input,
.module-form textarea,
.module-form select,
.module-form button {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
}

.module-filters button,
.module-form button {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
    cursor: pointer;
}

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

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

.module-table th,
.module-table td {
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    padding: 10px 8px;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.row-actions a {
    color: #2563eb;
}

.table-meta {
    margin-bottom: 10px;
    color: #475569;
}

.module-form {
    display: grid;
    gap: 12px;
}

.module-form label {
    display: grid;
    gap: 8px;
}

.module-form textarea {
    min-height: 120px;
    resize: vertical;
}

.utility-stack {
    display: grid;
    gap: 18px;
}

.utility-form {
    display: grid;
    gap: 14px;
}

.utility-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.utility-form label,
.utility-field {
    display: grid;
    gap: 8px;
}

.utility-form input,
.utility-form textarea,
.utility-form select {
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    box-sizing: border-box;
    width: 100%;
}

.utility-form textarea {
    min-height: 280px;
    resize: vertical;
}

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

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

.utility-table th,
.utility-table td {
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    padding: 10px 8px;
}

.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.stat-pill {
    padding: 14px 16px;
    border-radius: 14px;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
}

.stat-pill strong {
    display: block;
    font-size: 20px;
    margin-top: 6px;
}

.note-box {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    line-height: 1.7;
}

.note-box.note-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.badge-ok,
.badge-warn {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
}

.badge-ok {
    background: #dcfce7;
    color: #166534;
}

.badge-warn {
    background: #fee2e2;
    color: #991b1b;
}

.tiny {
    font-size: 12px;
    color: #64748b;
}

.inline-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    word-break: break-all;
    color: #1e293b;
}

.admin-card .label {
    color: #64748b;
    font-size: 13px;
    margin-bottom: 8px;
}

.admin-card .value {
    font-size: 26px;
    font-weight: 700;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(320px, 520px) 1fr;
}

.login-panel {
    background: #0f172a;
    color: #f8fafc;
    padding: 56px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-panel h1 {
    font-size: 42px;
    margin: 0 0 12px;
}

.login-panel p {
    color: #cbd5e1;
    line-height: 1.7;
}

.login-form {
    margin-top: 28px;
}

.login-form label {
    display: block;
    margin-bottom: 16px;
}

.login-form span {
    display: block;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.login-form input {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    border-radius: 14px;
    padding: 14px 16px;
    font-size: 15px;
}

.login-form button {
    width: 100%;
    border: 0;
    border-radius: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    margin-top: 8px;
}

.login-side {
    background:
        radial-gradient(circle at top left, rgba(56, 189, 248, 0.25), transparent 32%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.2), transparent 30%),
        linear-gradient(135deg, #e2e8f0 0%, #f8fafc 50%, #dbeafe 100%);
    padding: 56px;
    display: flex;
    align-items: flex-end;
}

.login-side-card {
    max-width: 460px;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}

.login-side-card h2 {
    margin: 0 0 10px;
    font-size: 28px;
}

.muted {
    color: #64748b;
}

.notice {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(56, 189, 248, 0.08);
    color: #0f172a;
    font-size: 14px;
}

.auto-jump a {
    color: #2563eb;
    font-weight: 600;
}

.utility-actions form {
    margin: 0;
}

.utility-form-inline {
    align-items: end;
}

.wide-textarea {
    min-height: 320px;
}

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

.chip-btn {
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    border-radius: 999px;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
}

.indent-name {
    padding-left: 24px !important;
}

.field-inline {
    display: flex;
    gap: 10px;
    align-items: center;
}

.field-inline input {
    flex: 1 1 auto;
}

.btn-inline {
    white-space: nowrap;
    padding: 10px 12px;
}

.flat-card {
    box-shadow: none;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.option-line {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    align-items: center;
}

.option-line label {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

@media (max-width: 960px) {
    .login-wrap {
        grid-template-columns: 1fr;
    }

    .admin-main {
        margin-left: 0;
        padding-top: 112px;
    }

    .admin-sidebar {
        height: 112px;
        flex-wrap: wrap;
    }

    .admin-brand {
        width: 100%;
        border-right: 0;
        border-bottom: 1px solid #3a3f4d;
        height: 44px;
        line-height: 44px;
    }

    .admin-group h3 {
        height: 66px;
        line-height: 66px;
    }

    .admin-group ul {
        width: 100%;
        top: 112px;
        height: calc(100vh - 112px);
    }

    .login-side {
        min-height: 260px;
        align-items: center;
    }
}
