:root {
    --bg: #081120;
    --bg-soft: #0f172a;
    --panel: rgba(15, 23, 42, 0.88);
    --panel-strong: #111c33;
    --panel-border: rgba(148, 163, 184, 0.14);
    --panel-border-focus: rgba(99, 102, 241, 0.45);
    --text: #e5eefc;
    --text-muted: #8ea0bd;
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-soft: rgba(79, 70, 229, 0.16);
    --secondary-bg: rgba(255, 255, 255, 0.06);
    --secondary-hover: rgba(255, 255, 255, 0.12);
    --success: #10b981;
    --success-soft: rgba(16, 185, 129, 0.15);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.15);
    --warning: #f59e0b;
    --accent: #38bdf8;
    --shadow: 0 20px 60px rgba(2, 6, 23, 0.38);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
    --radius-sm: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(79, 70, 229, 0.22), transparent 28%),
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.14), transparent 26%),
        radial-gradient(circle at bottom right, rgba(16, 185, 129, 0.12), transparent 30%),
        linear-gradient(180deg, #081120 0%, #0b1324 50%, #0a1428 100%);
    background-attachment: fixed;
}

code,
pre,
.result-card__value,
.env-current-url,
.env-sub {
    font-family: "SFMono-Regular", SFMono-Regular, ui-monospace, Menlo, Monaco, Consolas,
        "Liberation Mono", "Courier New", monospace;
}

.dashboard-shell {
    display: grid;
    grid-template-columns: 310px minmax(0, 1fr);
    min-height: 100vh;
}

/* 侧边栏 */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px 18px;
    border-right: 1px solid var(--panel-border);
    background: rgba(6, 11, 23, 0.82);
    backdrop-filter: blur(14px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}

.brand__logo {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
}

.brand__title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand__subtitle {
    margin-top: 3px;
    color: var(--text-muted);
    font-size: 12px;
}

/* 全局环境切换器盒子 */
.env-selector-box {
    background: rgba(17, 28, 51, 0.7);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 14px;
    margin-bottom: 20px;
}

.env-selector__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 10px;
    font-weight: 600;
}

.env-toggle-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.env-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.env-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(148, 163, 184, 0.25);
    color: var(--text);
}

.env-toggle-btn.active {
    background: var(--primary-soft);
    border-color: rgba(99, 102, 241, 0.55);
    color: #fff;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.env-text {
    display: flex;
    flex-direction: column;
}

.env-name {
    font-size: 12px;
    font-weight: 700;
}

.env-sub {
    font-size: 10px;
    opacity: 0.75;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.online {
    background: var(--success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
}

.env-current-url {
    margin-top: 10px;
    font-size: 11px;
    color: var(--accent);
    word-break: break-all;
    background: rgba(0, 0, 0, 0.25);
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px dashed rgba(56, 189, 248, 0.25);
}

/* 侧边导航 */
.sidebar-nav {
    display: grid;
    gap: 8px;
}

.sidebar-nav__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    color: var(--text);
    text-decoration: none;
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    transition: all 0.15s ease;
    font-size: 14px;
}

.sidebar-nav__item:hover {
    transform: translateX(3px);
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(148, 163, 184, 0.12);
}

.sidebar-nav__item--active {
    background: var(--primary-soft);
    border-color: rgba(99, 102, 241, 0.35);
    color: #fff;
    font-weight: 600;
}

.sidebar-nav__icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.07);
    color: #c7d2fe;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-card {
    margin-top: auto;
    padding: 16px;
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(79, 70, 229, 0.12), rgba(14, 165, 233, 0.05));
}

.sidebar-card__label {
    color: #c7d2fe;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar-card__title {
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.sidebar-card__desc {
    margin: 6px 0 0 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

/* 主内容区 */
.main-content {
    padding: 32px 40px;
    max-width: 1200px;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--panel-border);
}

.topbar__eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
}

.topbar__title {
    margin: 6px 0 0 0;
    font-size: 26px;
    font-weight: 800;
}

.topbar__desc {
    margin: 8px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
    max-width: 650px;
    line-height: 1.5;
}

.topbar-meta {
    display: flex;
    gap: 12px;
}

.topbar-meta__item {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.topbar-meta__label {
    font-size: 11px;
    color: var(--text-muted);
}

.topbar-meta__item code {
    padding: 6px 10px;
    border-radius: 6px;
    background: rgba(17, 28, 51, 0.85);
    border: 1px solid var(--panel-border);
    color: var(--accent);
    font-size: 12px;
}

/* 面板 */
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    backdrop-filter: blur(12px);
    overflow: hidden;
    animation: fadeIn 0.25s ease-out;
}

.panel--hidden {
    display: none !important;
}

.panel__header {
    padding: 24px 28px 20px;
    border-bottom: 1px solid var(--panel-border);
    background: rgba(255, 255, 255, 0.02);
}

.panel__header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel__eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #818cf8;
}

.panel__title {
    margin: 6px 0 0 0;
    font-size: 20px;
    font-weight: 700;
}

