/* ── 设计令牌 ────────────────────────────────────────────────────── */
:root {
    --bg: #f0f4f9;
    --bg-soft: #f7f9fc;
    --surface: #ffffff;
    --surface-soft: #f5f8fc;
    --surface-deep: #e8eef6;
    --line: #d4dde9;
    --line-strong: #b8c8db;
    --text: #1a2636;
    --muted: #5a6e84;
    --brand: #0f4fa8;
    --brand-deep: #093d8a;
    --brand-light: #e8f0fb;
    --gold: #b8922a;
    --gold-soft: #fdf3dc;
    --danger: #c0392b;
    --success: #1a7a50;
    --shadow-sm: 0 1px 3px rgba(15, 60, 120, 0.07);
    --shadow: 0 2px 8px rgba(15, 60, 120, 0.09);
    --radius-lg: 10px;
    --radius-md: 8px;
    --radius-sm: 6px;
}

/* ── 重置 & 基础 ─────────────────────────────────────────────────── */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text);
    background: var(--bg);
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, "Open Sans", "Hiragino Sans GB", sans-serif;
    line-height: 1.65;
    font-size: 15px;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }
p { margin: 0; }

h1, h2, h3, h4, h5, h6 {
    margin: 0;
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.25;
}

code {
    background: var(--brand-light);
    color: var(--brand-deep);
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

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

/* ── 页面骨架 ────────────────────────────────────────────────────── */
.page-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── 顶部工具栏 ──────────────────────────────────────────────────── */
.utility-bar {
    background: #0a3d82;
    color: rgba(255, 255, 255, 0.82);
    border-top: 3px solid var(--gold);
}

.utility-inner,
.brand-bar-inner,
.site-nav-inner {
    width: min(1440px, calc(100vw - 48px));
    margin: 0 auto;
}

.content,
.site-footer-inner {
    width: min(1280px, calc(100vw - 48px));
    margin: 0 auto;
}

.utility-inner {
    min-height: 2.8rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: 0.88rem;
}

.utility-links {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.utility-links-right {
    justify-content: flex-end;
    text-align: right;
}

.utility-separator {
    width: 1px;
    height: 0.85rem;
    background: rgba(255, 255, 255, 0.25);
}

/* ── 品牌栏 ──────────────────────────────────────────────────────── */
.brand-bar {
    background: #0d4898;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.brand-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    padding: 1rem 0;
    min-height: 5rem;
}

.brand-logout { flex-shrink: 0; }

.brand {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    min-width: 0;
}

.brand-logo {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.brand-logo img {
    display: block;
    width: clamp(240px, 22vw, 380px);
    height: auto;
    opacity: 0.95;
}

.brand-text { min-width: 0; }

.brand-heading { display: grid; gap: 0.25rem; }

.brand-system-kicker {
    margin: 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.brand-system-name {
    color: #fff;
    font-size: clamp(1.4rem, 1rem + 0.8vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.1;
}

.brand-system-subtitle {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.88rem;
    font-weight: 500;
}

.brand-kicker,
.hero-kicker {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.4rem;
    color: var(--gold);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.brand-kicker::before,
.hero-kicker::before {
    content: "";
    width: 1.5rem;
    height: 1px;
    background: currentColor;
    opacity: 0.7;
}


/* ── 导航 ────────────────────────────────────────────────────────── */
.site-nav {
    position: sticky;
    top: 0;
    z-index: 30;
    background: #0c4496;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s ease;
}

.site-nav-sentinel { height: 1px; }

.site-nav-inner {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    flex-wrap: wrap;
    padding: 0.55rem 0;
    transition: padding 0.2s ease;
}

.nav-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 2.6rem;
    padding: 0.55rem 1.1rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.91rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    transition: background 0.15s ease, color 0.15s ease;
}

.nav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
}

.nav-link.active::after {
    content: "";
    position: absolute;
    left: 1.1rem;
    right: 1.1rem;
    bottom: 0.35rem;
    height: 2.5px;
    background: var(--gold);
    border-radius: 999px;
}

.nav-divider {
    width: 1px;
    height: 1.1rem;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 0.4rem;
    flex-shrink: 0;
}

body.nav-stuck .site-nav {
    box-shadow: 0 2px 14px rgba(8, 40, 100, 0.22);
}

body.nav-stuck .site-nav-inner {
    padding: 0.35rem 0;
}

body.nav-stuck .nav-link {
    min-height: 2.3rem;
}

/* ── 主内容区 ────────────────────────────────────────────────────── */
.content {
    flex: 1;
    padding: 1.5rem 0 2.5rem;
    display: grid;
    gap: 1rem;
}

.content-auth {
    padding-top: 3rem;
    padding-bottom: 3rem;
    align-items: start;
}

/* ── 页脚 ────────────────────────────────────────────────────────── */
.site-footer {
    margin-top: auto;
    background: #0a3d82;
    color: rgba(255, 255, 255, 0.82);
    border-top: 3px solid var(--gold);
}

.site-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1.4rem 0 1.6rem;
}

.site-footer-inner strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 1rem;
    color: #fff;
}

.footer-meta {
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    justify-content: flex-end;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-brand img {
    width: clamp(180px, 16vw, 260px);
    height: auto;
    flex: 0 0 auto;
    opacity: 0.9;
}

/* ── 提示消息 ────────────────────────────────────────────────────── */
.flash {
    padding: 0.85rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid;
    font-size: 0.93rem;
}

.flash-success {
    color: var(--success);
    background: rgba(26, 122, 80, 0.07);
    border-color: rgba(26, 122, 80, 0.2);
}

.flash-error {
    color: var(--danger);
    background: rgba(192, 57, 43, 0.06);
    border-color: rgba(192, 57, 43, 0.18);
}

/* ── 卡片 ────────────────────────────────────────────────────────── */
.card,
.stat-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.card,
.stat-card {
    padding: 1.25rem;
}

.card-header h3 {
    color: var(--brand-deep);
    font-size: 1.05rem;
}

/* ── Hero 面板（蓝色大卡片） ──────────────────────────────────────── */
.hero-panel {
    overflow: hidden;
    padding: 1.75rem 2rem;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.hero-panel p { color: rgba(255, 255, 255, 0.8); }
.hero-panel .muted { color: rgba(255, 255, 255, 0.65); }

.hero-panel-side {
    display: grid;
    gap: 0.85rem;
    align-content: center;
}

.hero-highlight {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero-highlight span {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.65);
}

.hero-highlight strong {
    display: block;
    margin: 0.3rem 0 0.15rem;
    font-size: 1.15rem;
}

.hero-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* ── 页面头部区 ──────────────────────────────────────────────────── */
.page-header,
.card-header,
.table-toolbar,
.actions,
.header-actions,
.filter-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header {
    padding: 1.25rem 1.5rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 4px solid var(--brand);
    box-shadow: var(--shadow-sm);
}

.page-header h2,
.hero-panel h2,
.auth-card h2 {
    font-size: clamp(1.35rem, 1.1rem + 0.5vw, 1.75rem);
}

.page-header p:last-child:not(.hero-kicker),
.hero-panel p:last-child:not(.hero-kicker),
.card-header p:last-child {
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.9rem;
}

/* ── 统计卡片网格 ────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.stat-card {
    overflow: hidden;
    padding-top: 1.2rem;
    border-top: 3px solid var(--brand);
}

.stat-card p,
.muted { color: var(--muted); }

.stat-card strong {
    display: block;
    margin-top: 0.45rem;
    color: var(--brand-deep);
    font-size: clamp(1.8rem, 1.2rem + 0.9vw, 2.4rem);
    line-height: 1;
}

/* ── 布局网格 ────────────────────────────────────────────────────── */
.two-column {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.alumni-photo,
.alumni-photo-placeholder {
    width: min(100%, 260px);
    aspect-ratio: 3 / 4;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
}

.alumni-photo {
    display: block;
    object-fit: cover;
    background: var(--surface-soft);
}

.alumni-photo-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    background: var(--surface-soft);
}

.admin-users-layout {
    display: grid;
    grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.35fr);
    gap: 1rem;
    align-items: start;
}

.admin-teacher-switcher {
    display: grid;
    gap: 0.75rem;
}

.teacher-select-card {
    display: grid;
    gap: 0.65rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

.teacher-select-card:hover {
    border-color: rgba(15, 79, 168, 0.28);
    background: var(--brand-light);
}

.teacher-select-card.is-selected {
    border-color: rgba(15, 79, 168, 0.42);
    background: rgba(15, 79, 168, 0.07);
    box-shadow: inset 3px 0 0 var(--brand);
}

.teacher-select-head,
.teacher-current-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.teacher-select-head strong {
    display: block;
    color: var(--brand-deep);
}

.teacher-select-head small,
.teacher-select-meta,
.teacher-current-banner span {
    color: var(--muted);
    font-size: 0.86rem;
}

.teacher-select-meta {
    display: grid;
    gap: 0.22rem;
}

.teacher-select-action {
    color: var(--brand);
    font-size: 0.88rem;
    font-weight: 700;
}

.teacher-current-banner {
    margin: 0.9rem 0 1rem;
    padding: 0.8rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    justify-content: flex-start;
}

.teacher-current-banner strong {
    color: var(--brand-deep);
}

.teacher-current-banner a {
    margin-left: auto;
    font-weight: 700;
}

.teacher-empty-state {
    min-height: 20rem;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 0.8rem;
    padding: 1rem;
}

.teacher-empty-state h3 {
    color: var(--brand-deep);
    font-size: 1.15rem;
}

.teacher-empty-state p {
    max-width: 34rem;
    color: var(--muted);
}

.admin-users-sidebar {
    position: sticky;
    top: 6rem;
}

.admin-user-form-grid,
.admin-user-scope-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.admin-user-reference-note {
    grid-column: 1 / -1;
}

.import-upload-card,
.import-batches-card { display: grid; gap: 1rem; }

.import-upload-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: 2rem;
    align-items: start;
}

.import-submit-btn { align-self: start; }

.import-batches-card .table-wrap table { min-width: 1040px; }

.import-aside-label {
    margin: 0 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.import-mode-hints { display: grid; gap: 0.45rem; margin-bottom: 1rem; }

.import-mode-hint {
    padding: 0.6rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.import-mode-hint span {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.import-mode-hint p {
    margin: 0.2rem 0 0;
    font-size: 0.82rem;
    color: var(--muted);
}

/* ── 档案检索 ────────────────────────────────────────────────────── */
.directory-filter-card { display: grid; gap: 0.9rem; }

.directory-filter-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.directory-filter-summary { min-width: 200px; }

.directory-filter-summary strong,
.dashboard-summary-grid .metric-inline strong,
.discovery-metrics .metric-inline strong,
.message-guidance-grid .metric-inline strong {
    font-size: 1.25rem;
    line-height: 1.2;
}

.directory-filter-grid { align-items: end; }
.directory-filter-keyword { grid-column: span 2; }
.directory-filter-actions { justify-content: flex-end; }

/* ── Dashboard ───────────────────────────────────────────────────── */
.dashboard-stats .stat-card { min-height: 8rem; }

.dashboard-panels {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1rem;
    align-items: start;
}

.dashboard-side-stack {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.dashboard-side-card {
    position: sticky;
    top: 6rem;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.dashboard-main-card .list-stack { gap: 0.7rem; }

/* ── Portal Hero ─────────────────────────────────────────────────── */
.portal-hero {
    overflow: hidden;
    padding: 2.5rem 2rem;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 2rem;
    align-items: center;
    border-radius: var(--radius-lg);
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow);
}

.portal-hero p { color: rgba(255, 255, 255, 0.8); }
.portal-hero .muted { color: rgba(255, 255, 255, 0.65); }
.portal-hero .hero-kicker { color: rgba(255, 255, 255, 0.55); }

.portal-hero h2 {
    font-size: clamp(1.6rem, 1.2rem + 0.8vw, 2.2rem);
}

.portal-stat-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.portal-stat {
    padding: 1rem 0.9rem;
    text-align: center;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.portal-stat:last-child { border-right: none; }

.portal-stat strong {
    display: block;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
    color: #fff;
}

.portal-stat span {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.77rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.04em;
}

/* ── Portal 仪表盘统计卡片 ───────────────────────────────────────── */
.portal-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 0.9rem;
    align-items: stretch;
}

.portal-dashboard-card {
    --card-accent: var(--brand);
    --card-accent-soft: var(--brand-light);
    --card-accent-wash: rgba(15, 79, 168, 0.06);
    position: relative;
    overflow: hidden;
    min-height: 11.6rem;
    padding: 1rem;
    display: grid;
    grid-template-rows: auto auto 1fr;
    gap: 0.75rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    border: 1px solid color-mix(in srgb, var(--card-accent) 26%, var(--line));
    background:
        linear-gradient(135deg, var(--card-accent-wash), rgba(255, 255, 255, 0) 52%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 249, 252, 0.96)),
        var(--surface);
    box-shadow: inset 0 4px 0 var(--card-accent), 0 8px 18px rgba(15, 60, 120, 0.08);
    isolation: isolate;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.portal-dashboard-card::after {
    content: "";
    position: absolute;
    right: 0.75rem;
    bottom: 0.75rem;
    width: 3.1rem;
    height: 0.35rem;
    border-radius: 999px;
    background: var(--card-accent);
    opacity: 0.55;
    z-index: 0;
    pointer-events: none;
}

a.portal-dashboard-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    border-color: color-mix(in srgb, var(--card-accent) 45%, var(--line-strong));
    box-shadow: inset 0 4px 0 var(--card-accent), 0 12px 24px rgba(15, 60, 120, 0.12);
}

.portal-dashboard-card:focus-visible {
    outline: 3px solid var(--card-accent-soft);
    outline-offset: 2px;
}

.portal-dashboard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.portal-dashboard-top,
.portal-dashboard-main,
.portal-dashboard-metrics,
.portal-dashboard-card > p {
    position: relative;
    z-index: 1;
}

.portal-dashboard-icon {
    width: 2.25rem;
    height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    border-radius: 7px;
    color: var(--card-accent);
    background: var(--card-accent-soft);
    border: 1px solid rgba(15, 79, 168, 0.14);
    border: 1px solid color-mix(in srgb, var(--card-accent) 18%, transparent);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
}

.portal-dashboard-label {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.35;
    text-align: right;
    overflow-wrap: anywhere;
}

.portal-dashboard-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
}

.portal-dashboard-card strong {
    display: block;
    color: var(--card-accent);
    font-size: 2.15rem;
    font-weight: 800;
    line-height: 1;
    overflow-wrap: anywhere;
}

.portal-dashboard-card small {
    margin-left: 0.25rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.portal-dashboard-signal {
    display: inline-flex;
    align-items: center;
    min-height: 1.65rem;
    padding: 0.15rem 0.55rem;
    border-radius: 4px;
    color: var(--card-accent);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
    border: 1px solid color-mix(in srgb, var(--card-accent) 16%, var(--line));
    font-size: 0.76rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-dashboard-card p {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.portal-dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.45rem;
    align-self: end;
}

.portal-dashboard-metrics span {
    min-height: 3.05rem;
    padding: 0.48rem 0.55rem;
    display: grid;
    gap: 0.2rem;
    align-content: center;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.76);
    border: 1px solid var(--line);
    border: 1px solid color-mix(in srgb, var(--card-accent) 12%, var(--line));
}

.portal-dashboard-metrics em {
    color: var(--muted);
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.portal-dashboard-metrics b {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1.1;
}

.portal-dashboard-metrics b small {
    margin-left: 0.1rem;
    font-size: 0.7rem;
}

.portal-dashboard-card-message {
    --card-accent: var(--brand);
    --card-accent-soft: var(--brand-light);
    --card-accent-wash: rgba(15, 79, 168, 0.07);
}

.portal-dashboard-card-crawl {
    --card-accent: var(--gold);
    --card-accent-soft: var(--gold-soft);
    --card-accent-wash: rgba(184, 146, 42, 0.1);
}

.portal-dashboard-card-discovery {
    --card-accent: var(--success);
    --card-accent-soft: rgba(26, 122, 80, 0.1);
    --card-accent-wash: rgba(26, 122, 80, 0.08);
}

.portal-dashboard-card-todo {
    --card-accent: var(--danger);
    --card-accent-soft: rgba(192, 57, 43, 0.09);
    --card-accent-wash: rgba(192, 57, 43, 0.07);
}

/* ── Portal 数据快照 ─────────────────────────────────────────────── */
.portal-snapshot-card { display: grid; gap: 0; }

.portal-snapshot-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    margin-top: 0.25rem;
}

.portal-snapshot-block {
    padding: 1.25rem 1.5rem;
    border-right: 1px solid var(--line);
    display: grid;
    gap: 0.6rem;
    align-content: start;
}

.portal-snapshot-block:last-child { border-right: none; }

.portal-snapshot-block h4 {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0;
}

.portal-year-range {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--brand-deep);
}

.portal-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.portal-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.3rem 0.75rem;
    border-radius: 4px;
    color: var(--brand-deep);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.14);
    font-size: 0.84rem;
    font-weight: 600;
}

.portal-chip-soft {
    color: var(--text);
    background: var(--surface-soft);
    border-color: var(--line);
    font-weight: 400;
}

.portal-chip-count {
    font-style: normal;
    font-size: 0.78rem;
    color: var(--brand);
    opacity: 0.75;
}

/* ── Portal 管理员状态条 ─────────────────────────────────────────── */
.portal-admin-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.portal-admin-item {
    padding: 1.1rem 1.5rem;
    border-right: 1px solid var(--line);
    display: grid;
    gap: 0.2rem;
    align-content: start;
}

.portal-admin-item:last-child { border-right: none; }

.portal-admin-item > span {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.portal-admin-item > strong {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--brand-deep);
    line-height: 1.15;
}

.portal-admin-item > p {
    font-size: 0.83rem;
    color: var(--muted);
    margin: 0;
}

/* ── Portal 活动列表 ─────────────────────────────────────────────── */
.portal-activity-card { display: grid; gap: 0.9rem; }

/* ── 公开检索（Enrichment）──────────────────────────────────────── */
.enrichment-showcase,
.enrichment-orchestra-grid,
.enrichment-console-grid,
.enrichment-quality-grid,
.enrichment-stat-grid,
.enrichment-telemetry-grid {
    display: grid;
    gap: 1rem;
}

.enrichment-showcase {
    grid-template-columns: 3fr 2fr;
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: none;
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow);
}

.enrichment-showcase-main,
.enrichment-showcase-side {
    display: grid;
    gap: 0.9rem;
    align-content: start;
}

.enrichment-showcase-main > p:not(.hero-kicker),
.enrichment-soft-note,
.enrichment-availability-card p {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.9rem;
}

.enrichment-showcase h2 {
    font-size: clamp(1.6rem, 1.2rem + 0.8vw, 2.2rem);
    line-height: 1.15;
}

.enrichment-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.enrichment-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.82rem;
    font-weight: 600;
}

.enrichment-action-row { align-items: center; }
.inline-form { display: inline-flex; }
.enrichment-quick-details { width: fit-content; }

.enrichment-quick-details summary {
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.enrichment-quick-details[open] summary { margin-bottom: 0.75rem; }

.enrichment-quick-actions {
    display: flex;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.enrichment-soft-note { max-width: 52rem; }

.enrichment-availability-card,
.enrichment-stat-card {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
}

.enrichment-availability-card { display: grid; gap: 0.7rem; }
.enrichment-availability-card strong { font-size: 1.2rem; color: #fff; }

.enrichment-availability-meta { display: grid; gap: 0.22rem; }

.enrichment-availability-meta span,
.enrichment-stat-card span {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.enrichment-availability-meta strong { font-size: 0.97rem; }

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

.enrichment-stat-card strong {
    display: block;
    margin: 0.25rem 0 0.18rem;
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
}

.enrichment-stat-card p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.88rem;
}

.enrichment-target-card,
.enrichment-telemetry-card { display: grid; gap: 0.9rem; }

.enrichment-target-toolbar {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.enrichment-target-search {
    display: grid;
    gap: 0.3rem;
    min-width: min(100%, 24rem);
    color: var(--brand-deep);
    font-weight: 600;
}

.enrichment-target-search input {
    min-height: 2.7rem;
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
}

.enrichment-target-toolbar-meta {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.88rem;
}

.enrichment-target-toolbar-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 2.1rem;
    padding: 0.28rem 0.75rem;
    border-radius: 4px;
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.enrichment-target-summary {
    display: grid;
    gap: 0.85rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.enrichment-target-summary-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.enrichment-target-summary-head strong {
    display: inline-flex;
    margin-top: 0.15rem;
    color: var(--brand-deep);
    font-size: 1.1rem;
}

.enrichment-target-summary-note { color: var(--muted); font-size: 0.88rem; }

.enrichment-submit-review {
    display: grid;
    gap: 0.75rem;
    padding: 0.95rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.enrichment-submit-review-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.enrichment-submit-review-head strong { color: var(--brand-deep); }
.enrichment-submit-review-note { color: var(--muted); font-size: 0.88rem; }

.enrichment-selected-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.enrichment-selected-pill {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.22rem 0.72rem;
    border-radius: 4px;
    color: var(--brand-deep);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.15);
    font-size: 0.84rem;
    font-weight: 600;
}

.enrichment-selected-pill.is-muted {
    color: var(--muted);
    background: var(--surface-soft);
    border-color: var(--line);
}

/* ── 检索弹窗 ────────────────────────────────────────────────────── */
.enrichment-target-dialog {
    width: min(980px, calc(100vw - 2rem));
    max-width: 980px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    box-shadow: 0 8px 40px rgba(5, 24, 56, 0.22);
}

.enrichment-target-dialog::backdrop {
    background: rgba(5, 18, 44, 0.4);
    backdrop-filter: blur(4px);
}

.enrichment-target-dialog-shell {
    display: grid;
    gap: 0.9rem;
    max-height: min(86vh, 56rem);
    padding: 1.1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
}

.enrichment-target-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.enrichment-target-dialog .enrichment-target-toolbar { align-items: end; }

.enrichment-target-dialog .enrichment-target-list {
    max-height: min(54vh, 34rem);
    padding-right: 0.4rem;
}

.enrichment-target-dialog-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.enrichment-target-dialog-footer .enrichment-target-footer { flex: 1 1 18rem; }

.enrichment-confirm-dialog {
    width: min(720px, calc(100vw - 2rem));
    max-width: 720px;
    padding: 0;
    border: none;
    border-radius: var(--radius-lg);
    background: transparent;
    box-shadow: 0 8px 40px rgba(5, 24, 56, 0.22);
}

.enrichment-confirm-dialog::backdrop {
    background: rgba(5, 18, 44, 0.42);
    backdrop-filter: blur(4px);
}

.enrichment-confirm-dialog-shell {
    display: grid;
    gap: 0.9rem;
    padding: 1.1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
}

.enrichment-confirm-dialog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.enrichment-confirm-meta,
.enrichment-confirm-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.enrichment-confirm-list { min-height: 2rem; }

.enrichment-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.enrichment-target-list {
    display: grid;
    gap: 0.6rem;
    max-height: 34rem;
    overflow: auto;
    padding-right: 0.15rem;
}

.enrichment-target-option,
.enrichment-engine-option {
    position: relative;
    display: grid;
    grid-template-columns: 1.1rem minmax(0, 1fr);
    gap: 0.85rem;
    align-items: start;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.enrichment-target-option:hover,
.enrichment-engine-option:hover {
    border-color: var(--brand);
    background: var(--brand-light);
}

.enrichment-target-option.is-selected {
    border-color: var(--brand);
    background: var(--brand-light);
    border-left: 3px solid var(--brand);
}

.enrichment-target-option.is-selected,
.enrichment-engine-option.is-selected {
    border-color: var(--brand);
}

.enrichment-target-option input,
.enrichment-engine-option input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.18rem 0 0;
    place-self: start;
    flex-shrink: 0;
    accent-color: var(--brand);
}

.enrichment-target-copy,
.enrichment-engine-option div { display: grid; gap: 0.22rem; }

.enrichment-target-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.enrichment-target-option strong,
.enrichment-engine-option strong { color: var(--brand-deep); }

.enrichment-target-option p,
.enrichment-target-option small,
.enrichment-engine-option p { color: var(--muted); font-size: 0.88rem; }

.enrichment-target-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 0.9rem;
}

.enrichment-empty-state { margin-top: -0.1rem; }

.enrichment-engine-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.enrichment-run-choices { display: grid; gap: 0.65rem; }

.enrichment-target-card,
.enrichment-telemetry-card,
.enrichment-runtime-card {
    display: grid;
    gap: 0.9rem;
    align-content: start;
}

.enrichment-inline-state {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.65rem;
}

.enrichment-engine-option.is-disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.enrichment-orchestra-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
}

.enrichment-process-card,
.enrichment-telemetry-card,
.enrichment-runtime-card,
.enrichment-console-card,
.enrichment-job-card { overflow: hidden; }

.enrichment-runtime-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.enrichment-process-steps { display: grid; gap: 0.75rem; }

.enrichment-process-step {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: start;
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.15s ease;
}

.enrichment-process-step span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.7rem;
    border-radius: var(--radius-sm);
    color: var(--brand-deep);
    background: var(--brand-light);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
}

.enrichment-process-step strong {
    display: block;
    margin-bottom: 0.18rem;
    color: var(--brand-deep);
    font-size: 1rem;
}

.enrichment-process-step p { color: var(--muted); font-size: 0.9rem; }

.enrichment-process-step.is-active {
    border-color: var(--brand);
    background: var(--brand-light);
}

.enrichment-process-step.is-active span {
    color: #fff;
    background: var(--brand);
}

.enrichment-process-step.is-complete { border-color: rgba(26, 122, 80, 0.3); }

.enrichment-process-step.is-complete span {
    color: #fff;
    background: var(--success);
}

.enrichment-stage-panel {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.enrichment-stage-panel strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--brand-deep);
    font-size: 1.05rem;
}

.enrichment-stage-panel p { color: var(--muted); font-size: 0.9rem; }

.enrichment-telemetry-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.enrichment-quality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.enrichment-console-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
}

.enrichment-advanced-card {
    overflow: hidden;
    padding: 0;
}

.enrichment-advanced-card > summary {
    display: block;
    cursor: pointer;
    padding: 1.1rem 1.25rem;
    list-style: none;
}

.enrichment-advanced-card > summary::-webkit-details-marker { display: none; }
.enrichment-advanced-card > summary p { color: var(--muted); }

.enrichment-advanced-card[open] > summary {
    border-bottom: 1px solid var(--line);
}

.enrichment-advanced-card > .enrichment-console-grid {
    padding: 0 1.25rem 1.25rem;
}

.enrichment-console {
    min-height: 22rem;
    max-height: 32rem;
    overflow: auto;
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid #0d2a56;
    background: #03112e;
    font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
}

.enrichment-console-line {
    position: relative;
    padding-left: 1rem;
    color: rgba(180, 215, 255, 0.88);
    font-size: 0.86rem;
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}

.enrichment-console-line::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.72rem;
    width: 0.35rem;
    height: 0.35rem;
    border-radius: 50%;
    background: #5aabff;
    opacity: 0.7;
}

