:root {
    --bg: #ffffff;
    --bg-soft: #f5f7f9;
    --bg-muted: #f0f0f0;
    --text: #202020;
    --text-muted: #737373;
    --text-light: #9a9a9a;
    --border: #e0e0e0;
    --border-strong: #c8c8c8;
    --primary: #2b77c4;
    --primary-hover: #1f63a8;
    --primary-soft: #e3eef9;
    --link: #2b77c4;
    --sidebar: #384859;
    --sidebar-active: #536a7d;
    --sidebar-hover: #44566a;
    --sidebar-text: #ffffff;
    --success: #43a047;
    --warning: #f29d1a;
    --danger: #d02d4b;
    --danger-soft: #fde8ec;
    --success-soft: #e6f4e7;
    --warning-soft: #fff4e0;
    --info-soft: #e3eef9;
    --shadow: 0 1px 3px rgba(0, 0, 0, .12);
    --shadow-lg: 0 6px 24px rgba(0, 0, 0, .18);
    --input-bg: #ffffff;
    --row-hover: #f5f8fb;
    --overlay: rgba(0, 0, 0, .45);
    --code-bg: #f6f8fa;
}

:root[data-theme="dark"] {
    --bg: #1f2428;
    --bg-soft: #181c20;
    --bg-muted: #2c333a;
    --text: #e6e6e6;
    --text-muted: #a8b0b8;
    --text-light: #7d8790;
    --border: #353d45;
    --border-strong: #4a535c;
    --primary: #4a90d9;
    --primary-hover: #66a5e6;
    --primary-soft: #1e3247;
    --link: #6aaaf0;
    --sidebar: #12161a;
    --sidebar-active: #2d3a47;
    --sidebar-hover: #222b33;
    --danger-soft: #3d1f26;
    --success-soft: #1e3322;
    --warning-soft: #3a2f1a;
    --info-soft: #1e3247;
    --input-bg: #262c32;
    --row-hover: #262d34;
    --code-bg: #262c32;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"])[data-theme-auto="1"] {
        --bg: #1f2428;
        --bg-soft: #181c20;
        --bg-muted: #2c333a;
        --text: #e6e6e6;
        --text-muted: #a8b0b8;
        --border: #353d45;
        --sidebar: #12161a;
        --sidebar-active: #2d3a47;
        --input-bg: #262c32;
        --row-hover: #262d34;
    }
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: "Open Sans", "Helvetica Neue", Helvetica, Arial, "PingFang TC", "Microsoft JhengHei", sans-serif;
    font-size: 14px;
    line-height: 1.43;
    color: var(--text);
    background: var(--bg);
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { font-weight: 400; margin: 0; }

.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 224px;
    flex: 0 0 224px;
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 30;
    transition: margin-left .2s;
}

.sidebar__logo {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: #fff;
    font-size: 30px;
    font-weight: 300;
    letter-spacing: -1px;
}

