/* ============================================================
   CertManager 后台样式（浅色主题）
   ============================================================ */

:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --line: #e6eaf2;
    --line-strong: #d7ddea;
    --text: #111827;
    --muted: #6b7280;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-weak: #eff4ff;
    --green: #059669;
    --green-weak: #ecfdf5;
    --amber: #b45309;
    --amber-weak: #fffbeb;
    --red: #dc2626;
    --red-weak: #fef2f2;
    --info: #0e7490;
    --info-weak: #ecfeff;
    --radius: 14px;
    --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 10px 28px rgba(16, 24, 40, .05);
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    color: var(--primary-dark);
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 650;
    letter-spacing: -.01em;
}

p {
    margin: 0 0 10px;
}

code {
    background: #f3f4f6;
    border-radius: 6px;
    padding: 1px 6px;
    font-family: var(--mono);
    font-size: 12.5px;
    color: #334155;
}

/* ---------------- 布局 ---------------- */

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

.sidebar {
    width: 224px;
    flex: 0 0 224px;
    background: var(--panel);
    border-right: 1px solid var(--line);
    padding: 22px 14px 18px;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px 20px;
    color: var(--text);
    font-weight: 700;
    font-size: 16px;
    letter-spacing: -.02em;
}

.brand:hover {
    color: var(--text);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, #2563eb, #0ea5e9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .25);
}

.brand-mark svg {
    width: 19px;
    height: 19px;
}

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

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #4b5563;
    font-weight: 500;
    transition: background .15s, color .15s;
}

.nav-item svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    opacity: .8;
}

.nav-item:hover {
    background: #f6f8fc;
    color: var(--text);
}

.nav-item.active {
    background: var(--primary-weak);
    color: var(--primary);
    font-weight: 600;
}

.nav-item.active svg {
    opacity: 1;
}

.nav-count {
    margin-left: auto;
    background: var(--red-weak);
    color: var(--red);
    border-radius: 999px;
    font-size: 11px;
    padding: 0 7px;
    line-height: 18px;
    font-weight: 600;
}

.sidebar-foot {
    margin-top: auto;
    padding: 14px 10px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #9ca3af;
    display: inline-block;
}

.status-dot.ok {
    background: var(--green);
    box-shadow: 0 0 0 3px var(--green-weak);
}

