/* ==========================================================================
   后台管理系统 · 样式表（统一设计规范）
   ========================================================================== */

:root {
    --brand:        #4f46e5;
    --brand-dark:   #4338ca;
    --brand-soft:   #eef2ff;
    --ink:          #0f172a;
    --ink-2:        #334155;
    --muted:        #94a3b8;
    --line:         #e6e9f0;
    --line-soft:    #f1f3f9;
    --bg:           #f5f7fb;
    --card:         #ffffff;
    --ok:           #15803d;
    --ok-soft:      #ecfdf5;
    --warn:         #b45309;
    --warn-soft:    #fffbeb;
    --danger:       #dc2626;
    --danger-soft:  #fef2f2;
    --radius:       14px;
    --radius-sm:    10px;
    --shadow:       0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .18);
    --shadow-sm:    0 1px 2px rgba(15, 23, 42, .06);
    --sidebar-w:    248px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--ink-2);
    line-height: 1.65;
    font-size: 14px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
h1, h2, h3 { color: var(--ink); font-weight: 650; letter-spacing: -.01em; }
code {
    background: var(--line-soft);
    border-radius: 6px;
    padding: 1px 6px;
    font-size: 12.5px;
    color: var(--brand-dark);
}

/* ========== 登录页 ========== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(1200px 600px at 10% -10%, #6366f1 0%, transparent 55%),
        radial-gradient(900px 500px at 110% 110%, #0ea5e9 0%, transparent 50%),
        linear-gradient(135deg, #312e81 0%, #1e1b4b 100%);
    padding: 24px;
}

.login-container { width: 100%; max-width: 420px; }

.login-card {
    background: rgba(255, 255, 255, .97);
    border-radius: 20px;
    padding: 42px 38px 36px;
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .45);
    border: 1px solid rgba(255, 255, 255, .6);
}

.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 { font-size: 26px; margin-bottom: 6px; }
.login-header p { color: var(--muted); font-size: 14px; }

.login-form .form-group { margin-bottom: 18px; }
.login-form label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    color: var(--ink-2);
    font-size: 13px;
}

/* ========== 布局 ========== */
.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    background: linear-gradient(180deg, #111827 0%, #1e1b4b 60%, #1e293b 100%);
    color: #fff;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .04), 8px 0 32px -20px rgba(15, 23, 42, .8);
}

.sidebar-header { padding: 26px 22px 18px; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.sidebar-header h2 { font-size: 17px; font-weight: 650; letter-spacing: .02em; color: #fff; }

.sidebar-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border-radius: 12px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, .72);
    transition: background .18s ease, color .18s ease, transform .18s ease;
    font-size: 14.5px;
    font-weight: 500;
}

.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active {
    background: linear-gradient(135deg, var(--brand) 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 10px 22px -12px rgba(79, 70, 229, .95);
}

.sidebar-footer {
    padding: 16px 18px 20px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.user-info { color: rgba(255, 255, 255, .68); font-size: 13px; }

.main-content {
    flex: 1;
    margin-left: var(--sidebar-w);
    padding: 26px 32px 60px;
    min-width: 0;
}

/* ========== 页头 ========== */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.page-header h1 { font-size: 22px; display: flex; align-items: center; gap: 8px; }

/* ========== 按钮 ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 38px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    background: #eef1f7;
    color: var(--ink-2);
    transition: all .16s ease;
    white-space: nowrap;
    line-height: 1;
}

.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn:active { transform: translateY(0); }

.btn-primary {
    background: linear-gradient(135deg, var(--brand) 0%, #6366f1 100%);
    color: #fff;
    box-shadow: 0 8px 18px -12px rgba(79, 70, 229, 1);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--brand-dark) 0%, #4f46e5 100%); }

.btn-edit { background: var(--brand-soft); color: var(--brand-dark); }
.btn-edit:hover { background: #e0e7ff; }

.btn-danger { background: #fee2e2; color: #b91c1c; }
.btn-danger:hover { background: #fecaca; }

.btn-cancel, .btn-clear { background: #eef1f7; color: #64748b; }
.btn-cancel:hover, .btn-clear:hover { background: #e2e8f0; color: var(--ink-2); }

.btn-back { background: #fff; border-color: var(--line); color: var(--ink-2); }

.btn-logout {
    background: rgba(255, 255, 255, .1);
    color: #fff;
    border-color: rgba(255, 255, 255, .16);
    height: 34px;
    font-size: 13px;
}
.btn-logout:hover { background: rgba(255, 255, 255, .18); }

.btn-block { width: 100%; height: 44px; font-size: 15px; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 8px; }
.btn-cooling, .btn-cooling:disabled {
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* ========== 表单 ========== */
.form-container, .steps-box, .table-container, .danger-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.form-container { padding: 24px 26px; }

.record-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
}

.form-group { margin-bottom: 18px; }

.record-form label,
.form-group > label {
    display: block;
    margin-bottom: 7px;
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-2);
}