.sidebar__logo:hover { text-decoration: none; }
.sidebar__logo img { max-height: 36px; max-width: 190px; }
.sidebar__logo-text { font-size: 20px; font-weight: 600; letter-spacing: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.sidebar__nav { flex: 1; overflow-y: auto; padding: 4px 0; }

.sidebar__item {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 31px;
    padding: 0 14px;
    color: var(--sidebar-text);
    font-size: 14px;
    white-space: nowrap;
}

.sidebar__item i { font-size: 15px; width: 18px; text-align: center; opacity: .9; }
.sidebar__item:hover { background: var(--sidebar-hover); text-decoration: none; }
.sidebar__item.is-active { background: var(--sidebar-active); }
.sidebar__sep { height: 1px; background: rgba(255, 255, 255, .08); margin: 6px 0; }

.sidebar__footer {
    padding: 10px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, .7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-toggle {
    position: fixed;
    left: 224px;
    top: 50%;
    width: 14px;
    height: 76px;
    margin-top: -38px;
    background: var(--bg-muted);
    border: 0;
    border-radius: 0 4px 4px 0;
    color: var(--text-muted);
    cursor: pointer;
    z-index: 31;
    padding: 0;
    font-size: 11px;
}

body.sidebar-collapsed .sidebar { margin-left: -224px; }
body.sidebar-collapsed .sidebar-toggle { left: 0; }
body.sidebar-collapsed .main { margin-left: 0; }

.main { flex: 1; margin-left: 224px; display: flex; flex-direction: column; min-width: 0; transition: margin-left .2s; }

.header {
    height: 42px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 16px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 20;
}

.header__search { position: relative; width: 438px; max-width: 40vw; }

.header__search input {
    width: 100%;
    height: 28px;
    border: 1px solid transparent;
    background: var(--bg-muted);
    border-radius: 3px;
    padding: 0 10px 0 34px;
    font-size: 13px;
    color: var(--text);
}

.header__search input:focus { outline: none; border-color: var(--primary); background: var(--input-bg); }
.header__search i { position: absolute; left: 11px; top: 6px; color: var(--text-muted); font-size: 14px; }

.search-results {
    position: absolute;
    top: 32px;
    left: 0;
    right: 0;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: 3px;
    max-height: 420px;
    overflow-y: auto;
    display: none;
    z-index: 50;
}

.search-results.is-open { display: block; }
.search-results__group { padding: 6px 12px 2px; font-size: 11px; text-transform: uppercase; color: var(--text-muted); font-weight: 600; }
.search-results a { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: var(--text); }
.search-results a:hover, .search-results a.is-focus { background: var(--row-hover); text-decoration: none; }
.search-results__empty { padding: 12px; color: var(--text-muted); }

.header__spacer { flex: 1; }

.header__btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    background: none;
    color: var(--link);
    font-size: 12px;
    cursor: pointer;
    position: relative;
    white-space: nowrap;
}

.header__btn i { font-size: 14px; }
.header__btn--icon { color: var(--text-muted); font-size: 16px; }
.header__btn--icon i { font-size: 16px; }
.header__btn:hover { text-decoration: none; color: var(--primary-hover); }

.badge-count {
    position: absolute;
    top: -2px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    background: var(--text-muted);
    color: #fff;
    font-size: 10px;
    line-height: 16px;
    text-align: center;
    padding: 0 4px;
}

.dropdown { position: relative; display: inline-block; }

.dropdown__menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--bg);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: 3px;
    padding: 4px 0;
    display: none;
    z-index: 60;
    max-height: 70vh;
    overflow-y: auto;
}

.dropdown__menu--left { left: 0; right: auto; }
.dropdown.is-open > .dropdown__menu { display: block; }

.dropdown__item, .dropdown__menu button.dropdown__item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 14px;
    color: var(--text);
    font-size: 13px;
    background: none;
    border: 0;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
    font-family: inherit;
}