.enrichment-job-stack { display: grid; gap: 0.7rem; }

.enrichment-job-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
}

.enrichment-job-row span { color: var(--muted); }
.enrichment-job-row strong { color: var(--brand-deep); text-align: right; }

.enrichment-subtle-note p,
.enrichment-subtle-note a { color: var(--muted); }

.enrichment-subtle-note a {
    text-decoration: underline;
    text-decoration-color: rgba(15, 79, 168, 0.3);
}

@keyframes enrichment-scan {
    0% { transform: translateX(-18%) rotate(-12deg); opacity: 0; }
    12% { opacity: 1; }
    60% { opacity: 0.55; }
    100% { transform: translateX(120%) rotate(-12deg); opacity: 0; }
}

/* ── Discovery ───────────────────────────────────────────────────── */
.discovery-overview {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    align-items: start;
}

.target-prep-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.target-prep-card { display: grid; gap: 0.9rem; }

.discovery-jobs-card .table-wrap table { min-width: 760px; }

.discovery-leads { display: grid; gap: 0.9rem; }

.discovery-lead-card {
    display: grid;
    gap: 0.9rem;
    padding: 1.1rem 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.discovery-lead-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.discovery-lead-head h4 { color: var(--brand-deep); font-size: 1.1rem; }
.discovery-lead-score { min-width: 200px; }
.discovery-lead-score strong { font-size: 1.4rem; line-height: 1.05; }

.discovery-lead-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: 0.9rem;
    align-items: start;
}