.required { color: var(--danger); margin-left: 2px; }

input[type="text"], input[type="password"], input[type="number"],
input[type="datetime-local"], input[type="file"], select, textarea {
    width: 100%;
    height: 42px;
    padding: 0 13px;
    font-size: 14px;
    font-family: inherit;
    color: var(--ink);
    background: #fbfcfe;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

textarea { height: auto; padding: 10px 13px; }

input[type="file"] { padding: 9px 12px; line-height: 1.4; }

input:hover, select:hover { border-color: #cbd5e1; }

input:focus, select:focus, textarea:focus {
    background: #fff;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, .12);
}

input:disabled, select:disabled, textarea:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

input::placeholder, textarea::placeholder { color: #b6c0cf; }

/* 屏蔽浏览器自带的密码显示按钮，统一用我们的按钮 */
input[type="password"]::-ms-reveal,
input[type="password"]::-ms-clear { display: none; }
input[type="password"]::-webkit-credentials-auto-fill-button,
input[type="password"]::-webkit-textfield-decoration-container { display: none !important; }

.hint { display: block; margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.6; }

.input-group { display: flex; align-items: center; gap: 8px; }
.input-group input, .input-group select { flex: 1; min-width: 0; }
.input-suffix {
    flex: none;
    color: var(--brand);
    font-weight: 650;
    font-size: 13.5px;
    background: var(--brand-soft);
    border: 1px solid #dfe4ff;
    border-radius: 8px;
    padding: 8px 10px;
    line-height: 1;
}

/* 密码框：右侧内嵌切换按钮 */
.pw-field { position: relative; display: block; }
.pw-field input { padding-right: 82px; }
.pw-field .pw-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
    border-radius: 8px;
    background: #eef1f7;
    color: #64748b;
    border: 1px solid transparent;
}
.pw-field .pw-toggle:hover {
    background: var(--brand-soft);
    color: var(--brand-dark);
    transform: translateY(-50%);
    box-shadow: none;
}

.radio-group { display: flex; flex-wrap: wrap; gap: 18px; padding-top: 2px; }

.radio-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-weight: 500;
    color: var(--ink-2);
    cursor: pointer;
    font-size: 14px;
}

.radio-label input[type="radio"],
.radio-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
    cursor: pointer;
    margin: 0;
}

.checkbox-inline { display: inline-flex; align-items: center; gap: 8px; }

.form-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line-soft);
}

.section-title {
    font-size: 14.5px;
    font-weight: 650;
    color: var(--ink);
    margin: 22px 0 14px;
    padding-left: 11px;
    border-left: 3px solid var(--brand);
    line-height: 1.3;
}
.record-form > .section-title:first-child { margin-top: 0; }

.advanced, .box-default {
    background: #f8faff;
    border: 1px solid #e5eaff;
    border-radius: var(--radius-sm);
    padding: 16px 18px 4px;
    margin-bottom: 16px;
}

