/* 原生组件 + 语义颜色；视觉改版不依赖第三方资源或新的构建流程。 */
:root {
    --canvas: var(--mkt-canvas);
    --paper: var(--mkt-panel);
    --ink: var(--mkt-ink);
    --muted: var(--mkt-muted);
    --line: var(--mkt-line);
    --green: #246b55;
    --green-soft: #edf5f0;
    --amber: #94601b;
    --amber-soft: #faf2e4;
    --red: #a73c3c;
    font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-size: 14px;
    font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.6; }
button, input, select { font: inherit; color: inherit; }
button, select { min-height: 36px; }
button {
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 5px;
    background: var(--paper);
    cursor: pointer;
    line-height: 1.45;
    transition: background .15s, border-color .15s;
}
button:hover { background: #f0f4f1; border-color: #b9cbc0; }
button:disabled { opacity: .55; cursor: wait; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, [tabindex]:focus-visible {
    outline: 2px solid var(--green); outline-offset: 3px;
}
input, select { border: 1px solid #d6ded9; border-radius: 5px; background: #fff; padding: 8px 11px; max-width: 100%; }
select { padding-right: 27px; }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
h1 { font-size: 27px; line-height: 1.35; letter-spacing: -.6px; font-weight: 650; }
h2 { font-size: 17px; line-height: 1.5; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
small { font-size: 12px; }
strong { font-weight: 600; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { font-size: 12px; letter-spacing: 1.3px; color: var(--muted); margin-bottom: 7px; }
.primary { background: var(--green); color: white; border-color: var(--green); }
.primary:hover { background: #1d5745; color: white; border-color: #1d5745; }
.text-button { padding: 4px 0; min-height: 28px; border: 0; background: transparent; color: var(--green); text-align: left; }
.text-button:hover { background: transparent; color: #184b39; text-decoration: underline; }
.error { color: var(--red); font-size: 13px; }
.error:empty { display: none; }
.warning-text { color: var(--amber); display: block; margin-top: 5px; }
.nowrap { white-space: nowrap; }
.inline-actions, .tags { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

/* 工作空间：窄导航 + 账号上下文 + 页面内容。 */
#shell { min-height: 100vh; display: grid; grid-template-columns: 222px minmax(0, 1fr); }
.sidebar { background: #f0f3f0; border-right: 1px solid var(--line); padding: 30px 18px 20px; display: flex; flex-direction: column; height: 100vh; position: sticky; top: 0; }
.brand { display: flex; align-items: center; gap: 10px; color: #203f33; font-size: 16px; font-weight: 650; white-space: nowrap; }
.brand svg { width: 29px; height: 32px; stroke: var(--green); fill: none; stroke-width: 1.7; flex-shrink: 0; }
.brand small { display: block; font-size: 12px; font-weight: 400; color: #7a887f; letter-spacing: .15px; margin-top: 2px; }
.nav-label { margin: 44px 12px 12px; color: #839087; font-size: 12px; letter-spacing: 1px; }
.sidebar nav { display: flex; flex-direction: column; gap: 5px; }
.nav { display: flex; align-items: center; gap: 12px; width: 100%; border-color: transparent; border-radius: 5px; text-align: left; padding: 12px; background: transparent; color: #617066; }
.nav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.55; flex-shrink: 0; }
.nav.active { color: #214e3c; background: #e0e9e2; font-weight: 600; border-color: transparent; }
.nav:hover { background: #e5ece6; border-color: transparent; }
.aside-foot { margin-top: auto; padding: 22px 10px 0; border-top: 1px solid #dce4dd; font-size: 12px; }
#sideStatus { margin-bottom: 12px; }
/* 不覆盖账号组件内部span布局，授权图标和文字共用flex垂直中心。 */
#sideStatus > .pill { display: inline-flex; max-width: 100%; margin-top: 12px; }
#logout { color: var(--muted); font-size: 12px; }
main { min-width: 0; }
.workspace-bar { min-height: 76px; background: #fff; border-bottom: 1px solid var(--line); padding: 16px 34px; display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.breadcrumb { font-size: 12px; color: var(--muted); white-space: nowrap; }
.breadcrumb span:first-child { color: #b1bdb5; padding: 0 10px; }
.breadcrumb span:last-child { color: var(--ink); }
.topactions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.topactions button, .topactions select { font-size: 12px; }
.account-label { font-size: 12px; color: var(--muted); }
#accountPicker { max-width: 220px; }
.workspace-body { padding: 32px 34px 45px; max-width: 1600px; margin: auto; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 18px; margin-bottom: 25px; }
#subtitle { color: var(--muted); font-size: 13px; margin-top: 9px; }
.scope-note { color: #869087; font-size: 12px; text-align: right; }
.notice { display: flex; align-items: center; gap: 14px; color: #6c786f; font-size: 12px; margin: 0 0 22px; min-height: 28px; }
.notice .pill { background: transparent; padding-left: 0; color: #476352; }
.notice .pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: #8fa697; }
.notice .pill.green::before { background: var(--green); }
.notice-time { margin-left: auto; font-size: 12px; color: #8a948e; }
#systemMessage:not(:empty) { background: #fff2f0; padding: 12px 16px; margin: 0 0 18px; border-left: 2px solid #be6157; }
#content { min-height: 260px; }
.surface { border: 1px solid var(--line); border-radius: 7px; background: var(--paper); margin-bottom: 22px; min-width: 0; overflow: hidden; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 23px 24px 20px; }
.section-heading p { font-size: 12px; margin-top: 4px; }
.section-heading button { font-size: 12px; flex-shrink: 0; }
.section-heading select { font-size: 12px; max-width: 280px; }
.footnote { color: #839087; font-size: 12px; line-height: 1.9; margin-top: 15px; }
.empty { text-align: center; padding: 60px 22px; }
.empty h3 { font-size: 15px; margin: 15px 0 7px; }
.empty p { font-size: 12px; max-width: 430px; margin: auto; }
.empty-mark { display: inline-flex; justify-content: center; align-items: center; width: 34px; height: 34px; border: 1px solid #c9d7ce; border-radius: 50%; color: #94ab9e; font-size: 22px; }
.loading { padding: 70px 20px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* 增长总览：累计人数与最近任务回执使用不同口径，不生成虚假转化率。 */
.metrics { background: white; border: 1px solid var(--line); border-radius: 7px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 26px; }
.metric { text-align: left; padding: 23px 25px; position: relative; background: transparent; border: 0; border-radius: 0; min-width: 0; }
.metric + .metric { border-left: 1px solid var(--line); }
.metric:hover { background: #f6faf7; }
.metric-label { display: block; font-size: 12px; color: #58665d; }
.metric-value { display: block; font-size: 35px; line-height: 1.5; font-weight: 500; letter-spacing: -.6px; font-variant-numeric: tabular-nums; margin: 7px 0; }
.metric-hint { color: #8a948e; font-size: 12px; }
.metric-arrow { position: absolute; right: 20px; top: 19px; color: #a5b6aa; font-size: 17px; }
.overview-columns { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(280px, 1fr); gap: 24px; align-items: start; }
.recent-prospect { display: flex; justify-content: space-between; gap: 20px; padding: 22px 24px; border-top: 1px solid #edf0ed; cursor: pointer; }
.recent-prospect:hover { background: #fafcfb; }
.recent-info { min-width: 0; }
.recent-comment { font-size: 13px; margin: 13px 0 0 48px; overflow-wrap: anywhere; }
.recent-result { display: flex; align-items: flex-end; flex-direction: column; gap: 9px; flex-shrink: 0; font-size: 12px; }
.next-step { padding-bottom: 22px; }
.runtime-step { display: flex; align-items: center; gap: 15px; margin: 0 24px; padding: 20px 0; border-top: 1px solid #edf0ed; }
.runtime-step strong { font-size: 13px; }
.runtime-step p { font-size: 12px; margin-top: 5px; }
.step-number { font-size: 12px; font-variant-numeric: tabular-nums; color: #8a9e90; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; margin-left: auto; flex-shrink: 0; background: #a9b3ac; }
.status-dot.green { background: var(--green); }
.status-dot.amber { background: #b5935c; }
.next-step > .text-button { margin: 10px 24px 0; font-size: 12px; }
.attention { background: #fbf7ef; padding: 17px; margin: 24px 18px 0; border-left: 2px solid #c9a465; font-size: 12px; color: #785d34; }
.attention p { margin-top: 6px; }
.attention .text-button { color: #785d34; margin-top: 8px; }

/* 数据表：保留完整资料和可滚动内容，在小屏上不撑破整页。 */
.filters { display: flex; gap: 5px; flex-wrap: wrap; padding: 0 24px 20px; }
.filter { border-color: transparent; background: transparent; font-size: 12px; padding: 7px 10px; color: #6d7a71; }
.filter span { margin-left: 8px; font-size: 12px; font-variant-numeric: tabular-nums; opacity: .8; }
.filter[aria-pressed="true"] { color: var(--green); border-color: #d7e6dc; background: var(--green-soft); font-weight: 600; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; min-width: 680px; }
.table th { background: #f8faf8; padding: 12px 22px; border-block: 1px solid var(--line); color: #839087; font-weight: 400; font-size: 12px; white-space: nowrap; }
.table td { border-bottom: 1px solid #edf0ed; padding: 24px 22px; vertical-align: top; overflow-wrap: anywhere; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr[data-viewer], .table tbody tr[data-task] { cursor: pointer; }
.table tbody tr:hover { background: #fafcfb; }
.leads { min-width: 890px; table-layout: fixed; }
.leads th:nth-child(1) { width: 26%; }
.leads th:nth-child(2) { width: 30%; }
.leads th:nth-child(3) { width: 20%; }
.leads th:nth-child(4) { width: 24%; }
.outreach-table { min-width: 850px; table-layout: fixed; }
.outreach-table th:nth-child(1) { width: 26%; }
.outreach-table th:nth-child(2) { width: 31%; }
.outreach-table th:nth-child(3) { width: 29%; }
.outreach-table th:nth-child(4) { width: 14%; }
.identity { display: flex; gap: 12px; align-items: center; min-width: 0; }
.identity-text { min-width: 0; }
.who { font-size: 13px; overflow-wrap: anywhere; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: #eff3ef; color: #99ab9e; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.2; }
.avatar.large { width: 64px; height: 64px; }
.avatar.large svg { width: 32px; height: 32px; }
.profile-line { font-size: 12px; color: #8a948e; margin-top: 4px; line-height: 1.7; overflow-wrap: anywhere; }
.identity-sub { margin-left: 48px; margin-top: 10px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 7px; border-radius: 3px; background: #f0f3f1; color: #64756a; font-size: 12px; line-height: 1.5; }
.pill.green { color: #346e50; background: #edf5ee; }
.pill.amber { color: var(--amber); background: var(--amber-soft); }
.tags:empty { display: none; }
.comment { margin-top: 9px; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.event-count { display: inline-block; margin: 0 9px 6px 0; font-size: 12px; color: #67786b; }
.touch-note { color: #859087; font-size: 12px; margin: 8px 0; }
.row-link { font-size: 12px; color: var(--green); }
.pagination { display: flex; justify-content: space-between; align-items: center; gap: 15px; border-top: 1px solid var(--line); padding: 15px 24px; font-size: 12px; }

/* 渠道与账号。 */
.account-roster { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 18px; }
.account-tile { text-align: left; min-width: 210px; padding: 14px 18px; flex-shrink: 0; }
.account-tile.selected { border-color: #7eaa90; background: #f5faf6; }
.account-hero { display: flex; justify-content: space-between; align-items: center; gap: 26px; padding: 28px; }
.account-intro { display: flex; align-items: center; gap: 20px; min-width: 0; }
.account-intro h2 { font-size: 22px; margin-bottom: 5px; }
.account-intro .eyebrow { margin-bottom: 3px; }
.profile-links { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; margin-top: 12px; font-size: 12px; }
.profile-links button { font-size: inherit; }
.account-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.settings { padding: 0 24px 20px; }
.settings .section-heading { padding-inline: 0; }
.keyrow { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 13px 0; border-top: 1px solid #edf0ed; font-size: 12px; }
.keyrow > span { color: #879289; flex-shrink: 0; }
.keyrow > strong { text-align: right; font-weight: 400; overflow-wrap: anywhere; min-width: 0; }
.settings > .text-button { font-size: 12px; margin-top: 13px; }
.qr-block { display: flex; flex-direction: column; align-items: center; font-size: 12px; gap: 3px; flex-shrink: 0; }
.qr-block img { width: 84px; height: 84px; }
.profile-bio { color: var(--muted); font-size: 12px; white-space: pre-wrap; margin-top: 18px; overflow-wrap: anywhere; }

/* 自动化：运行信息和明确的人工控制分开，切页不触发设置变更。 */
.automation-status { display: flex; align-items: center; justify-content: space-between; gap: 25px; padding: 25px 28px; background: #edf3ee; border: 1px solid #dae5dd; border-radius: 6px; margin-bottom: 26px; }
.automation-status h2 { font-size: 20px; color: #2c5140; }
.automation-status .muted { font-size: 12px; margin-top: 7px; }
.automation-status button { flex-shrink: 0; font-size: 12px; }
.section-tabs { display: flex; gap: 28px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.section-tabs button { padding: 0 0 12px; min-height: 34px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); font-size: 13px; }
.section-tabs button[aria-pressed="true"] { border-bottom-color: var(--green); color: var(--green); font-weight: 600; }
.automation-flow { display: grid; grid-template-columns: repeat(4, 1fr); padding: 5px 24px 30px; gap: 28px; }
.flow-step { position: relative; }
.flow-step:not(:last-child)::after { content: '→'; position: absolute; top: 0; right: 0; color: #a6b7ab; }
.flow-step h3 { margin: 12px 0 8px; }
.flow-step p { font-size: 12px; line-height: 1.9; }

/* 客户档案使用侧边抽屉；授权仍是独立弹窗，保留原交互协议。 */
dialog { color: var(--ink); border: 1px solid var(--line); padding: 0; background: white; }
dialog::backdrop { background: rgb(23 36 29 / 30%); }
#detail { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(960px, 96vw); max-width: 100vw; height: 100dvh; max-height: 100dvh; border: 0; border-left: 1px solid #dae2dc; box-shadow: -12px 0 50px #182e2315; overflow-x: hidden; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--line); background: white; }
.dialog-head h2 { font-size: 20px; }
.dialog-head .eyebrow { margin-bottom: 4px; }
.close { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 34px; padding: 0; line-height: 1; font-size: 23px; color: #7c8981; border: 0; flex-shrink: 0; }
#detailBody { display: grid; grid-template-columns: 245px minmax(0, 1fr); min-height: calc(100% - 99px); }
.profile-rail { background: #f8faf8; border-right: 1px solid var(--line); padding: 26px 24px; min-width: 0; }
.profile-intro { margin-bottom: 23px; }
.profile-intro h3 { margin-top: 16px; font-size: 16px; }
.profile-intro p { font-size: 12px; margin-top: 6px; }
.profile-rail .profile-links { gap: 5px 15px; }
.profile-rail .keyrow { font-size: 12px; gap: 12px; }
.profile-rail .qr-block { margin-top: 24px; }
.profile-ref { white-space: pre-line; overflow-wrap: anywhere; font-size: 12px; color: #97a299; margin-top: 24px; }
.lead-main { padding: 25px 30px; min-width: 0; }
.source-context { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 12px; margin-bottom: 22px; }
.source-context button { font-size: 12px; }
.journey { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 30px; }
.journey-step { padding-top: 12px; border-top: 2px solid #e8ede9; font-size: 12px; color: #98a59c; }
.journey-step.done { border-color: #6b9f7a; color: #356446; }
.journey-step small { display: block; color: #8b978e; font-size: 12px; margin-top: 6px; }
.detail-section { border-top: 1px solid var(--line); padding: 24px 0; }
.detail-section h3 { margin-bottom: 14px; }
.detail-section > .muted { font-size: 12px; }
.need-label { font-size: 13px; margin: 5px 0; }
blockquote { border-left: 2px solid #c7dbce; padding: 10px 14px; margin: 14px 0; background: #f6f9f6; font-size: 13px; line-height: 1.9; overflow-wrap: anywhere; }
.reach-block > p { font-size: 12px; margin-top: 10px; color: var(--muted); }
.diagnostic { margin-top: 15px; font-size: 12px; color: var(--muted); }
.diagnostic summary { cursor: pointer; }
.diagnostic .profile-ref { margin-top: 10px; }
.timeline { padding: 15px 0 0 13px; }
.event { border-left: 1px solid #dce5df; padding: 0 0 25px 21px; position: relative; }
.event::before { content: ''; position: absolute; left: -4px; top: 7px; width: 7px; height: 7px; border-radius: 50%; background: #8eab97; }
.event:last-child { border-color: transparent; padding-bottom: 0; }
.event-head { display: flex; justify-content: space-between; gap: 16px; font-size: 12px; }
.event-head time { font-size: 12px; }
.event-content { font-size: 13px; margin: 10px 0; overflow-wrap: anywhere; }
.assessment { font-size: 12px; color: #6c8574; margin: 8px 0; }
/* 授权流程使用独立窗口样式，避免影响已经运行的工作台。 */
.auth-spinner { display:inline-block; width:16px; height:16px; border:2px solid #dbe2ed; border-top-color:var(--mkt-primary); border-radius:50%; animation:auth-spin .8s linear infinite; }
@keyframes auth-spin { to { transform:rotate(360deg); } }
@media (prefers-reduced-motion:reduce) { .auth-spinner { animation:none; } }

/* 登录与响应式布局。 */
#login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-story { background: #eaf1e9; padding: 55px 9%; display: flex; flex-direction: column; justify-content: space-between; }
.login-story h1 { font-size: clamp(28px, 3vw, 43px); line-height: 1.5; letter-spacing: -1px; margin: 16px 0 24px; }
.login-story p:not(.eyebrow) { color: #6c7c70; font-size: 13px; line-height: 2; }
.login-story footer { font-size: 12px; color: #7b8e7e; }
.login-story footer span { padding: 0 12px; }
.login-area { display: grid; place-items: center; padding: 30px; background: white; }
#loginForm { width: 330px; max-width: 100%; }
#loginForm h2 { font-size: 25px; margin-bottom: 10px; }
#loginForm > p { font-size: 13px; margin-bottom: 32px; }
.field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; margin-bottom: 20px; }
.field input, .field select { width: 100%; min-height: 42px; }
#loginForm > button { width: 100%; margin: 5px 0 18px; min-height: 42px; }
@media (min-width: 1650px) { .workspace-body { padding-top: 40px; } .metric { padding-block: 28px; } }
@media (max-width: 1180px) {
    #shell { grid-template-columns: 200px minmax(0, 1fr); }
    .sidebar { padding-inline: 13px; }
    .brand { font-size: 14px; gap: 7px; }
    .brand small { font-size: 12px; }
    .workspace-bar { padding: 16px 24px; flex-wrap: wrap; }
    .workspace-body { padding: 28px 24px; }
    .overview-columns { grid-template-columns: minmax(0, 1.45fr) minmax(260px, 1fr); gap: 18px; }
    .metric { padding: 20px 18px; }
    .metric-hint { font-size: 12px; }
    .metric-arrow { right: 13px; }
    .account-label { display: none; }
    .recent-prospect { padding: 20px; }
    .account-columns { gap: 18px; }
}
@media (max-width: 950px) {
    .overview-columns { grid-template-columns: 1fr; }
    .account-columns { grid-template-columns: 1fr; gap: 0; }
    .scope-note { display: none; }
    .automation-flow { grid-template-columns: 1fr 1fr; gap: 25px; }
    .automation-status { align-items: flex-start; }
    .metric-value { font-size: 28px; }
    .metric-arrow { display: none; }
    .notice { flex-wrap: wrap; gap: 6px 14px; }
    .notice-time { margin-left: 0; }
    #detailBody { grid-template-columns: 215px minmax(0, 1fr); }
    .profile-rail { padding: 24px 18px; }
    .lead-main { padding: 24px; }
}
@media (max-width: 720px) {
    #shell { display: block; }
    .sidebar { position: static; height: auto; padding: 18px 16px 0; border-right: 0; border-bottom: 1px solid var(--line); }
    .sidebar .brand { margin-bottom: 18px; font-size: 16px; }
    .brand small { font-size: 12px; }
    .nav-label, #sideStatus { display: none; }
    .sidebar { position: relative; }
    .aside-foot { display: block; position: absolute; right: 20px; top: 24px; padding: 0; border: 0; margin: 0; }
    .sidebar nav { flex-direction: row; gap: 4px; overflow-x: auto; padding-bottom: 10px; }
    .nav { justify-content: center; flex-shrink: 0; width: auto; flex: 1; font-size: 12px; padding: 10px 8px; white-space: nowrap; }
    .nav svg { display: none; }
    .workspace-bar { padding: 14px 18px; min-height: auto; gap: 10px; }
    .breadcrumb { display: none; }
    .topactions { justify-content: flex-start; width: 100%; gap: 7px; }
    #accountPicker { max-width: 180px; flex: 1; min-width: 125px; }
    .workspace-body { padding: 24px 18px 30px; }
    h1 { font-size: 24px; }
    #subtitle { font-size: 12px; }
    .page-heading { margin-bottom: 17px; }
    .notice { font-size: 12px; margin-bottom: 20px; }
    .notice .pill { font-size: 12px; }
    .notice-time { display: none; }
    .metrics { grid-template-columns: 1fr 1fr; }
    .metric { padding: 17px 19px; }
    .metric:nth-child(3) { border-left: 0; }
    .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
    .metric-value { font-size: 31px; }
    .section-heading { padding: 20px 18px; gap: 14px; flex-wrap: wrap; }
    .section-heading h2 { font-size: 16px; }
    .section-heading p { font-size: 12px; }
    .section-heading select { width: 100%; }
    .filters { padding: 0 15px 17px; gap: 4px; }
    .filter { padding: 5px 8px; font-size: 12px; }
    .filter span { margin-left: 5px; }
    .recent-prospect { padding: 20px 18px; gap: 10px; }
    .recent-comment { margin-left: 0; }
    .recent-result { max-width: 100px; text-align: right; }
    .account-hero { padding: 24px 18px; align-items: flex-start; flex-wrap: wrap; }
    .account-intro { gap: 15px; }
    .account-intro .avatar { width: 48px; height: 48px; }
    .account-intro h2 { font-size: 19px; }
    .account-hero .qr-block { flex-direction: row; gap: 15px; }
    .account-hero .qr-block img { width: 68px; height: 68px; }
    .settings { padding: 0 18px 18px; }
    .keyrow { gap: 15px; font-size: 12px; }
    .automation-status { flex-direction: column; padding: 23px 20px; gap: 18px; }
    .automation-status h2 { font-size: 18px; }
    .automation-flow { padding: 0 18px 25px; gap: 25px 22px; }
    .flow-step p { font-size: 12px; }
    .flow-step h3 { font-size: 13px; }
    #detail { width: 100vw; }
    #detailBody { display: block; }
    .dialog-head { padding: 20px; }
    .profile-rail { padding: 22px; border-right: 0; border-bottom: 1px solid var(--line); }
    .profile-intro { display: grid; grid-template-columns: 56px 1fr; gap: 0 15px; margin-bottom: 18px; }
    .profile-intro .avatar { grid-row: span 3; width: 48px; height: 48px; }
    .profile-intro h3 { margin-top: 0; }
    .profile-intro .profile-links { grid-column: 2; }
    .profile-rail .qr-block { flex-direction: row; gap: 16px; }
    .profile-ref { margin-top: 16px; }
    .lead-main { padding: 22px; }
    .journey { gap: 8px; }
    .journey-step small { font-size: 12px; }
    .event-head { gap: 8px; }
    .onboarding-dialog .dialog-body { padding: 20px; }
    #login { display: block; }
    .login-story { padding: 24px; min-height: 270px; gap: 35px; }
    .login-story h1 { font-size: 26px; margin-block: 10px; }
    .login-story footer, .login-story > div > p:not(.eyebrow) { display: none; }
    .login-area { padding: 35px 24px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* 状态使用图形与文字共同表达，颜色不是唯一依据。 */
.ui-icon,.logout-button svg{display:block;width:16px;height:16px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
button:has(.ui-icon),.logout-button,.setting-state{display:inline-flex;align-items:center;justify-content:center;gap:8px}.logout-button{border:1px solid var(--line,#d9e3df);border-radius:5px;background:white;padding:9px 12px;margin-top:12px;color:inherit;cursor:pointer}
.state-badge{display:inline-flex;align-items:center;gap:6px}.state-badge:before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor}.setting-state.green{color:#23765d}.setting-state.amber{color:#94621b}.aside-foot .state-badge{margin-top:7px;white-space:normal}
.state-badge:has(> .ui-icon)::before { content: none; }
#logout { margin-top: 0; }

/* 窄屏保持完整字段：表格变成带列名的卡片，避免横向拖动和缩小字号。 */
.workspace-body { width:100%; padding:clamp(20px,2.3vw,36px); }
.notice,.keyrow,.recent-result,.profile-ref,.journey-step small { overflow-wrap:anywhere; }
.table { font-size:14px; }
.table th { font-size:12px; }
.table td { padding:20px; }
.touch-note,.metric-hint,.identity-sub,.profile-line,.event-head time,.assessment { font-size:12px; }
.recent-result { max-width:180px; }
@media (max-width:1200px) {
 .table-wrap { overflow:visible; }
 .table-wrap .table { min-width:0; width:100%; table-layout:auto; display:block; }
 .table thead { position:absolute; width:1px; height:1px; clip-path:inset(50%); overflow:hidden; }
 .table tbody { display:grid; gap:12px; padding:0 18px 18px; }
 .table tbody tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 24px; padding:20px; border:1px solid var(--line); border-radius:5px; }
 .table tbody td { display:block; border:0; min-width:0; width:auto; padding:0; white-space:normal; }
 .table tbody td:first-child { grid-column:1 / -1; }
 .table tbody td:before { content:attr(data-label); display:block; color:var(--muted); font-size:12px; margin-bottom:8px; }
 .table tbody td:first-child:before { display:none; }
 .overview-columns { grid-template-columns:1fr; }
 .metric-hint { font-size:12px; }
 .topactions button,.topactions select { font-size:13px; }
}
@media (max-width:720px) {
 .sidebar { padding:16px; }
 /* 手机把账号操作和退出放在同一行；共享网格决定位置，不用像素偏移凑齐。 */
 .aside-foot { position:static; display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:8px; padding:12px 0 0; border-top:1px solid var(--line); }
 #sideStatus { display:contents; }
 #sideStatus .account-portrait { grid-column:1; grid-row:1; }
 #sideStatus .account-copy { grid-column:2 / -1; grid-row:1; }
 #sideStatus .account-actions { grid-column:2; grid-row:2; }
 #sideStatus > .pill { grid-column:1 / -1; grid-row:3; justify-self:start; margin-top:4px; }
 #sideStatus .account-copy { max-width:none; }
 #sideStatus .account-actions { margin-left:0; }
 #sideStatus .account-identity { gap:8px; }
 #logout { grid-column:3; grid-row:2; margin:0; font-size:13px; flex-shrink:0; }
 .nav { font-size:13px; min-height:44px; padding:10px 8px; }
 button,select,.text-button,.close { min-height:44px; }
 .close { min-width:44px; }
 .workspace-body { padding:22px 16px 32px; }
 .workspace-bar { padding:14px 16px; }
 .topactions { gap:8px; }
 #accountPicker { flex-basis:100%; max-width:none; width:100%; }
 .table tbody { padding-inline:12px; }
 .table tbody tr { grid-template-columns:1fr; gap:18px; padding:18px; }
 .table tbody td:first-child { grid-column:auto; }
 .notice { font-size:12px; }
 .recent-prospect { flex-wrap:wrap; }
 .recent-result { width:100%; max-width:none; flex-direction:row; align-items:center; justify-content:space-between; text-align:left; }
 .keyrow { display:grid; grid-template-columns:minmax(90px, .7fr) minmax(0,1fr); gap:12px; font-size:13px; }
 .journey { grid-template-columns:repeat(2,minmax(0,1fr)); gap:16px; }
 .journey-step small { font-size:12px; }
 .lead-main,.profile-rail { padding:20px 16px; }
 .dialog-head { padding:16px; position:sticky; top:0; z-index:2; }
 .account-intro { width:100%; }
 .onboarding-dialog { width:calc(100vw - 20px); }
}
@media (max-width:380px) {
 .sidebar nav { display:grid; grid-template-columns:1fr 1fr; }
 .nav { justify-content:flex-start; }
 .metrics { grid-template-columns:1fr 1fr; }
 .metric { padding:16px 12px; }
 .automation-flow { grid-template-columns:1fr; }
 .aside-foot { align-items:flex-start; flex-wrap:wrap; }
}

/* 商业服务状态与抖音授权分别显示，避免把到期误写成Cookie失效。 */
.subscription-notice{display:flex;align-items:center;flex-wrap:wrap;gap:12px;border:1px solid #dce6e1;background:#f5faf7;padding:12px 16px;border-radius:6px;margin-bottom:20px;font-size:12px}


/* 与管理端同一品牌与中性基底；绿色仍只用于成功状态。 */
.sidebar { background: var(--mkt-panel); }
.brand { color: var(--mkt-ink); }
.brand svg { stroke: var(--mkt-primary); }
.brand small, .nav-label { color: var(--mkt-subtle); }
.nav { color: var(--mkt-muted); }
.nav.active { color: var(--mkt-primary); background: var(--mkt-primary-soft); }
.nav:hover { background: var(--mkt-canvas); }
.primary { background: var(--mkt-primary); border-color: var(--mkt-primary); }
.primary:hover { background: var(--mkt-primary-hover); border-color: var(--mkt-primary-hover); }
.login-story { background: var(--mkt-canvas); }
.profile-rail { background: var(--mkt-canvas); }

/* 扫码与验证在同一窗口完成；原生输入框用几何映射覆盖，支持手机键盘。 */
.onboarding-dialog { width:min(700px, calc(100vw - 32px)); max-height:calc(100dvh - 32px); padding:0; border:1px solid var(--line); border-radius:18px; box-shadow:0 24px 90px #14203b30; overflow:auto; }
.onboarding-dialog .dialog-head { position:sticky; top:0; background:var(--paper); z-index:2; padding:20px 24px; }
.onboarding-dialog .dialog-head h2 { font-size:20px; margin:0; }
.onboarding-dialog [data-close] { min-width:36px; min-height:36px; font-size:22px; padding:0; display:grid; place-items:center; }
.onboarding-dialog .dialog-body { display:block; padding:20px 24px 24px; }
.onboarding-dialog .auth-intro { color:var(--muted); line-height:1.7; margin:0 0 12px; font-size:13px; }
.auth-steps { display:flex; padding:0; margin:16px 0; list-style:none; gap:16px; }
.auth-steps li { flex:1; display:flex; align-items:center; gap:8px; color:var(--muted); padding:8px 0 12px; font-size:13px; border-bottom:2px solid var(--line); }
.auth-steps li span { display:grid; place-items:center; width:24px; height:24px; background:var(--canvas); border-radius:50%; flex-shrink:0; }
.auth-steps li[aria-current] { color:var(--mkt-primary); border-color:currentColor; font-weight:600; }
.auth-steps li[data-done] { color:var(--mkt-primary); }
.auth-status { margin:16px 0; }
.auth-status:has([data-status]:empty) { display:none; }
.auth-status p { margin:0 0 6px; line-height:1.65; font-size:14px; }
.auth-status small { color:var(--muted); font-size:12px; font-variant-numeric:tabular-nums; }
.onboarding-dialog [data-loading] { display:flex; align-items:center; gap:10px; color:var(--muted); font-size:13px; padding:18px 0; }
.auth-canvas { position:relative; margin:16px auto 0; border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fafbfc; width:100%; }
.onboarding-dialog [data-screen] { display:block; width:100%; height:auto; touch-action:none; user-select:none; }
.auth-inline-input { position:absolute; min-width:0; min-height:32px; transform:translateY(-50%); margin:0; border:1px solid #cbd5e1; border-radius:6px; padding:0 8px; background:#fff; color:#172033; font-size:16px; font-family:inherit; line-height:1.3; box-sizing:border-box; z-index:1; }
.auth-inline-input:focus { outline:2px solid var(--mkt-primary); outline-offset:1px; }
.onboarding-dialog [data-actions] { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:14px 0; }
.auth-help { font-size:12px; color:var(--muted); }
.onboarding-dialog [data-refresh] { font-size:12px; padding:7px 10px; }
.onboarding-dialog [data-confirm] { background:var(--canvas); border:1px solid var(--line); border-radius:12px; padding:20px; }
.onboarding-dialog [data-confirm] h3 { margin:0 0 16px; font-size:17px; }
.onboarding-dialog [data-confirm] p { line-height:1.7; font-size:13px; }
.onboarding-dialog [data-identity] { font-weight:600; font-size:18px; overflow-wrap:anywhere; }
.onboarding-dialog [data-bind] { width:100%; min-height:44px; margin-top:12px; }
.onboarding-dialog [data-confirm] label { display:flex; align-items:flex-start; gap:8px; line-height:1.6; font-size:13px; }
.onboarding-dialog [data-confirm] input { flex-shrink:0; margin-top:5px; }
.onboarding-dialog [data-create] { display:grid; gap:16px; }
.onboarding-dialog [data-error] { margin:14px 0 0; font-size:13px; }
.onboarding-dialog [hidden] { display:none !important; }
@media(max-width:600px) { .onboarding-dialog { width:calc(100vw - 16px); max-height:calc(100dvh - 16px); border-radius:14px; } .onboarding-dialog .dialog-head { padding:16px; } .onboarding-dialog .dialog-body { padding:16px; } .auth-steps { gap:8px; } .auth-steps li { gap:5px; font-size:12px; } .auth-steps li span { width:20px; height:20px; } .onboarding-dialog [data-actions] { flex-wrap:wrap; } }