.status-dot.bad {
    background: var(--red);
    box-shadow: 0 0 0 3px var(--red-weak);
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    padding: 22px 34px 16px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.page-title {
    font-size: 24px;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: -.02em;
}

.page-sub {
    color: var(--muted);
    font-size: 13px;
    margin-top: 4px;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.content {
    padding: 0 34px 40px;
    max-width: 1360px;
    width: 100%;
}

/* ---------------- 提示 ---------------- */

.alert {
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13.5px;
}

.alert a {
    margin-left: auto;
    white-space: nowrap;
    font-weight: 600;
}

.alert-success {
    background: var(--green-weak);
    border-color: #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: var(--red-weak);
    border-color: #fecaca;
    color: #991b1b;
}

.alert-warn {
    background: var(--amber-weak);
    border-color: #fde68a;
    color: #92400e;
}

.alert-info {
    background: var(--info-weak);
    border-color: #a5f3fc;
    color: #155e75;
}

/* ---------------- 徽章 ---------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
}

.badge-ok {
    background: var(--green-weak);
    color: var(--green);
}

.badge-warn {
    background: var(--amber-weak);
    color: var(--amber);
}

.badge-danger {
    background: var(--red-weak);
    color: var(--red);
}

.badge-info {
    background: var(--info-weak);
    color: var(--info);
}

.badge-primary {
    background: var(--primary-weak);
    color: var(--primary);
}

.badge-muted {
    background: #f3f4f6;
    color: #6b7280;
}

.dot-pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .25; }
}

.tone-ok { color: var(--green); font-weight: 600; }
.tone-warn { color: var(--amber); font-weight: 600; }
.tone-danger { color: var(--red); font-weight: 600; }
.tone-muted { color: #9ca3af; font-weight: 500; }

/* ---------------- 卡片 ---------------- */

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 18px;
    overflow: hidden;
}

.card-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.card-title {
    font-size: 15px;
    font-weight: 650;
}

.card-sub {
    color: var(--muted);
    font-size: 12.5px;
    margin-top: 2px;
}

.card-body {
    padding: 20px;
}

.card-body.tight {
    padding: 0;
}

.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

/* ---------------- 统计 ---------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.stat-label {
    color: var(--muted);
    font-size: 12.5px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-value {
    font-size: 30px;
    font-weight: 720;
    letter-spacing: -.03em;
    line-height: 1.15;
    margin-top: 8px;
}

.stat-foot {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

.stat-accent {
    position: absolute;
    right: -20px;
    top: -20px;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: var(--primary-weak);
    opacity: .7;
}

.stat.tone-green .stat-accent { background: var(--green-weak); }
.stat.tone-amber .stat-accent { background: var(--amber-weak); }
.stat.tone-red .stat-accent { background: var(--red-weak); }

/* ---------------- 按钮 ---------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 9px;
    border: 1px solid var(--line-strong);
    background: #fff;
    color: #374151;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
    white-space: nowrap;
    font-family: inherit;
}

.btn:hover {
    background: #f9fafb;
    border-color: #cbd5e1;
    color: var(--text);
}

.btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .18);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-danger {
    background: #fff;
    border-color: #fecaca;
    color: var(--red);
}

.btn-danger:hover {
    background: var(--red-weak);
    border-color: #fca5a5;
    color: var(--red);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #4b5563;
}

.btn-ghost:hover {
    background: #f3f4f6;
    border-color: transparent;
}

.btn-sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 7px;
}

.btn-link {
    border: none;
    background: none;
    padding: 0;
    height: auto;
    color: var(--primary);
    font-weight: 600;
    box-shadow: none;
}

.btn-link:hover {
    background: none;
    color: var(--primary-dark);
}

.btn-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---------------- 表格 ---------------- */

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

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

table.table th {
    text-align: left;
    font-weight: 600;
    color: #64748b;
    background: #f8fafc;
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
    font-size: 12.5px;
}

table.table td {
    padding: 13px 14px;
    border-bottom: 1px solid #f0f3f9;
    vertical-align: middle;
}

table.table tr:last-child td {
    border-bottom: none;
}

table.table tbody tr:hover {
    background: #fbfcff;
}

table.table .cell-main {
    font-weight: 600;
    color: var(--text);
}

table.table .cell-sub {
    color: var(--muted);
    font-size: 12px;
    margin-top: 2px;
}

table.table .cell-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.checkbox {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.empty {
    text-align: center;
    color: var(--muted);
    padding: 46px 20px;
    font-size: 13.5px;
}

.empty-icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: #f1f5ff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
}

/* ---------------- 表单 ---------------- */

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

.form-grid .span-2 {
    grid-column: span 2;
}

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

.field > label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}

.field .req {
    color: var(--red);
    margin-left: 2px;
}

.input,
.select,
textarea.input {
    width: 100%;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    font-size: 13.5px;
    padding: 9px 12px;
    height: 38px;
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    font-family: inherit;
}

textarea.input {
    height: auto;
    min-height: 92px;
    resize: vertical;
    line-height: 1.55;
}

.input:focus,
.select:focus,
textarea.input:focus {
    border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.input::placeholder,
textarea.input::placeholder {
    color: #b6becd;
}

.hint {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.55;
}

.error-text {
    color: var(--red);
    font-size: 12.5px;
}

.password-wrap {
    position: relative;
}

.password-wrap .input {
    padding-right: 64px;
}

.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    font-family: inherit;
}

.password-toggle:hover {
    background: #f3f4f6;
    color: var(--text);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    color: #374151;
}

.check-row input {
    accent-color: var(--primary);
}

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

.radio-card {
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    position: relative;
}

.radio-card input {
    position: absolute;
    opacity: 0;
}

.radio-card .rc-title {
    font-weight: 650;
    font-size: 14px;
}

.radio-card .rc-desc {
    color: var(--muted);
    font-size: 12px;
    margin-top: 3px;
}

.radio-card:hover {
    border-color: #b9c9ea;
}

.radio-card.checked {
    border-color: var(--primary);
    background: var(--primary-weak);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, .08);
}

.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 13.5px;
}

.switch input {
    position: absolute;
    opacity: 0;
}

.switch-track {
    width: 38px;
    height: 22px;
    border-radius: 999px;
    background: #d1d5db;
    transition: background .15s;
    position: relative;
    flex: 0 0 38px;
}

.switch-track::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform .15s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .2);
}

.switch input:checked + .switch-track {
    background: var(--primary);
}

