* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

img {
    display: block;
    max-width: 100%;
}

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

.router-shell {
    display: flex;
    flex-direction: column;
    width: min(960px, calc(100% - 32px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 24px 0 0;
}

.router-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: 36px;
}

.router-brand {
    display: inline-flex;
    align-items: center;
}

.router-logo {
    width: 110px;
    height: auto;
}

.router-bar-label {
    color: var(--text-faint);
    font-family: var(--font-sans);
    font-size: 12px;
}

.router-main {
    display: flex;
    flex: 1;
    align-items: flex-start;
    justify-content: center;
    padding: 0 0 48px;
}

.router-main-top {
    padding-top: 0;
}

.router-error {
    width: 100%;
    max-width: 860px;
    text-align: left;
}

.router-error-head h1 {
    margin: 0;
    color: var(--text-muted);
    font-size: 36px;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.router-error-head h1 strong {
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 300;
}

.router-ray {
    margin: 2px 0 0;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 12px;
}

.router-error-head h2 {
    margin: 18px 0 10px;
    color: var(--text-primary);
    font-size: 30px;
    font-weight: 300;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.router-lead {
    max-width: 640px;
    margin: 0;
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1.6;
}

.router-highlight {
    margin-top: 32px;
    padding: 28px 0;
    background: #101012;
    box-shadow: 0 0 0 100vmax #101012;
    clip-path: inset(0 -100vmax);
}

.router-status-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.router-status {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 24px;
    border-right: 1px solid var(--border-subtle);
}

.router-status:first-child {
    padding-left: 0;
}

.router-status:last-child {
    padding-right: 0;
    border-right: 0;
}

.router-status-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.router-status-icon {
    width: 22px;
    height: 22px;
    color: var(--text-faint);
}

.router-status.is-error .router-status-icon {
    color: var(--status-error);
}

.router-status.is-warning .router-status-icon {
    color: var(--status-warning);
}

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

.router-status h3 {
    margin: 0 0 4px;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.router-status-state {
    color: var(--status-success);
    font-size: 13px;
}

.router-status.is-error .router-status-state {
    color: var(--status-error);
}

.router-status.is-warning .router-status-state {
    color: var(--status-warning);
}

.router-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-top: 36px;
    text-align: left;
}

.router-columns h2 {
    margin: 0 0 10px;
    color: var(--text-secondary);
    font-size: 20px;
    font-weight: 400;
    line-height: 1.3;
}

.router-columns p {
    margin: 0 0 12px;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

.router-columns a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-decoration-color: var(--border-strong);
    text-underline-offset: 3px;
}

.router-columns a:hover {
    color: var(--text-primary);
}

.router-columns code {
    padding: 1px 4px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
}

.router-detail {
    margin-top: 14px;
    padding: 12px 14px;
    overflow-wrap: anywhere;
    border: 1px solid var(--border-subtle);
    border-left: 2px solid var(--border-strong);
    border-radius: 2px;
    background: #0d0d0f;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.55;
}

.router-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.router-button:hover {
    border-color: var(--border-default);
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.router-button.primary {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: var(--bg-primary);
}

.router-button.primary:hover {
    border-color: var(--accent-hover);
    background: var(--accent-hover);
}

.router-hint {
    margin-top: 24px;
    color: var(--text-faint);
    font-size: 13px;
    line-height: 1.6;
}

.router-hint a {
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.router-hint a:hover {
    color: var(--text-secondary);
}

.router-footer {
    padding: 24px 0 32px;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-faint);
    font-family: var(--font-sans);
    font-size: 13px;
    text-align: center;
}

.router-footer span {
    display: block;
}

.router-footer span + span {
    margin-top: 4px;
}

.router-footer strong {
    color: var(--text-muted);
    font-weight: 500;
}

.router-footer a {
    color: var(--text-muted);
}

.router-footer a:hover {
    color: var(--text-secondary);
}

.router-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}

.router-page-head h1 {
    margin: 0 0 8px;
    font-size: 30px;
    font-weight: 300;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.router-page-head p {
    margin: 0;
    color: var(--text-tertiary);
    font-size: 15px;
    line-height: 1.6;
}

.router-panel {
    width: 100%;
    margin: 0 auto;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    background: var(--bg-secondary);
}

.router-form {
    max-width: 420px;
    margin-top: 24px;
}

.router-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.router-field label {
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.router-input {
    width: 100%;
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 2px;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    transition: border-color var(--transition-fast);
}

.router-input:hover {
    border-color: var(--border-default);
}

.router-input:focus {
    border-color: var(--border-strong);
    background: var(--bg-primary);
}

.router-input::placeholder {
    color: var(--text-faint);
}

.router-form .router-button {
    width: 100%;
}

.router-alert {
    max-width: 420px;
    margin: 14px 0 0;
    padding: 9px 12px;
    border: 1px solid #7f1d1d;
    border-radius: 2px;
    background: #1a0d0d;
    color: #fca5a5;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}

.router-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: var(--text-sm);
    line-height: 1.6;
}

.router-info {
    width: 100%;
    max-width: 620px;
    margin: 24px 0 0;
    border-top: 1px solid var(--border-subtle);
    border-bottom: 1px solid var(--border-subtle);
    text-align: left;
}

.router-info-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-4);
    padding: 9px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.router-info-row:last-child {
    border-bottom: 0;
}

.router-info-row span {
    color: var(--text-muted);
    font-size: var(--text-sm);
}

.router-info-row strong {
    max-width: 62%;
    overflow: hidden;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    font-weight: 500;
    text-align: right;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.router-terminal-panel {
    max-width: 960px;
}

.router-terminal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-primary);
}

.router-terminal-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--text-tertiary);
    font-size: var(--text-sm);
    font-weight: 500;
}

.router-terminal-title span {
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: 10px;
}

.router-term-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-tertiary);
    font-family: var(--font-mono);
    font-size: 10px;
}