.discovery-metrics { display: grid; gap: 0.65rem; }
.discovery-review-form { align-content: start; }

/* ── 消息工作台 ──────────────────────────────────────────────────── */
.messages-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.messages-page-header { align-items: stretch; }

.messages-header-aside {
    display: grid;
    grid-template-columns: repeat(2, minmax(200px, 1fr));
    gap: 0.75rem;
    min-width: min(100%, 30rem);
}

.messages-workflow {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.messages-workflow-item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.25rem 0.65rem;
    align-items: center;
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.messages-workflow-item span,
.messages-step-number {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-deep);
    font-size: 0.86rem;
    font-weight: 700;
}

.messages-workflow-item.active span {
    color: #fff;
    background: var(--brand);
}

.messages-workflow-item strong {
    color: var(--brand-deep);
    line-height: 1.15;
}

.messages-workflow-item small {
    grid-column: 2;
    color: var(--muted);
    font-size: 0.82rem;
}

.messages-header-metric strong { font-size: 1.15rem; }
.messages-compose-form { gap: 0.9rem; }
.messages-side-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}
.messages-preview-card {
    /* height matches compose card via stretch alignment */
}
.messages-campaigns-card {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.messages-step {
    display: grid;
    gap: 0.85rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.messages-compose-form .messages-step:first-child {
    padding-top: 0;
    border-top: none;
}

.messages-step-heading {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
}

.messages-step-heading h4 {
    color: var(--brand-deep);
    font-size: 1rem;
}

.messages-step-heading p {
    margin-top: 0.15rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.messages-step-action {
    align-items: start;
}

.preview-card-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.preview-recipients-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
}
.messages-filter-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.messages-filter-grid > label { grid-column: span 1; }
.messages-keyword-field { grid-column: span 2; }
.messages-featured-toggle { align-self: end; }
.message-guidance-grid { display: grid; gap: 0.75rem; }
.messages-scope-note { margin-top: 0.1rem; }

.messages-form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
    width: 100%;
}

.messages-preview-metrics,
.messages-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.messages-detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.message-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.message-chip-list-compact {
    gap: 0.35rem;
    margin-top: 0.4rem;
}

.message-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.18rem 0.68rem;
    border-radius: 4px;
    color: var(--brand-deep);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.15);
    font-size: 0.82rem;
    font-weight: 600;
}