.dropdown__item:hover { background: var(--row-hover); text-decoration: none; }
.dropdown__item.is-danger { color: var(--danger); }
.dropdown__item.is-selected { font-weight: 600; }
.dropdown__head { padding: 8px 14px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.dropdown__sep { height: 1px; background: var(--border); margin: 4px 0; }

.content { flex: 1; padding: 18px 20px 30px; display: flex; gap: 20px; align-items: flex-start; }
.content__main { flex: 1; min-width: 0; }
.content__aside { width: 212px; flex: 0 0 212px; }

.footer {
    border-top: 1px solid var(--border);
    background: var(--bg-soft);
    text-align: center;
    padding: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.footer a { color: var(--link); margin: 0 4px; }

.breadcrumbs { font-size: 12px; margin-bottom: 4px; color: var(--text-muted); }
.breadcrumbs a { color: var(--link); }
.breadcrumbs .sep { margin: 0 4px; }

.page-title { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; min-height: 44px; flex-wrap: wrap; }
.page-title h1 { font-size: 32px; font-weight: 400; line-height: 1.2; color: var(--text); }
.page-title h1 a { color: var(--link); }
.page-title__tools { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.page-desc { margin: -6px 0 16px; color: var(--text); max-width: 1100px; }

.tabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; }

.tabs a, .tabs button {
    padding: 4px 0 6px;
    color: var(--text);
    font-size: 13px;
    border: 0;
    background: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-family: inherit;
}

.tabs a:hover, .tabs button:hover { text-decoration: none; color: var(--link); }
.tabs a.is-active, .tabs button.is-active { border-bottom-color: var(--text); font-weight: 600; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 28px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    background: var(--bg-muted);
    color: var(--text);
    line-height: 1;
}

.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn:disabled, .btn.is-disabled { opacity: .5; cursor: default; pointer-events: none; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); filter: none; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--ghost { background: transparent; border-color: var(--border-strong); }
.btn--link { background: none; color: var(--link); padding: 0 4px; font-weight: 400; }
.btn--sm { height: 24px; padding: 0 10px; font-size: 12px; }
.btn--lg { height: 34px; padding: 0 22px; font-size: 13px; }
.btn--icon { width: 28px; padding: 0; }
.btn i { font-size: 13px; }

.toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.toolbar__right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

.list-meta { display: flex; align-items: center; justify-content: space-between; font-size: 12px; margin-bottom: 10px; color: var(--text); }
.list-meta a { color: var(--link); }

.search-box { position: relative; }

.search-box input {
    height: 28px;
    width: 180px;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    padding: 0 28px 0 8px;
    font-size: 12px;
    background: var(--input-bg);
    color: var(--text);
}

.search-box button { position: absolute; right: 2px; top: 2px; height: 24px; width: 24px; border: 0; background: none; color: var(--text-muted); cursor: pointer; }

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

.table th {
    text-align: left;
    font-weight: 400;
    color: var(--text);
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-strong);
    font-size: 13px;
    white-space: nowrap;
    background: var(--bg);
}

.table th a { color: var(--text); }
.table th.is-sorted { font-weight: 600; }
.table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:hover { background: var(--row-hover); }
.table td.actions { text-align: right; white-space: nowrap; }
.table .col-check { width: 30px; padding-right: 0; }
.table td a.strong, .table td .name-link { font-weight: 600; }
.table .muted, .muted { color: var(--text-muted); }
.table .small, .small { font-size: 12px; }
.table .unit { color: var(--text-muted); font-size: 12px; }
.table-empty { padding: 30px 10px; text-align: center; color: var(--text-muted); }
.table--compact td, .table--compact th { padding: 5px 8px; font-size: 13px; }

.row-icons { display: inline-flex; gap: 10px; align-items: center; }
.row-icons a { color: var(--text-muted); font-size: 15px; }
.row-icons a:hover { color: var(--primary); text-decoration: none; }
.row-icons .is-blank { width: 15px; display: inline-block; }

.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; white-space: nowrap; }
.status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--text-light); }
.status--active::before, .status--ok::before { background: var(--success); }
.status--disabled::before { background: var(--text-muted); }
.status--suspended::before, .status--error::before { background: var(--danger); }
.status--warning::before { background: var(--warning); }

.status-btn { border: 0; background: none; padding: 2px 4px; cursor: pointer; font-family: inherit; color: var(--text); }

.domain-avatar {
    display: inline-flex;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    color: #fff;
    font-size: 7px;
    font-weight: 700;
    align-items: center;
    justify-content: center;
    margin-right: 6px;
    vertical-align: -3px;
    flex: 0 0 16px;
}

