:root {
    --admin-bg: #f3f6fb;
    --sidebar-bg: linear-gradient(180deg, #0f172a 0%, #151e36 100%);
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --content-card: #ffffff;
    --text-main: #162033;
    --text-sub: #6b7280;
    --line: #e8edf5;
    --primary: #4f46e5;
    --primary-soft: rgba(79, 70, 229, 0.1);
    --success: #16a34a;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.16);
    --shadow-md: 0 14px 35px rgba(15, 23, 42, 0.08);
    --radius-xl: 24px;
    --radius-lg: 18px;
    --radius-md: 14px;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    background: var(--admin-bg);
    color: var(--text-main);
}

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

button,
input,
select,
textarea {
    font: inherit;
}

.admin-shell {
    min-height: 100vh;
    display: flex;
    background: linear-gradient(180deg, #eef2ff 0%, #f8fafc 45%, #f1f5f9 100%);
}

.sidebar-float {
    width: 280px;
    padding: 22px 16px;
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
}

.sidebar-panel {
    height: calc(100vh - 44px);
    border-radius: 28px;
    background: var(--sidebar-bg);
    border: 1px solid var(--sidebar-border);
    box-shadow: var(--shadow-lg);
    padding: 14px;
    display: flex;
    flex-direction: column;
    color: #dbe4ff;
    overflow: hidden;
}

.brand-admin {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
}

.brand-mark {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
}

.brand-copy strong,
.brand-copy span {
    display: block;
}

.brand-copy span,
.sidebar-foot,
.user-meta span,
.kpi-card p,
.card-head p,
.table-note,
.meta-line,
.empty-note,
.timeline-item p,
.preview-frame p,
.preview-frame li,
.login-copy p,
.login-panel p,
.login-meta,
.data-table td,
.input-group span,
.section-tabs a,
.status-text {
    color: var(--text-sub);
}

.brand-copy span {
    color: #8ea0d4;
    font-size: 12px;
    margin-top: 2px;
}

.user-card {
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.user-meta strong {
    display: block;
    color: #fff;
    margin-bottom: 2px;
}

.sidebar-nav-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 4px;
}

.sidebar-nav-scroll::-webkit-scrollbar {
    width: 6px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.35);
    border-radius: 999px;
}

.sidebar-nav-group {
    margin-top: 6px;
}

.sidebar-nav-group.is-first {
    margin-top: 0;
}

.nav-list {
    display: grid;
    gap: 2px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 12px;
    color: #c8d5ff;
    transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(79, 70, 229, 0.22);
    color: #fff;
    transform: translateX(2px);
}

/* 父菜单（含子菜单）的箭头 */
.nav-link--parent .nav-arrow {
    margin-left: auto;
    font-size: 11px;
    color: rgba(200, 213, 255, 0.6);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.nav-link--parent.expanded .nav-arrow {
    color: #fff;
}

/* 子菜单容器 */
.nav-children {
    display: none;
    margin: 2px 0 4px 14px;
    padding-left: 10px;
    border-left: 1px solid rgba(200, 213, 255, 0.15);
    gap: 1px;
}
.nav-children.show {
    display: grid;
}

/* 子菜单项 */
.nav-link--child {
    padding: 6px 10px;
    font-size: 13px;
    gap: 8px;
}
.nav-link--child .nav-child-icon {
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    font-size: 13px;
    flex-shrink: 0;
    opacity: 0.85;
}
.nav-link--child .nav-text strong {
    font-weight: 500;
    font-size: 13px;
}

.nav-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: inherit;
}

.nav-icon::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: 18px 18px;
    mask-size: 18px 18px;
}

.nav-icon--dashboard::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12l9-9 9 9'/><path d='M5 10v11h5v-6h4v6h5V10'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 12l9-9 9 9'/><path d='M5 10v11h5v-6h4v6h5V10'/></svg>");
}

.nav-icon--domains::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M2 12h20'/><path d='M12 2a15 15 0 010 20M12 2a15 15 0 000 20'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M2 12h20'/><path d='M12 2a15 15 0 010 20M12 2a15 15 0 000 20'/></svg>");
}

.nav-icon--templates::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>");
}

.nav-icon--ai-models::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M9 2v2M15 2v2M9 20v2M15 20v2M2 9h2M2 15h2M20 9h2M20 15h2'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='4' y='4' width='16' height='16' rx='2'/><rect x='9' y='9' width='6' height='6'/><path d='M9 2v2M15 2v2M9 20v2M15 20v2M2 9h2M2 15h2M20 9h2M20 15h2'/></svg>");
}

.nav-icon--menus::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><circle cx='4' cy='6' r='1'/><circle cx='4' cy='12' r='1'/><circle cx='4' cy='18' r='1'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><line x1='8' y1='6' x2='21' y2='6'/><line x1='8' y1='12' x2='21' y2='12'/><line x1='8' y1='18' x2='21' y2='18'/><circle cx='4' cy='6' r='1'/><circle cx='4' cy='12' r='1'/><circle cx='4' cy='18' r='1'/></svg>");
}

.nav-icon--site-build::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2l3 3-3 10-3-10 3-3z'/><path d='M9 15l-3 3 2 2 2-2M15 15l3 3-2 2-2-2'/><circle cx='12' cy='9' r='1.5'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2l3 3-3 10-3-10 3-3z'/><path d='M9 15l-3 3 2 2 2-2M15 15l3 3-2 2-2-2'/><circle cx='12' cy='9' r='1.5'/></svg>");
}