.message-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.85rem;
    padding: 0.18rem 0.68rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid transparent;
    white-space: nowrap;
}

.tone-info {
    color: var(--brand-deep);
    background: var(--brand-light);
    border-color: rgba(15, 79, 168, 0.15);
}

.tone-success {
    color: var(--success);
    background: rgba(26, 122, 80, 0.1);
    border-color: rgba(26, 122, 80, 0.2);
}

.tone-warn {
    color: #7a5510;
    background: rgba(184, 146, 42, 0.12);
    border-color: rgba(184, 146, 42, 0.22);
}

.message-recipient-item { align-items: center; }

.message-recipient-meta {
    display: grid;
    justify-items: end;
    gap: 0.35rem;
    text-align: right;
}

.message-campaign-link.selected {
    border-color: rgba(15, 79, 168, 0.28);
    background: var(--brand-light);
}

.message-campaign-copy { display: grid; gap: 0.3rem; min-width: 0; }

.message-campaign-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    flex-wrap: wrap;
}

.message-inline-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.message-detail-card { display: grid; gap: 0.9rem; }

.platform-inbox-card {
    display: grid;
    gap: 0.9rem;
}

.platform-inbox-item {
    align-items: flex-start;
}

.platform-inbox-item p {
    margin-top: 0.35rem;
    color: var(--text);
    white-space: pre-wrap;
}

/* ── 通用列表 & 堆栈 ─────────────────────────────────────────────── */
.stack,
.list-stack { display: grid; gap: 0.9rem; }

.list-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.list-item:hover {
    border-color: rgba(15, 79, 168, 0.25);
    background: var(--brand-light);
}

.list-item strong { color: var(--brand-deep); }