.switch input:checked + .switch-track::after {
    transform: translateX(16px);
}

.form-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-top: 6px;
}

/* ---------------- 筛选条 ---------------- */

.toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.toolbar .spacer {
    flex: 1;
}

.search {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 0 10px;
    height: 36px;
}

.search input {
    border: none;
    outline: none;
    background: transparent;
    height: 34px;
    width: 190px;
    font-size: 13.5px;
    font-family: inherit;
    color: var(--text);
}

.search svg {
    width: 15px;
    height: 15px;
    color: #9ca3af;
}

.select-sm {
    height: 36px;
    border: 1px solid var(--line-strong);
    border-radius: 9px;
    padding: 0 10px;
    background: #fff;
    font-size: 13px;
    color: #374151;
    font-family: inherit;
}

.bulkbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: #f8faff;
    border: 1px solid #e0e9ff;
    border-radius: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.bulkbar .bulk-info {
    font-size: 13px;
    color: #475569;
    font-weight: 600;
}

/* ---------------- 分页 ---------------- */

.pager {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    flex-wrap: wrap;
    border-top: 1px solid var(--line);
}

.pager-info {
    color: var(--muted);
    font-size: 12.5px;
    margin-right: auto;
}

.pager-item {
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--line);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 9px;
    font-size: 13px;
    color: #475569;
    background: #fff;
}

.pager-item:hover {
    border-color: #b9c9ea;
    color: var(--primary);
}

.pager-item.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    font-weight: 600;
}

.pager-item.disabled {
    color: #c3c9d4;
    background: #fafbfc;
}

/* ---------------- 步骤向导 ---------------- */

.wizard-steps {
    display: flex;
    gap: 8px;
    padding: 18px 20px;
    border-bottom: 1px solid var(--line);
    background: #fbfcff;
    overflow-x: auto;
}

.wstep {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    flex: 1;
}

.wstep .num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    background: #fff;
    flex: 0 0 24px;
}

.wstep.active {
    background: var(--primary-weak);
    color: var(--primary);
}

.wstep.active .num {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.wstep.done {
    color: var(--green);
}

.wstep.done .num {
    background: var(--green-weak);
    color: var(--green);
    border-color: #a7f3d0;
}

.wizard-body {
    padding: 22px;
}

.wizard-panel {
    display: none;
}

.wizard-panel.active {
    display: block;
}

.wizard-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    background: #fcfdff;
}

.summary {
    display: grid;
    grid-template-columns: 160px 1fr;
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
}

.summary .k,
.summary .v {
    padding: 11px 14px;
    border-bottom: 1px solid #f0f3f9;
    font-size: 13.5px;
}

.summary .k {
    background: #f8fafc;
    color: var(--muted);
    font-weight: 600;
}

.summary .v {
    background: #fff;
}

/* ---------------- 日志 / 弹窗 ---------------- */

.log-pre {
    background: #0f172a;
    color: #dbeafe;
    border-radius: 10px;
    padding: 16px;
    font-family: var(--mono);
    font-size: 12px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 460px;
    overflow: auto;
    margin: 12px 0 0;
}

.log-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    color: var(--muted);
    font-size: 12.5px;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal[hidden] {
    display: none !important;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    backdrop-filter: blur(2px);
}

.modal-card {
    position: relative;
    width: min(880px, 100%);
    max-height: 86vh;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .22);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-head {
    padding: 16px 20px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.modal-title {
    font-size: 15px;
    font-weight: 650;
}

.modal-body {
    padding: 18px 20px 22px;
    overflow: auto;
}

.modal-close {
    border: none;
    background: #f3f4f6;
    width: 30px;
    height: 30px;
    border-radius: 8px;
    cursor: pointer;
    color: #6b7280;
    font-size: 16px;
    line-height: 1;
}

.modal-close:hover {
    background: #e5e7eb;
    color: var(--text);
}

/* ---------------- 提示 toast ---------------- */

.toast-wrap {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
}

.toast {
    background: #111827;
    color: #fff;
    border-radius: 999px;
    padding: 9px 18px;
    font-size: 13px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .25);
    animation: toast-in .18s ease-out;
    max-width: 80vw;
}

.toast.error {
    background: #b91c1c;
}

.toast.success {
    background: #047857;
}

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

/* ---------------- 登录 / 安装 ---------------- */