.panel__desc {
    margin: 6px 0 0 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.panel__body {
    padding: 28px;
}

/* 提示卡片 */
.callout-box {
    background: rgba(79, 70, 229, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.25);
    border-radius: var(--radius-md);
    padding: 14px 18px;
    margin-bottom: 24px;
}

.callout-box__title {
    font-size: 13px;
    font-weight: 700;
    color: #c7d2fe;
    margin-bottom: 4px;
}

.callout-box__content {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.text-accent {
    color: var(--accent);
}

.text-danger {
    color: var(--danger);
}

/* 表单组件 */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 24px;
}

.form-grid--two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.field--full {
    grid-column: 1 / -1;
}

.field__label {
    font-size: 13px;
    font-weight: 600;
    color: #cbd5e1;
}

.field__control {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(15, 23, 42, 0.7);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.field__control:focus {
    border-color: var(--panel-border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.field__control--readonly {
    background: rgba(255, 255, 255, 0.03);
    border-style: dashed;
    display: flex;
    align-items: center;
}

.input-with-action {
    display: flex;
    gap: 8px;
}

.input-with-action input {
    flex: 1;
}

/* 步骤引导卡片网格 */
.step-guide-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.step-guide-item {
    background: rgba(17, 28, 51, 0.6);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.step-guide-item:hover,
.step-guide-item.active {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(79, 70, 229, 0.1);
}

.step-num {
    background: rgba(99, 102, 241, 0.2);
    color: #c7d2fe;
    font-weight: 800;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 13px;
    flex-shrink: 0;
}

.step-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.step-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
}

.step-sub {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* 按钮及工具栏 */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
}

.btn--primary {
    background: linear-gradient(135deg, #4f46e5 0%, #4338ca 100%);
    color: #fff;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
}

.btn--primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.btn--secondary {
    background: var(--secondary-bg);
    color: var(--text);
    border-color: rgba(148, 163, 184, 0.16);
}

.btn--secondary:hover:not(:disabled) {
    background: var(--secondary-hover);
    border-color: rgba(148, 163, 184, 0.28);
}

.btn--mini {
    padding: 8px 12px;
    font-size: 12px;
    border-radius: var(--radius-sm);
    background: rgba(79, 70, 229, 0.2);
    color: #c7d2fe;
    border: 1px solid rgba(99, 102, 241, 0.3);
    white-space: nowrap;
    cursor: pointer;
}

.btn--mini:hover {
    background: rgba(79, 70, 229, 0.35);
}

.btn--small {
    padding: 7px 14px;
    font-size: 12px;
}

/* 状态条 */
.status-bar {
    padding: 10px 16px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(148, 163, 184, 0.1);
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.status-bar--success {
    background: var(--success-soft);
    border-color: rgba(16, 185, 129, 0.3);
    color: #a7f3d0;
}

.status-bar--error {
    background: var(--danger-soft);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.status-bar--loading {
    background: var(--primary-soft);
    border-color: rgba(99, 102, 241, 0.3);
    color: #c7d2fe;
}

/* 结果卡片 */
.result-card {
    background: var(--panel-strong);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.result-card__head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.result-card__tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.result-card__value {
    font-size: 28px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    word-break: break-all;
}

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

.metric {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(148, 163, 184, 0.08);
    border-radius: var(--radius-md);
    padding: 12px 16px;
}

.metric__label {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.metric__value {
    font-size: 15px;
    font-weight: 700;
    color: #cbd5e1;
    word-break: break-all;
}

/* 折叠 JSON */
.result-json-details {
    margin-top: 14px;
}

.result-json-details__summary {
    font-size: 12px;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    padding: 6px 0;
}

.result-json-details__summary:hover {
    color: var(--text);
}

.result-json {
    margin-top: 10px;
    padding: 14px;
    border-radius: var(--radius-md);
    background: #060c18;
    border: 1px solid rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 300px;
}

/* 历史表格 */
.table-container {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
}

.data-table th {
    padding: 12px 14px;
    color: var(--text-muted);
    font-weight: 600;
    border-bottom: 1px solid var(--panel-border);
    font-size: 12px;
    text-transform: uppercase;
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.08);
    color: #cbd5e1;
}

.data-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.table-empty {
    text-align: center;
    padding: 40px !important;
    color: var(--text-muted);
}

.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.badge--eq {
    background: rgba(79, 70, 229, 0.2);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge--orda {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* Toast 提示 */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 9999;
}

.toast {
    padding: 12px 18px;
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: var(--radius-md);
    color: #fff;
    font-size: 13px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.25s ease-out;
}

.toast--success {
    border-color: rgba(16, 185, 129, 0.5);
    background: rgba(6, 78, 59, 0.9);
}

.toast--error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(127, 29, 29, 0.9);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* 响应式适配 */
@media (max-width: 900px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: relative;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--panel-border);
    }
    .step-guide-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .form-grid--two {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 20px;
    }
}

/* 身份认证登录弹窗 */
.auth-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(4, 8, 18, 0.9);
    backdrop-filter: blur(28px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.auth-modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-modal-card {
    width: 100%;
    max-width: 420px;
    padding: 36px 32px;
    background: var(--panel-strong);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.05);
    animation: fadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.auth-modal-desc {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
}

.auth-error-msg {
    margin-top: 10px;
    padding: 10px 14px;
    font-size: 13px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.28);
    border-radius: var(--radius-sm);
    animation: fadeIn 0.2s ease;
}

/* 分页控件 */
.pagination-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-md);
    flex-wrap: wrap;
}

.pagination-info {
    font-size: 13px;
    color: var(--text-muted);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.table-action-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