.nav-icon--content::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/><polyline points='14 2 14 8 20 8'/><line x1='8' y1='13' x2='16' y2='13'/><line x1='8' y1='17' x2='16' y2='17'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z'/><polyline points='14 2 14 8 20 8'/><line x1='8' y1='13' x2='16' y2='13'/><line x1='8' y1='17' x2='16' y2='17'/></svg>");
}

.nav-icon--ads::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11v2l14 5V6L3 11z'/><path d='M17 9v6'/><path d='M6 13v5h3v-4'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M3 11v2l14 5V6L3 11z'/><path d='M17 9v6'/><path d='M6 13v5h3v-4'/></svg>");
}

.nav-icon--settings::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='3'/><path d='M12 2v3M12 19v3M4.2 4.2l2.1 2.1M17.7 17.7l2.1 2.1M2 12h3M19 12h3M4.2 19.8l2.1-2.1M17.7 6.3l2.1-2.1'/></svg>");
}

.nav-icon--help::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9 9a3 3 0 016 0c0 2-3 2-3 4'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='10'/><path d='M9 9a3 3 0 016 0c0 2-3 2-3 4'/><line x1='12' y1='17' x2='12.01' y2='17'/></svg>");
}

.nav-icon--template-packs::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><rect x='3' y='3' width='7' height='7' rx='1'/><rect x='14' y='3' width='7' height='7' rx='1'/><rect x='3' y='14' width='7' height='7' rx='1'/><rect x='14' y='14' width='7' height='7' rx='1'/></svg>");
}

.nav-icon--spider-stats::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2a4 4 0 014 4v1a4 4 0 01-8 0V6a4 4 0 014-4z'/><path d='M6.5 7L3 5M17.5 7L21 5M6 12H2M18 12h4M6.5 17L3 19M17.5 17L21 19M12 11v11'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M12 2a4 4 0 014 4v1a4 4 0 01-8 0V6a4 4 0 014-4z'/><path d='M6.5 7L3 5M17.5 7L21 5M6 12H2M18 12h4M6.5 17L3 19M17.5 17L21 19M12 11v11'/></svg>");
}

.nav-icon--system-update::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 2v6h-6'/><path d='M3 12a9 9 0 0115-6.7L21 8'/><path d='M3 22v-6h6'/><path d='M21 12a9 9 0 01-15 6.7L3 16'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M21 2v6h-6'/><path d='M3 12a9 9 0 0115-6.7L21 8'/><path d='M3 22v-6h6'/><path d='M21 12a9 9 0 01-15 6.7L3 16'/></svg>");
}

.nav-icon--admins::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 00-4-4H8a4 4 0 00-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>");
}

.nav-text strong,
.nav-text span {
    display: block;
}

.nav-text strong {
    font-size: 13px;
    line-height: 1.2;
}

.nav-text span {
    display: none;
}

.nav-update-badge {
    display: inline-flex !important;
    align-items: center;
    margin-left: 6px;
    padding: 1px 7px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.6;
    color: #fff;
    background: #ef4444;
    border-radius: 8px;
    letter-spacing: 0.5px;
    vertical-align: middle;
    animation: badge-pulse 2s ease-in-out infinite;
}

@keyframes badge-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .7; }
}

/* 视口较矮时进一步收紧 */
@media (max-height: 820px) {
    .nav-link { padding: 6px 10px; }
    .nav-list { gap: 1px; }
    .sidebar-nav-group { margin-top: 4px; }
    .brand-admin { padding: 4px 8px 8px; }
    .user-card { padding: 8px 10px; margin-bottom: 6px; }
    .sidebar-foot { padding: 8px 10px 4px; gap: 6px; }
}

.sidebar-foot {
    flex: 0 0 auto;
    padding: 10px 10px 4px;
    color: #8ea0d4;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.1);
    color: #fecaca;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(239, 68, 68, 0.18);
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.sidebar-logout:hover {
    background: rgba(239, 68, 68, 0.22);
    color: #fff;
    border-color: rgba(239, 68, 68, 0.45);
    transform: translateY(-1px);
}

.sidebar-logout:active {
    transform: translateY(0);
}

.sidebar-logout-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
}

.sidebar-version {
    text-align: center;
    color: #8ea0d4;
    font-size: 11.5px;
    letter-spacing: 0.04em;
}

.admin-content {
    margin-left: 280px;
    width: calc(100% - 280px);
    padding: 26px 24px 26px 0;
}

.content-wrap {
    min-height: calc(100vh - 52px);
    background: rgba(255, 255, 255, 0.52);
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 32px;
    padding: 24px;
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
}

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

.topbar h1,
.card-head h2,
.page-title {
    margin: 0 0 6px;
}

.page-subtitle,
.topbar p {
    margin: 0;
    color: var(--text-sub);
}

.topbar-actions,
.form-actions,
.quick-grid,
.filter-row,
.section-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn,
.btn-primary,
.btn-soft,
.btn-ghost {
    border: 0;
    cursor: pointer;
    border-radius: 14px;
    padding: 11px 18px;
    transition: all 0.2s ease;
}

.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    box-shadow: 0 12px 26px rgba(79, 70, 229, 0.24);
}

.btn-soft {
    color: var(--primary);
    background: var(--primary-soft);
}

.btn-ghost {
    color: var(--text-main);
    background: #fff;
    border: 1px solid var(--line);
}

.btn-primary:hover,
.btn-soft:hover,
.btn-ghost:hover {
    transform: translateY(-1px);
}