.list-item p,
.list-item small {
    margin-top: 0.18rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.list-item-tall { align-items: flex-start; }

.table-subtext {
    margin-top: 0.18rem;
    font-size: 0.86rem;
    color: var(--muted);
}

.table-detail-stack { display: grid; gap: 0.38rem; }
.table-detail-stack p { margin: 0; }

.evidence-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.enrichment-report-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.9rem;
}

.evidence-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.85rem;
    padding: 0.18rem 0.65rem;
    border-radius: 4px;
    color: var(--brand-deep);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.14);
    font-size: 0.82rem;
    font-weight: 600;
}

/* ── 表单 ────────────────────────────────────────────────────────── */
.filter-grid,
.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

label {
    display: grid;
    gap: 0.35rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

label span:first-child { color: var(--muted); font-weight: 600; font-size: 0.88rem; }

[hidden] {
    display: none !important;
}

.field-label {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.choice-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.choice-row input {
    width: auto;
}

.login-method-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.45rem;
}

.login-method-row label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0;
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.login-method-row span {
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
}

.inline-action-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
}

.inline-action-field .button {
    min-height: 2.75rem;
    white-space: nowrap;
}

.form-helper {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
}

input,
select,
textarea {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    padding: 0.72rem 0.9rem;
    color: var(--text);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 79, 168, 0.1);
    background: var(--surface);
}

textarea {
    resize: vertical;
    min-height: 7rem;
}

.checkbox-field {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    font-weight: 500;
}

.checkbox-field input {
    width: auto;
    margin: 0;
    accent-color: var(--brand);
}

/* ── 按钮 ────────────────────────────────────────────────────────── */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.6rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.15rem;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    transition: background 0.15s ease, opacity 0.15s ease;
}

.button:hover { background: var(--brand-deep); }

.button:disabled,
.button[disabled],
.button-ghost:disabled,
.button-ghost-light:disabled,
.button-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-ghost {
    color: var(--brand-deep);
    background: var(--surface);
    border-color: var(--line-strong);
}

.button-ghost:hover {
    background: var(--brand-light);
    border-color: rgba(15, 79, 168, 0.3);
}

.button-ghost-light {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.button-ghost-light:hover {
    background: rgba(255, 255, 255, 0.2);
}

.button-danger {
    background: var(--danger);
    border-color: transparent;
}

.button-danger:hover { background: #a93226; }

.full-width { width: 100%; }

/* ── 表格 ────────────────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

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

th, td {
    padding: 0.82rem 0.85rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 0.9rem;
}

thead th {
    color: var(--brand-deep);
    font-weight: 700;
    background: var(--surface-soft);
    font-size: 0.84rem;
}

tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--brand-light); }

/* ── 翻页 ────────────────────────────────────────────────────────── */
.pagination,
.filter-actions,
.actions,
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.pagination { justify-content: flex-end; padding-top: 0.2rem; }

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    min-height: 2.2rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    color: var(--brand-deep);
    font-size: 0.88rem;
}

/* ── 徽章 ────────────────────────────────────────────────────────── */
.badge,
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.28rem;
    min-height: 1.75rem;
    padding: 0.18rem 0.62rem;
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 600;
}

.badge {
    color: #6b4a0a;
    background: rgba(184, 146, 42, 0.14);
    border: 1px solid rgba(184, 146, 42, 0.25);
}

.status-warn {
    color: #7a5510;
    background: rgba(184, 146, 42, 0.12);
    border: 1px solid rgba(184, 146, 42, 0.22);
}

.status-skip {
    color: var(--brand);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.18);
}

.status-success {
    color: var(--success);
    background: rgba(26, 122, 80, 0.1);
    border: 1px solid rgba(26, 122, 80, 0.2);
}

.status-error {
    color: var(--danger);
    background: rgba(192, 57, 43, 0.1);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

/* ── 指标列表 ────────────────────────────────────────────────────── */
.metric-list,
.detail-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0;
}

.metric-list > *,
.detail-list > div {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.72rem 0;
    border-bottom: 1px solid var(--line);
    font-size: 0.9rem;
}

.metric-list > *:last-child,
.detail-list > div:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.metric-inline {
    display: grid;
    gap: 0.15rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.metric-inline.is-live-updated { animation: metricLivePulse 0.6s ease; }

.metric-inline span { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.metric-inline strong { font-size: 0.95rem; line-height: 1.45; color: var(--brand-deep); }
.metric-inline p { color: var(--muted); font-size: 0.82rem; margin-top: 0.1rem; }

.enrichment-live-stamp {
    display: inline-flex;
    align-items: center;
    min-height: 1.9rem;
    padding: 0.16rem 0.68rem;
    border-radius: 4px;
    color: var(--brand-deep);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.14);
    font-size: 0.82rem;
    font-weight: 600;
}

@keyframes metricLivePulse {
    0% { border-color: var(--line); }
    40% { border-color: var(--brand); background: var(--brand-light); }
    100% { border-color: var(--line); }
}

.detail-list dt { color: var(--muted); }

.detail-list dd {
    margin: 0;
    text-align: right;
    max-width: 62%;
    word-break: break-word;
}

.compact-list { gap: 0.45rem; }

.snapshot-block {
    margin: 0;
    padding: 0.85rem 1rem;
    max-width: 100%;
    overflow: auto;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-size: 0.84rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-block {
    margin: 0;
    padding: 0.85rem 1rem;
    overflow: auto;
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    border: 1px solid var(--line);
    font-size: 0.84rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

.audit-details summary {
    cursor: pointer;
    color: var(--brand);
    font-weight: 600;
}

.audit-changed-row td { background: rgba(184, 146, 42, 0.07); }

.wide-block { max-width: none; }

.card-subsection {
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.education-table { display: grid; gap: 0.6rem; }

.education-head,
.education-row {
    display: grid;
    grid-template-columns: 60px 1fr 2fr 1.2fr;
    gap: 0.75rem;
    align-items: center;
}

.education-head {
    color: var(--muted);
    font-size: 0.85rem;
    padding-bottom: 0.18rem;
}

/* ── 提示块 ──────────────────────────────────────────────────────── */
.note-block {
    padding: 0.9rem 1.1rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--gold);
    background: var(--gold-soft);
    font-size: 0.9rem;
    color: var(--text);
}

.note-block h4 {
    margin-bottom: 0.35rem;
    color: var(--brand-deep);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.note-contrast {
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-left: 3px solid rgba(255, 255, 255, 0.6);
}

.note-contrast h4,
.note-contrast p { color: inherit; }

/* ── 登录页 ──────────────────────────────────────────────────────── */
.auth-card {
    width: 100%;
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
    align-items: stretch;
}

.hero-copy {
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    background: var(--brand);
    color: #fff;
}

.hero-copy p { color: rgba(255, 255, 255, 0.78); }

.auth-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0 1rem;
}

.auth-metric {
    padding: 0.9rem 1rem;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
}

.auth-metric strong {
    display: block;
    font-size: 0.94rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.3;
}

.auth-metric span {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.4;
}

.auth-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0;
}

.panel-heading { display: grid; gap: 0.18rem; margin-bottom: 1.25rem; }

.panel-heading p:last-child {
    margin-top: 0.3rem;
    color: var(--muted);
    font-size: 0.88rem;
}

/* ── 表格工具栏 ──────────────────────────────────────────────────── */
.table-toolbar p { color: var(--muted); font-size: 0.9rem; }

.demo-accounts { display: grid; gap: 0.75rem; }

.demo-accounts table {
    border-radius: var(--radius-sm);
    overflow: hidden;
}

/* ── 响应式 ──────────────────────────────────────────────────────── */
@media (max-width: 1280px) {

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

    .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .dashboard-panels { grid-template-columns: 1fr; }
    .portal-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

    .portal-hero,
    .portal-snapshot-grid,
    .portal-admin-strip,
    .target-prep-grid,
    .enrichment-orchestra-grid,
    .enrichment-runtime-layout,
    .enrichment-console-grid,
    .enrichment-quality-grid,
    .enrichment-telemetry-grid {
        grid-template-columns: 1fr;
    }

    .portal-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-snapshot-block { border-right: none; border-bottom: 1px solid var(--line); }
    .portal-snapshot-block:last-child { border-bottom: none; }
    .portal-admin-item { border-right: none; border-bottom: 1px solid var(--line); }
    .portal-admin-item:last-child { border-bottom: none; }

    .dashboard-summary-grid,
    .discovery-lead-grid,
    .messages-layout { grid-template-columns: 1fr; }

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

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

    .dashboard-side-card,
    .admin-users-sidebar { position: static; }

    .admin-users-layout { grid-template-columns: 1fr; }

    .directory-filter-head,
    .discovery-lead-head { flex-direction: column; }

    .messages-header-aside { width: 100%; }
}

@media (max-width: 1080px) {
    .utility-inner,
    .brand-bar-inner,
    .site-footer-inner,
    .hero-panel,
    .portal-hero,
    .enrichment-showcase,
    .auth-card,
    .two-column,
    .discovery-overview,
    .admin-users-layout,
    .checkbox-grid { grid-template-columns: 1fr; }

    .utility-inner,
    .brand-bar-inner,
    .site-footer-inner { display: grid; justify-content: stretch; }

    .brand { flex-direction: column; align-items: flex-start; }
    .brand-panel { flex-direction: row; justify-content: flex-start; }
    .brand-purpose { justify-content: flex-start; }
    .brand-caption { text-align: left; }

    .hero-panel { padding: 1.4rem 1.5rem; }
    .portal-hero { padding: 1.4rem 1.5rem; }
    .enrichment-showcase { padding: 1.4rem 1.5rem; }
    .auth-card { gap: 1rem; }

    .site-nav-inner {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
        scrollbar-width: none;
    }

    .site-nav-inner::-webkit-scrollbar { display: none; }

    .enrichment-engine-list { grid-template-columns: 1fr; }
    .nav-link { flex: 0 0 auto; }

    .admin-user-form-grid,
    .admin-user-scope-grid { grid-template-columns: 1fr; }

    .directory-filter-keyword,
    .messages-keyword-field { grid-column: auto; }

    .messages-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .messages-preview-metrics { grid-template-columns: 1fr; }
    .import-upload-body { grid-template-columns: 1fr; }

    .enrichment-target-summary-head,
    .enrichment-target-dialog-header,
    .enrichment-target-dialog-footer {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 800px) {
    .utility-inner,
    .brand-bar-inner,
    .site-nav-inner,
    .content,
    .site-footer-inner {
        width: min(100vw - 28px, 1280px);
    }

    .filter-grid,
    .form-grid,
    .stats-grid,
    .auth-metrics,
    .enrichment-stat-grid { grid-template-columns: 1fr; }

    .portal-stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .portal-dashboard-grid { grid-template-columns: 1fr; }

    .dashboard-summary-grid,
    .messages-filter-grid { grid-template-columns: 1fr; }

    .messages-header-aside,
    .messages-workflow,
    .messages-detail-grid { grid-template-columns: 1fr; }

    .checkbox-grid { grid-template-columns: 1fr; }
    .dashboard-panels { grid-template-columns: 1fr; }

    .page-header { padding: 1.1rem 1.25rem; }
    .card { padding: 1.1rem; }

    .brand-logo img,
    .footer-brand img { width: min(100%, 280px); }
}

/* ── 现代化表单组件（定向消息 + 教师管理重设计） ────────────────── */

.chip-select {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line-strong);
    background: var(--surface);
    min-height: 2.65rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.chip-select.is-focused {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 79, 168, 0.1);
}

.chip-select .chip-select-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.18rem 0.45rem 0.18rem 0.6rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-deep);
    border: 1px solid rgba(15, 79, 168, 0.18);
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.6;
}