.card { background: var(--bg); border: 1px solid var(--border); border-radius: 3px; box-shadow: var(--shadow); }
.card__head { padding: 10px 14px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card__body { padding: 12px 14px; }
.card + .card { margin-top: 14px; }

.aside-links { padding: 10px 14px; }
.aside-links a { display: flex; align-items: center; gap: 8px; color: var(--text); font-size: 12px; padding: 5px 0; }
.aside-links a i { font-size: 15px; width: 18px; text-align: center; }
.aside-links a:hover { color: var(--link); text-decoration: none; }

.sysinfo { font-size: 12px; }
.sysinfo__head { background: var(--bg-muted); padding: 10px 14px; font-size: 15px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.sysinfo__body { padding: 10px 14px; }
.sysinfo__body p { margin: 0 0 8px; word-break: break-all; }
.sysinfo__body b { font-weight: 600; }
.sysinfo__sec { border-top: 1px solid var(--border); padding: 10px 14px; }

.form-section { margin-bottom: 26px; max-width: 980px; }
.form-section > h2, .form-section__title { font-size: 20px; font-weight: 600; margin: 0 0 14px; }
.form-section > h3 { font-size: 16px; font-weight: 600; margin: 18px 0 10px; }

.form-row { display: flex; gap: 16px; margin-bottom: 14px; align-items: flex-start; }
.form-row__label { width: 190px; flex: 0 0 190px; padding-top: 5px; font-size: 13px; color: var(--text); }
.form-row__label .req { color: var(--danger); }
.form-row__field { flex: 1; min-width: 0; }
.form-row--plain .form-row__label { padding-top: 0; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }
.field-error input, .field-error select, .field-error textarea { border-color: var(--danger) !important; }

.input, .select, .textarea, input.input, select.select, textarea.textarea {
    height: 28px;
    border: 1px solid var(--border-strong);
    border-radius: 2px;
    padding: 0 8px;
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    max-width: 100%;
}

.input { width: 260px; }
.input--wide { width: 440px; }
.input--full { width: 100%; }
.input--sm { width: 120px; }
.input--xs { width: 70px; }
.select { padding-right: 24px; min-width: 120px; }
.textarea { height: auto; min-height: 90px; padding: 6px 8px; width: 440px; resize: vertical; line-height: 1.5; }
.textarea--code { font-family: Menlo, Consolas, "Courier New", monospace; font-size: 12px; width: 100%; min-height: 160px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.input[readonly] { background: var(--bg-muted); }

.input-group { display: inline-flex; align-items: center; gap: 0; }
.input-group .addon { height: 28px; display: inline-flex; align-items: center; padding: 0 8px; background: var(--bg-muted); border: 1px solid var(--border-strong); font-size: 13px; color: var(--text-muted); }
.input-group .addon:first-child { border-right: 0; border-radius: 2px 0 0 2px; }
.input-group .addon:last-child { border-left: 0; border-radius: 0 2px 2px 0; }
.input-group .input { border-radius: 0; }
.input-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

.check { display: inline-flex; align-items: flex-start; gap: 7px; cursor: pointer; font-size: 13px; line-height: 1.4; }
.check input { margin: 2px 0 0; width: 15px; height: 15px; accent-color: var(--primary); flex: 0 0 15px; }
.check + .form-hint { margin-left: 22px; }
.check-list { display: flex; flex-direction: column; gap: 8px; }

.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--border); }
.form-actions .req-note { margin-right: auto; font-size: 12px; color: var(--text-muted); }
.form-actions--plain { border-top: 0; padding-top: 0; }

.alert { padding: 10px 14px; border-radius: 2px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; }
.alert i { font-size: 16px; line-height: 1.2; }
.alert--error { background: var(--danger-soft); color: var(--text); }
.alert--error i { color: var(--danger); }
.alert--success { background: var(--success-soft); }
.alert--success i { color: var(--success); }
.alert--warning { background: var(--warning-soft); }
.alert--warning i { color: var(--warning); }
.alert--info { background: var(--info-soft); }
.alert--info i { color: var(--primary); }
.alert ul { margin: 4px 0 0; padding-left: 18px; }

.toast-wrap { position: fixed; right: 20px; bottom: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.toast { background: var(--bg); border-left: 4px solid var(--success); box-shadow: var(--shadow-lg); padding: 12px 36px 12px 14px; border-radius: 3px; font-size: 13px; position: relative; animation: toast-in .2s ease-out; }
.toast--error { border-left-color: var(--danger); }
.toast--warning { border-left-color: var(--warning); }
.toast__close { position: absolute; right: 8px; top: 8px; border: 0; background: none; cursor: pointer; color: var(--text-muted); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

.drawer-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 100; display: none; }
.drawer-overlay.is-open { display: block; }

.drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 920px;
    max-width: 96vw;
    background: var(--bg);
    z-index: 101;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform .22s ease-out;
    box-shadow: var(--shadow-lg);
    border-radius: 0 10px 10px 0;
}

.drawer.is-open { transform: none; }
.drawer--sm { width: 560px; }
.drawer__head { padding: 18px 24px 10px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--border); }
.drawer__head h2 { font-size: 22px; font-weight: 400; }
.drawer__head .sub { font-size: 12px; color: var(--text-muted); }
.drawer__close { border: 0; background: none; font-size: 18px; color: var(--text-muted); cursor: pointer; }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 24px; }
.drawer__foot { padding: 14px 24px; border-top: 1px solid var(--border); display: flex; gap: 8px; }
.drawer__layout { display: flex; gap: 26px; }
.drawer__layout > .drawer__form { flex: 1; min-width: 0; }
.drawer__toc { width: 200px; flex: 0 0 200px; position: sticky; top: 0; align-self: flex-start; font-size: 13px; }
.drawer__toc b { display: block; color: var(--link); margin: 0 0 6px; }
.drawer__toc a { display: block; padding: 2px 0 2px 12px; color: var(--link); font-size: 12px; position: relative; }
.drawer__toc a::before { content: "•"; position: absolute; left: 2px; color: var(--text); }
.drawer__toc div + b { margin-top: 12px; }
.drawer .form-row__label { width: 150px; flex-basis: 150px; }
.drawer .form-section { max-width: none; }
.drawer-loading { padding: 60px; text-align: center; color: var(--text-muted); }