.advanced summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--brand-dark);
    font-size: 13.5px;
    margin-bottom: 10px;
    list-style: none;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before { content: "▸ "; color: var(--brand); }
.advanced[open] summary::before { content: "▾ "; }

/* ========== 搜索栏 ========== */
.search-bar { margin-bottom: 18px; }
.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 12px 14px;
    box-shadow: var(--shadow-sm);
}
.search-form input[type="text"],
.search-form input[type="number"] { max-width: 340px; }

/* ========== 表格 ========== */
.table-container { overflow: hidden; }
.table-container > .data-table { border-radius: 0; }
.table-container { overflow-x: auto; }

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

.data-table thead th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 650;
    font-size: 12.5px;
    text-align: left;
    letter-spacing: .03em;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.data-table tbody td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line-soft);
    color: var(--ink-2);
    vertical-align: middle;
}

.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: #fafbff; }

.url-cell {
    font-weight: 600;
    color: var(--brand-dark);
    background: var(--brand-soft);
    border-radius: 7px;
    padding: 3px 9px;
    font-size: 12.5px;
    display: inline-block;
}

.password-cell { color: var(--muted); letter-spacing: 2px; }

.port-badge {
    display: inline-block;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 650;
    padding: 3px 10px;
    border-radius: 7px;
    font-size: 12.5px;
}

.path-cell {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #64748b;
    font-size: 12.5px;
}

.empty-row { text-align: center; color: var(--muted); padding: 34px 0 !important; }

.actions { white-space: nowrap; }
.actions form { display: inline-block; margin-right: 4px; }
.actions .btn { margin-bottom: 3px; }