.kpi-grid,
.card-grid,
.two-col,
.login-grid {
    display: grid;
    gap: 18px;
}

.kpi-grid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 22px;
}

.kpi-card,
.page-card,
.preview-frame,
.login-panel,
.login-copy {
    background: var(--content-card);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.kpi-card {
    padding: 22px;
}

.kpi-card strong {
    display: block;
    font-size: 30px;
    margin-bottom: 8px;
}

.page-card {
    padding: 22px;
}

.card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 18px;
}

.card-grid {
    grid-template-columns: 1.3fr 1fr;
}

.two-col {
    grid-template-columns: 1.15fr 0.85fr;
}

.filter-row {
    margin-bottom: 14px;
    align-items: center;
}

.filter-row > .input,
.filter-row > .select {
    flex: 1 1 180px;
    min-width: 140px;
    width: auto;
}

.filter-row > .btn,
.filter-row > .btn-primary,
.filter-row > .btn-soft,
.filter-row > .btn-ghost {
    flex: 0 0 auto;
}

.input,
.select,
.textarea {
    width: 100%;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 12px 14px;
    color: var(--text-main);
}

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

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

.span-2 {
    grid-column: 1 / -1;
}

/* 文章编辑二列布局 */
.edit-two-col {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
    align-items: start;
}
.edit-col-left .page-card + .page-card { margin-top: 20px; }
.edit-col-left .form-grid { grid-template-columns: 1fr; }
.edit-col-right .page-card { position: sticky; top: 16px; }

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 10px;
    border-bottom: 1px solid var(--line);
}

.data-table th {
    color: var(--text-main);
    font-size: 13px;
}

.data-table td {
    font-size: 13.5px;
    color: var(--text-main);
    vertical-align: middle;
}

.content-title-cell {
    max-width: 360px;
    min-width: 220px;
}

.content-title-cell strong {
    display: block;
    font-weight: 500;
    font-size: 13.5px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.content-title-cell .content-subline {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.content-actions {
    white-space: nowrap;
    font-size: 13px;
    color: #64748b;
}

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

.content-actions a:hover {
    text-decoration: underline;
}

.link-btn {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    color: var(--primary);
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.link-btn:hover {
    text-decoration: underline;
}

.table-note {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed var(--line);
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.6;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    white-space: nowrap;
}

.badge.success {
    background: rgba(22, 163, 74, 0.1);
    color: var(--success);
}

.badge.warning {
    background: rgba(217, 119, 6, 0.12);
    color: var(--warning);
}

.badge.danger {
    background: rgba(220, 38, 38, 0.1);
    color: var(--danger);
}

.badge.info {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
}

.list-stack,
.timeline,
.template-stack,
.setting-list {
    display: grid;
    gap: 12px;
}

.mini-item,
.timeline-item,
.template-item,
.setting-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
}

.mini-item strong,
.timeline-item strong,
.template-item strong,
.setting-item strong,
.preview-frame strong {
    display: block;
    margin-bottom: 6px;
}

.editor-box {
    min-height: 260px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: #fff;
    overflow: hidden;
}

.editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    border-bottom: 1px solid var(--line);
}

.editor-toolbar button {
    border: 1px solid var(--line);
    background: #f8fafc;
    border-radius: 10px;
    padding: 8px 12px;
    cursor: pointer;
}

.editor-area {
    min-height: 200px;
    padding: 18px;
    color: var(--text-sub);
}

.template-preview {
    display: grid;
    gap: 14px;
}

.preview-frame ul {
    margin: 0;
    padding-left: 18px;
}

.section-tabs a {
    padding: 10px 14px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.section-tabs a.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-color: rgba(79, 70, 229, 0.2);
}

/* ============================================================
   Dashboard · Tech Blue Design System (scope: .dash-theme)
   ============================================================ */
.dash-theme {
    --dash-bg: #f4f7fb;
    --dash-ink: #0b1a33;
    --dash-ink-2: #1f2a44;
    --dash-muted: #5a6a85;
    --dash-muted-2: #8a97ae;
    --dash-line: rgba(15, 42, 88, 0.08);
    --dash-line-strong: rgba(15, 42, 88, 0.14);
    --dash-surface: #ffffff;
    --dash-surface-2: #f8fbff;
    --dash-primary: #2563eb;
    --dash-primary-2: #1d4ed8;
    --dash-primary-soft: rgba(37, 99, 235, 0.08);
    --dash-cyan: #06b6d4;
    --dash-success: #10b981;
    --dash-warning: #f59e0b;
    --dash-danger: #ef4444;
    --dash-shadow-sm: 0 2px 6px rgba(15, 42, 88, 0.04);
    --dash-shadow-md: 0 8px 24px rgba(15, 42, 88, 0.06);
    --dash-shadow-lg: 0 20px 44px rgba(15, 42, 88, 0.08);
    --dash-radius: 16px;
    --dash-radius-lg: 22px;
}

.dash-wrap {
    display: grid;
    gap: 20px;
    color: var(--dash-ink);
    font-feature-settings: 'tnum';
}

.dash-wrap h1,
.dash-wrap h2,
.dash-wrap h3 {
    color: inherit;
    letter-spacing: -0.01em;
}

/* ---------- Hero ---------- */
.dash-hero {
    position: relative;
    overflow: hidden;
    border-radius: 28px;
    padding: 34px;
    color: #e8f0ff;
    background:
        radial-gradient(1200px 400px at 110% -20%, rgba(6, 182, 212, 0.28), transparent 60%),
        radial-gradient(900px 500px at -10% 120%, rgba(37, 99, 235, 0.55), transparent 60%),
        linear-gradient(135deg, #0b1a33 0%, #0f2a5a 45%, #1e3a8a 100%);
    box-shadow: 0 30px 60px rgba(11, 26, 51, 0.28);
}

.dash-hero__grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: radial-gradient(ellipse at 30% 20%, rgba(0, 0, 0, 0.55), transparent 70%);
    pointer-events: none;
}

.dash-hero__glow {
    position: absolute;
    right: -160px;
    top: -160px;
    width: 420px;
    height: 420px;
    background: radial-gradient(closest-side, rgba(6, 182, 212, 0.35), transparent 70%);
    filter: blur(10px);
    pointer-events: none;
    animation: dashGlow 8s ease-in-out infinite alternate;
}

@keyframes dashGlow {
    0% { transform: translate(0, 0) scale(1); opacity: 0.9; }
    100% { transform: translate(-30px, 20px) scale(1.08); opacity: 1; }
}

.dash-hero__content {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(320px, 520px);
    gap: 28px;
    align-items: center;
}

.dash-hero__copy h1 {
    margin: 10px 0 12px;
    font-size: clamp(26px, 2.6vw, 34px);
    color: #fff;
    font-weight: 600;
}

.dash-hero__copy h1 .accent {
    background: linear-gradient(90deg, #7dd3fc, #38bdf8 40%, #67e8f9);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.dash-hero__copy p {
    margin: 0;
    max-width: 640px;
    color: rgba(224, 235, 255, 0.78);
    line-height: 1.8;
    font-size: 14px;
}

.dash-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(125, 211, 252, 0.08);
    border: 1px solid rgba(125, 211, 252, 0.22);
    color: #bae6fd;
    font-size: 12px;
    letter-spacing: 0.04em;
}

.dash-eyebrow .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22d3ee;
    box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18);
    animation: dashPulse 1.8s ease-in-out infinite;
}