.chip-select-tag button {
    border: none;
    background: transparent;
    color: inherit;
    cursor: pointer;
    padding: 0;
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    border-radius: 50%;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chip-select-tag button:hover {
    background: rgba(15, 79, 168, 0.15);
}

.chip-select-tag button:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 1px;
}

.chip-select-input {
    flex: 1;
    min-width: 6rem;
    border: none !important;
    outline: none;
    padding: 0.32rem 0.4rem !important;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text);
    font-size: 0.9rem;
}

.chip-select-input:focus {
    box-shadow: none !important;
    border: none !important;
}

.chip-select-options {
    position: absolute;
    z-index: 30;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    max-height: 14rem;
    overflow-y: auto;
    margin: 0;
    padding: 0.3rem;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.chip-select-option {
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.88rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
}

.chip-select-option small {
    color: var(--muted);
    font-size: 0.78rem;
}

.chip-select-option:hover,
.chip-select-option.is-active {
    background: var(--brand-light);
    color: var(--brand-deep);
}

.chip-select-option.is-selected {
    color: var(--muted);
}

.chip-select-empty {
    padding: 0.55rem 0.6rem;
    color: var(--muted);
    font-size: 0.85rem;
}

/* 开关样式 */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.55rem 0.85rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-switch-track {
    position: relative;
    flex-shrink: 0;
    width: 2.4rem;
    height: 1.32rem;
    border-radius: 999px;
    background: var(--line-strong);
    transition: background 0.18s ease;
}

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

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

.toggle-switch input:checked + .toggle-switch-track::after {
    transform: translateX(1.08rem);
}

.toggle-switch input:focus-visible + .toggle-switch-track {
    box-shadow: 0 0 0 3px rgba(15, 79, 168, 0.18);
}

.toggle-switch-text { display: grid; gap: 0.05rem; }
.toggle-switch-text small { color: var(--muted); font-size: 0.8rem; font-weight: 500; }

.toggle-switch-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.toggle-switch-row + .toggle-switch-row { margin-top: 0.55rem; }

.toggle-switch-row .toggle-switch {
    border: none;
    padding: 0;
    background: transparent;
}

/* 通道选择卡片 */
.channel-tile-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.channel-tile {
    position: relative;
    display: grid;
    gap: 0.25rem;
    padding: 0.7rem 0.85rem;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.channel-tile:hover {
    border-color: rgba(15, 79, 168, 0.35);
    transform: translateY(-1px);
}

.channel-tile:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.channel-tile input { position: absolute; opacity: 0; pointer-events: none; }

.channel-tile-icon {
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-deep);
    font-size: 0.9rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.channel-tile-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
}

.channel-tile-help {
    color: var(--text);
    font-size: 0.8rem;
    line-height: 1.35;
}

.channel-tile.is-selected {
    border-color: var(--brand);
    background: var(--brand-light);
    box-shadow: 0 0 0 1px var(--brand) inset;
}

.channel-tile.is-selected .channel-tile-icon {
    background: var(--brand);
    color: #fff;
}

/* 段进度条 */
.flow-stepper {
    position: sticky;
    top: 4.6rem;
    z-index: 25;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.65rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.flow-stepper-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.flow-stepper-item:hover {
    background: var(--brand-light);
    color: var(--brand-deep);
}

.flow-stepper-item.is-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand-deep);
}

.flow-stepper-item.is-active .flow-stepper-num { background: rgba(255, 255, 255, 0.2); color: #fff; }
.flow-stepper-item.is-active .flow-stepper-sub { color: rgba(255, 255, 255, 0.85); }

.flow-stepper-num {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-deep);
    font-weight: 700;
    font-size: 0.85rem;
}

.flow-stepper-text { display: grid; gap: 0.05rem; min-width: 0; }
.flow-stepper-text strong { font-size: 0.88rem; line-height: 1.2; }
.flow-stepper-sub { font-size: 0.76rem; color: var(--muted); }

/* 段标题 */
.flow-section {
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.flow-section:first-of-type { border-top: none; padding-top: 0; }

.flow-section-heading {
    display: grid;
    gap: 0.15rem;
    margin-bottom: 0.85rem;
}

.flow-section-heading h4 {
    font-size: 1.02rem;
    margin: 0;
    color: var(--brand-deep);
}

.flow-section-heading p {
    color: var(--muted);
    font-size: 0.85rem;
    margin: 0;
}

/* 字符计数 */
.field-with-counter { position: relative; }
.field-counter {
    position: absolute;
    right: 0.6rem;
    bottom: 0.4rem;
    color: var(--muted);
    font-size: 0.78rem;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.78);
    padding: 0 0.25rem;
    border-radius: 4px;
}
.field-counter.is-warn { color: var(--gold); }
.field-counter.is-over { color: var(--danger); }

/* sticky 操作条（提交栏 / 保存栏） */
.sticky-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    margin-top: 1.1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 -2px 10px rgba(15, 60, 120, 0.08);
}

.sticky-actionbar-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 600;
}

.sticky-actionbar-info strong {
    color: var(--brand-deep);
    font-size: 0.95rem;
}