.auth-wrap {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    background:
        radial-gradient(900px 500px at 12% 8%, #e5edff 0%, rgba(229, 237, 255, 0) 60%),
        radial-gradient(800px 500px at 92% 92%, #dcfce7 0%, rgba(220, 252, 231, 0) 55%),
        #f7f9fd;
}

.auth-card {
    width: min(410px, 100%);
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, .08);
    padding: 30px 30px 26px;
}

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

.auth-title {
    font-size: 22px;
    font-weight: 720;
    letter-spacing: -.02em;
}

.auth-sub {
    color: var(--muted);
    font-size: 13px;
    margin: 3px 0 22px;
}

.auth-foot {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

.install-wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 34px 24px 60px;
}

.install-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.steps {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.steps .s {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 600;
}

.steps .s b {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
}

.steps .s.on {
    border-color: #bfd3ff;
    background: var(--primary-weak);
    color: var(--primary);
}

.steps .s.on b {
    background: var(--primary);
    color: #fff;
}

/* ---------------- 环境检测 ---------------- */

.check-list {
    display: flex;
    flex-direction: column;
}

.check-item {
    display: flex;
    gap: 14px;
    padding: 13px 20px;
    border-bottom: 1px solid #f0f3f9;
    align-items: flex-start;
}

.check-item:last-child {
    border-bottom: none;
}

.check-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex: 0 0 24px;
    margin-top: 1px;
}

.check-icon.ok {
    background: var(--green-weak);
    color: var(--green);
}

.check-icon.warn {
    background: var(--amber-weak);
    color: var(--amber);
}

.check-icon.fail {
    background: var(--red-weak);
    color: var(--red);
}

.check-main {
    flex: 1;
    min-width: 0;
}

.check-label {
    font-weight: 600;
    font-size: 13.5px;
}

.check-detail {
    color: var(--muted);
    font-size: 12.5px;
    word-break: break-all;
}

.check-hint {
    color: var(--amber);
    font-size: 12px;
    margin-top: 2px;
}

.kv {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed #e8edf6;
    font-size: 13px;
}

.kv:last-child {
    border-bottom: none;
}

.kv .k {
    color: var(--muted);
}

.kv .v {
    font-weight: 600;
    text-align: right;
}

.tabs {
    display: flex;
    gap: 6px;
    border-bottom: 1px solid var(--line);
    padding: 0 20px;
    background: #fcfdff;
    overflow-x: auto;
}

.tab {
    padding: 13px 12px 11px;
    border: none;
    background: none;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    font-family: inherit;
    white-space: nowrap;
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.two-col {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.mono {
    font-family: var(--mono);
    font-size: 12.5px;
}

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

.nowrap {
    white-space: nowrap;
}

.mt-0 { margin-top: 0; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }

.divider {
    height: 1px;
    background: var(--line);
    margin: 18px 0;
}

.note-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 13px;
}

.note-list li {
    margin: 4px 0;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1080px) {
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .two-col { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
    .app { flex-direction: column; }
    .sidebar {
        width: 100%;
        flex: none;
        height: auto;
        position: static;
        padding: 12px 14px;
        flex-direction: row;
        align-items: center;
        gap: 12px;
        overflow-x: auto;
    }
    .brand { padding: 0; flex: 0 0 auto; }
    .brand span:last-child { display: none; }
    .nav { flex-direction: row; gap: 2px; }
    .nav-item { padding: 8px 10px; }
    .nav-item span.nav-text { display: none; }
    .sidebar-foot { display: none; }
    .topbar { padding: 18px 18px 12px; }
    .content { padding: 0 18px 30px; }
    .form-grid { grid-template-columns: 1fr; }
    .form-grid .span-2 { grid-column: auto; }
    .radio-cards { grid-template-columns: 1fr; }
    .summary { grid-template-columns: 110px 1fr; }
}

@media (max-width: 560px) {
    .stats { grid-template-columns: 1fr; }
    .topbar { flex-direction: column; }
    .page-title { font-size: 20px; }
    .modal { padding: 10px; }
    .modal-card { max-height: 92vh; }
}

/* ---------------- 部署方式子面板 ---------------- */
.deploy-panel {
    display: none;
    margin-top: 16px;
}

.deploy-panel.active {
    display: block;
}

/* 四选一的部署方式卡片 */
.radio-cards-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* 证书 PEM 预览 */
.cert-pem {
    margin: 0;
    padding: 14px 16px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 11.5px;
    line-height: 1.65;
    color: #334155;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 340px;
    overflow: auto;
}