.modal-overlay { position: fixed; inset: 0; background: var(--overlay); z-index: 150; display: none; align-items: center; justify-content: center; }
.modal-overlay.is-open { display: flex; }
.modal { background: var(--bg); width: 520px; max-width: 94vw; border-radius: 4px; box-shadow: var(--shadow-lg); max-height: 90vh; display: flex; flex-direction: column; }
.modal--wide { width: 860px; }
.modal__head { padding: 16px 20px 8px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal__body { padding: 8px 20px 16px; overflow-y: auto; }
.modal__foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.choice-card {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 3px;
    box-shadow: var(--shadow);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 13px;
}

.choice-card:hover { border-color: var(--primary); text-decoration: none; }
.choice-card.is-selected { background: var(--bg-muted); border-color: var(--border-strong); }
.choice-card i { font-size: 30px; line-height: 1; }
.choice-card b { display: block; font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.choice-card span { color: var(--text-muted); font-size: 12px; }

.icon-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 20px; margin-bottom: 18px; }
.icon-link { display: flex; align-items: center; gap: 10px; color: var(--text); padding: 4px 0; font-size: 13px; }
.icon-link:hover { text-decoration: none; color: var(--link); }
.icon-link .ico { width: 34px; height: 34px; border: 1px solid var(--border); border-radius: 3px; display: inline-flex; align-items: center; justify-content: center; font-size: 18px; flex: 0 0 34px; box-shadow: var(--shadow); background: var(--bg); }
.icon-link small { display: block; color: var(--text-muted); font-size: 11px; }
.icon-link small.warn { background: #fde3c9; color: #b85c00; padding: 0 4px; display: inline-block; }
.icon-group-title { font-weight: 600; font-size: 14px; margin: 4px 0 10px; }

.c-blue { color: #2b77c4; }
.c-green { color: #43a047; }
.c-orange { color: #f29d1a; }
.c-red { color: #d02d4b; }
.c-purple { color: #7e57c2; }
.c-teal { color: #00897b; }
.c-gray { color: #78909c; }
.c-indigo { color: #3f51b5; }

.dom-panel { display: flex; gap: 0; border: 1px solid var(--border); border-radius: 3px; box-shadow: var(--shadow); background: var(--bg); }
.dom-panel__side { width: 190px; flex: 0 0 190px; border-right: 1px solid var(--border); padding: 10px; }
.dom-panel__main { flex: 1; padding: 14px 16px; min-width: 0; }
.dom-preview { height: 130px; border: 1px solid var(--border); background: var(--bg-soft); display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 28px; margin-bottom: 8px; overflow: hidden; }
.dom-preview iframe { width: 1280px; height: 960px; transform: scale(.132); transform-origin: 0 0; border: 0; pointer-events: none; }
.dom-preview-wrap { position: relative; width: 100%; height: 130px; overflow: hidden; }
.dom-stats { border: 1px solid var(--border); padding: 8px 10px; font-size: 12px; }
.dom-stats b { font-weight: 600; font-size: 13px; display: flex; justify-content: space-between; margin-bottom: 6px; }
.dom-stats div { display: flex; gap: 8px; margin-bottom: 4px; }
.dom-stats div span:first-child { color: var(--text-muted); min-width: 64px; }
.dom-foot { border-top: 1px solid var(--border); padding: 8px 12px; font-size: 11px; color: var(--text-muted); display: flex; gap: 18px; flex-wrap: wrap; }
.dom-foot a { margin-left: auto; }

.tools-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 30px; }
.tools-group h3 { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.tools-group h3 i { font-size: 22px; }
.tools-group ul { list-style: none; margin: 0; padding: 0 0 0 30px; }
.tools-group li { font-size: 12px; padding: 1px 0; position: relative; }
.tools-group li::before { content: "•"; position: absolute; left: -10px; color: var(--text); }

.fm { display: flex; gap: 0; border-top: 1px solid var(--border); }
.fm__tree { width: 220px; flex: 0 0 220px; border-right: 1px solid var(--border); padding: 8px 6px; font-size: 12px; max-height: 70vh; overflow: auto; }
.fm__tree ul { list-style: none; margin: 0; padding-left: 14px; }
.fm__tree > ul { padding-left: 0; }
.fm__tree li > a { display: flex; align-items: center; gap: 4px; padding: 3px 4px; color: var(--text); white-space: nowrap; border-radius: 2px; }
.fm__tree li > a:hover { background: var(--row-hover); text-decoration: none; }
.fm__tree li > a.is-current { background: var(--primary-soft); }
.fm__tree .toggle { width: 12px; color: var(--text-muted); cursor: pointer; font-size: 9px; }
.fm__tree .bi-folder-fill { color: #f0b429; }
.fm__main { flex: 1; min-width: 0; padding: 8px 0 0 14px; }
.fm__path { font-size: 12px; margin-bottom: 6px; }
.fm .bi-folder-fill { color: #f0b429; }
.fm .file-icon { color: var(--text-muted); }

.editor-wrap { border: 1px solid var(--border-strong); }
.editor-wrap textarea { border: 0; width: 100%; min-height: 62vh; font-family: Menlo, Consolas, "Courier New", monospace; font-size: 13px; padding: 10px; background: var(--code-bg); color: var(--text); resize: vertical; tab-size: 4; line-height: 1.5; }
.editor-wrap textarea:focus { outline: none; }

.pre { background: var(--code-bg); border: 1px solid var(--border); padding: 10px 12px; font-family: Menlo, Consolas, monospace; font-size: 12px; white-space: pre-wrap; word-break: break-all; max-height: 60vh; overflow: auto; margin: 0; }
.pre--log { white-space: pre; word-break: normal; }

.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-all; }

.meter { height: 6px; background: var(--bg-muted); border-radius: 3px; overflow: hidden; min-width: 80px; }
.meter > span { display: block; height: 100%; background: var(--primary); }
.meter--warn > span { background: var(--warning); }
.meter--danger > span { background: var(--danger); }

.stat-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat-card { border: 1px solid var(--border); border-radius: 3px; padding: 12px 14px; box-shadow: var(--shadow); }
.stat-card__label { font-size: 12px; color: var(--text-muted); }
.stat-card__value { font-size: 24px; font-weight: 300; margin-top: 4px; }

.pager { display: flex; gap: 4px; align-items: center; font-size: 12px; }
.pager a, .pager span { padding: 2px 7px; border-radius: 2px; }
.pager .is-current { background: var(--primary); color: #fff; }
.per-page a { margin: 0 2px; }
.per-page .is-current { font-weight: 600; color: var(--text); }

.empty-state { text-align: center; padding: 50px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; display: block; margin-bottom: 10px; color: var(--border-strong); }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 6px; }

.expand-row td { background: var(--bg-soft); }
.db-card { border: 1px solid var(--border); border-radius: 3px; margin-bottom: 12px; box-shadow: var(--shadow); }
.db-card__head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--border); border-top: 2px solid var(--primary); }
.db-card__head b { font-size: 14px; }
.db-card__body { padding: 14px 18px; }
.db-card__foot { padding: 8px 18px; font-size: 11px; color: var(--text-muted); border-top: 1px solid var(--border); display: flex; gap: 16px; }

.chart { width: 100%; height: 220px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; margin-top: 6px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; background: var(--c); vertical-align: -1px; }

.copy-btn { border: 0; background: none; color: var(--text-muted); cursor: pointer; padding: 0 2px; }
.copy-btn:hover { color: var(--primary); }

.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg-soft); }
.login-box { width: 360px; background: var(--bg); padding: 34px 36px 28px; border-radius: 4px; box-shadow: 0 2px 14px rgba(0, 0, 0, .1); }
.login-logo { text-align: center; font-size: 30px; font-weight: 600; color: var(--sidebar); margin-bottom: 18px; letter-spacing: 2px; }
.login-box label { display: block; font-size: 13px; margin: 12px 0 4px; }
.login-box .input, .login-box .select { width: 100%; height: 34px; font-size: 14px; }
.login-box .btn { width: 100%; height: 36px; margin-top: 20px; font-size: 14px; }
.login-foot { margin-top: 16px; font-size: 12px; color: var(--text-muted); text-align: center; }

.hidden { display: none !important; }
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 6px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 20px; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 6px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 20px; }
.gap-1 { gap: 6px; }
.flex { display: flex; align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.grow { flex: 1; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12px; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.strong { font-weight: 600; }
.tag { display: inline-block; padding: 0 6px; border-radius: 2px; font-size: 11px; background: var(--bg-muted); color: var(--text-muted); line-height: 18px; }
.tag--blue { background: var(--primary-soft); color: var(--primary); }
.tag--green { background: var(--success-soft); color: var(--success); }
.tag--red { background: var(--danger-soft); color: var(--danger); }
.tag--orange { background: var(--warning-soft); color: #b56a00; }

.air-datepicker { --adp-accent-color: var(--primary); --adp-background-color: var(--bg); --adp-color: var(--text); --adp-border-color: var(--border); --adp-border-color-inner: var(--border); font-family: inherit; }

@media (max-width: 1200px) {
    .content__aside { display: none; }
    .tools-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .sidebar { margin-left: -224px; }
    .sidebar-toggle { left: 0; }
    body.sidebar-open .sidebar { margin-left: 0; }
    body.sidebar-open .sidebar-toggle { left: 224px; }
    .main { margin-left: 0; }
    .form-row { flex-direction: column; gap: 4px; }
    .form-row__label { width: auto; flex: none; }
    .tools-grid, .icon-grid, .choice-grid, .stat-cards { grid-template-columns: repeat(1, minmax(0, 1fr)); }
    .header__search { width: auto; flex: 1; }
    .dom-panel { flex-direction: column; }
    .dom-panel__side { width: auto; border-right: 0; border-bottom: 1px solid var(--border); }
    .drawer__toc { display: none; }
    .input, .input--wide, .textarea { width: 100%; }
    .table-wrap { overflow-x: auto; }
}

.spin { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