.sticky-actionbar-info .dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--gold);
    margin-right: 0.25rem;
}

.sticky-actionbar-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

/* 教师管理紧凑统计 */
.admin-users-meta-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--gold);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.admin-users-meta-strip > div {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
}

.admin-users-meta-strip span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.admin-users-meta-strip strong {
    color: var(--brand-deep);
    font-size: 1.05rem;
    font-weight: 700;
}

/* 老师搜索 */
.teacher-search {
    position: relative;
    margin-bottom: 0.65rem;
}

.teacher-search input {
    padding-left: 2.3rem;
}

.teacher-search::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 0.85rem;
    width: 0.95rem;
    height: 0.95rem;
    transform: translateY(-50%);
    border: 1.5px solid var(--muted);
    border-radius: 50%;
    pointer-events: none;
}

.teacher-search::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 1.55rem;
    width: 0.5rem;
    height: 1.5px;
    background: var(--muted);
    transform: translateY(0.05rem) rotate(45deg);
    transform-origin: 0 50%;
    pointer-events: none;
}

.teacher-quick-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.55rem;
}

/* 编辑器 tab */
.editor-tabs {
    display: inline-flex;
    align-items: stretch;
    gap: 0.25rem;
    padding: 0.25rem;
    margin: 0.5rem 0 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
}

.editor-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.95rem;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: var(--muted);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.editor-tab:hover { color: var(--brand-deep); }

.editor-tab.is-active {
    background: var(--brand);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

.editor-tab:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.chip-toggle:focus-within {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.flow-stepper-item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.editor-tab-dot {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: var(--line-strong);
}

.editor-tab.is-dirty .editor-tab-dot { background: var(--gold); }
.editor-tab.is-filled .editor-tab-dot { background: var(--brand); }
.editor-tab.is-active .editor-tab-dot { background: rgba(255, 255, 255, 0.85); }

/* tab 面板 */
.editor-panel { display: grid; gap: 1rem; }
.editor-panel[hidden] { display: none; }

/* 选项胶囊（chip-toggle） */
.chip-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--line-strong);
    background: var(--surface);
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.chip-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.chip-toggle:hover { color: var(--brand-deep); border-color: rgba(15, 79, 168, 0.3); }

.chip-toggle.is-checked {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand-deep);
}

/* 教师编辑卡 header（avatar + 名字 + 状态徽章替代原 H3 + description） */
.teacher-editor-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.45rem 0 1rem;
    margin-bottom: 0.6rem;
    border-bottom: 1px solid var(--line);
}

.teacher-editor-header .teacher-editor-meta { flex: 1; min-width: 0; }

.teacher-banner-avatar {
    width: 2.8rem;
    height: 2.8rem;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.teacher-editor-meta { display: grid; gap: 0.05rem; min-width: 0; }
.teacher-editor-meta strong { color: var(--brand-deep); font-size: 1.1rem; line-height: 1.3; }
.teacher-editor-meta small { color: var(--muted); font-size: 0.85rem; }

/* 教师卡片内行内 toggle */
.teacher-select-card-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    color: var(--muted);
    font-weight: 600;
}

/* scope 摘要卡 */
.scope-summary-card {
    display: grid;
    gap: 0.35rem;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    background: var(--surface-soft);
}

.scope-summary-card strong {
    color: var(--brand-deep);
    font-size: 1rem;
}

.scope-summary-card small { color: var(--muted); font-size: 0.84rem; }

/* 定向消息：精简的右栏 sticky 预览 */
.messages-sticky-rail { position: sticky; top: 5rem; align-self: start; }

.messages-summary-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-light);
    color: var(--brand-deep);
    border: 1px solid rgba(15, 79, 168, 0.16);
    font-size: 0.85rem;
    font-weight: 600;
}

.messages-summary-pill strong { font-weight: 700; }

/* 消息任务搜索条 */
.campaigns-search {
    margin-bottom: 0.6rem;
}

/* 名单展开/收起 */
.preview-recipients-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.25s ease;
}

.preview-recipients-wrap.is-expanded { max-height: 60rem; }

.preview-toggle-btn {
    min-height: 2.1rem;
    padding: 0.32rem 0.7rem;
    font-size: 0.84rem;
}

.preview-error {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: rgba(192, 57, 43, 0.1);
    color: var(--danger);
    font-size: 0.78rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* 接受人占位（加载中） */
.preview-loading { color: var(--muted); font-size: 0.85rem; }

/* messages 双列布局微调 */
.messages-audience-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.messages-audience-grid .chip-select { width: 100%; }
.messages-audience-grid .keyword-field { grid-column: span 2; }
.messages-audience-grid .featured-row { grid-column: span 2; }

/* 响应式微调 */
@media (max-width: 1080px) {
    .flow-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .channel-tile-grid { grid-template-columns: 1fr; }
    .messages-audience-grid { grid-template-columns: 1fr; }
    .messages-audience-grid .keyword-field,
    .messages-audience-grid .featured-row { grid-column: auto; }
    .admin-users-meta-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .messages-sticky-rail { position: static; }
    .flow-stepper { position: static; }
}

@media (max-width: 800px) {
    .admin-users-meta-strip { grid-template-columns: 1fr; }
    .editor-tabs { width: 100%; overflow-x: auto; }
}

/* ── 定向消息概览 + Wizard ──────────────────────────────────────── */

.messages-overview-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-left: 3px solid var(--gold);
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.messages-overview-meta > div { display: flex; align-items: baseline; gap: 0.45rem; }
.messages-overview-meta span { color: var(--muted); font-size: 0.82rem; font-weight: 600; }
.messages-overview-meta strong { color: var(--brand-deep); font-size: 1.05rem; font-weight: 700; }

.messages-overview-layout {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.35fr);
    gap: 1.1rem;
    align-items: start;
}

/* draft 卡片 */
.draft-card {
    display: grid;
    gap: 0.55rem;
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.draft-card:hover {
    border-color: rgba(15, 79, 168, 0.3);
    box-shadow: var(--shadow-sm);
}

.draft-card-headline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.draft-card-title strong {
    color: var(--brand-deep);
    font-size: 1rem;
    font-weight: 600;
}

.draft-card-preview {
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.draft-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.draft-card-progress {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.15rem;
}

.draft-step-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 1px dashed var(--line-strong);
}

.draft-step-chip.is-done {
    color: #fff;
    background: var(--brand);
    border-color: var(--brand-deep);
    border-style: solid;
}

.draft-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    padding-top: 0.4rem;
    border-top: 1px dashed var(--line);
}

.draft-card-footer small { color: var(--muted); font-size: 0.8rem; }

.draft-card-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.empty-state {
    padding: 1.4rem 1.2rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    color: var(--muted);
    text-align: center;
}

.empty-state strong { display: block; color: var(--brand-deep); margin-bottom: 0.25rem; font-size: 0.98rem; }
.empty-state p { font-size: 0.85rem; }

/* ── Wizard ─────────────────────────────────────────────────── */

.wizard-page-header {
    margin-bottom: 1rem;
}

.wizard-stepper {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.55rem;
    padding: 0.5rem;
    margin-bottom: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.wizard-step-form { margin: 0; padding: 0; }

.wizard-stepper-item {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.8rem;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    text-align: left;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.wizard-stepper-item:hover { background: var(--brand-light); color: var(--brand-deep); }

.wizard-stepper-item.is-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand-deep);
    box-shadow: var(--shadow-sm);
}

.wizard-stepper-item.is-done .wizard-stepper-num {
    background: var(--success);
    color: #fff;
}

.wizard-stepper-num {
    flex-shrink: 0;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 50%;
    background: var(--brand-light);
    color: var(--brand-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.wizard-stepper-item.is-active .wizard-stepper-num {
    background: rgba(255, 255, 255, 0.22);
    color: #fff;
}

.wizard-stepper-text { display: grid; gap: 0.05rem; min-width: 0; }
.wizard-stepper-text strong { font-size: 0.9rem; line-height: 1.2; }
.wizard-stepper-sub { font-size: 0.76rem; color: inherit; opacity: 0.78; }

.wizard-stepper-item:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* 主体 */
.wizard-form {
    display: grid;
    gap: 1rem;
}

.wizard-step-card {
    display: grid;
    gap: 1rem;
    padding: 1.4rem;
}

.wizard-step-intro h3 {
    color: var(--brand-deep);
    font-size: 1.15rem;
    margin-bottom: 0.2rem;
}

.wizard-step-intro p {
    color: var(--muted);
    font-size: 0.9rem;
}

.wizard-step-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr);
    gap: 1rem;
    align-items: start;
}