.router-term-status::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--status-success);
    content: "";
}

.router-term-status[data-state="disconnected"]::before,
.router-term-status[data-state="error"]::before,
.router-term-status[data-state="container stopped"]::before {
    background: var(--status-error);
}

.router-terminal {
    height: 58vh;
    min-height: 300px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    background: #08080a;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.edge-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: 40px 24px;
}

.edge-page-content {
    width: 100%;
    max-width: 640px;
    text-align: center;
}

.edge-page-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: 100%;
    margin: 0 auto 30px;
}

.edge-page-mark {
    flex: 0 0 52px;
    width: 52px;
    height: 52px;
    overflow: hidden;
}

.edge-page-mark img {
    width: 319px;
    max-width: none;
    height: auto;
}

.edge-page-wordmark {
    min-width: 0;
    overflow: hidden;
    color: #fafafa;
    font-family: var(--font-brand);
    font-size: clamp(32px, 4.6vw, 48px);
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.01em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.edge-page h1 {
    margin: 0;
    color: #c5c6cc;
    font-size: 30px;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.02em;
}

.edge-page-summary {
    margin: 11px 0 0;
    color: #9fa0a8;
    font-size: 15px;
    line-height: 1.7;
}

.edge-page-meta {
    width: fit-content;
    margin: 15px auto 0;
    color: #8f9098;
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

.edge-page-meta p {
    margin: 0;
}

.edge-page-meta strong {
    color: #a8a9b0;
    font-weight: 500;
}

@media (max-width: 700px) {
    .router-shell {
        width: min(100% - 24px, 960px);
        padding-top: 16px;
    }

    .router-bar {
        margin-bottom: 28px;
    }

    .router-bar-label {
        display: none;
    }

    .router-main {
        padding: 0 0 32px;
    }

    .router-error-head h1 {
        font-size: 30px;
    }

    .router-error-head h2 {
        margin-top: 14px;
        font-size: 25px;
    }

    .router-highlight {
        padding: 22px 0;
    }

    .router-status-grid {
        grid-template-columns: 1fr;
    }

    .router-status {
        padding: 14px 0;
        border-right: 0;
        border-bottom: 1px solid var(--border-subtle);
    }

    .router-status:first-child {
        padding-top: 0;
    }

    .router-status:last-child {
        padding-bottom: 0;
        border-bottom: 0;
    }

    .router-columns {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-top: 28px;
    }

    .router-footer {
        padding-bottom: 24px;
    }

    .router-page-head {
        flex-direction: column;
        gap: var(--space-3);
    }

    .router-page-head h1 {
        font-size: 25px;
    }

    .router-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .router-info-row strong {
        max-width: 100%;
        text-align: left;
    }
}



@media (max-width: 560px) {
    .edge-page {
        padding: 32px 20px;
    }

    .edge-page-brand {
        gap: 5px;
        margin-bottom: 26px;
    }

    .edge-page-mark {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
    }

    .edge-page-mark img {
        width: 245px;
    }

    .edge-page-wordmark {
        font-size: clamp(20px, 6.2vw, 23px);
    }

    .edge-page h1 {
        font-size: 27px;
    }

    .edge-page-summary {
        font-size: 14px;
    }

    .edge-page-meta {
        font-size: 13px;
    }
}