.table-footer {
    margin-top: 12px;
    color: var(--muted);
    font-size: 13px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.table-footer strong { color: var(--ink); }

/* ========== 提示条 ========== */
.alert {
    padding: 13px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 18px;
    font-size: 13.5px;
    border: 1px solid transparent;
    border-left-width: 4px;
    line-height: 1.7;
}
.alert-danger  { background: var(--danger-soft); color: #b91c1c; border-color: #fecaca; }
.alert-success { background: var(--ok-soft);     color: #15803d; border-color: #bbf7d0; }
.alert-info    { background: var(--brand-soft);  color: #3730a3; border-color: #c7d2fe; }

/* ========== 徽标 ========== */
.badge {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
}
.badge-success { background: #dcfce7; color: #15803d; }
.badge-warning { background: #fef3c7; color: #b45309; }
.badge-danger  { background: #fee2e2; color: #b91c1c; }

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

/* ========== 步骤结果 ========== */
.steps-box { padding: 8px 20px; margin-bottom: 20px; }

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13.5px;
}
.step-item:last-child { border-bottom: none; }

.step-mark {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-top: 1px;
}
.step-ok   .step-mark { background: #dcfce7; color: var(--ok); }
.step-fail .step-mark { background: #fee2e2; color: var(--danger); }
.step-warn .step-mark { background: #fef3c7; color: var(--warn); }

.step-name { flex: none; min-width: 190px; font-weight: 600; color: var(--ink); }
.step-detail { flex: 1; color: #64748b; word-break: break-all; }
.step-fail .step-detail { color: #b91c1c; }
.step-warn .step-detail { color: var(--warn); }

/* ========== 端口检测结果 / 日志 ========== */
.port-result { margin-top: 10px; font-size: 13px; line-height: 1.7; }
.port-result.port-good, .port-result.port-bad, .port-result.port-warn { padding: 11px 14px; border-radius: var(--radius-sm); }
.port-good { background: var(--ok-soft); color: #15803d; border: 1px solid #bbf7d0; }
.port-bad  { background: var(--danger-soft); color: #b91c1c; border: 1px solid #fecaca; }
.port-warn { background: var(--warn-soft); color: var(--warn); border: 1px solid #fde68a; }

.owner-list, .check-list { margin: 8px 0 0 18px; font-size: 12.5px; }
.owner-list li, .check-list li { margin-bottom: 5px; }

.log-box {
    background: #0f172a;
    color: #cbd5e1;
    border-radius: var(--radius);
    padding: 16px 18px;
    font-size: 12.5px;
    line-height: 1.7;
    max-height: 420px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* ========== 删除确认页 ========== */
.danger-card {
    border: 1px solid #fecaca;
    background: linear-gradient(180deg, #fffafa 0%, #ffffff 30%);
    padding: 22px 24px;
}

.kv-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.kv-table th {
    text-align: left;
    width: 150px;
    padding: 10px 14px;
    color: #64748b;
    font-weight: 600;
    background: #f8fafc;
    border-bottom: 1px solid var(--line-soft);
}
.kv-table td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); word-break: break-all; color: var(--ink); }
.kv-table tr:first-child th { border-top-left-radius: var(--radius-sm); }
.kv-table tr:first-child td { border-top-right-radius: var(--radius-sm); }
.kv-table tr:last-child th, .kv-table tr:last-child td { border-bottom: none; }

/* ========== 滚动条 ========== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .sidebar { width: 100%; position: relative; height: auto; }
    .wrapper { flex-direction: column; }
    .main-content { margin-left: 0; padding: 18px 16px 40px; }
    .directory-placeholder { display: none; }
    .record-form .form-row { grid-template-columns: 1fr; gap: 0; }
    .page-header { flex-direction: column; align-items: flex-start; gap: 12px; }
    .search-form { flex-direction: column; align-items: stretch; }
    .search-form input[type="text"], .search-form input[type="number"] { max-width: none; }
    .step-name { min-width: auto; }
    .step-item { flex-wrap: wrap; }
}
/* URL 单元格可点击跳转 */
a.url-cell { transition: background .15s ease, color .15s ease, box-shadow .15s ease; }
a.url-cell:hover {
    background: #e0e7ff;
    color: #312e81;
    box-shadow: 0 2px 10px -4px rgba(79, 70, 229, .7);
}
a.url-cell .ext {
    font-size: 11px;
    opacity: .65;
    margin-left: 3px;
    vertical-align: 1px;
}
a.url-cell:hover .ext { opacity: 1; }
/* 侧边栏外链图标 */
.nav-item .nav-ext {
    margin-left: auto;
    font-size: 11px;
    opacity: .6;
}
.nav-item:hover .nav-ext { opacity: 1; }
/* ========== QQ 机器人（NapCat）状态卡片 ========== */
.napcat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px 20px 6px;
    margin-bottom: 6px;
}

.napcat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.napcat-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

@media (max-width: 900px) {
    .napcat-actions { margin-left: 0; }
}
/* 仪表盘上的 QQ 机器人状态条 */
.napcat-strip {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 10px 16px;
    margin-bottom: 16px;
    font-size: 13.5px;
}
.napcat-strip-icon { font-size: 16px; }
.napcat-strip-actions { margin-left: auto; display: flex; gap: 8px; }
/* ========== 危险操作确认弹窗（点击后 5 秒冷静期） ========== */
.cool-mask {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
}

.cool-dialog {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 30px 60px -20px rgba(15, 23, 42, .5);
    width: 100%;
    max-width: 460px;
    padding: 22px 24px 18px;
    border: 1px solid var(--line);
}

.cool-dialog-title {
    font-size: 16px;
    font-weight: 650;
    color: #b91c1c;
    margin-bottom: 10px;
}

.cool-dialog-text {
    font-size: 14px;
    color: var(--ink-2);
    line-height: 1.75;
    white-space: pre-wrap;
    word-break: break-word;
    background: var(--danger-soft);
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
}

.cool-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.cool-dialog-actions .btn:disabled {
    background: #fee2e2;
    color: #f0a3a3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
/* ========== 房间检测预览（固定 600 × 450 容器） ========== */
.room-preview {
    width: 600px;
    max-width: 100%;
    height: 450px;
    margin: 10px 0 18px;
    display: flex;
    flex-direction: column;
}

.rp-card {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f8faff;
    border: 1px solid #e5eaff;
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 30px -22px rgba(15, 23, 42, .8);
}

.rp-cover {
    flex: none;
    width: 100%;
    height: 240px;
    overflow: hidden;
    display: block;
    line-height: 0;
    background: #eef2ff;
}

.rp-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.rp-info {
    flex: 1;
    min-height: 0;
    padding: 12px 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rp-badges { display: flex; gap: 8px; flex-wrap: wrap; }

.rp-title {
    font-size: 15px;
    font-weight: 650;
    color: var(--ink);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.rp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    color: #64748b;
    font-size: 12.5px;
    overflow: hidden;
}

.rp-actions {
    margin-top: auto;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.rp-loading {
    flex: none;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: #f8faff;
    border: 1px dashed #c7d2fe;
    color: #4f46e5;
    font-size: 13.5px;
}

@media (max-width: 700px) {
    .room-preview { width: 100%; height: auto; }
    .rp-cover { height: auto; }
    .rp-cover img { height: auto; }
}

/* ========== 域名与 SSL 管理 ========== */
.dom-page { display: flex; flex-direction: column; gap: 18px; }

/* 汇总条 */
.ssl-summary {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 6px 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}
.ssl-summary .ssl-metric {
    padding: 10px 22px 10px 14px;
    border-right: 1px dashed var(--line);
    min-width: 96px;
}
.ssl-summary .ssl-metric:last-child { border-right: none; }
.ssl-metric-val {
    font-size: 24px;
    font-weight: 750;
    line-height: 1.15;
    color: var(--ink);
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.ssl-metric-unit { font-size: 12.5px; font-weight: 600; color: var(--muted); }
.ssl-metric-label { font-size: 12.5px; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.ssl-metric.is-ok    .ssl-metric-val { color: var(--ok); }
.ssl-metric.is-warn  .ssl-metric-val { color: var(--warn); }
.ssl-metric.is-danger .ssl-metric-val { color: var(--danger); }
.ssl-summary-note {
    margin-left: auto;
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.75;
    text-align: right;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
}

/* 说明折叠 */
.ssl-help {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
}
.ssl-help > summary {
    cursor: pointer;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 650;
    color: var(--ink-2);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.ssl-help > summary::-webkit-details-marker { display: none; }
.ssl-help > summary::after {
    content: '▾';
    margin-left: auto;
    color: var(--muted);
    transition: transform .18s ease;
}
.ssl-help[open] > summary::after { transform: rotate(180deg); }
.ssl-help-body {
    padding: 2px 16px 16px;
    font-size: 13px;
    line-height: 1.85;
    color: #475569;
    border-top: 1px solid var(--line-soft);
}
.ssl-help-body b { color: var(--ink); }
.ssl-help-body code { background: var(--brand-soft); color: var(--brand-dark); padding: 2px 7px; border-radius: 6px; font-size: 12.5px; }
.ssl-help-body ul { margin: 8px 0 0; padding-left: 18px; }
.ssl-help-body li { margin: 4px 0; }

/* 站点单元格 */
.site-cell { display: flex; flex-direction: column; gap: 5px; }
.site-name { font-size: 14px; font-weight: 700; color: var(--ink); }
.site-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.site-kind {
    font-size: 11.5px;
    font-weight: 650;
    color: #64748b;
    background: var(--line-soft);
    border-radius: 6px;
    padding: 2px 7px;
}
.site-flag {
    font-size: 11.5px;
    font-weight: 650;
    color: #6d28d9;
    background: #f5f3ff;
    border-radius: 6px;
    padding: 2px 7px;
}
.site-url {
    font-size: 11.5px;
    color: var(--muted);
    text-decoration: none;
    border-bottom: 1px dashed var(--line);
}
.site-url:hover { color: var(--brand-dark); border-bottom-color: var(--brand); }

/* 域名 chips */
.dom-list { display: block; }
.dom-list .dom-chip { margin: 0 4px 4px 0; }
.dom-more { display: inline-block; margin-bottom: 4px; }
.dom-chip {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    padding: 2px 10px;
    background: var(--line-soft);
    color: #475569;
    border: 1px solid transparent;
    line-height: 1.7;
}
.dom-chip.is-main { background: var(--brand-soft); color: var(--brand-dark); border-color: #dfe4ff; }

/* HTTPS 状态：主状态 + 跳转标记合成一个整体 */
.https-cell { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.https-state {
    display: inline-flex;
    align-items: stretch;
    border-radius: 9px;
    overflow: hidden;
    border: 1px solid transparent;
}
.https-state .hs-main,
.https-state .hs-sub {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 650;
    padding: 3px 9px;
    white-space: nowrap;
}
.https-state.on { border-color: #bbf7d0; }
.https-state.on .hs-main { background: #dcfce7; color: var(--ok); }
.https-state.on .hs-sub {
    background: #ecfdf5;
    color: #0f766e;
    border-left: 1px solid #d1fae5;
}
.https-state.off { border-color: #e2e8f0; }
.https-state.off .hs-main { background: #f8fafc; color: #64748b; }
.https-state.off .hs-sub { background: #f8fafc; color: var(--muted); border-left: 1px solid #e2e8f0; }
.https-state .hs-sub em { font-style: normal; opacity: .65; font-size: 11px; }
.https-state .hs-caret { opacity: .55; font-size: 10px; }

/* 证书单元格 */
.cert-cell { display: flex; flex-direction: column; gap: 4px; }
.cert-subject {
    font-size: 13px;
    font-weight: 650;
    color: var(--ink);
    max-width: 170px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cert-sub { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.cert-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 650;
    border-radius: 6px;
    padding: 1px 7px;
    line-height: 1.7;
}
.cert-badge.ok { background: #dcfce7; color: var(--ok); }
.cert-badge.warn { background: #fef3c7; color: var(--warn); }
.cert-badge.mute { background: var(--line-soft); color: var(--muted); }
.cert-none { font-size: 12.5px; color: var(--muted); }

/* 备选证书（折叠） */
.cert-extra > summary {
    cursor: pointer;
    font-size: 11.5px;
    color: var(--brand-dark);
    list-style: none;
    margin-top: 2px;
}
.cert-extra > summary::-webkit-details-marker { display: none; }
.cert-extra > summary::before { content: '▸ '; }
.cert-extra[open] > summary::before { content: '▾ '; }
.cert-extra-body {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

/* 到期时间 + 进度条 */
.expiry { display: flex; flex-direction: column; gap: 6px; min-width: 108px; }
.expiry-days { font-size: 13px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.expiry-days.is-warn { color: var(--warn); }
.expiry-days.is-danger { color: var(--danger); }
.expiry-days.is-unknown { color: var(--muted); font-weight: 600; }
.expiry-bar {
    height: 5px;
    border-radius: 99px;
    background: var(--line);
    overflow: hidden;
    width: 100%;
}
.expiry-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--ok); }
.expiry-bar.is-warn > i { background: #f59e0b; }
.expiry-bar.is-danger > i { background: var(--danger); }
.expiry-bar.is-unknown > i { background: #cbd5e1; width: 100% !important; opacity: .45; }
.expiry-date { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* 操作区 */
.actions .btn { margin-bottom: 0; }
.action-group { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.action-sep { width: 1px; height: 18px; background: var(--line); display: inline-block; }
.readonly-note { font-size: 12.5px; color: var(--muted); }
.readonly-note a { color: var(--brand-dark); font-weight: 650; }

/* 操作区紧凑化 */
.actions .btn-icon { padding: 0 9px; font-size: 13px; line-height: 1; }
.actions .action-group { gap: 5px; }
