:root {
    --ink: #16233e;
    --ink-deep: #0e192e;
    --ink-soft: #263858;
    --brass: #d6b978;
    --brass-deep: #b4934d;
    --jade: #1f8a70;
    --jade-soft: #e7f5f0;
    --canvas: #f2f5fa;
    --paper: #ffffff;
    --line: #dfe5ee;
    --line-strong: #cbd4e1;
    --text: #1a2740;
    --muted: #6d788a;
    --danger: #bd4d55;
    --danger-soft: #fff0f1;
    --shadow: 0 18px 48px rgba(20, 35, 62, .10);
    --shadow-small: 0 8px 24px rgba(20, 35, 62, .08);
    --radius: 14px;
    --radius-small: 9px;
    font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--canvas);
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; background: var(--canvas); }
button, input, select { font: inherit; }
button { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

:focus-visible {
    outline: 3px solid rgba(31, 138, 112, .28);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.eyebrow {
    margin: 0 0 7px;
    color: var(--brass-deep);
    font: 700 11px/1.2 Bahnschrift, "Segoe UI", sans-serif;
    letter-spacing: .18em;
}

/* 登录页 */
.login-view {
    position: relative;
    display: grid;
    grid-template-columns: minmax(420px, 1.15fr) minmax(440px, .85fr);
    min-height: 100vh;
    overflow: hidden;
    background:
        radial-gradient(circle at 14% 87%, rgba(31, 138, 112, .14), transparent 30%),
        radial-gradient(circle at 87% 9%, rgba(214, 185, 120, .14), transparent 28%),
        linear-gradient(135deg, #edf4f7 0%, #f6f8fb 52%, #eef1f6 100%);
}

.login-orbit {
    position: absolute;
    border: 1px solid rgba(31, 138, 112, .14);
    border-radius: 50%;
    pointer-events: none;
}
.orbit-one { width: 520px; height: 520px; left: -200px; bottom: -210px; box-shadow: inset 0 0 0 54px rgba(31, 138, 112, .035); }
.orbit-two { width: 390px; height: 390px; right: -150px; top: -175px; border-color: rgba(180, 147, 77, .17); }

.login-story {
    position: relative;
    z-index: 1;
    align-self: center;
    max-width: 650px;
    padding: 70px clamp(50px, 7vw, 120px);
}

.story-mark {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 30px;
    color: var(--jade);
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(31, 138, 112, .16);
    border-radius: 21px;
    box-shadow: var(--shadow-small);
}
.story-mark svg { width: 43px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.login-story h1 { margin: 0; max-width: 560px; color: var(--ink); font-size: clamp(36px, 4.5vw, 62px); line-height: 1.17; letter-spacing: -.045em; font-weight: 760; }
.login-story > p:not(.eyebrow) { max-width: 570px; margin: 24px 0 0; color: #56657b; font-size: 16px; line-height: 1.9; }

.story-flow {
    display: flex;
    align-items: center;
    max-width: 570px;
    margin-top: 45px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}
.story-flow span, .story-flow strong { white-space: nowrap; }
.story-flow strong { padding: 9px 14px; color: white; background: var(--ink); border-radius: 7px; letter-spacing: .04em; }
.story-flow i { position: relative; flex: 1; height: 1px; margin: 0 10px; background: linear-gradient(90deg, var(--line-strong), var(--jade)); }
.story-flow i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-top: 1px solid var(--jade); border-right: 1px solid var(--jade); transform: rotate(45deg); }

.login-card-wrap {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 42px clamp(28px, 5vw, 80px);
    background: rgba(255, 255, 255, .34);
    border-left: 1px solid rgba(255, 255, 255, .7);
    backdrop-filter: blur(12px);
}

.login-card {
    width: min(100%, 430px);
    padding: 34px 36px 28px;
    background: rgba(255, 255, 255, .96);
    border: 1px solid rgba(203, 212, 225, .78);
    border-radius: 20px;
    box-shadow: 0 28px 70px rgba(22, 35, 62, .14);
}
.login-brand { display: flex; align-items: center; gap: 15px; margin-bottom: 26px; }
.login-logo { display: grid; place-items: center; width: 52px; height: 52px; color: white; background: linear-gradient(145deg, var(--ink-soft), var(--ink-deep)); border-radius: 15px; box-shadow: 0 9px 20px rgba(14, 25, 46, .20); font-size: 22px; font-weight: 800; }
.login-brand h2 { margin: 0; color: var(--ink); font-size: 22px; letter-spacing: .04em; }
.login-brand .eyebrow { margin-bottom: 5px; }
.login-notice { display: flex; align-items: center; gap: 9px; margin-bottom: 23px; padding: 10px 12px; color: #4b5b70; background: #f4f7fa; border: 1px solid #e5eaf1; border-radius: 8px; font-size: 12px; }
.notice-dot { width: 8px; height: 8px; background: var(--jade); border-radius: 50%; box-shadow: 0 0 0 4px rgba(31, 138, 112, .11); }

.field-label { display: block; margin-bottom: 18px; }
.field-label > span { display: block; margin-bottom: 8px; color: #48556a; font-size: 13px; font-weight: 700; }
.locked-account, .input-shell {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 13px;
    background: white;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.locked-account { background: #f7f8fa; color: var(--ink); }
.locked-account svg, .input-shell > svg { width: 18px; height: 18px; margin-right: 10px; fill: none; stroke: #7a8798; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.locked-account strong { font-size: 14px; }
.locked-account small { margin-left: auto; color: #8a94a3; font-size: 11px; }
.input-shell:focus-within { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(31, 138, 112, .1); }
.input-shell input { flex: 1; min-width: 0; height: 44px; padding: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 14px; }
.input-shell input::placeholder { color: #a4adba; }
.input-action { padding: 6px 0 6px 10px; color: var(--jade); background: transparent; border: 0; cursor: pointer; font-size: 12px; }

.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 118px; gap: 10px; }
.captcha-button { position: relative; display: grid; place-items: center; height: 46px; padding: 0; overflow: hidden; background: #eef2f5; border: 1px solid var(--line-strong); border-radius: 8px; cursor: pointer; }
.captcha-button img { width: 100%; height: 100%; object-fit: cover; }
.captcha-button span { color: var(--muted); font-size: 12px; }

.mfa-panel { margin: 4px 0 18px; padding: 14px; background: #fffaf0; border: 1px solid #eadab5; border-radius: 10px; }
.mfa-heading { display: flex; align-items: center; justify-content: space-between; }
.mfa-heading span { color: #7a6128; font-weight: 800; font-size: 13px; }
.mfa-heading button { color: #8a6a27; background: transparent; border: 0; cursor: pointer; font-size: 12px; }
.mfa-panel > p { margin: 8px 0 14px; color: #7d704f; font-size: 12px; line-height: 1.65; }
.mfa-panel .field-label { margin-bottom: 0; }

.login-message { min-height: 20px; margin: -2px 0 9px; color: var(--danger); font-size: 12px; line-height: 1.5; }
.login-submit { display: flex; justify-content: center; align-items: center; gap: 10px; width: 100%; min-height: 48px; color: white; background: linear-gradient(135deg, var(--ink-soft), var(--ink-deep)); border: 0; border-radius: 9px; box-shadow: 0 12px 24px rgba(14, 25, 46, .18); cursor: pointer; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease; }
.login-submit:hover { transform: translateY(-1px); box-shadow: 0 15px 28px rgba(14, 25, 46, .23); }
.login-submit:disabled { opacity: .64; cursor: wait; transform: none; }
.login-submit svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.login-security { margin: 18px 2px 0; color: #8993a1; font-size: 11px; line-height: 1.65; text-align: center; }
.login-footnote { margin: 20px 0 0; color: #8993a1; font: 11px/1.4 Bahnschrift, "Microsoft YaHei", sans-serif; letter-spacing: .08em; }

/* 后台框架 */
.admin-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 8; display: flex; flex-direction: column; width: 236px; padding: 24px 18px; color: #dce4f1; background: linear-gradient(180deg, var(--ink-deep), var(--ink) 58%, #12203a); box-shadow: 9px 0 30px rgba(14, 25, 46, .08); }
.sidebar-brand { display: flex; align-items: center; gap: 12px; min-height: 55px; padding: 0 10px 24px; border-bottom: 1px solid rgba(255, 255, 255, .09); }
.brand-seal { display: grid; place-items: center; width: 40px; height: 40px; color: var(--ink-deep); background: var(--brass); border-radius: 11px; font-size: 18px; font-weight: 900; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand strong { color: white; font-size: 16px; letter-spacing: .06em; }
.sidebar-brand span { margin-top: 4px; color: #8290a8; font: 9px Bahnschrift, sans-serif; letter-spacing: .17em; }
.sidebar nav { margin-top: 26px; }
.nav-item { display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 0 13px; color: #9eabc0; border-radius: 8px; text-decoration: none; font-size: 14px; transition: background .18s ease, color .18s ease; }
.nav-item svg { width: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav-item.active { color: #fff; background: rgba(214, 185, 120, .13); box-shadow: inset 3px 0 0 var(--brass); }
.sidebar-note { display: flex; align-items: flex-start; gap: 11px; margin-top: auto; padding: 14px 12px; background: rgba(255, 255, 255, .045); border: 1px solid rgba(255, 255, 255, .07); border-radius: 10px; }
.sidebar-note strong, .sidebar-note small { display: block; }
.sidebar-note strong { color: #eaf0f8; font-size: 12px; }
.sidebar-note small { margin-top: 5px; color: #7e8ba0; font-size: 10px; line-height: 1.5; }
.online-dot { flex: 0 0 auto; width: 8px; height: 8px; margin-top: 3px; background: #55c79d; border-radius: 50%; box-shadow: 0 0 0 4px rgba(85, 199, 157, .10); }

.content-shell { grid-column: 2; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; min-height: 88px; padding: 15px clamp(24px, 4vw, 52px); background: rgba(255, 255, 255, .94); border-bottom: 1px solid var(--line); }
.breadcrumb { margin: 0 0 5px; color: #8893a2; font-size: 11px; }
.topbar h1 { margin: 0; color: var(--ink); font-size: 23px; letter-spacing: .025em; }
.operator-block { display: flex; align-items: center; gap: 11px; }
.operator-avatar { display: grid; place-items: center; width: 38px; height: 38px; color: var(--ink); background: #ead8ac; border-radius: 10px; font: 800 12px Bahnschrift, sans-serif; }
.operator-block small, .operator-block strong { display: block; }
.operator-block small { margin-bottom: 3px; color: #8b95a3; font-size: 10px; }
.operator-block strong { color: var(--ink); font-size: 13px; }
.logout-button { margin-left: 8px; padding: 8px 12px; color: #657186; background: transparent; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; font-size: 12px; }
.logout-button:hover { color: var(--danger); border-color: #e1b8bc; background: var(--danger-soft); }

main { padding: 30px clamp(24px, 4vw, 52px) 55px; }
.status-deck { display: grid; grid-template-columns: minmax(300px, 1.5fr) repeat(3, minmax(135px, .55fr)); overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.status-lead { display: flex; align-items: center; gap: 16px; min-height: 132px; padding: 24px 28px; background: linear-gradient(120deg, #f8fafc, #f1f6f5); }
.status-lead strong, .status-lead span { display: block; }
.status-lead strong { margin-bottom: 7px; color: var(--ink); font-size: 17px; }
.status-lead span { color: #778396; font-size: 11px; }
.status-icon { position: relative; display: flex; align-items: center; gap: 5px; width: 54px; height: 54px; padding: 0 10px; border: 1px solid #cfe1dc; border-radius: 14px; background: white; }
.status-icon span { width: 10px; height: 10px; background: var(--jade); border-radius: 50%; box-shadow: 0 0 0 5px rgba(31, 138, 112, .10); }
.status-icon i { flex: 1; height: 2px; background: #accfc5; }
.status-icon i:last-child { flex: 0 0 7px; height: 7px; background: var(--brass); border-radius: 2px; }
.metric { min-height: 132px; margin: 0; padding: 24px 22px; border-left: 1px solid var(--line); }
.metric dt { color: #778295; font-size: 11px; }
.metric dd { margin: 11px 0 7px; color: var(--ink); font: 700 28px/1 Bahnschrift, "Microsoft YaHei", sans-serif; }
.metric span { color: #9ba4b0; font-size: 10px; }
.metric.muted dd { color: #8994a5; }

.workspace { margin-top: 24px; padding: 28px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-small); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid #e8ecf2; }
.section-heading h2 { margin: 0; color: var(--ink); font-size: 22px; }
.section-heading > div > p:last-child { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.toolbar { display: flex; gap: 10px; }
.search-field { display: flex; align-items: center; width: min(310px, 30vw); height: 40px; padding: 0 12px; background: #f8f9fb; border: 1px solid var(--line); border-radius: 8px; }
.search-field:focus-within { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(31, 138, 112, .08); }
.search-field svg { width: 17px; margin-right: 8px; fill: none; stroke: #8b96a6; stroke-width: 1.8; stroke-linecap: round; }
.search-field input { flex: 1; min-width: 0; height: 100%; padding: 0; color: var(--text); background: transparent; border: 0; outline: 0; font-size: 12px; }

.button { min-height: 40px; padding: 0 16px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; font-size: 12px; font-weight: 700; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { opacity: .58; cursor: wait; transform: none; }
.button.primary { color: white; background: var(--ink); border-color: var(--ink); box-shadow: 0 7px 16px rgba(22, 35, 62, .14); }
.button.primary:hover { background: var(--ink-soft); }
.button.quiet { color: #5f6b7d; background: white; border-color: var(--line-strong); }
.button.signal { color: #176b59; background: var(--jade-soft); border-color: #b9dfd4; }
.button.danger { color: white; background: var(--danger); }

.route-list { display: grid; gap: 15px; }
.route-card { padding: 19px 20px 17px; background: white; border: 1px solid var(--line); border-radius: 11px; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
.route-card:hover { transform: translateY(-1px); border-color: #cad5e2; box-shadow: var(--shadow-small); }
.route-card.is-disabled { background: #fafbfc; opacity: .72; }
.route-card-header, .route-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 15px; }
.route-title-line { display: flex; align-items: center; gap: 9px; }
.route-title-line h3 { margin: 0; color: var(--ink); font: 700 15px Bahnschrift, "Microsoft YaHei", sans-serif; letter-spacing: .025em; }
.route-card-header p { margin: 6px 0 0; color: #929baa; font-size: 10px; }
.status-pill { display: inline-flex; align-items: center; min-height: 21px; padding: 0 8px; color: #18715d; background: var(--jade-soft); border: 1px solid #c2e5dc; border-radius: 20px; font-size: 9px; font-weight: 800; }
.is-disabled .status-pill { color: #717b89; background: #eef1f4; border-color: #dde2e8; }
.card-actions { display: flex; gap: 4px; }
.text-button { padding: 6px 8px; color: #556379; background: transparent; border: 0; border-radius: 5px; cursor: pointer; font-size: 11px; }
.text-button:hover { background: #f0f3f7; }
.danger-text { color: var(--danger); }

.route-topology { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 76px minmax(0, 1fr); align-items: center; gap: 46px; min-height: 104px; margin: 15px 0; padding: 14px 18px; background: linear-gradient(90deg, #f7f9fc, #f2f7f6 51%, #f7f9fc); border: 1px solid #e7ebf0; border-radius: 9px; }
.endpoint { position: relative; z-index: 2; min-width: 0; }
.endpoint small, .endpoint strong, .endpoint span { display: block; }
.endpoint small { margin-bottom: 6px; color: #9aa4b2; font: 700 8px Bahnschrift, sans-serif; letter-spacing: .16em; }
.endpoint strong { overflow: hidden; color: var(--ink); font: 700 13px/1.35 Bahnschrift, "Microsoft YaHei", sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.endpoint span { margin-top: 5px; overflow: hidden; color: #7b8798; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.internal-endpoint { text-align: right; }
.gateway-node { position: relative; z-index: 3; display: grid; place-items: center; width: 76px; height: 62px; color: white; background: linear-gradient(145deg, var(--ink-soft), var(--ink-deep)); border: 4px solid #edf2f3; border-radius: 12px; box-shadow: 0 7px 16px rgba(14, 25, 46, .16); }
.gateway-node span { font: 800 18px Bahnschrift, sans-serif; }
.gateway-node small { margin-top: -4px; color: var(--brass); font: 7px Bahnschrift, sans-serif; letter-spacing: .12em; }
.connection-line { position: absolute; top: 50%; z-index: 1; height: 1px; background: #aac8c0; }
.connection-line.first { left: calc(33.33% - 12px); right: calc(50% + 37px); }
.connection-line.second { left: calc(50% + 37px); right: calc(33.33% - 12px); }
.connection-line b { position: absolute; right: 10%; top: -3px; width: 7px; height: 7px; background: var(--jade); border-radius: 50%; box-shadow: 0 0 0 3px rgba(31, 138, 112, .10); }
.connection-line.first b { animation: signalTravel 2.8s ease-in-out infinite; }
.connection-line.second b { animation: signalTravel 2.8s .65s ease-in-out infinite; }

.route-card-footer { min-height: 28px; }
.route-flags { display: flex; flex: 1; flex-wrap: wrap; gap: 6px; }
.flag { padding: 4px 7px; color: #667386; background: #f5f7f9; border-radius: 4px; font-size: 9px; }
.version-tag { color: #9aa3b0; font: 9px Bahnschrift, sans-serif; }
.toggle-button { min-width: 58px; min-height: 28px; color: #6b7789; background: white; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; font-size: 10px; }
.toggle-button:hover { color: var(--ink); border-color: #aeb9c8; }

.empty-state { padding: 70px 20px; text-align: center; }
.empty-topology { display: flex; align-items: center; justify-content: center; width: 160px; height: 58px; margin: 0 auto 18px; }
.empty-topology span, .empty-topology strong { width: 28px; height: 28px; border: 2px solid #cdd6e1; border-radius: 7px; }
.empty-topology strong { background: var(--ink); border-color: var(--ink); }
.empty-topology i { width: 52px; height: 1px; background: #cdd6e1; }
.empty-state h3 { margin: 0; color: var(--ink); font-size: 17px; }
.empty-state p { margin: 9px 0 20px; color: var(--muted); font-size: 12px; }

/* 抽屉与表单 */
.drawer-backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(8, 17, 33, .48); backdrop-filter: blur(2px); }
.route-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 21; width: min(760px, 94vw); background: white; box-shadow: -22px 0 55px rgba(8, 17, 33, .18); transform: translateX(102%); transition: transform .22s ease; }
.route-drawer.is-open { transform: translateX(0); }
.route-drawer form { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; min-height: 84px; padding: 18px 28px; border-bottom: 1px solid var(--line); }
.drawer-header h2 { margin: 0; color: var(--ink); font-size: 21px; }
.close-button { display: grid; place-items: center; width: 34px; height: 34px; color: #6e7989; background: #f4f6f8; border: 0; border-radius: 8px; cursor: pointer; font-size: 22px; }
.form-scroll { overflow-y: auto; padding: 6px 28px 30px; }
.form-section { padding: 25px 0 27px; border-bottom: 1px solid #e9edf2; }
.form-section:last-child { border-bottom: 0; }
.form-section-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.form-section-title > span { display: grid; place-items: center; width: 28px; height: 28px; color: #8b6d31; background: #f6edd9; border-radius: 7px; font: 700 10px Bahnschrift, sans-serif; }
.form-section-title h3 { margin: 1px 0 0; color: var(--ink); font-size: 15px; }
.form-section-title p { margin: 5px 0 0; color: #8a94a2; font-size: 10px; }
.form-grid { display: grid; gap: 18px; }
.two-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-column { grid-template-columns: 1.2fr .8fr .8fr; }
.form-grid label > span, .target-row label > span { display: block; margin-bottom: 7px; color: #4d5a6e; font-size: 11px; font-weight: 700; }
.form-grid input, .form-grid select, .target-row input { width: 100%; min-height: 41px; padding: 0 11px; color: var(--text); background: #fbfcfd; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; font-size: 12px; }
.form-grid input:focus, .form-grid select:focus, .target-row input:focus { border-color: var(--jade); box-shadow: 0 0 0 3px rgba(31, 138, 112, .08); }
.form-grid small, .target-row small { display: block; margin-top: 6px; color: #949eab; font-size: 9px; line-height: 1.5; }
.target-row { display: grid; grid-template-columns: minmax(0, 1fr) 150px auto; align-items: end; gap: 12px; }
.target-section-title { align-items: center; }
.target-section-title > div { flex: 1; }
.add-target-button { margin-left: auto; white-space: nowrap; }
.targets-editor { display: grid; gap: 14px; }
.target-editor { padding: 16px; background: #fafcfd; border: 1px solid #dfe5eb; border-radius: 10px; }
.target-editor-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.target-editor-header strong, .target-editor-header small { display: block; }
.target-editor-header strong { color: var(--ink); font-size: 13px; }
.target-editor-header small { margin-top: 4px; color: #929daa; font-size: 9px; }
.target-definition-grid { grid-template-columns: minmax(120px, .65fr) minmax(190px, 1fr) minmax(240px, 1.35fr); }
.target-uri-field { grid-column: auto; }
.target-options { display: grid; grid-template-columns: minmax(160px, 1fr) minmax(140px, .7fr) auto; align-items: end; gap: 12px; margin-top: 14px; }
.target-options label > span { display: block; margin-bottom: 7px; color: #4d5a6e; font-size: 11px; font-weight: 700; }
.target-options input:not([type="checkbox"]) { width: 100%; min-height: 41px; padding: 0 11px; color: var(--text); background: white; border: 1px solid var(--line-strong); border-radius: 7px; outline: 0; font-size: 12px; }
.inline-check { display: flex; align-items: center; gap: 9px; min-height: 41px; padding: 0 11px; background: white; border: 1px solid var(--line); border-radius: 7px; cursor: pointer; }
.inline-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--jade); }
.inline-check span { margin: 0 !important; }
.probe-result { margin-top: 12px; padding: 10px 12px; color: #176b59; background: var(--jade-soft); border: 1px solid #bfe1d8; border-radius: 7px; font-size: 11px; }
.probe-result.is-failed { color: #9b3d45; background: var(--danger-soft); border-color: #efc7cb; }
.switch-grid { display: grid; gap: 9px; margin-top: 20px; }
.switch-row { display: flex; align-items: flex-start; gap: 11px; padding: 12px 13px; background: #fafbfc; border: 1px solid #e7ebf0; border-radius: 8px; cursor: pointer; }
.switch-row input { width: 16px; height: 16px; margin: 1px 0 0; accent-color: var(--jade); }
.switch-row strong, .switch-row small { display: block; }
.switch-row strong { color: #39475c; font-size: 11px; }
.switch-row small { margin-top: 4px; color: #8e98a6; font-size: 9px; line-height: 1.45; }
.drawer-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 74px; padding: 15px 28px; background: #fafbfc; border-top: 1px solid var(--line); }
.drawer-footer > span { color: #8d97a5; font-size: 10px; }
.drawer-footer > div { display: flex; gap: 9px; }

.confirm-dialog { width: min(430px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 14px; box-shadow: 0 28px 75px rgba(8, 17, 33, .26); }
.confirm-dialog::backdrop { background: rgba(8, 17, 33, .52); backdrop-filter: blur(2px); }
.confirm-dialog form { padding: 27px; }
.confirm-dialog h2 { margin: 0; color: var(--ink); font-size: 20px; }
.confirm-dialog p:not(.eyebrow) { margin: 12px 0 23px; color: #6d7889; font-size: 12px; line-height: 1.7; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; }
.toast-region { position: fixed; z-index: 50; top: 20px; right: 20px; display: grid; gap: 9px; width: min(340px, calc(100vw - 40px)); }
.toast { padding: 13px 15px; color: #185e50; background: #ecf8f4; border: 1px solid #b9dfd4; border-radius: 8px; box-shadow: var(--shadow); font-size: 12px; animation: toastIn .2s ease both; }
.toast.error { color: #963b43; background: var(--danger-soft); border-color: #edc2c6; }

@keyframes signalTravel { 0% { transform: translateX(-34px); opacity: 0; } 25%, 75% { opacity: 1; } 100% { transform: translateX(34px); opacity: 0; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } }

@media (max-width: 1080px) {
    .login-view { grid-template-columns: 1fr 1fr; }
    .login-story { padding-inline: 45px; }
    .status-deck { grid-template-columns: 1.4fr repeat(3, .6fr); }
    .route-topology { gap: 34px; }
}

@media (max-width: 860px) {
    .login-view { display: block; padding: 30px 18px; }
    .login-story { max-width: 650px; margin: 0 auto; padding: 25px 12px 36px; text-align: center; }
    .story-mark { margin-inline: auto; }
    .login-story h1 { font-size: 35px; }
    .login-story > p:not(.eyebrow) { margin-inline: auto; }
    .story-flow { margin-inline: auto; }
    .login-card-wrap { padding: 0 0 30px; background: transparent; border: 0; backdrop-filter: none; }
    .admin-layout { display: block; }
    .sidebar { position: static; width: 100%; height: auto; padding: 12px 18px; flex-direction: row; align-items: center; }
    .sidebar-brand { min-height: auto; padding: 0; border: 0; }
    .sidebar nav { margin: 0 0 0 auto; }
    .nav-item { min-height: 40px; }
    .sidebar-note { display: none; }
    .content-shell { width: 100%; }
    .status-deck { grid-template-columns: repeat(3, 1fr); }
    .status-lead { grid-column: 1 / -1; min-height: 105px; }
    .metric { min-height: 105px; border-top: 1px solid var(--line); }
    .metric:first-of-type { border-left: 0; }
    .section-heading { align-items: flex-start; flex-direction: column; }
    .toolbar { width: 100%; }
    .search-field { flex: 1; width: auto; }
}

@media (max-width: 640px) {
    .login-view { padding-inline: 12px; }
    .login-story { display: none; }
    .login-card-wrap { min-height: calc(100vh - 24px); }
    .login-card { padding: 27px 22px 24px; border-radius: 15px; }
    .topbar { align-items: flex-start; min-height: 80px; padding: 15px 17px; }
    .topbar .breadcrumb { display: none; }
    .topbar h1 { margin-top: 9px; font-size: 19px; }
    .operator-block small { display: none; }
    .logout-button { margin-left: 0; padding-inline: 8px; }
    main { padding: 18px 12px 35px; }
    .status-deck { grid-template-columns: repeat(3, 1fr); }
    .status-lead { padding: 18px; }
    .metric { min-height: 92px; padding: 18px 10px; }
    .metric dd { font-size: 23px; }
    .metric span { display: none; }
    .workspace { padding: 18px 13px; }
    .section-heading { margin-bottom: 17px; padding-bottom: 17px; }
    .toolbar { flex-direction: column; }
    .search-field, .toolbar .button { width: 100%; }
    .route-card { padding: 16px 13px; }
    .route-topology { grid-template-columns: 1fr; gap: 11px; padding: 14px; }
    .gateway-node { width: 100%; height: 38px; grid-template-columns: auto auto; justify-content: center; gap: 8px; border-width: 2px; }
    .gateway-node small { margin: 0; }
    .internal-endpoint { text-align: left; }
    .connection-line { display: none; }
    .route-card-footer { align-items: flex-end; flex-wrap: wrap; }
    .route-flags { flex-basis: 100%; }
    .two-column, .three-column, .target-row, .target-definition-grid, .target-options { grid-template-columns: 1fr; }
    .target-section-title { align-items: flex-start; flex-wrap: wrap; }
    .add-target-button { margin-left: 41px; }
    .form-scroll { padding-inline: 19px; }
    .drawer-header, .drawer-footer { padding-inline: 19px; }
    .drawer-footer { align-items: flex-end; flex-direction: column; }
    .drawer-footer > div, .drawer-footer .button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