@keyframes dashPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.18); }
    50% { box-shadow: 0 0 0 8px rgba(34, 211, 238, 0.02); }
}

.dash-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.dash-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.dash-btn--primary {
    color: #fff;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.35);
}

.dash-btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(56, 189, 248, 0.5);
}

.dash-btn--ghost {
    color: #e0ecff;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.16);
}

.dash-btn--ghost:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(125, 211, 252, 0.5);
}

.dash-hero__stats {
    display: grid;
    gap: 12px;
}

.dash-hero__stat {
    position: relative;
    padding: 16px 18px;
    border-radius: var(--dash-radius);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(148, 197, 255, 0.16);
    backdrop-filter: blur(14px);
}

.dash-hero__stat-label {
    display: block;
    color: rgba(224, 235, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.02em;
}

.dash-hero__stat-value {
    display: block;
    margin: 6px 0 4px;
    font-size: 30px;
    font-weight: 600;
    color: #fff;
    line-height: 1.1;
}

.dash-hero__stat-value small {
    font-size: 14px;
    margin-left: 2px;
    color: rgba(191, 219, 254, 0.85);
    font-weight: 500;
}

.dash-hero__stat-sub {
    display: block;
    font-style: normal;
    color: rgba(191, 219, 254, 0.7);
    font-size: 12px;
}

.dash-hero__stat-bar {
    position: relative;
    display: block;
    margin-top: 10px;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.dash-hero__stat-bar i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #22d3ee, #60a5fa);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* ---------- Alert ---------- */
.dash-alert {
    display: grid;
    gap: 4px;
    padding: 14px 18px;
    border-radius: var(--dash-radius);
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.18);
    color: #991b1b;
}

.dash-alert strong {
    color: #b91c1c;
}

.dash-alert span {
    font-size: 13px;
    color: #7f1d1d;
}

/* ---------- KPI grid ---------- */
.dash-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.dash-kpi {
    position: relative;
    padding: 20px 22px;
    border-radius: var(--dash-radius-lg);
    background: var(--dash-surface);
    border: 1px solid var(--dash-line);
    box-shadow: var(--dash-shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dash-kpi::before {
    content: '';
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2563eb, #38bdf8, #06b6d4);
    opacity: 0.9;
}

.dash-kpi[data-type="template"]::before { background: linear-gradient(90deg, #1d4ed8, #60a5fa); }
.dash-kpi[data-type="content"]::before { background: linear-gradient(90deg, #0ea5e9, #06b6d4); }
.dash-kpi[data-type="task"]::before { background: linear-gradient(90deg, #2563eb, #7c3aed); }

.dash-kpi:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: var(--dash-shadow-lg);
}

.dash-kpi__label {
    display: block;
    color: var(--dash-muted);
    font-size: 13px;
    letter-spacing: 0.02em;
}

.dash-kpi__value {
    display: block;
    margin: 10px 0 6px;
    font-size: 34px;
    font-weight: 600;
    color: var(--dash-ink);
    line-height: 1.05;
    letter-spacing: -0.02em;
}

.dash-kpi__meta {
    display: block;
    color: var(--dash-muted-2);
    font-size: 12.5px;
}

.dash-kpi__spark {
    position: absolute;
    right: 16px;
    top: 18px;
    width: 56px;
    height: 24px;
    background:
        linear-gradient(180deg, transparent 0%, rgba(37, 99, 235, 0.08) 100%),
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 24' preserveAspectRatio='none'><polyline fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' points='0,18 8,14 16,17 24,10 32,13 40,6 48,9 56,3'/></svg>") center/contain no-repeat;
    border-radius: 4px;
    opacity: 0.75;
}

/* ---------- Quick actions ---------- */
.dash-quick {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.dash-quick__card {
    position: relative;
    display: block;
    padding: 16px 18px;
    border-radius: var(--dash-radius);
    background: var(--dash-surface);
    border: 1px solid var(--dash-line);
    box-shadow: var(--dash-shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
    overflow: hidden;
}

.dash-quick__card::after {
    content: '';
    position: absolute;
    inset: auto 0 0 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--dash-primary), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.dash-quick__card:hover {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: var(--dash-shadow-md);
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
}

.dash-quick__card:hover::after {
    transform: scaleX(1);
}

.dash-quick__card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--dash-ink);
    font-size: 14.5px;
}

.dash-quick__card span {
    display: block;
    color: var(--dash-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

.dash-quick__arrow {
    position: absolute;
    right: 14px;
    top: 14px;
    color: var(--dash-muted-2);
    font-style: normal;
    transition: transform 0.18s ease, color 0.18s ease;
}

.dash-quick__card:hover .dash-quick__arrow {
    color: var(--dash-primary);
    transform: translateX(3px);
}

/* ---------- Grid / Panel ---------- */
.dash-grid {
    display: grid;
    gap: 20px;
}

.dash-grid--2 {
    grid-template-columns: 1.15fr 0.95fr;
}

.dash-panel {
    padding: 22px 24px;
    border-radius: var(--dash-radius-lg);
    background: var(--dash-surface);
    border: 1px solid var(--dash-line);
    box-shadow: var(--dash-shadow-sm);
}

.dash-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.dash-panel__head h2 {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 600;
}

.dash-panel__head p {
    margin: 0;
    color: var(--dash-muted);
    font-size: 13px;
    line-height: 1.7;
}

.dash-link {
    font-size: 13px;
    color: var(--dash-primary);
    padding: 6px 10px;
    border-radius: 10px;
    transition: background 0.18s ease;
}

.dash-link:hover {
    background: var(--dash-primary-soft);
}

/* ---------- Metric list ---------- */
.dash-metric-list,
.dash-health {
    display: grid;
    gap: 10px;
}

.dash-metric,
.dash-health__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid var(--dash-line);
    border-radius: 14px;
    background: var(--dash-surface-2);
    transition: border-color 0.18s ease, background 0.18s ease;
}

.dash-metric:hover,
.dash-health__row:hover {
    border-color: rgba(37, 99, 235, 0.18);
    background: #fff;
}

.dash-metric span,
.dash-health__row span {
    color: var(--dash-muted);
    font-size: 13px;
}

.dash-metric strong {
    color: var(--dash-ink);
    font-size: 15px;
    font-weight: 600;
}

.dash-metric strong em {
    color: var(--dash-muted-2);
    font-style: normal;
    font-weight: 400;
    font-size: 12.5px;
    margin-left: 4px;
}

/* ---------- Pill ---------- */
.dash-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
}

.dash-pill i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.9;
}

.dash-pill.is-ok    { color: #047857; background: rgba(16, 185, 129, 0.1); }
.dash-pill.is-warn  { color: #b45309; background: rgba(245, 158, 11, 0.12); }
.dash-pill.is-info  { color: #1d4ed8; background: rgba(37, 99, 235, 0.1); }
.dash-pill.is-danger{ color: #b91c1c; background: rgba(239, 68, 68, 0.1); }

/* ---------- Task list ---------- */
.dash-task-list {
    display: grid;
    gap: 12px;
}

.dash-task {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--dash-line);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.dash-task:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: var(--dash-shadow-md);
}

.dash-task__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.dash-task__top strong {
    color: var(--dash-ink);
    font-size: 14.5px;
}

.dash-task p {
    margin: 0;
    color: var(--dash-muted);
    font-size: 13px;
    line-height: 1.7;
}

.dash-task p em {
    color: var(--dash-ink-2);
    font-style: normal;
    font-weight: 500;
}

.dash-task__meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 10px 0 0;
    padding: 10px 0 0;
    list-style: none;
    border-top: 1px dashed var(--dash-line);
}

.dash-task__meta li {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-task__meta span {
    color: var(--dash-muted-2);
    font-size: 11.5px;
    letter-spacing: 0.02em;
}

.dash-task__meta b {
    color: var(--dash-ink);
    font-size: 15px;
    font-weight: 600;
}

.dash-task__meta b.ok { color: #059669; }
.dash-task__meta b.danger { color: #dc2626; }

/* ---------- Split / Timeline ---------- */
.dash-split {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.dash-subhead {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--dash-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.dash-timeline {
    position: relative;
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
    display: grid;
    gap: 12px;
}

.dash-timeline::before {
    content: '';
    position: absolute;
    left: 4px;
    top: 6px;
    bottom: 6px;
    width: 1px;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.3), rgba(37, 99, 235, 0));
}

.dash-timeline li {
    position: relative;
    padding: 0 0 0 6px;
}

.dash-timeline__dot {
    position: absolute;
    left: -14px;
    top: 6px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--dash-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.dash-timeline li strong {
    display: block;
    color: var(--dash-ink);
    font-size: 14px;
    margin-bottom: 2px;
}

.dash-timeline li span {
    color: var(--dash-muted);
    font-size: 12.5px;
    line-height: 1.6;
}

/* ---------- Domain grid ---------- */
.dash-domain-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dash-domain {
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--dash-line);
    background: var(--dash-surface-2);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.dash-domain:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    background: #fff;
    box-shadow: var(--dash-shadow-md);
}

.dash-domain__top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.dash-domain__top strong {
    color: var(--dash-ink);
    font-size: 14.5px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    letter-spacing: -0.01em;
}

.dash-domain p {
    margin: 0 0 6px;
    color: var(--dash-muted);
    font-size: 13px;
}

.dash-domain small {
    display: block;
    color: var(--dash-muted-2);
    font-size: 12px;
    line-height: 1.6;
}

/* ---------- Empty ---------- */
.dash-empty {
    padding: 20px;
    text-align: center;
    color: var(--dash-muted);
    border: 1px dashed var(--dash-line-strong);
    border-radius: 14px;
    background: var(--dash-surface-2);
    font-size: 13px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-quick    { grid-template-columns: repeat(3, 1fr); }
    .dash-grid--2  { grid-template-columns: 1fr; }
    .dash-domain-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 960px) {
    .dash-hero { padding: 26px; border-radius: 22px; }
    .dash-hero__content { grid-template-columns: 1fr; }
    .dash-split { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .dash-kpi-grid,
    .dash-quick,
    .dash-domain-grid { grid-template-columns: 1fr; }
    .dash-task__meta  { grid-template-columns: repeat(2, 1fr); }
    .dash-hero__stat-value { font-size: 26px; }
    .dash-kpi__value { font-size: 28px; }
    .dash-panel { padding: 18px; }
}

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top left, #4338ca 0%, #0f172a 45%, #111827 100%);
}

.login-grid {
    grid-template-columns: 1.05fr 0.95fr;
    width: min(1180px, 100%);
}

.login-copy,
.login-panel {
    padding: 34px;
}

.login-copy {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.14);
}

.login-copy p,
.login-copy .login-meta,
.login-copy li {
    color: rgba(255, 255, 255, 0.78);
}

.login-copy ul {
    margin: 18px 0 0;
    padding-left: 18px;
    line-height: 1.8;
}

.login-panel {
    background: rgba(255, 255, 255, 0.96);
}

.login-panel h1,
.login-copy h1 {
    margin: 0 0 10px;
}

.login-form {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.login-meta {
    margin-top: 18px;
    font-size: 13px;
}

.mobile-toggle {
    display: none;
}

@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .dashboard-hero,
    .dashboard-main-grid,
    .dashboard-split-list,
    .dashboard-domain-grid,
    .dashboard-action-grid {
        grid-template-columns: 1fr;
    }

    .card-grid,
    .two-col,
    .login-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 960px) {
    .sidebar-float {
        position: static;
        width: 100%;
        height: auto;
        padding: 14px;
    }

    .sidebar-panel {
        height: auto;
        overflow: visible;
    }

    .sidebar-nav-scroll {
        overflow: visible;
        padding-right: 0;
    }

    .admin-shell {
        flex-direction: column;
    }

    .admin-content {
        margin-left: 0;
        width: 100%;
        padding: 0 14px 14px;
    }

    .content-wrap {
        min-height: auto;
        border-radius: 24px;
    }
}

@media (max-width: 720px) {
    .topbar,
    .card-head,
    .filter-row,
    .topbar-actions,
    .section-tabs,
    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .kpi-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .edit-two-col {
        grid-template-columns: 1fr;
    }
    .edit-col-right .page-card { position: static; }

    .dashboard-hero {
        padding: 22px;
    }

    .hero-stat-card strong {
        font-size: 28px;
    }

    .metric-row,
    .health-item,
    .domain-health-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .login-copy,
    .login-panel,
    .page-card,
    .kpi-card {
        padding: 22px;
    }
}

/* ============================================================
   Settings & Help pages
   ============================================================ */
.inline-alert {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 16px;
    border: 1px solid transparent;
    font-size: 13px;
}
.inline-alert strong { font-size: 14px; }
.inline-alert.is-error { background: rgba(220, 38, 38, 0.06); border-color: rgba(220, 38, 38, 0.2); color: #7f1d1d; }
.inline-alert.is-error strong { color: #b91c1c; }
.inline-alert.is-success { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.22); color: #065f46; }
.inline-alert.is-success strong { color: #047857; }

.settings-tabs,
.help-tabs {
    margin-bottom: 18px;
}

.settings-card,
.help-card {
    margin-bottom: 16px;
}

.settings-card .card-head,
.help-card .card-head {
    align-items: flex-start;
}

.settings-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}
.settings-badge.is-ok   { color: #047857; background: rgba(16, 185, 129, 0.12); }
.settings-badge.is-warn { color: #b45309; background: rgba(245, 158, 11, 0.14); }

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

.settings-grid--compact {
    margin-top: 16px;
}

.settings-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
}

.settings-item span {
    color: #64748b;
    font-size: 12.5px;
    letter-spacing: 0.02em;
}

.settings-item strong {
    color: #0b1a33;
    font-size: 14.5px;
    font-weight: 600;
    word-break: break-all;
}

.settings-item strong.mono,
.mono {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    letter-spacing: -0.01em;
}

.settings-hint {
    font-size: 12px;
}
.settings-hint.ok   { color: #059669; }
.settings-hint.warn { color: #b45309; }

.settings-form {
    display: grid;
    gap: 16px;
    margin-bottom: 18px;
}

.settings-action-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.settings-action {
    padding: 18px;
    border-radius: 16px;
    background: #fff;
    border: 1px solid rgba(15, 42, 88, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.settings-action:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, 0.22);
    box-shadow: 0 8px 24px rgba(15, 42, 88, 0.06);
}
.settings-action strong { color: #0b1a33; font-size: 15px; }
.settings-action p { margin: 0; color: #5a6a85; font-size: 13px; line-height: 1.7; }
.settings-action .btn-ghost,
.settings-action a.btn-ghost { align-self: flex-start; padding: 8px 14px; font-size: 13px; }

/* Help page specific */
.help-steps {
    list-style: none;
    counter-reset: help-step;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 14px;
}
.help-steps li {
    counter-increment: help-step;
    position: relative;
    padding: 14px 16px 14px 56px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
    border-radius: 14px;
}
.help-steps li::before {
    content: counter(help-step);
    position: absolute;
    left: 14px;
    top: 14px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
}
.help-steps li strong { display: block; color: #0b1a33; margin-bottom: 4px; font-size: 14.5px; }
.help-steps li p { margin: 0; color: #5a6a85; line-height: 1.8; font-size: 13.5px; }
.help-steps li a { color: #2563eb; }

.help-concept-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.help-concept-grid > div {
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
}
.help-concept-grid strong { display: block; color: #0b1a33; margin-bottom: 4px; }
.help-concept-grid p { margin: 0; color: #5a6a85; font-size: 13px; line-height: 1.7; }

.help-body {
    color: #475569;
    line-height: 1.9;
    font-size: 13.5px;
}
.help-body p { margin: 6px 0; }
.help-body code,
.help-card code,
.inline-alert code {
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 12.5px;
    padding: 2px 6px;
    border-radius: 6px;
    background: rgba(37, 99, 235, 0.08);
    color: #1d4ed8;
}

.help-code {
    margin: 10px 0;
    padding: 14px 16px;
    background: #0b1a33;
    color: #bae6fd;
    border-radius: 12px;
    font-family: 'SFMono-Regular', Consolas, monospace;
    font-size: 13px;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.help-url-list {
    display: grid;
    gap: 8px;
}
.help-url-list > div {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
}
.help-url-list code {
    flex: 0 0 auto;
    min-width: 220px;
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    padding: 4px 10px;
    border-radius: 8px;
}
.help-url-list span { color: #5a6a85; font-size: 13px; }

.help-faq {
    display: grid;
    gap: 10px;
}
.help-faq details {
    padding: 0;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
    transition: border-color 0.18s ease;
}
.help-faq details[open] { border-color: rgba(37, 99, 235, 0.25); background: #fff; }
.help-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 14px 16px;
    color: #0b1a33;
    font-weight: 500;
    position: relative;
    padding-right: 40px;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after {
    content: '+';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.1);
    color: #2563eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s ease;
}
.help-faq details[open] summary::after { content: '−'; }
.help-faq details p {
    margin: 0;
    padding: 0 16px 14px;
    color: #5a6a85;
    line-height: 1.8;
    font-size: 13.5px;
}

@media (max-width: 1100px) {
    .settings-grid,
    .help-concept-grid { grid-template-columns: repeat(2, 1fr); }
    .settings-action-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .settings-grid,
    .help-concept-grid { grid-template-columns: 1fr; }
    .help-url-list > div { flex-direction: column; align-items: flex-start; }
    .help-url-list code { min-width: 0; }
}

/* ============================================================
   Install Wizard
   ============================================================ */
.install-shell {
    min-height: 100vh;
    padding: 32px 20px;
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(56, 189, 248, 0.18), transparent 60%),
        radial-gradient(900px 600px at 110% 110%, rgba(37, 99, 235, 0.18), transparent 60%),
        linear-gradient(180deg, #f4f7fb 0%, #e8eefc 100%);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    color: #0b1a33;
}

.install-wrap {
    width: 100%;
    max-width: 960px;
    display: grid;
    gap: 22px;
}

.install-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.install-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.install-logo {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.install-brand strong {
    display: block;
    font-size: 16px;
    color: #0b1a33;
}

.install-brand span {
    display: block;
    font-size: 12px;
    color: #5a6a85;
    letter-spacing: 0.04em;
}

/* stepper */
.install-stepper {
    list-style: none;
    margin: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(15, 42, 88, 0.06);
    border-radius: 18px;
    backdrop-filter: blur(8px);
}

.install-step-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    position: relative;
    transition: background 0.2s ease;
}

.install-step-index {
    flex: 0 0 auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    background: rgba(15, 42, 88, 0.08);
    color: #5a6a85;
    transition: background 0.2s ease, color 0.2s ease;
}

.install-step-label strong {
    display: block;
    font-size: 13px;
    color: #0b1a33;
    line-height: 1.2;
}

.install-step-label em {
    display: block;
    font-style: normal;
    font-size: 11.5px;
    color: #8a97ae;
    line-height: 1.4;
    margin-top: 2px;
}

.install-step-item.is-current {
    background: linear-gradient(180deg, rgba(56, 189, 248, 0.12), rgba(37, 99, 235, 0.08));
}

.install-step-item.is-current .install-step-index {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
}

.install-step-item.is-done .install-step-index {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.install-step-item.is-done .install-step-label em {
    color: #047857;
}

/* card */
.install-card {
    background: #fff;
    border-radius: 22px;
    padding: 32px 36px;
    border: 1px solid rgba(15, 42, 88, 0.06);
    box-shadow: 0 20px 44px rgba(15, 42, 88, 0.08);
}

.install-title {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.install-lead {
    margin: 0 0 22px;
    color: #5a6a85;
    line-height: 1.8;
    font-size: 14px;
}

.install-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.install-actions .btn-primary.is-disabled,
.install-actions .btn-primary[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
    pointer-events: none;
}

.install-actions .btn-ghost {
    background: #f4f7fb;
    border: 1px solid rgba(15, 42, 88, 0.08);
    color: #1f2a44;
}

/* step 1 feature list */
.install-feature-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.install-feature-list li {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 14px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
}

.install-feature-list li span {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
}

.install-feature-list li strong {
    display: block;
    margin-bottom: 4px;
    font-size: 14.5px;
}

.install-feature-list li p {
    margin: 0;
    color: #5a6a85;
    font-size: 13px;
    line-height: 1.7;
}

/* step 2 checks */
.install-check-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.install-check-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
}

.install-check-item strong { display: block; font-size: 13.5px; }
.install-check-item p { margin: 2px 0 0; font-size: 12.5px; color: #5a6a85; word-break: break-all; }

.install-check-dot {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.install-check-item.is-ok { background: rgba(16, 185, 129, 0.06); border-color: rgba(16, 185, 129, 0.22); }
.install-check-item.is-ok strong { color: #047857; }
.install-check-item.is-ok .install-check-dot { background: #10b981; }

.install-check-item.is-fail { background: rgba(239, 68, 68, 0.05); border-color: rgba(239, 68, 68, 0.22); }
.install-check-item.is-fail strong { color: #b91c1c; }
.install-check-item.is-fail .install-check-dot { background: #ef4444; }

/* form */
.install-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

/* step 5 progress */
.install-progress {
    margin: 8px 0 20px;
}

.install-progress-bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: rgba(15, 42, 88, 0.08);
    overflow: hidden;
}

.install-progress-bar i {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #22d3ee, #2563eb);
    transition: width 0.35s ease;
    position: relative;
    overflow: hidden;
}

.install-progress-bar i::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image: linear-gradient(45deg, rgba(255,255,255,0.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.25) 50%, rgba(255,255,255,0.25) 75%, transparent 75%);
    background-size: 20px 20px;
    animation: installStripes 1s linear infinite;
}

@keyframes installStripes {
    from { background-position: 0 0; }
    to { background-position: 20px 0; }
}

.install-progress-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12.5px;
    color: #5a6a85;
}

.install-progress-meta span:first-child {
    color: #1d4ed8;
    font-weight: 600;
}

.install-task-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}

.install-task {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.install-task-dot {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: rgba(15, 42, 88, 0.12);
    position: relative;
}

.install-task-body { flex: 1; min-width: 0; }
.install-task-body strong { display: block; font-size: 13.5px; color: #0b1a33; }
.install-task-body em { display: block; font-style: normal; font-size: 12px; color: #8a97ae; margin-top: 2px; }

.install-task.is-running { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.2); }
.install-task.is-running .install-task-dot {
    background: #2563eb;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
    animation: installPulse 1.2s infinite;
}
.install-task.is-running .install-task-body em { color: #1d4ed8; }

@keyframes installPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5); }
    70%  { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.install-task.is-done .install-task-dot {
    background: #10b981;
}
.install-task.is-done .install-task-dot::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'><path fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2.5 6.5l2.5 2.5 4.5-5'/></svg>") center/10px no-repeat;
}
.install-task.is-done .install-task-body em { color: #047857; }

/* step 6 summary */
.install-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 18px;
}

.install-summary > div {
    padding: 12px 14px;
    border-radius: 12px;
    background: #f8fbff;
    border: 1px solid rgba(15, 42, 88, 0.06);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.install-summary span { color: #5a6a85; font-size: 12.5px; }
.install-summary strong { color: #0b1a33; font-size: 14.5px; }

.install-tips {
    padding: 16px 18px;
    border-radius: 14px;
    background: linear-gradient(180deg, #f4f9ff 0%, #ffffff 100%);
    border: 1px solid rgba(37, 99, 235, 0.16);
    margin-bottom: 6px;
}
.install-tips strong { display: block; margin-bottom: 6px; color: #1d4ed8; }
.install-tips ol { margin: 0; padding-left: 20px; color: #5a6a85; line-height: 1.9; font-size: 13.5px; }
.install-tips em { font-style: normal; font-weight: 600; color: #1f2a44; }

.install-foot {
    text-align: center;
    color: #8a97ae;
    font-size: 12px;
}

@media (max-width: 900px) {
    .install-stepper { grid-template-columns: repeat(3, 1fr); }
    .install-feature-list,
    .install-check-grid,
    .install-form-grid,
    .install-summary { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
    .install-stepper { grid-template-columns: repeat(2, 1fr); }
    .install-card { padding: 22px; }
    .install-step-label em { display: none; }
}

/* ============================================================
   Login captcha
   ============================================================ */
.captcha-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.captcha-row .captcha-input {
    flex: 1 1 auto;
    min-width: 0;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-family: 'SFMono-Regular', Consolas, monospace;
}

.captcha-image {
    flex: 0 0 auto;
    width: 132px;
    height: 46px;
    border-radius: 12px;
    border: 1px solid rgba(15, 42, 88, 0.1);
    background: #f4f7fb;
    cursor: pointer;
    object-fit: cover;
    transition: border-color 0.18s ease, transform 0.18s ease;
    user-select: none;
}

.captcha-image:hover {
    border-color: rgba(37, 99, 235, 0.35);
    transform: translateY(-1px);
}

.captcha-image:active {
    transform: translateY(0);
}

body.cke_editable {
    padding: 16px 20px;
    margin: 0;
    background: #fff;
}