.wizard-preview-card {
    position: sticky;
    top: 5rem;
    padding: 1.2rem;
    display: grid;
    gap: 0.85rem;
}

.wizard-preview-card h3 {
    color: var(--brand-deep);
    font-size: 1rem;
}

.wizard-preview-list { display: grid; gap: 0.55rem; }

.wizard-preview-item {
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface-soft);
    display: grid;
    gap: 0.18rem;
}

.wizard-preview-item strong { color: var(--brand-deep); font-size: 0.92rem; }
.wizard-preview-item small { color: var(--muted); font-size: 0.8rem; }

/* 确认页摘要 */
.wizard-confirm-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.wizard-confirm-summary section {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    display: grid;
    gap: 0.45rem;
}

.wizard-confirm-summary h4 {
    color: var(--brand-deep);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.wizard-confirm-summary .confirm-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand-deep);
}

.wizard-confirm-summary .confirm-content {
    white-space: pre-wrap;
    color: var(--text);
    line-height: 1.55;
    font-size: 0.9rem;
}

.wizard-confirm-card {
    border-top: 4px solid var(--gold);
    box-shadow: 0 4px 18px rgba(184, 146, 42, 0.12);
}

.confirm-banner {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    padding: 0.95rem 1.1rem;
    border-radius: var(--radius-md);
    background: var(--gold-soft);
    border-left: 4px solid var(--gold);
}

.confirm-banner-icon {
    font-size: 1.45rem;
    line-height: 1;
    color: var(--gold);
}

.confirm-banner strong { color: var(--brand-deep); font-size: 1rem; display: block; margin-bottom: 0.15rem; }
.confirm-banner p { color: var(--text); font-size: 0.88rem; margin: 0; }

.confirm-acknowledge {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.65rem 0.95rem;
    border-radius: var(--radius-md);
    background: var(--brand-light);
    border: 1px solid rgba(15, 79, 168, 0.18);
    cursor: pointer;
    font-weight: 600;
    color: var(--brand-deep);
}

.confirm-acknowledge input {
    width: 1.05rem;
    height: 1.05rem;
    accent-color: var(--brand);
    margin: 0;
}

/* 按钮：图标 ghost、finalize 强调态 */
.button-icon-ghost {
    color: var(--muted);
    background: transparent;
    border: 1px solid var(--line);
    min-width: 2.6rem;
    padding: 0.5rem 0.7rem;
}

.button-icon-ghost:hover {
    color: var(--danger);
    border-color: rgba(192, 57, 43, 0.3);
    background: rgba(192, 57, 43, 0.05);
}

.wizard-finalize:not(:disabled) {
    box-shadow: 0 0 0 4px rgba(15, 79, 168, 0.12);
}

.wizard-finalize:not(:disabled):hover {
    box-shadow: 0 0 0 6px rgba(15, 79, 168, 0.18);
}

.wizard-actionbar-hint { color: var(--muted); }
.wizard-actionbar-hint small { font-size: 0.82rem; }
.wizard-header-actions { display: inline-flex; align-items: center; gap: 0.55rem; }

/* sr-only 工具类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 概览页空状态放大 */
.messages-drafts-card .empty-state {
    padding: 2rem 1.5rem;
    display: grid;
    gap: 0.6rem;
    justify-items: center;
}

.messages-drafts-card .empty-state::before {
    content: "+";
    font-size: 2.2rem;
    color: var(--brand);
    background: var(--brand-light);
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.messages-drafts-card .empty-state strong { font-size: 1.05rem; }

/* 底部操作条 */
.wizard-actionbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1.1rem;
    margin-top: 0.5rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(8px);
    box-shadow: 0 -2px 10px rgba(15, 60, 120, 0.08);
}

.wizard-actionbar-secondary,
.wizard-actionbar-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.wizard-finalize {
    background: var(--brand);
    border-color: var(--brand-deep);
    font-size: 0.98rem;
    min-height: 2.8rem;
    padding: 0.7rem 1.4rem;
}

.wizard-finalize:not(:disabled):hover {
    background: var(--brand-deep);
}

/* 响应式 */
@media (max-width: 1080px) {
    .messages-overview-layout { grid-template-columns: 1fr; }
    .wizard-stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-step-grid { grid-template-columns: 1fr; }
    .wizard-preview-card { position: static; }
}

@media (max-width: 800px) {
    .messages-overview-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wizard-stepper { grid-template-columns: 1fr; }
}

/* ── 公开检索：启动控制台 + 状态条 ─────────────────────────────── */

.enrichment-header-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.enrichment-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--text);
    border: 1px solid var(--line);
    font-size: 0.85rem;
    font-weight: 600;
}

.enrichment-pill strong { color: var(--brand-deep); }

.enrichment-pill.is-info {
    background: var(--brand-light);
    color: var(--brand-deep);
    border-color: rgba(15, 79, 168, 0.18);
}

.enrichment-pill.is-ok { background: rgba(26, 122, 80, 0.1); color: var(--success); border-color: rgba(26, 122, 80, 0.22); }
.enrichment-pill.is-warn { background: var(--gold-soft); color: #6b4a0a; border-color: rgba(184, 146, 42, 0.25); }

.enrichment-pill-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: currentColor;
}

/* 启动控制台 */
.enrichment-launchpad {
    display: grid;
    gap: 1.1rem;
    padding: 1.4rem;
}

.enrichment-launchpad-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--line);
}

.enrichment-launchpad-head h3 { color: var(--brand-deep); font-size: 1.12rem; margin-bottom: 0.18rem; }

.enrichment-launchpad-row {
    display: grid;
    grid-template-columns: minmax(220px, 0.6fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: center;
}

.enrichment-launchpad-summary {
    display: grid;
    gap: 0.2rem;
    padding: 0.85rem 1rem;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
}

.enrichment-launchpad-summary strong {
    font-size: 1.4rem;
    color: var(--brand-deep);
    line-height: 1.2;
}

.enrichment-launchpad-summary .portal-panel-label { color: var(--muted); }

.enrichment-launchpad-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.55rem;
    border-top: 1px solid var(--line);
}

.enrichment-dry-toggle { flex: 1; min-width: 260px; }

.enrichment-start-btn {
    font-size: 1rem;
    min-height: 2.8rem;
    padding: 0.7rem 1.5rem;
    box-shadow: 0 0 0 3px rgba(15, 79, 168, 0.1);
}

.enrichment-start-btn:not(:disabled):hover { box-shadow: 0 0 0 4px rgba(15, 79, 168, 0.18); }

/* 状态条（脉冲灯 + 文字 + 进度） */
.enrichment-status-strip {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.95rem;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--line);
}

.enrichment-status-light {
    flex-shrink: 0;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: var(--line-strong);
    box-shadow: 0 0 0 0 transparent;
}

.enrichment-status-light.is-running {
    background: var(--brand);
    animation: enrichment-status-pulse 1.4s ease-in-out infinite;
}

@keyframes enrichment-status-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(15, 79, 168, 0.45); }
    70%  { box-shadow: 0 0 0 10px rgba(15, 79, 168, 0); }
    100% { box-shadow: 0 0 0 0 rgba(15, 79, 168, 0); }
}

.enrichment-status-text { flex: 1; min-width: 0; display: grid; gap: 0.1rem; }
.enrichment-status-text strong { color: var(--brand-deep); font-size: 0.95rem; }
.enrichment-status-text span { font-size: 0.85rem; }

.enrichment-progress-meter {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.1rem;
    font-size: 0.86rem;
    color: var(--text);
    text-align: right;
    flex-shrink: 0;
}

.enrichment-progress-meter strong { color: var(--brand-deep); }

@media (max-width: 980px) {
    .enrichment-launchpad-row { grid-template-columns: 1fr; }
    .enrichment-launchpad-controls { flex-direction: column; align-items: stretch; }
    .enrichment-start-btn { width: 100%; }
    .enrichment-status-strip { flex-wrap: wrap; }
    .enrichment-progress-meter { width: 100%; flex-direction: row; justify-content: space-between; }
}
