@font-face {
    font-family: "FangSong_GB2312";
    src: url("/fonts/gb2312-regular") format("truetype");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

@font-face {
    font-family: "Times New Roman Web";
    src: url("/fonts/times-regular") format("truetype");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: "Times New Roman Web";
    src: url("/fonts/times-bold") format("truetype");
    font-style: normal;
    font-weight: 600 700;
    font-display: swap;
}

:root {
    --font-ui: "Times New Roman Web", "Times New Roman", "FangSong_GB2312", "PingFang SC", "Microsoft YaHei", sans-serif;
    --font-display: "Times New Roman Web", "Times New Roman", "FangSong_GB2312", "PingFang SC", serif;

    --bg: #f5f5f7;
    --bg-elevated: #fbfbfd;
    --surface: #ffffff;
    --surface-subtle: #f7f7f9;
    --surface-blue: #f2f7ff;
    --ink: #1d1d1f;
    --ink-soft: #3a3a3c;
    --muted: #6e6e73;
    --muted-light: #8e8e93;
    --line: #e2e2e7;
    --line-strong: #d1d1d6;
    --blue: #0071e3;
    --blue-dark: #0062c4;
    --blue-soft: #eaf3ff;
    --green: #248a3d;
    --green-soft: #edf8f0;
    --red: #d70015;
    --red-soft: #fff0f1;
    --orange: #9a5b00;
    --orange-soft: #fff7e8;

    --shadow-sm: 0 8px 30px rgba(0, 0, 0, 0.055);
    --shadow-md: 0 22px 70px rgba(22, 33, 51, 0.12);
    --shadow-modal: 0 34px 100px rgba(15, 22, 35, 0.22);

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --font-display-title: 48px;
    --line-display-title: 54px;
    --font-page-title: 32px;
    --line-page-title: 38px;
    --font-section-title: 24px;
    --line-section-title: 31px;
    --font-card-title: 20px;
    --line-card-title: 26px;
    --font-nav: 17px;
    --line-nav: 24px;
    --font-large-body: 16px;
    --line-large-body: 26px;
    --font-body: 14px;
    --line-body: 22px;
    --font-meta: 13px;
    --line-meta: 19px;
    --font-note: 12px;
    --line-note: 18px;
    --weight-regular: 400;
    --weight-medium: 500;
    --weight-semibold: 600;
    --weight-bold: 700;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--bg);
}

body {
    min-height: 100%;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-ui);
    font-size: var(--font-body);
    font-weight: 400;
    line-height: var(--line-body);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

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

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button {
    border: 0;
}

a {
    color: inherit;
}

svg {
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.7;
}

[hidden] {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.brand-symbol {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: linear-gradient(145deg, #1682ee, #0058b7);
    color: #fff;
    box-shadow: 0 10px 24px rgba(0, 90, 190, 0.22);
}

.brand-symbol svg {
    width: 27px;
    height: 27px;
    stroke-width: 1.8;
}

/* 登录 */

.controller-login {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 8% 8%, rgba(0, 113, 227, 0.09), transparent 28%),
        var(--bg);
}

.login-layout {
    display: grid;
    min-height: 100vh;
    min-height: 100dvh;
    grid-template-columns: minmax(0, 1.1fr) minmax(440px, 0.9fr);
}

.login-intro {
    position: relative;
    display: flex;
    min-height: 100%;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;
    padding: 48px 7vw 56px;
    border-right: 1px solid rgba(210, 210, 215, 0.76);
    background:
        radial-gradient(circle at 72% 28%, rgba(0, 113, 227, 0.15), transparent 26%),
        radial-gradient(circle at 16% 80%, rgba(90, 200, 250, 0.14), transparent 29%),
        linear-gradient(145deg, #fbfdff 0%, #f1f7fd 58%, #f9fafc 100%);
}

.login-intro::after {
    position: absolute;
    right: -140px;
    bottom: -190px;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 50%;
    box-shadow:
        0 0 0 54px rgba(0, 113, 227, 0.025),
        0 0 0 112px rgba(0, 113, 227, 0.018);
    content: "";
    pointer-events: none;
}

.login-brand {
    position: relative;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 13px;
    align-self: flex-start;
    text-decoration: none;
}

.login-brand strong {
    font-size: var(--font-card-title);
    font-weight: 700;
    line-height: var(--line-card-title);
}

.login-copy {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: auto 0;
    padding: 54px 0;
}

.login-kicker,
.landing-kicker,
.admin-kicker,
.dialog-kicker,
.admin-panel-head > div > span {
    display: block;
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-meta);
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: var(--line-meta);
}

.login-copy h1 {
    margin: 13px 0 20px;
    font-family: var(--font-display);
    font-size: var(--font-display-title);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: var(--line-display-title);
}

.login-copy p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.login-flow {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(140px, 1fr) 46px minmax(140px, 1fr) 46px minmax(140px, 1fr);
    align-items: center;
    max-width: 720px;
}

.login-flow > div {
    display: grid;
    gap: 2px;
}

.login-flow > div > span {
    margin-bottom: 7px;
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-meta);
    font-weight: 700;
    line-height: var(--line-meta);
}

.login-flow strong {
    font-size: var(--font-nav);
    font-weight: 600;
    line-height: var(--line-nav);
}

.login-flow small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.login-flow > i {
    height: 1px;
    margin: 0 12px;
    background: linear-gradient(90deg, var(--line-strong), rgba(209, 209, 214, 0));
}

.login-panel {
    display: grid;
    min-height: 100%;
    place-items: center;
    padding: 48px;
    background: rgba(255, 255, 255, 0.74);
    backdrop-filter: blur(24px) saturate(1.2);
}

.login-card {
    width: min(100%, 440px);
    padding: 42px;
    border: 1px solid rgba(220, 220, 225, 0.9);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: var(--shadow-md);
}

.login-card-head {
    margin-bottom: 28px;
}

.mobile-login-logo {
    display: none;
}

.login-card-head > span:not(.mobile-login-logo) {
    display: block;
    margin-bottom: 5px;
    color: var(--blue);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.login-card-head h2 {
    margin: 0 0 6px;
    font-size: var(--font-page-title);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: var(--line-page-title);
}

.login-card-head p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.login-flashes {
    display: grid;
    gap: 8px;
    margin: -8px 0 18px;
}

.login-flash {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border: 1px solid rgba(215, 0, 21, 0.14);
    border-radius: 12px;
    background: var(--red-soft);
    color: #a30010;
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.login-flash svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
}

.login-form {
    display: grid;
    gap: 17px;
}

.login-form > label {
    display: grid;
    gap: 7px;
}

.login-form > label > span {
    color: var(--ink-soft);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.login-input {
    position: relative;
}

.login-input > svg {
    position: absolute;
    top: 50%;
    left: 14px;
    width: 20px;
    height: 20px;
    color: var(--muted-light);
    transform: translateY(-50%);
    pointer-events: none;
}

.login-input input {
    width: 100%;
    height: 50px;
    padding: 0 46px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    outline: none;
    background: #fff;
    font-size: var(--font-body);
    line-height: var(--line-body);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.login-input input::placeholder {
    color: #aeaeb2;
}

.login-input input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.11);
}

.login-input button {
    position: absolute;
    top: 50%;
    right: 8px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transform: translateY(-50%);
}

.login-input button:hover {
    background: var(--surface-subtle);
}

.login-input button svg {
    width: 20px;
    height: 20px;
}

.login-submit {
    display: inline-flex;
    min-height: 50px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 5px;
    padding: 12px 18px;
    border-radius: 13px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    box-shadow: 0 12px 24px rgba(0, 102, 204, 0.18);
    transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.login-submit:hover {
    background: var(--blue-dark);
    box-shadow: 0 14px 30px rgba(0, 102, 204, 0.24);
    transform: translateY(-1px);
}

.login-submit svg {
    width: 19px;
    height: 19px;
    stroke-width: 2;
}

.login-help {
    display: grid;
    gap: 5px;
    margin-top: 24px;
    padding-top: 19px;
    border-top: 1px solid var(--line);
    color: var(--muted);
}

.login-help span {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.login-help svg {
    width: 18px;
    height: 18px;
}

.login-help small {
    padding-left: 25px;
    color: var(--muted-light);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

/* 聊天工作台 */

.controller-app {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    background: var(--bg);
}

.app-frame {
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 292px minmax(0, 1fr);
}

.project-sidebar {
    position: relative;
    z-index: 40;
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--line);
    background: rgba(248, 248, 250, 0.96);
}

.sidebar-brand-row {
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 12px 18px;
}

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.sidebar-brand .brand-symbol {
    width: 38px;
    height: 38px;
    border-radius: 12px;
}

.sidebar-brand .brand-symbol svg {
    width: 24px;
    height: 24px;
}

.sidebar-brand > span:last-child {
    display: grid;
    min-width: 0;
    gap: 0;
}

.sidebar-brand strong {
    font-size: var(--font-nav);
    font-weight: 700;
    line-height: var(--line-nav);
}

.sidebar-brand small {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-close,
.sidebar-trigger {
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.sidebar-close {
    width: 34px;
    height: 34px;
}

.sidebar-close:hover,
.sidebar-trigger:hover {
    background: #ebebef;
    color: var(--ink);
}

.sidebar-close svg,
.sidebar-trigger svg {
    width: 21px;
    height: 21px;
}

.new-project-form {
    display: grid;
    gap: 7px;
    padding: 8px 16px 17px;
}

.new-project-form > label,
.new-project-form > span,
.sidebar-section-label {
    color: var(--muted);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.new-project-form > input[type="text"] {
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--hairline, rgba(0, 0, 0, 0.12));
    border-radius: 10px;
    background: var(--surface, #fff);
    color: inherit;
    font-size: 14px;
    line-height: 20px;
}

.new-project-form > input[type="text"]:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.16);
}

.new-project-create {
    display: flex;
    height: 42px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 0 12px;
    border: 0;
    border-radius: 11px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.16);
    transition: background 150ms ease, transform 150ms ease;
}

.new-project-create:hover {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.new-project-create svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* 扫码入口降为次要动作：项目由控制端发号新建，扫码只用来拿表头。 */
.new-project-scan {
    display: flex;
    height: 42px;
    align-items: center;
    gap: 9px;
    padding: 0 12px;
    border-radius: 11px;
    background: transparent;
    color: var(--blue);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-decoration: none;
    border: 1px solid rgba(0, 102, 204, 0.28);
    transition: background 150ms ease, transform 150ms ease;
}

.new-project-scan:hover {
    background: rgba(0, 102, 204, 0.08);
    transform: translateY(-1px);
}

.new-project-scan svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
}

/* 新建项目弹窗：项目名称必填，避免主系统那边落一堆“新项目N”。 */
.new-project-dialog {
    width: min(100%, 460px);
}

.new-project-fields {
    display: grid;
    gap: 14px;
    margin-top: 20px;
}

.new-project-fields > label {
    display: grid;
    gap: 6px;
}

.new-project-fields > label > span {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.new-project-fields > label > span > em {
    padding: 1px 7px;
    border-radius: 6px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
}

.new-project-fields input[type="text"],
.new-project-fields textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--hairline, rgba(0, 0, 0, 0.12));
    border-radius: 11px;
    background: var(--surface, #fff);
    color: inherit;
    font-family: inherit;
    font-size: 15px;
    line-height: 21px;
}

.new-project-fields textarea {
    min-height: 74px;
    resize: vertical;
}

.new-project-fields input[type="text"]:focus,
.new-project-fields textarea:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.16);
}

.new-project-hint {
    margin: 0;
    padding: 11px 13px;
    border-radius: 12px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: 1.65;
}

.new-project-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 2px;
}

.new-project-cancel,
.new-project-submit {
    height: 42px;
    padding: 0 20px;
    border: 0;
    border-radius: 11px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: background 150ms ease, transform 150ms ease;
}

.new-project-cancel {
    background: var(--surface-subtle);
    color: var(--ink);
}

.new-project-cancel:hover {
    background: #ebebef;
}

.new-project-submit {
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 102, 204, 0.16);
}

.new-project-submit:hover:not(:disabled) {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.new-project-submit:disabled {
    background: rgba(0, 102, 204, 0.32);
    box-shadow: none;
    cursor: not-allowed;
}

.project-navigation {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
    padding: 0 10px;
}

.sidebar-section-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 9px 9px;
}

.sidebar-section-label em {
    display: grid;
    min-width: 23px;
    height: 21px;
    place-items: center;
    padding: 0 6px;
    border-radius: 999px;
    background: #e8e8ec;
    color: var(--muted);
    font-size: var(--font-note);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-note);
}

.project-list {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 0 0 12px;
    scrollbar-color: #c6c6ca transparent;
    scrollbar-width: thin;
}

.project-item {
    display: grid;
    min-height: 61px;
    grid-template-columns: 34px minmax(0, 1fr) 18px;
    gap: 9px;
    align-items: center;
    margin-bottom: 4px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 13px;
    text-decoration: none;
    transition: background 150ms ease, border-color 150ms ease;
}

.project-item:hover {
    background: #ededf1;
}

.project-item.is-active {
    border-color: rgba(0, 113, 227, 0.13);
    background: var(--blue-soft);
}

.project-item-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 10px;
    background: #e8e8ec;
    color: #68686d;
}

.project-item.is-active .project-item-icon {
    background: rgba(0, 113, 227, 0.12);
    color: var(--blue);
}

.project-item-icon svg {
    width: 19px;
    height: 19px;
}

.project-item-copy {
    display: grid;
    min-width: 0;
    gap: 1px;
}

.project-item-copy strong {
    overflow: hidden;
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-item-copy small {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-item-arrow {
    width: 16px;
    height: 16px;
    color: #aeaeb2;
}

.project-item.is-active .project-item-arrow {
    color: var(--blue);
}

.sidebar-empty {
    display: grid;
    justify-items: center;
    padding: 30px 18px;
    color: var(--muted);
    text-align: center;
}

.sidebar-empty > span {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 15px;
    background: #eaeaee;
}

.sidebar-empty svg {
    width: 25px;
    height: 25px;
}

.sidebar-empty strong {
    color: var(--ink-soft);
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.sidebar-empty small {
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.sidebar-footer {
    display: grid;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--line);
    background: rgba(248, 248, 250, 0.98);
}

.sidebar-admin-link {
    display: flex;
    min-height: 40px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.sidebar-admin-link:hover {
    background: #eaeaee;
}

.sidebar-admin-link svg {
    width: 20px;
    height: 20px;
    color: var(--blue);
}

.account-card {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 34px;
    gap: 9px;
    align-items: center;
    min-height: 52px;
    padding: 7px 8px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.8);
}

.account-avatar,
.admin-avatar,
.admin-user-avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: linear-gradient(145deg, #dcecff, #bcd9f9);
    color: #145a9e;
    font-weight: 700;
}

.account-avatar {
    width: 36px;
    height: 36px;
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.account-copy {
    display: grid;
    min-width: 0;
}

.account-copy strong,
.account-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-copy strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.account-copy small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.account-card > a {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    color: var(--muted);
}

.account-card > a:hover {
    background: var(--surface-subtle);
    color: var(--red);
}

.account-card > a svg {
    width: 19px;
    height: 19px;
}

.sidebar-scrim {
    display: none;
}

.chat-workspace {
    position: relative;
    display: flex;
    min-width: 0;
    height: 100%;
    flex-direction: column;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(0, 113, 227, 0.035), transparent 35%),
        var(--bg-elevated);
}

.chat-header {
    position: relative;
    z-index: 20;
    display: grid;
    min-height: 76px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 10px 24px;
    border-bottom: 1px solid rgba(226, 226, 231, 0.9);
    background: rgba(251, 251, 253, 0.84);
    backdrop-filter: blur(20px) saturate(1.35);
}

.sidebar-trigger {
    width: 40px;
    height: 40px;
}

.chat-heading {
    display: grid;
    min-width: 0;
    gap: 0;
}

.chat-heading-meta {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: var(--font-note);
    font-weight: 500;
    line-height: var(--line-note);
}

.chat-heading > span {
    color: var(--muted);
    font-size: var(--font-note);
    font-weight: 500;
    line-height: var(--line-note);
}

.chat-context-status {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 5px;
    overflow: hidden;
    color: var(--green);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-context-status::before {
    width: 1px;
    height: 10px;
    margin-right: 1px;
    background: var(--line-strong);
    content: "";
}

.chat-context-status i {
    width: 6px;
    height: 6px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 3px rgba(36, 138, 61, 0.1);
}

.chat-heading h1 {
    overflow: hidden;
    margin: 0;
    font-size: var(--font-nav);
    font-weight: 600;
    line-height: var(--line-nav);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-actions {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
}

.project-actions > button {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 11px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.project-actions > button:hover,
.project-actions > button[aria-expanded="true"] {
    background: #ececf0;
    color: var(--ink);
}

.project-actions > button svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
    stroke: none;
}

.project-actions > .modeling-flow-jump {
    display: inline-flex;
    width: auto;
    min-width: 40px;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(0, 113, 227, 0.15);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    font-weight: var(--weight-semibold);
}

.project-actions > .modeling-flow-jump:hover {
    background: #deedff;
    color: var(--blue-dark);
}

.project-actions > .modeling-flow-jump svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
}

.modeling-flow-jump strong {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-bold);
}

.project-menu {
    position: absolute;
    top: 47px;
    right: 0;
    z-index: 30;
    display: grid;
    width: 168px;
    gap: 3px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-sm);
}

.project-menu button {
    display: flex;
    min-height: 39px;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
    font-size: var(--font-body);
    font-weight: 500;
    line-height: var(--line-body);
    text-align: left;
}

.project-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    color: inherit;
    font-size: var(--type-body, 14px);
    line-height: var(--leading-body, 22px);
    font-weight: 500;
    text-decoration: none;
}

.project-menu a:hover {
    background: rgba(0, 0, 0, 0.05);
}

.project-menu a svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.project-menu button:hover {
    background: var(--surface-subtle);
}

.project-menu button.danger {
    color: var(--red);
}

.project-menu button svg {
    width: 19px;
    height: 19px;
}

.header-security {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.header-security svg {
    width: 17px;
    height: 17px;
}

.workspace-flashes {
    position: absolute;
    top: 88px;
    right: 20px;
    z-index: 30;
    display: grid;
    width: min(380px, calc(100% - 40px));
    gap: 8px;
}

.workspace-flash,
.admin-flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid rgba(36, 138, 61, 0.14);
    border-radius: 12px;
    background: rgba(237, 248, 240, 0.97);
    color: var(--green);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    box-shadow: var(--shadow-sm);
}

.workspace-flash.error,
.admin-flash.error {
    border-color: rgba(215, 0, 21, 0.14);
    background: rgba(255, 240, 241, 0.98);
    color: var(--red);
}

.workspace-flash button,
.admin-flash button {
    flex: 0 0 auto;
    background: transparent;
    color: currentColor;
    cursor: pointer;
    font-size: var(--font-card-title);
    line-height: var(--line-card-title);
}

.project-landing {
    display: grid;
    width: min(680px, calc(100% - 40px));
    margin: auto;
    justify-items: center;
    padding: 42px 30px;
    text-align: center;
}

.landing-symbol {
    display: grid;
    width: 86px;
    height: 86px;
    place-items: center;
    margin-bottom: 22px;
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 26px;
    background: linear-gradient(145deg, #fff, #edf5ff);
    color: var(--blue);
    box-shadow: 0 18px 45px rgba(0, 94, 190, 0.1);
}

.landing-symbol svg {
    width: 48px;
    height: 48px;
}

.project-landing h2 {
    margin: 7px 0 9px;
    font-size: var(--font-page-title);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: var(--line-page-title);
}

.project-landing p {
    max-width: 570px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.landing-open-sidebar {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 7px;
    margin-top: 24px;
    padding: 10px 17px;
    border-radius: 12px;
    background: var(--blue);
    border: 0;
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
    text-decoration: none;
}

.landing-open-sidebar svg {
    width: 18px;
    height: 18px;
}

.conversation {
    min-height: 0;
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 40px max(24px, calc((100% - 920px) / 2)) 190px;
    scroll-behavior: smooth;
    scrollbar-color: #c5c5ca transparent;
    scrollbar-width: thin;
}

.modeling-flow-card {
    width: min(820px, 100%);
    margin: 0 auto 30px;
    padding: 20px;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(circle at 92% 10%, rgba(90, 200, 250, 0.13), transparent 28%),
        rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-sm);
}

.modeling-flow-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.modeling-flow-head > div {
    min-width: 0;
}

.modeling-flow-head > div > span {
    color: var(--blue);
    font-size: var(--font-note);
    line-height: var(--line-note);
    font-weight: var(--weight-semibold);
    letter-spacing: 0.08em;
}

.modeling-flow-head h2 {
    margin: 2px 0 3px;
    color: var(--ink);
    font-size: var(--font-card-title);
    line-height: var(--line-card-title);
    font-weight: var(--weight-semibold);
}

.modeling-flow-head p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.modeling-revision {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 999px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    font-weight: var(--weight-medium);
    white-space: nowrap;
}

.modeling-revision strong {
    font-family: var(--font-display);
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-bold);
}

.modeling-flow-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
    margin: 18px 0 14px;
    padding: 0;
    list-style: none;
}

.modeling-flow-steps li {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface-subtle);
    color: var(--muted);
}

.modeling-flow-steps li.is-current {
    border-color: rgba(0, 113, 227, 0.34);
    background: var(--surface-blue);
    color: var(--ink);
}

.modeling-flow-steps li.is-complete {
    border-color: rgba(36, 138, 61, 0.23);
    background: var(--green-soft);
    color: var(--ink);
}

.modeling-flow-steps i {
    display: grid;
    flex: none;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: #fff;
    color: currentColor;
    font-family: var(--font-display);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    font-style: normal;
    font-variant-numeric: tabular-nums;
    font-weight: var(--weight-bold);
    box-shadow: 0 2px 8px rgba(31, 35, 45, 0.06);
}

.modeling-flow-steps li.is-current i {
    background: var(--blue);
    color: #fff;
}

.modeling-flow-steps li.is-complete i {
    background: var(--green);
    color: #fff;
}

.modeling-flow-steps span {
    display: grid;
    min-width: 0;
}

.modeling-flow-steps strong {
    color: inherit;
    font-size: var(--font-body);
    line-height: var(--line-body);
    font-weight: var(--weight-semibold);
}

.modeling-flow-steps small {
    overflow: hidden;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modeling-flow-guidance {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    border-radius: var(--radius-md);
    background: rgba(242, 247, 255, 0.9);
}

.modeling-flow-guidance-icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #fff;
    color: var(--blue);
}

.modeling-flow-guidance-icon svg {
    width: 21px;
    height: 21px;
}

.modeling-flow-guidance > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.modeling-flow-guidance strong {
    color: var(--ink);
    font-size: var(--font-body);
    line-height: var(--line-body);
    font-weight: var(--weight-semibold);
}

.modeling-flow-guidance small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.modeling-flow-guidance button {
    min-height: 34px;
    padding: 7px 12px;
    border-radius: 999px;
    background: #fff;
    color: var(--blue-dark);
    cursor: pointer;
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    font-weight: var(--weight-semibold);
    box-shadow: 0 3px 10px rgba(0, 79, 160, 0.08);
}

.modeling-revision-note {
    margin: 9px 2px 0;
    color: var(--muted-light);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.modeling-flow-card + .chat-welcome {
    margin-top: 36px;
}

.chat-welcome {
    display: grid;
    width: min(720px, 100%);
    margin: min(10vh, 100px) auto 0;
    justify-items: center;
    text-align: center;
}

.welcome-mark {
    display: grid;
    width: 68px;
    height: 68px;
    place-items: center;
    margin-bottom: 18px;
    border: 1px solid rgba(0, 113, 227, 0.12);
    border-radius: 22px;
    background: linear-gradient(145deg, #fff, #eef6ff);
    color: var(--blue);
    box-shadow: 0 14px 34px rgba(0, 100, 200, 0.09);
}

.welcome-mark svg {
    width: 40px;
    height: 40px;
}

.chat-welcome h2 {
    margin: 0 0 8px;
    font-size: var(--font-section-title);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: var(--line-section-title);
}

.chat-welcome > p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.welcome-suggestions {
    display: grid;
    width: min(680px, 100%);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

.welcome-suggestions button {
    display: grid;
    min-height: 66px;
    grid-template-columns: minmax(0, 1fr) 20px;
    gap: 10px;
    align-items: center;
    padding: 11px 13px 11px 15px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink-soft);
    cursor: pointer;
    font-size: var(--font-body);
    font-weight: 500;
    line-height: var(--line-body);
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.welcome-suggestions button:hover {
    border-color: rgba(0, 113, 227, 0.3);
    background: #fff;
    transform: translateY(-1px);
}

.welcome-suggestions svg {
    width: 18px;
    height: 18px;
    color: var(--blue);
}

.plan-filter-list i {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 8px;
    background: #fff;
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-note);
    font-style: normal;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: var(--line-note);
}

.plan-filter-list span {
    display: grid;
    min-width: 0;
}

.plan-filter-list strong {
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.plan-filter-list small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.chat-row {
    display: flex;
    width: 100%;
    gap: 12px;
    margin: 0 auto 28px;
}

.chat-row.user {
    justify-content: flex-end;
}

.message-avatar {
    display: grid;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    place-items: center;
    margin-top: 22px;
    border-radius: 12px;
}

.assistant-avatar {
    background: linear-gradient(145deg, #1682ee, #0058b7);
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 90, 190, 0.16);
}

.assistant-avatar svg {
    width: 24px;
    height: 24px;
}

.message-wrap {
    display: grid;
    max-width: min(760px, calc(100% - 50px));
    gap: 5px;
}

.chat-row.user .message-wrap {
    justify-items: end;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 3px;
}

.chat-row.user .message-meta {
    flex-direction: row-reverse;
}

.message-meta strong {
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.message-meta time {
    color: var(--muted-light);
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.message-bubble {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 6px 18px 18px 18px;
    background: #fff;
    box-shadow: 0 6px 22px rgba(30, 35, 45, 0.035);
    /* 保证选中文字后系统自带的复制气泡菜单可用（iOS 需显式放开）。 */
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

.chat-row.user .message-bubble {
    border-color: var(--blue);
    border-radius: 18px 6px 18px 18px;
    background: var(--blue);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 102, 204, 0.14);
}

.message-bubble > p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.message-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.message-steps span {
    display: inline-flex;
    min-height: 29px;
    align-items: center;
    gap: 6px;
    padding: 5px 9px 5px 6px;
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--ink-soft);
    font-size: var(--font-meta);
    font-weight: 500;
    line-height: var(--line-meta);
}

.message-steps i {
    display: grid;
    width: 19px;
    height: 19px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-note);
    font-style: normal;
    font-weight: 700;
    line-height: var(--line-note);
}

.message-qr-button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 7px;
    margin-top: 13px;
    padding: 8px 12px;
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: background 150ms ease;
}

.message-qr-button:hover {
    background: #dcecff;
}

.message-qr-button svg {
    width: 19px;
    height: 19px;
    stroke-width: 1.5;
}

.chat-row.is-typing {
    animation: message-in 220ms ease both;
}

.typing-dots {
    display: inline-flex;
    min-width: 62px;
    align-items: center;
    gap: 5px;
    padding: 17px 18px;
}

.typing-dots i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8e8e93;
    animation: typing 1.15s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: 120ms;
}

.typing-dots i:nth-child(3) {
    animation-delay: 240ms;
}

@keyframes typing {
    0%,
    70%,
    100% {
        opacity: 0.35;
        transform: translateY(0);
    }
    35% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

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

.composer-shell {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 15;
    padding: 18px max(24px, calc((100% - 920px) / 2)) calc(16px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(251, 251, 253, 0), rgba(251, 251, 253, 0.94) 20%, #fbfbfd 52%);
}

.chat-composer {
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 14px 40px rgba(32, 38, 50, 0.1);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.chat-composer:focus-within {
    border-color: rgba(0, 113, 227, 0.68);
    box-shadow:
        0 14px 42px rgba(32, 38, 50, 0.11),
        0 0 0 4px rgba(0, 113, 227, 0.08);
}

.chat-composer textarea {
    display: block;
    width: 100%;
    min-height: 54px;
    max-height: 154px;
    padding: 15px 17px 6px;
    overflow-y: auto;
    border: 0;
    outline: none;
    background: transparent;
    resize: none;
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.chat-composer textarea::placeholder {
    color: #9a9a9f;
}

.composer-footer {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 8px 8px 17px;
}

.composer-shortcut {
    color: var(--muted-light);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

/* 模型不可用时替换掉快捷键提示，直接把原因摆在输入框旁边。 */
.composer-model-blocked {
    overflow: hidden;
    max-width: 100%;
    color: var(--danger, #d92c20);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.composer-actions {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 7px;
}

.composer-select {
    position: relative;
    display: flex;
    min-width: 0;
    height: 36px;
    align-items: center;
    gap: 5px;
    padding: 0 24px 0 10px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-subtle);
    color: var(--muted);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.composer-select:hover {
    border-color: var(--line-strong);
    background: #f1f1f4;
    color: var(--ink-soft);
}

.composer-select:focus-within {
    border-color: rgba(0, 113, 227, 0.48);
    background: var(--surface-blue);
    color: var(--blue-dark);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.07);
}

.composer-select::after {
    position: absolute;
    top: 50%;
    right: 10px;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: "";
    pointer-events: none;
    transform: translateY(-65%) rotate(45deg);
}

.composer-select > span {
    flex: 0 0 auto;
    color: var(--muted-light);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.composer-select select {
    min-width: 0;
    height: 34px;
    padding: 0;
    overflow: hidden;
    border: 0;
    outline: 0;
    appearance: none;
    background: transparent;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
    text-overflow: ellipsis;
}

.composer-model-select {
    width: min(270px, 31vw);
}

.composer-model-select select {
    width: 100%;
}

.composer-reasoning-select {
    width: 132px;
}

.composer-reasoning-select select {
    flex: 1;
}

.composer-select select:disabled {
    cursor: default;
    opacity: 0.58;
}

.composer-footer button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0, 102, 204, 0.17);
    transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.composer-footer button:hover:not(:disabled) {
    background: var(--blue-dark);
    transform: translateY(-1px);
}

.composer-footer button:disabled {
    background: #d1d1d6;
    box-shadow: none;
    cursor: default;
}

.composer-footer button svg {
    width: 21px;
    height: 21px;
    stroke-width: 2;
}

.composer-send-label {
    display: none;
}

.composer-shell > p {
    margin: 7px 4px 0;
    color: var(--muted-light);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-align: center;
}

/* 二维码弹窗 */

.qr-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 22px;
}

.qr-modal[hidden] {
    display: none;
}

body.has-qr-modal {
    overflow: hidden;
}

.qr-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 22, 27, 0.38);
    cursor: default;
    backdrop-filter: blur(12px) saturate(0.8);
    animation: fade-in 180ms ease both;
}

.qr-dialog {
    position: relative;
    z-index: 1;
    width: min(100%, 490px);
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    overflow-x: hidden;
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-modal);
    animation: modal-in 220ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.qr-close {
    position: absolute;
    top: 14px;
    right: 14px;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-subtle);
    color: var(--muted);
    cursor: pointer;
}

.qr-close:hover {
    background: #ebebef;
    color: var(--ink);
}

.qr-close svg {
    width: 19px;
    height: 19px;
}

.qr-dialog-head {
    display: grid;
    justify-items: center;
    padding: 3px 24px 0;
    text-align: center;
}

.qr-ready-icon {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    margin-bottom: 10px;
    border-radius: 15px;
    background: var(--green-soft);
    color: var(--green);
}

.qr-ready-icon svg {
    width: 27px;
    height: 27px;
}

.dialog-kicker {
    color: var(--green);
    letter-spacing: 0.06em;
}

.qr-dialog-head h2 {
    margin: 4px 0 6px;
    font-size: var(--font-section-title);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: var(--line-section-title);
}

.qr-dialog-head p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.plan-view {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.plan-trust-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--surface-subtle);
}

.plan-trust-grid > div {
    display: grid;
    min-width: 0;
    gap: 2px;
    padding: 12px 10px;
    text-align: center;
}

.plan-trust-grid > div + div {
    border-left: 1px solid var(--line);
}

.plan-trust-grid span {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.plan-trust-grid strong {
    overflow: hidden;
    font-family: var(--font-display);
    font-size: var(--font-body);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: var(--line-body);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-boundary-note {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    padding: 12px 13px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 15px;
    background: var(--surface-blue);
}

.plan-boundary-note > svg {
    width: 25px;
    height: 25px;
    justify-self: center;
    color: var(--blue);
}

.plan-boundary-note > div {
    display: grid;
    gap: 1px;
}

.plan-boundary-note strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.plan-boundary-note span {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.plan-filter-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.plan-filter-head {
    display: flex;
    min-height: 42px;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 11px;
    border-bottom: 1px solid var(--line);
}

.plan-filter-head > span {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.plan-filter-head > em {
    overflow: hidden;
    max-width: 58%;
    padding: 3px 8px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: var(--font-note);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-filter-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 10px;
}

.plan-filter-list > div {
    display: grid;
    min-width: 0;
    grid-template-columns: 24px minmax(0, 1fr);
    align-items: start;
    gap: 8px;
    padding: 7px 8px;
    border-radius: 11px;
    background: var(--surface-subtle);
}

.plan-filter-card > p {
    margin: 0;
    padding: 8px 11px;
    border-top: 1px solid rgba(154, 91, 0, 0.12);
    background: var(--orange-soft);
    color: var(--orange);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.plan-action-list {
    display: grid;
    gap: 7px;
}

.plan-action-item {
    display: grid;
    min-height: 43px;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 9px;
    padding: 7px 10px 7px 8px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}

.plan-action-item > i {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-note);
    font-style: normal;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: var(--line-note);
}

.plan-action-item > span {
    display: grid;
    min-width: 0;
}

.plan-action-item strong {
    overflow: hidden;
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-action-item small {
    overflow: hidden;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.plan-action-item > em {
    color: var(--green);
    font-size: var(--font-note);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-note);
}

.plan-json-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.plan-json-card summary {
    display: flex;
    min-height: 55px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 13px;
    cursor: pointer;
    list-style: none;
}

.plan-json-card summary::-webkit-details-marker {
    display: none;
}

.plan-json-card summary > span {
    display: grid;
}

.plan-json-card summary strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.plan-json-card summary small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.plan-json-card summary svg {
    width: 19px;
    height: 19px;
    color: var(--muted);
    transition: transform 160ms ease;
}

.plan-json-card[open] summary svg {
    transform: rotate(180deg);
}

.plan-json-card pre {
    max-height: 230px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    background: #10151d;
    color: #dce9f6;
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
    tab-size: 2;
    white-space: pre-wrap;
    word-break: break-word;
}

.plan-primary-action {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 11px 9px 15px;
    border-radius: 16px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 96, 204, 0.18);
}

.plan-primary-action > span {
    display: grid;
    text-align: left;
}

.plan-primary-action strong {
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.plan-primary-action small {
    color: rgba(255, 255, 255, 0.76);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.plan-primary-action > svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.qr-credential-view {
    display: grid;
    justify-items: center;
    margin-top: 20px;
}

.qr-credential-view[hidden] {
    display: none;
}

.qr-credential-status {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.qr-credential-status i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.09);
    animation: qr-live-pulse 1.8s ease-in-out infinite;
}

.qr-code-frame {
    display: grid;
    width: 244px;
    height: 244px;
    margin: 20px auto 16px;
    place-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #fff;
    box-shadow: inset 0 0 0 6px #fafafa;
}

.qr-code-frame svg,
.qr-code-frame img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.qr-loading {
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.qr-scan-copy {
    margin: -4px 0 13px;
    color: var(--ink-soft);
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
    text-align: center;
}

.qr-fullscreen-action {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
    padding: 10px 14px;
    border-radius: 12px;
    background: var(--blue);
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.qr-fullscreen-action:hover {
    background: var(--blue-dark);
}

.qr-fullscreen-action svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.qr-step-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin: 0 auto 18px;
}

.qr-step-list span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--ink-soft);
    font-size: var(--font-note);
    font-weight: 500;
    line-height: var(--line-note);
}

.qr-step-list i {
    color: var(--blue);
    font-family: var(--font-display);
    font-style: normal;
    font-weight: 700;
}

.qr-credential-meta {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0 0 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface-subtle);
}

.qr-credential-meta > div {
    display: grid;
    gap: 1px;
    padding: 10px 12px;
}

.qr-credential-meta > div + div {
    border-left: 1px solid var(--line);
}

.qr-credential-meta dt {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-credential-meta dd {
    margin: 0;
    overflow: hidden;
    font-family: var(--font-display);
    font-size: var(--font-meta);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: var(--line-meta);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qr-read-boundary {
    width: 100%;
    margin-bottom: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(154, 91, 0, 0.14);
    border-radius: 13px;
    background: var(--orange-soft);
    color: var(--orange);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-dialog-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 15px;
    border-top: 1px solid var(--line);
}

.qr-dialog-foot > span {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-dialog-foot button {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.qr-dialog-foot button svg {
    width: 18px;
    height: 18px;
}

.planning-status-list {
    display: grid;
    min-width: min(310px, 72vw);
    gap: 7px;
}

.planning-status-list span {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    transition: color 180ms ease;
}

.planning-status-list i {
    display: grid;
    width: 20px;
    height: 20px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: #fff;
}

.planning-status-list i::before {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--line-strong);
    content: "";
}

.planning-status-list span.is-active {
    color: var(--blue);
    font-weight: 600;
}

.planning-status-list span.is-active i {
    border-color: rgba(0, 113, 227, 0.25);
    background: var(--blue-soft);
}

.planning-status-list span.is-active i::before {
    background: var(--blue);
    animation: qr-live-pulse 1.2s ease-in-out infinite;
}

.planning-status-list span.is-complete {
    color: var(--ink-soft);
}

.planning-status-list span.is-complete i {
    border-color: var(--green);
    background: var(--green-soft);
}

.planning-status-list span.is-complete i::before {
    width: 8px;
    height: 5px;
    border: solid var(--green);
    border-width: 0 0 2px 2px;
    border-radius: 0;
    background: transparent;
    transform: rotate(-45deg) translate(1px, -1px);
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.controller-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 140;
    max-width: min(420px, calc(100% - 44px));
    padding: 11px 14px;
    border: 1px solid rgba(36, 138, 61, 0.16);
    border-radius: 12px;
    background: rgba(237, 248, 240, 0.98);
    color: var(--green);
    font-size: var(--font-meta);
    font-weight: 500;
    line-height: var(--line-meta);
    box-shadow: var(--shadow-sm);
}

/* 提示条收紧(2026-09-01):手机上长文案会折成一大块糊住半屏,
   限宽限行,超出省略号——完整信息本来就不该塞在临时提示里。 */
@media (max-width: 720px) {
    .controller-toast {
        top: 12px;
        max-width: calc(100% - 28px);
        padding: 9px 12px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

.controller-toast.error {
    border-color: rgba(215, 0, 21, 0.16);
    background: rgba(255, 240, 241, 0.98);
    color: var(--red);
}

/* 管理中心 */

.controller-admin {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 92% 0%, rgba(0, 113, 227, 0.055), transparent 24%),
        var(--bg);
}

.admin-header {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 76px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 11px max(28px, calc((100% - 1280px) / 2));
    border-bottom: 1px solid rgba(226, 226, 231, 0.9);
    background: rgba(250, 250, 252, 0.86);
    backdrop-filter: blur(22px) saturate(1.35);
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.admin-brand .brand-symbol {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.admin-brand .brand-symbol svg {
    width: 25px;
    height: 25px;
}

.admin-brand > span:last-child {
    display: grid;
}

.admin-brand strong {
    font-size: var(--font-nav);
    font-weight: 700;
    line-height: var(--line-nav);
}

.admin-brand small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-header-actions > a {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 6px;
    padding: 8px 11px;
    border-radius: 10px;
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.admin-header-actions > a:hover {
    background: #ececf0;
}

.admin-header-actions > a svg {
    width: 19px;
    height: 19px;
}

.admin-avatar {
    width: 38px;
    height: 38px;
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.admin-shell {
    width: min(1280px, calc(100% - 56px));
    margin: 0 auto;
    padding: 38px 0 64px;
}

.admin-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 25px;
}

.admin-page-head h1 {
    margin: 5px 0 4px;
    font-size: var(--font-page-title);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: var(--line-page-title);
}

.admin-page-head p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.admin-tabs {
    display: flex;
    gap: 5px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.75);
}

.admin-tabs a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border-radius: 9px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.admin-tabs a:hover {
    color: var(--ink);
}

.admin-tabs a.is-active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
}

.admin-tabs svg {
    width: 19px;
    height: 19px;
}

.admin-flashes {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
}

.admin-flash {
    box-shadow: none;
}

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

.admin-metrics article {
    display: grid;
    min-height: 128px;
    align-content: center;
    gap: 2px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 24px rgba(25, 31, 42, 0.035);
}

.admin-metrics span,
.admin-metrics small {
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.admin-metrics strong {
    margin: 2px 0;
    font-family: var(--font-display);
    font-size: var(--font-page-title);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: var(--line-page-title);
}

.admin-panel {
    margin-bottom: 18px;
    padding: 23px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 32px rgba(25, 31, 42, 0.04);
}

.admin-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 19px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.admin-panel-head h2 {
    margin: 3px 0 0;
    font-size: var(--font-card-title);
    font-weight: 600;
    line-height: var(--line-card-title);
}

.admin-panel-head > p {
    max-width: 440px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    text-align: right;
}

.admin-create-user {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 0.8fr 0.75fr auto;
    gap: 11px;
    align-items: end;
}

.admin-create-user label,
.admin-user-row label,
.global-settings-form > label {
    display: grid;
    gap: 6px;
}

.admin-create-user label > span,
.admin-user-row label > span,
.global-settings-form > label > span {
    color: var(--muted);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.admin-create-user input,
.admin-create-user select,
.admin-user-row input,
.admin-user-row select,
.global-settings-form select {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    background: #fff;
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.admin-create-user input:focus,
.admin-create-user select:focus,
.admin-user-row input:focus,
.admin-user-row select:focus,
.global-settings-form select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09);
}

.admin-create-user > button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    white-space: nowrap;
}

.admin-create-user > button:hover,
.save-settings:hover {
    background: var(--blue-dark);
}

.admin-create-user > button svg {
    width: 18px;
    height: 18px;
}

.users-panel {
    padding-bottom: 10px;
}

.admin-user-list {
    display: grid;
}

.admin-user-row {
    display: grid;
    grid-template-columns: minmax(230px, 1.25fr) minmax(150px, 0.85fr) 130px 120px minmax(150px, 0.8fr) 70px;
    gap: 11px;
    align-items: end;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.admin-user-row:last-child {
    border-bottom: 0;
}

.admin-user-identity {
    display: grid;
    min-width: 0;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    padding-bottom: 1px;
}

.admin-user-avatar {
    width: 42px;
    height: 42px;
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.admin-user-identity > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.admin-user-identity strong,
.admin-user-identity small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.admin-user-identity strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.admin-user-identity small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.admin-user-identity em {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--red-soft);
    color: var(--red);
    font-size: var(--font-note);
    font-style: normal;
    font-weight: 600;
    line-height: var(--line-note);
}

.admin-user-identity em.active {
    background: var(--green-soft);
    color: var(--green);
}

.save-user {
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.save-user:hover {
    border-color: rgba(0, 113, 227, 0.35);
    color: var(--blue);
}

.settings-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 18px;
    align-items: start;
}

.settings-panel {
    margin: 0;
}

.global-settings-form {
    display: grid;
    gap: 18px;
}

.global-settings-form > label {
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: center;
}

.global-settings-form > label > span {
    grid-column: 1;
    grid-row: 1;
    color: var(--ink-soft);
}

.global-settings-form > label > select {
    grid-column: 2;
    grid-row: 1;
}

.global-settings-form > label > small {
    grid-column: 2;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.settings-notice {
    display: flex;
    gap: 11px;
    margin-top: 2px;
    padding: 13px 14px;
    border: 1px solid rgba(0, 113, 227, 0.13);
    border-radius: 13px;
    background: var(--blue-soft);
    color: var(--blue-dark);
}

.settings-notice > svg {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    margin-top: 1px;
}

.settings-notice > span {
    display: grid;
}

.settings-notice strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.settings-notice small {
    color: #4f6f8f;
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.save-settings {
    min-height: 44px;
    justify-self: end;
    padding: 10px 18px;
    border-radius: 11px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}

.settings-guide {
    display: grid;
    padding: 25px;
    border: 1px solid rgba(0, 113, 227, 0.11);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, #f7fbff, #eef6ff);
}

.settings-guide-icon {
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    margin-bottom: 17px;
    border-radius: 16px;
    background: #fff;
    color: var(--blue);
    box-shadow: 0 8px 22px rgba(0, 96, 190, 0.08);
}

.settings-guide-icon svg {
    width: 32px;
    height: 32px;
}

.settings-guide h3 {
    margin: 0 0 7px;
    font-size: var(--font-card-title);
    font-weight: 600;
    line-height: var(--line-card-title);
}

.settings-guide p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.settings-guide ul {
    display: grid;
    gap: 8px;
    margin: 19px 0 0;
    padding: 17px 0 0 20px;
    border-top: 1px solid rgba(0, 113, 227, 0.11);
    color: var(--ink-soft);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

/* 放行清单：一家供应商一组，勾选放行、单选默认。 */
.enabled-model-groups {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.enabled-model-group {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid rgba(0, 113, 227, 0.14);
    border-radius: 12px;
}

.enabled-model-group.is-blocked {
    background: rgba(142, 142, 147, 0.06);
    opacity: 0.72;
}

.enabled-model-group legend {
    padding: 0 6px;
    color: var(--ink);
    font-size: var(--font-meta);
    font-weight: 600;
}

.enabled-model-blocked {
    margin-left: 8px;
    color: var(--danger, #d92c20);
    font-weight: 400;
}

.enabled-model-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 0;
    font-size: var(--font-meta);
}

.enabled-model-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.enabled-model-default {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-light);
    white-space: nowrap;
}

.enabled-model-empty {
    margin: 4px 0 0;
    color: var(--muted-light);
    font-size: var(--font-note);
}

.provider-active-summary {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 14px;
    border: 1px solid rgba(52, 199, 89, 0.18);
    border-radius: 13px;
    background: rgba(52, 199, 89, 0.07);
}

.provider-active-summary.is-warning {
    border-color: rgba(255, 149, 0, 0.2);
    background: rgba(255, 149, 0, 0.08);
}

.provider-status-dot {
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #34c759;
    box-shadow: 0 0 0 5px rgba(52, 199, 89, 0.12);
}

.provider-active-summary.is-warning .provider-status-dot {
    background: #ff9500;
    box-shadow: 0 0 0 5px rgba(255, 149, 0, 0.12);
}

.provider-active-summary > span:last-child {
    display: grid;
    gap: 2px;
}

.provider-active-summary strong {
    color: var(--ink-soft);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.provider-active-summary small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.provider-connections-section {
    margin-top: 18px;
}

.provider-connections-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 15px;
}

.provider-connections-heading span {
    color: var(--blue);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.provider-connections-heading h2 {
    margin: 3px 0 0;
    font-size: 24px;
    line-height: 30px;
}

.provider-connections-heading p {
    max-width: 560px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
    text-align: right;
}

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

.provider-connection-card {
    display: grid;
    gap: 15px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 32px rgba(25, 31, 42, 0.045);
}

.provider-card-head {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 11px;
    align-items: center;
}

.provider-card-mark {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 13px;
    background: #111;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
}

.provider-deepseek .provider-card-mark {
    background: linear-gradient(145deg, #3977f6, #2451bd);
}

.provider-kimi .provider-card-mark {
    background: linear-gradient(145deg, #171719, #4b4b52);
}

.provider-card-title {
    display: grid;
    min-width: 0;
}

.provider-card-title strong {
    color: var(--ink);
    font-size: 16px;
    line-height: 22px;
}

.provider-card-title small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.provider-connection-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.provider-connection-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8e8e93;
}

.provider-connection-status.status-ready {
    background: rgba(52, 199, 89, 0.1);
    color: #227a3c;
}

.provider-connection-status.status-ready i {
    background: #34c759;
}

.provider-connection-status.status-error {
    background: rgba(255, 59, 48, 0.09);
    color: #bf2f28;
}

.provider-connection-status.status-error i {
    background: #ff3b30;
}

.provider-connection-status.status-configured {
    background: rgba(255, 149, 0, 0.1);
    color: #9b5b00;
}

.provider-connection-status.status-configured i {
    background: #ff9500;
}

.provider-card-description {
    min-height: 40px;
    margin: -3px 0 0;
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.provider-connection-card > label:not(.provider-clear-key) {
    display: grid;
    gap: 6px;
}

.provider-model-field {
    display: grid;
    gap: 6px;
}

.provider-connection-card > label > span,
.provider-model-field > span {
    color: var(--ink-soft);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.provider-connection-card input[type="url"],
.provider-connection-card input[type="password"],
.provider-connection-card input[type="text"] {
    width: 100%;
    height: 43px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    background: #fff;
    color: var(--ink);
    font: inherit;
}

.provider-model-picker {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 43px;
    gap: 8px;
}

.provider-model-picker select {
    width: 100%;
    min-width: 0;
    height: 43px;
    padding: 0 36px 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    outline: none;
    background-color: #fff;
    color: var(--ink);
    cursor: pointer;
    font: inherit;
}

.provider-model-add {
    display: grid;
    width: 43px;
    height: 43px;
    padding: 0;
    place-items: center;
    border: 1px solid rgba(0, 113, 227, 0.2);
    border-radius: 11px;
    background: rgba(0, 113, 227, 0.08);
    color: var(--blue);
    cursor: pointer;
    font-size: 25px;
    font-weight: 400;
    line-height: 1;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.provider-model-add:hover {
    border-color: rgba(0, 113, 227, 0.36);
    background: rgba(0, 113, 227, 0.13);
}

.provider-model-add:active {
    transform: scale(0.96);
}

.provider-model-add[aria-expanded="true"] {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

.provider-model-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: 13px;
    background: rgba(0, 113, 227, 0.045);
}

.provider-model-composer[hidden] {
    display: none;
}

.provider-model-composer button {
    min-height: 43px;
    padding: 0 13px;
    border: 1px solid var(--blue);
    border-radius: 10px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.provider-model-composer button.quiet {
    border-color: transparent;
    background: transparent;
    color: var(--muted);
}

.provider-connection-card input:focus,
.provider-model-picker select:focus,
.provider-model-add:focus-visible,
.provider-model-composer button:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09);
}

.provider-connection-card label small,
.provider-model-field > small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.provider-model-field > small.provider-model-reasoning {
    width: fit-content;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(0, 113, 227, 0.07);
    color: #075fae;
    font-weight: 600;
}

.provider-clear-key {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    color: var(--red);
    cursor: pointer;
    font-size: var(--font-note);
}

.provider-clear-key input {
    width: 16px;
    height: 16px;
    accent-color: var(--red);
}

.provider-test-message {
    margin: 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--surface-subtle);
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.provider-test-message.status-ready {
    background: rgba(52, 199, 89, 0.08);
    color: #227a3c;
}

.provider-test-message.status-error {
    background: rgba(255, 59, 48, 0.08);
    color: #bf2f28;
}

.provider-card-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding-top: 2px;
}

.provider-card-actions > span {
    display: flex;
    gap: 10px;
    margin-right: auto;
}

.provider-card-actions a {
    color: var(--blue);
    font-size: var(--font-note);
    text-decoration: none;
}

.provider-card-actions button {
    min-height: 38px;
    padding: 8px 12px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: #fff;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.provider-card-actions button.primary {
    border-color: var(--blue);
    background: var(--blue);
    color: #fff;
}

@media (max-width: 920px) {
    .provider-connection-grid {
        grid-template-columns: 1fr;
    }

    .provider-connections-heading {
        align-items: start;
        flex-direction: column;
        gap: 6px;
    }

    .provider-connections-heading p {
        text-align: left;
    }
}

@media (max-width: 620px) {
    .provider-card-head {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .provider-connection-status {
        grid-column: 1 / -1;
        justify-self: start;
    }

    .provider-card-actions {
        align-items: stretch;
        flex-wrap: wrap;
    }

    .provider-card-actions > span {
        width: 100%;
    }

    .provider-model-composer {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .provider-model-composer input {
        grid-column: 1 / -1;
    }
}

/* 系统提示词 */

.prompt-admin {
    display: grid;
    gap: 18px;
}

.prompt-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(390px, 0.92fr);
    gap: 18px;
    align-items: start;
}

.prompt-admin-grid.is-prompt-only {
    grid-template-columns: minmax(0, 1fr);
}

.prompt-admin-grid > .admin-panel {
    margin: 0;
}

.prompt-editor-panel,
.schema-scanner-panel {
    min-width: 0;
}

.prompt-field,
.schema-paste-field,
.schema-json-field {
    display: grid;
    gap: 6px;
}

.prompt-field + .prompt-field {
    margin-top: 18px;
}

.prompt-category {
    margin: 22px 0 4px;
    font-size: var(--font-meta);
    font-weight: 700;
    color: var(--ink-soft);
    border-top: 1px solid var(--line, #e3e3e8);
    padding-top: 14px;
}

.prompt-field > span,
.schema-paste-field > span,
.schema-json-field > span,
.schema-edit-grid label > span {
    color: var(--ink-soft);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.prompt-field > small,
.schema-json-field > small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.prompt-field textarea,
.schema-paste-field textarea,
.schema-json-field textarea,
.final-prompt-panel textarea {
    width: 100%;
    padding: 12px 13px;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    outline: none;
    background: #fff;
    font-family: var(--font-ui);
    font-size: var(--font-body);
    line-height: var(--line-body);
    tab-size: 2;
}

.prompt-field textarea:focus,
.schema-paste-field textarea:focus,
.schema-json-field textarea:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09);
}

.prompt-editor-panel > .save-settings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
}

.protocol-preview {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.protocol-preview summary {
    padding: 11px 13px;
    color: var(--ink-soft);
    cursor: pointer;
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.protocol-preview pre {
    max-height: 420px;
    margin: 0;
    padding: 14px;
    overflow: auto;
    border-top: 1px solid var(--line);
    background: #fff;
    color: var(--ink-soft);
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
    white-space: pre-wrap;
    word-break: break-word;
}

.scanner-notice {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
    padding: 12px 13px;
    border: 1px solid rgba(36, 138, 61, 0.14);
    border-radius: 12px;
    background: var(--green-soft);
    color: var(--green);
}

.scanner-notice svg {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
}

.scanner-notice > span {
    display: grid;
}

.scanner-notice strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.scanner-notice small {
    color: #53765b;
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-camera {
    position: relative;
    display: grid;
    aspect-ratio: 16 / 10;
    place-items: center;
    overflow: hidden;
    margin-bottom: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #111820;
}

.schema-camera video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.schema-camera > span {
    position: absolute;
    right: 12px;
    bottom: 10px;
    left: 12px;
    padding: 7px 9px;
    border-radius: 9px;
    background: rgba(15, 20, 28, 0.72);
    color: #fff;
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-align: center;
    backdrop-filter: blur(8px);
}

.schema-scan-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.schema-scan-actions button,
.schema-scan-actions label,
.schema-decode-button,
.schema-import-preview > button,
.schema-edit-footer button {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    padding: 8px 13px;
    border: 1px solid rgba(0, 113, 227, 0.18);
    border-radius: 10px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.schema-scan-actions button:hover,
.schema-scan-actions label:hover,
.schema-decode-button:hover,
.schema-edit-footer button:hover {
    background: #dcecff;
}

.schema-scan-actions .secondary {
    border-color: var(--line);
    background: #fff;
    color: var(--muted);
}

.schema-camera-fallback {
    margin: 9px 0 14px;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-paste-field {
    margin-top: 4px;
}

.schema-paste-field textarea {
    min-height: 86px;
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
    word-break: break-all;
}

.schema-decode-button {
    width: 100%;
    margin-top: 9px;
    border-color: transparent;
    background: var(--blue);
    color: #fff;
}

.schema-decode-button:hover,
.schema-import-preview > button:hover {
    background: var(--blue-dark);
}

.schema-scan-status {
    min-height: var(--line-meta);
    margin: 9px 0 0;
    color: var(--muted);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.schema-scan-status.is-error {
    color: var(--red);
}

.schema-scan-status.is-success {
    color: var(--green);
}

.schema-import-preview {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: 14px;
    background: var(--surface-blue);
}

.schema-import-preview > div:first-child {
    display: grid;
    gap: 2px;
}

.schema-import-preview > div:first-child > span {
    color: var(--blue);
    font-size: var(--font-note);
    font-weight: 600;
    line-height: var(--line-note);
}

.schema-import-preview > div:first-child > strong {
    font-size: var(--font-nav);
    font-weight: 600;
    line-height: var(--line-nav);
}

.schema-import-preview > div:first-child > small,
.schema-import-preview > p {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-import-preview > p {
    margin: 8px 0 0;
    color: var(--orange);
}

.schema-preview-table-wrap {
    max-height: 250px;
    margin: 12px 0;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

.schema-preview-table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-align: left;
}

.schema-preview-table-wrap th,
.schema-preview-table-wrap td {
    padding: 7px 9px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

.schema-preview-table-wrap th {
    position: sticky;
    top: 0;
    background: var(--surface-subtle);
    color: var(--muted);
    font-weight: 600;
}

.schema-import-preview > button {
    width: 100%;
    border-color: transparent;
    background: var(--blue);
    color: #fff;
}

.schema-directory-panel,
.final-prompt-panel {
    margin: 0;
}

.schema-directory {
    display: grid;
    gap: 10px;
}

.schema-directory-item {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.schema-directory-item.is-disabled {
    background: var(--surface-subtle);
    opacity: 0.78;
}

.schema-directory-item summary {
    display: grid;
    min-height: 68px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
}

.schema-directory-item summary::-webkit-details-marker {
    display: none;
}

.schema-source-badge {
    display: inline-flex;
    min-width: 54px;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    border-radius: 9px;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-size: var(--font-note);
    font-weight: 700;
    line-height: var(--line-note);
}

.schema-source-badge.mysql {
    background: var(--green-soft);
    color: var(--green);
}

.schema-directory-item summary > span:nth-child(2) {
    display: grid;
    min-width: 0;
}

.schema-directory-item summary strong,
.schema-directory-item summary small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schema-directory-item summary strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.schema-directory-item summary small,
.schema-directory-item summary em {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-directory-item summary em {
    padding: 4px 8px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
    font-style: normal;
    font-weight: 600;
}

.schema-directory-item.is-disabled summary em {
    background: #ececf0;
    color: var(--muted);
}

.schema-directory-item form {
    padding: 16px;
    border-top: 1px solid var(--line);
}

.schema-edit-grid {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) 130px minmax(180px, 1fr) 170px;
    gap: 10px;
    margin-bottom: 13px;
}

.schema-edit-grid label {
    display: grid;
    gap: 6px;
}

.schema-edit-grid input,
.schema-edit-grid select {
    width: 100%;
    height: 40px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    background: #fff;
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.schema-edit-grid input:focus,
.schema-edit-grid select:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.09);
}

.schema-json-field textarea {
    min-height: 220px;
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-edit-footer {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto auto;
    gap: 12px;
    align-items: center;
    margin-top: 12px;
}

.schema-edit-footer code {
    overflow: hidden;
    color: var(--muted);
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.schema-edit-footer > span {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.schema-empty-state {
    display: grid;
    min-height: 150px;
    place-content: center;
    text-align: center;
}

.schema-empty-state strong {
    font-size: var(--font-nav);
    font-weight: 600;
    line-height: var(--line-nav);
}

.schema-empty-state p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: var(--font-body);
    line-height: var(--line-body);
}

.final-prompt-panel textarea {
    min-height: 460px;
    resize: vertical;
    background: #101820;
    color: #eaf1f8;
    font-family: var(--font-display);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

@media (max-width: 1120px) {
    .prompt-admin-grid {
        grid-template-columns: 1fr;
    }

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

/* 响应式 */

@media (min-width: 861px) {
    .sidebar-close {
        visibility: hidden;
    }

    .sidebar-trigger {
        display: none;
    }

    .chat-header {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .landing-open-sidebar {
        display: none;
    }
}

@media (max-width: 1180px) {
    .login-layout {
        grid-template-columns: minmax(0, 1fr) minmax(410px, 0.85fr);
    }

    .login-intro {
        padding-right: 5vw;
        padding-left: 5vw;
    }

    .login-flow {
        grid-template-columns: repeat(3, minmax(110px, 1fr));
        gap: 20px;
    }

    .login-flow > i {
        display: none;
    }

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

    .admin-create-user > button {
        min-width: 130px;
        justify-self: start;
    }

    .admin-user-row {
        grid-template-columns: minmax(220px, 1fr) repeat(2, minmax(130px, 0.65fr));
        align-items: end;
    }

    .admin-user-identity {
        grid-row: span 2;
    }

    .save-user {
        width: 90px;
    }
}

@media (max-width: 860px) {
    .login-layout {
        display: block;
    }

    .login-intro {
        display: none;
    }

    .login-panel {
        min-height: 100vh;
        min-height: 100dvh;
        padding: 24px;
        background:
            radial-gradient(circle at 50% 5%, rgba(0, 113, 227, 0.11), transparent 30%),
            var(--bg);
    }

    .login-card {
        padding: 32px 28px;
        border-radius: 26px;
    }

    .mobile-login-logo {
        display: grid;
        margin-bottom: 20px;
    }

    .login-card-head h2 {
        font-size: var(--font-section-title);
        line-height: var(--line-section-title);
    }

    .app-frame {
        display: block;
    }

    .project-sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(88vw, 330px);
        transform: translateX(-104%);
        transition: transform 220ms cubic-bezier(0.2, 0.7, 0.25, 1);
        box-shadow: 24px 0 70px rgba(20, 28, 42, 0.14);
    }

    .controller-app.is-sidebar-open .project-sidebar {
        transform: translateX(0);
    }

    .sidebar-scrim {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: block;
        visibility: hidden;
        background: rgba(20, 22, 27, 0.28);
        opacity: 0;
        cursor: default;
        backdrop-filter: blur(4px);
        transition: opacity 200ms ease, visibility 200ms ease;
    }

    .controller-app.is-sidebar-open .sidebar-scrim {
        visibility: visible;
        opacity: 1;
    }

    .chat-workspace {
        width: 100%;
    }

    .chat-header {
        min-height: 68px;
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 8px 13px;
    }

    .conversation {
        padding: 26px 16px 180px;
    }

    .modeling-flow-card {
        padding: 16px;
    }

    .modeling-flow-steps {
        grid-template-columns: 1fr;
    }

    .modeling-flow-steps small {
        white-space: normal;
    }

    .modeling-flow-guidance {
        grid-template-columns: 34px minmax(0, 1fr);
    }

    .modeling-flow-guidance button {
        grid-column: 2;
        justify-self: start;
    }

    .chat-welcome {
        margin-top: 5vh;
    }

    .composer-shell {
        padding-right: 12px;
        padding-left: 12px;
    }

    .project-landing {
        padding-right: 18px;
        padding-left: 18px;
    }

    .admin-header {
        min-height: 68px;
        padding: 9px 16px;
    }

    .admin-brand small,
    .admin-header-actions > a {
        display: none;
    }

    .admin-shell {
        width: min(100% - 28px, 720px);
        padding-top: 25px;
    }

    .admin-page-head {
        display: grid;
        align-items: start;
        gap: 18px;
    }

    .admin-page-head h1 {
        font-size: var(--font-section-title);
        line-height: var(--line-section-title);
    }

    .admin-tabs {
        width: 100%;
    }

    .admin-tabs a {
        flex: 1;
        justify-content: center;
    }

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

    .admin-metrics article {
        min-height: 104px;
    }

    .admin-create-user,
    .admin-user-row {
        grid-template-columns: 1fr 1fr;
    }

    .admin-user-identity {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-bottom: 4px;
    }

    .save-user {
        width: 100%;
    }

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

    .settings-guide {
        grid-row: 1;
    }

    .schema-edit-footer {
        grid-template-columns: 1fr auto;
    }

    .schema-edit-footer code {
        grid-column: 1 / -1;
    }
}

@media (max-width: 620px) {
    .login-panel {
        padding: 16px;
    }

    .login-card {
        padding: 28px 22px;
        border-radius: 23px;
    }

    .login-card-head {
        margin-bottom: 24px;
    }

    .sidebar-brand-row {
        min-height: 70px;
    }

    .chat-heading > span {
        display: none;
    }

    .chat-heading-meta > span:first-child,
    .chat-context-status::before {
        display: none;
    }

    .chat-context-status {
        max-width: 48vw;
    }

    .modeling-flow-jump span {
        display: none;
    }

    .project-actions > .modeling-flow-jump {
        padding: 0;
    }

    .header-security {
        padding: 6px 8px;
    }

    .header-security {
        font-size: 0;
    }

    .header-security svg {
        width: 20px;
        height: 20px;
    }

    .welcome-mark {
        width: 60px;
        height: 60px;
        border-radius: 19px;
    }

    .modeling-flow-head {
        display: grid;
    }

    .modeling-revision {
        justify-self: start;
    }

    .chat-welcome h2,
    .project-landing h2 {
        font-size: var(--font-section-title);
        line-height: var(--line-section-title);
    }

    .chat-welcome > p,
    .project-landing p {
        font-size: var(--font-body);
        line-height: var(--line-body);
    }

    .welcome-suggestions {
        grid-template-columns: 1fr;
        margin-top: 22px;
    }

    .welcome-suggestions button {
        min-height: 54px;
    }

    .plan-filter-list {
        grid-template-columns: 1fr;
    }

    .chat-row {
        gap: 8px;
        margin-bottom: 23px;
    }

    .message-avatar {
        width: 32px;
        height: 32px;
        border-radius: 10px;
    }

    .assistant-avatar svg {
        width: 21px;
        height: 21px;
    }

    .message-wrap {
        max-width: calc(100% - 40px);
    }

    .chat-row.user .message-wrap {
        max-width: 88%;
    }

    .message-bubble {
        padding: 12px 13px;
    }

    .message-bubble > p {
        font-size: var(--font-body);
        line-height: var(--line-body);
    }

    .message-steps {
        display: grid;
    }

    .message-steps span {
        justify-self: start;
    }

    .composer-footer {
        padding-left: 8px;
    }

    .composer-shortcut {
        display: none;
    }

    .composer-actions {
        width: 100%;
    }

    .composer-model-select {
        width: auto;
        flex: 1 1 auto;
    }

    .composer-reasoning-select {
        width: 112px;
        flex: 0 0 112px;
    }

    .composer-select > span {
        display: none;
    }

    .composer-shell > p {
        display: none;
    }

    .qr-modal {
        align-items: end;
        padding: 0;
    }

    .qr-dialog {
        width: 100%;
        max-height: calc(100dvh - 22px);
        padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
        border-radius: 26px 26px 0 0;
    }

    .qr-dialog-head {
        padding-right: 28px;
        padding-left: 28px;
    }

    .qr-ready-icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .plan-view {
        margin-top: 18px;
    }

    .plan-action-list {
        max-height: 205px;
        padding-right: 2px;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    .plan-primary-action {
        position: static;
    }

    .plan-json-card[open] + .plan-primary-action {
        position: static;
    }

    .qr-code-frame {
        width: 252px;
        height: 252px;
        margin-top: 16px;
    }

    .qr-dialog-foot {
        align-items: flex-start;
    }

    .qr-dialog-foot > span {
        max-width: 170px;
        text-align: right;
    }

    .controller-toast {
        /* 只贴底部：必须清掉顶部定位与居中平移，否则上下同时定位会把提示
           拉成整列高，平移又把它推出屏幕左侧，只剩一块空白绿板。 */
        top: auto;
        right: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        left: 12px;
        max-width: none;
        transform: none;
    }

    .admin-shell {
        width: calc(100% - 20px);
        padding-bottom: 36px;
    }

    .admin-panel {
        padding: 18px 15px;
        border-radius: 18px;
    }

    .admin-panel-head {
        display: grid;
        gap: 7px;
    }

    .admin-panel-head > p {
        text-align: left;
    }

    .admin-create-user,
    .admin-user-row {
        grid-template-columns: 1fr;
    }

    .admin-create-user > button {
        width: 100%;
    }

    .admin-user-identity {
        grid-column: auto;
    }

    .global-settings-form > label {
        grid-template-columns: 1fr;
    }

    .global-settings-form > label > span,
    .global-settings-form > label > select,
    .global-settings-form > label > small {
        grid-column: 1;
        grid-row: auto;
    }

    .save-settings {
        width: 100%;
        justify-self: stretch;
    }

    .admin-tabs {
        flex-wrap: wrap;
    }

    .admin-tabs a {
        min-width: calc(50% - 4px);
    }

    .schema-edit-grid {
        grid-template-columns: 1fr;
    }

    .schema-directory-item summary {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .schema-directory-item summary em {
        grid-column: 2;
        justify-self: start;
    }

    .schema-edit-footer {
        grid-template-columns: 1fr;
    }

    .schema-edit-footer code,
    .schema-edit-footer > span {
        grid-column: auto;
    }

    .schema-edit-footer button,
    .schema-scan-actions > button,
    .schema-scan-actions > label {
        width: 100%;
    }
}

/* 独立二维码展示页 */

.qr-display-nav small {
    margin-left: auto;
    color: var(--muted-light);
    font-size: var(--font-note);
    font-weight: 500;
    line-height: var(--line-note);
}

.controller-qr-display {
    min-height: 100vh;
    min-height: 100dvh;
    background:
        radial-gradient(circle at 18% 8%, rgba(0, 113, 227, 0.09), transparent 26%),
        radial-gradient(circle at 84% 88%, rgba(90, 200, 250, 0.08), transparent 28%),
        var(--bg);
}

.qr-display-shell {
    width: min(1480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 24px 0 28px;
}

.qr-display-header {
    display: flex;
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.qr-display-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.qr-display-brand .brand-symbol {
    width: 40px;
    height: 40px;
    border-radius: 12px;
}

.qr-display-brand .brand-symbol svg {
    width: 25px;
    height: 25px;
}

.qr-display-brand > span:last-child {
    display: grid;
}

.qr-display-brand strong {
    font-size: var(--font-nav);
    font-weight: 700;
    line-height: var(--line-nav);
}

.qr-display-brand small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-display-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-display-header-actions > a {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 14px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.74);
    color: var(--ink-soft);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.qr-display-header-actions > a:hover {
    border-color: var(--line-strong);
    background: #fff;
}

.qr-live-state {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--green-soft);
    color: var(--green);
}

.qr-live-state i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.1);
    animation: qr-live-pulse 1.8s ease-in-out infinite;
}

.qr-live-state b {
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.qr-live-state.is-error {
    background: var(--red-soft);
    color: var(--red);
}

@keyframes qr-live-pulse {
    0%,
    100% {
        opacity: 0.7;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.08);
    }
}

.qr-display-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 28px;
    padding: 46px 4px 24px;
}

.display-kicker {
    color: var(--blue);
    font-family: var(--font-display);
    font-size: var(--font-meta);
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: var(--line-meta);
}

.qr-display-intro h1 {
    margin: 5px 0 8px;
    font-size: var(--font-page-title);
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: var(--line-page-title);
}

.qr-display-intro p {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.qr-display-account {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px 8px 9px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.66);
}

.qr-display-account > i {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue-dark);
    font-style: normal;
    font-weight: 700;
}

.qr-display-account > span {
    display: grid;
}

.qr-display-account strong {
    font-size: var(--font-body);
    font-weight: 600;
    line-height: var(--line-body);
}

.qr-display-account small {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-display-card {
    display: grid;
    min-height: 720px;
    grid-template-columns: minmax(680px, 1.2fr) minmax(400px, 0.8fr);
    overflow: hidden;
    border: 1px solid rgba(220, 220, 225, 0.88);
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
}

.qr-display-card.has-new-code {
    animation: qr-card-ready 460ms ease both;
}

@keyframes qr-card-ready {
    0% {
        box-shadow: var(--shadow-md), 0 0 0 0 rgba(0, 113, 227, 0.18);
    }
    50% {
        box-shadow: var(--shadow-md), 0 0 0 7px rgba(0, 113, 227, 0.09);
    }
    100% {
        box-shadow: var(--shadow-md), 0 0 0 0 rgba(0, 113, 227, 0);
    }
}

.qr-display-code-panel {
    display: grid;
    min-width: 0;
    align-content: center;
    justify-items: center;
    gap: 17px;
    padding: 36px;
    border-right: 1px solid var(--line);
    background:
        linear-gradient(rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.76)),
        linear-gradient(145deg, var(--surface-blue), #f8fbff);
}

.qr-display-code {
    display: grid;
    width: min(100%, 634px);
    aspect-ratio: 1;
    place-items: center;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: #fff;
    box-shadow:
        0 24px 64px rgba(21, 45, 74, 0.12),
        inset 0 0 0 8px #fafafa;
}

.qr-display-code svg,
.qr-display-code img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
    user-select: none;
    -webkit-user-drag: none;
}

.qr-frame-monitor {
    display: flex;
    width: min(100%, 634px);
    min-height: 34px;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}

.qr-frame-monitor[hidden] {
    display: none;
}

.qr-frame-monitor > span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.qr-frame-monitor i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 5px rgba(36, 138, 61, 0.1);
}

.qr-frame-monitor strong,
.qr-frame-monitor small {
    font-family: var(--font-display);
    font-size: var(--font-meta);
    line-height: var(--line-meta);
}

.qr-frame-monitor strong {
    font-weight: 600;
}

.qr-frame-monitor small {
    color: var(--muted);
    font-weight: 500;
}

.qr-frame-monitor.is-paused {
    color: var(--orange);
}

.qr-frame-monitor.is-error {
    color: var(--red);
}

.qr-display-placeholder {
    display: grid;
    max-width: 360px;
    justify-items: center;
    text-align: center;
}

.qr-display-placeholder > span {
    display: grid;
    width: 92px;
    height: 92px;
    place-items: center;
    margin-bottom: 22px;
    border-radius: 28px;
    background: var(--blue-soft);
    color: var(--blue);
}

.qr-display-placeholder svg {
    width: 48px;
    height: 48px;
    stroke-width: 1.5;
}

.qr-display-placeholder strong {
    font-size: var(--font-section-title);
    font-weight: 700;
    line-height: var(--line-section-title);
}

.qr-display-placeholder p {
    margin: 9px 0 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.qr-display-detail {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: 42px 46px;
}

.qr-display-ready {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qr-display-ready > span {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 15px;
    background: var(--green-soft);
    color: var(--green);
}

.qr-display-ready svg {
    width: 28px;
    height: 28px;
}

.qr-display-ready > div {
    display: grid;
}

.qr-display-ready small {
    color: var(--green);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.qr-display-ready strong {
    font-size: var(--font-nav);
    font-weight: 600;
    line-height: var(--line-nav);
}

.qr-display-project {
    padding: 34px 0 22px;
}

.qr-display-project > small {
    color: var(--muted);
    font-size: var(--font-meta);
    font-weight: 600;
    line-height: var(--line-meta);
}

.qr-display-project h2 {
    margin: 4px 0 9px;
    font-size: var(--font-section-title);
    font-weight: 700;
    line-height: var(--line-section-title);
}

.qr-display-project p {
    margin: 0;
    color: var(--muted);
    font-size: var(--font-large-body);
    line-height: var(--line-large-body);
}

.qr-display-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 25px;
}

.qr-display-manifest {
    overflow: hidden;
    margin-bottom: 25px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: #fff;
}

.qr-display-manifest summary {
    display: flex;
    min-height: 44px;
    align-items: center;
    padding: 10px 16px;
    cursor: pointer;
    font-size: var(--font-size-label);
    line-height: var(--line-height-label);
    font-weight: 600;
    color: var(--ink-soft);
}

.qr-display-manifest pre {
    max-height: 320px;
    overflow: auto;
    margin: 0;
    padding: 12px 16px;
    border-top: 1px solid var(--line);
    background: var(--surface-subtle);
    font-size: var(--font-size-note);
    line-height: var(--line-height-note);
    white-space: pre-wrap;
    word-break: break-all;
}

.qr-content-manifest {
    margin-bottom: 18px;
    text-align: left;
}

.qr-content-manifest pre {
    max-height: 280px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.qr-display-steps span {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    gap: 7px;
    padding: 5px 10px 5px 6px;
    border-radius: 999px;
    background: var(--surface-subtle);
    color: var(--ink-soft);
    font-size: var(--font-meta);
    font-weight: 500;
    line-height: var(--line-meta);
}

.qr-display-steps i {
    display: grid;
    width: 21px;
    height: 21px;
    place-items: center;
    border-radius: 50%;
    background: var(--blue-soft);
    color: var(--blue);
    font-style: normal;
    font-weight: 700;
}

.qr-display-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.qr-display-meta > div {
    display: grid;
    gap: 2px;
}

.qr-display-meta > div + div {
    padding-left: 14px;
    border-left: 1px solid var(--line);
}

.qr-display-meta dt {
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-display-meta dd {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--font-body);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    line-height: var(--line-body);
}

.qr-display-meta dd.is-expired {
    color: var(--red);
}

.qr-display-actions {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding-top: 22px;
}

.qr-player-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.qr-display-actions button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    border-radius: 11px;
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.qr-display-actions button:hover {
    background: var(--blue-dark);
}

.qr-speed-control {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.qr-display-actions .qr-speed-control button {
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    line-height: 18px;
}

.qr-display-actions .qr-speed-control button:hover {
    background: rgba(255, 255, 255, 0.8);
    color: var(--ink-soft);
}

.qr-display-actions .qr-speed-control button.is-active {
    background: #fff;
    color: var(--blue);
    box-shadow: 0 1px 5px rgba(18, 41, 68, 0.1);
}

.qr-display-actions button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.qr-display-actions button svg {
    width: 19px;
    height: 19px;
}

.qr-display-actions small {
    color: var(--muted);
    font-family: var(--font-display);
    font-size: var(--font-note);
    font-variant-numeric: tabular-nums;
    line-height: var(--line-note);
}

.qr-display-card.is-empty {
    grid-template-columns: 1fr;
}

.qr-display-card.is-empty .qr-display-code-panel {
    border-right: 0;
}

.qr-display-footnote {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding: 17px 8px 0;
    color: var(--muted);
    font-size: var(--font-note);
    line-height: var(--line-note);
}

.qr-display-footnote span {
    position: relative;
}

.qr-display-footnote span + span::before {
    position: absolute;
    top: 50%;
    left: -13px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--muted-light);
    content: "";
}

@media (max-width: 1180px) {
    .qr-display-card {
        grid-template-columns: minmax(540px, 1fr) minmax(350px, 0.78fr);
    }

    .qr-display-code,
    .qr-frame-monitor {
        width: min(100%, 520px);
    }

    .qr-display-code-panel,
    .qr-display-detail {
        padding: 34px;
    }

    .qr-display-actions {
        align-items: flex-start;
        flex-direction: column;
    }
}

@media (max-width: 980px) {
    .qr-display-card {
        grid-template-columns: minmax(360px, 0.9fr) minmax(360px, 1.1fr);
    }

    .qr-display-code-panel,
    .qr-display-detail {
        padding: 36px;
    }

    .qr-display-code,
    .qr-frame-monitor {
        width: min(100%, 520px);
    }
}

@media (max-width: 760px) {
    .qr-display-shell {
        width: calc(100% - 24px);
        padding-top: 12px;
    }

    .qr-display-header {
        min-height: 56px;
    }

    .qr-display-brand small,
    .qr-display-account,
    .qr-live-state b {
        display: none;
    }

    .qr-live-state {
        min-width: 38px;
        justify-content: center;
        padding: 7px;
    }

    .qr-display-intro {
        align-items: start;
        padding: 32px 2px 20px;
    }

    .qr-display-intro h1 {
        font-size: var(--font-section-title);
        line-height: var(--line-section-title);
    }

    .qr-display-intro p {
        font-size: var(--font-body);
        line-height: var(--line-body);
    }

    .qr-display-card {
        min-height: 0;
        grid-template-columns: 1fr;
        border-radius: 24px;
    }

    .qr-display-code-panel {
        padding: 28px 22px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .qr-display-code {
        width: min(100%, 380px);
        padding: 16px;
        border-radius: 24px;
    }

    .qr-display-detail {
        padding: 28px 24px;
    }

    .qr-display-project {
        padding-top: 26px;
    }

    .qr-display-meta {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .qr-display-meta > div + div {
        padding: 14px 0 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .qr-display-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .qr-player-controls {
        width: 100%;
    }

    .qr-frame-monitor {
        width: min(100%, 380px);
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .qr-display-footnote {
        align-items: center;
        flex-direction: column;
        gap: 3px;
    }

    .qr-display-footnote span + span::before {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.controller-error-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.controller-error-filters {
    display: grid;
    grid-template-columns: minmax(180px, 0.45fr) minmax(260px, 1fr) auto auto;
    gap: 12px;
    align-items: end;
    margin-top: 22px;
    padding: 16px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 18px;
    background: rgba(248, 248, 250, 0.82);
}

.controller-error-filters label {
    display: grid;
    gap: 7px;
}

.controller-error-filters label > span {
    color: #6e6e73;
    font-size: 12px;
    font-weight: 700;
}

.controller-error-filters input,
.controller-error-filters select {
    width: 100%;
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    background: #fff;
    color: #1d1d1f;
    font: inherit;
}

.controller-error-filters button,
.controller-error-filters > a {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 0;
    border-radius: 12px;
    background: #0071e3;
    color: #fff;
    font: inherit;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.controller-error-filters > a {
    background: #e8e8ed;
    color: #1d1d1f;
}

.controller-error-list {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.controller-error-row {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 150px;
    gap: 16px;
    align-items: center;
    padding: 15px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 16px;
    background: #fff;
}

.controller-error-status {
    display: grid;
    gap: 2px;
    justify-items: start;
}

.controller-error-status strong {
    color: #d70015;
    font-size: 24px;
    line-height: 1;
}

.controller-error-status span,
.controller-error-copy small,
.controller-error-row time {
    color: #6e6e73;
    font-size: 12px;
}

.controller-error-copy {
    display: grid;
    min-width: 0;
    gap: 6px;
}

.controller-error-copy > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.controller-error-copy code,
.controller-error-copy em {
    padding: 3px 7px;
    border-radius: 7px;
    background: #fff1f1;
    color: #b42318;
    font-size: 11px;
    font-style: normal;
    font-weight: 700;
}

.controller-error-copy em {
    background: #f2f2f7;
    color: #515154;
}

.controller-error-copy > strong {
    overflow-wrap: anywhere;
    color: #1d1d1f;
    font-size: 14px;
}

.controller-error-row time {
    justify-self: end;
    text-align: right;
}

.controller-error-empty {
    padding: 48px 24px;
    text-align: center;
    color: #6e6e73;
}

.controller-error-empty strong {
    color: #1d1d1f;
}

@media (max-width: 900px) {
    .controller-error-metrics,
    .controller-error-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .controller-error-row {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .controller-error-row time {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }
}

@media (max-width: 620px) {
    .controller-error-metrics,
    .controller-error-filters,
    .controller-error-row {
        grid-template-columns: 1fr;
    }

    .controller-error-row time {
        grid-column: auto;
    }
}

/* 与主系统同版发布的版本号徽标（页头内联形态） */
.app-version-badge.is-inline {
    position: static;
    margin-left: auto;
    align-self: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: #475569;
    font-size: 12px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* 一板一会话：项目行展开会话列表 */
.project-item-group {
    margin-bottom: 4px;
}

.project-item-group .project-item {
    width: 100%;
    margin-bottom: 0;
    background: none;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.project-item-group .project-item:hover {
    background: #ededf1;
}

.project-item-group.is-active .project-item {
    border-color: rgba(0, 113, 227, 0.13);
    background: var(--blue-soft);
}

.project-item-group .project-item-arrow {
    transition: transform 150ms ease;
}

.project-item-group.is-open .project-item-arrow {
    transform: rotate(90deg);
}

.project-session-list {
    display: none;
    padding: 2px 0 6px 20px;
}

.project-item-group.is-open .project-session-list {
    display: block;
}

.project-session-item {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 6px 9px;
    margin-bottom: 2px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
}

.project-session-item:hover {
    background: #ededf1;
}

.project-session-item.is-active {
    background: var(--blue-soft);
}

.project-session-icon {
    flex: 0 0 auto;
    color: #6e6e73;
    font-size: 12px;
}

.project-session-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.project-session-copy strong {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-session-copy small {
    color: #86868b;
    font-size: 11px;
}

/* 「新建白板」入口：借用会话项版式，按钮语义、绿色点缀 */
.project-session-create {
    display: contents;
}

.project-session-new {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.project-session-new .project-session-icon {
    color: #34c759;
    font-weight: 600;
}

.project-session-new .project-session-copy strong {
    color: #248a3d;
}

/* 顶部小图标按钮(2026-09-01):新建项目用得不多,从大按钮块收成图标,
   和头像并排放在品牌行右侧,把纵向空间让给项目列表。 */
.sidebar-icon-button {
    width: 34px;
    height: 34px;
    flex: none;
    padding: 0;
    display: grid;
    place-items: center;
    border: 1px solid rgba(60, 60, 67, 0.16);
    border-radius: 50%;
    background: #fff;
    color: #1d1d1f;
    cursor: pointer;
}

.sidebar-icon-button:hover {
    background: #f2f2f5;
}

.sidebar-icon-button svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.sidebar-brand-row {
    gap: 8px;
}

/* 展开箭头移到项目名前面(用户要求):原来在行尾,和三点菜单挤在一起。 */
.project-item {
    grid-template-columns: 24px minmax(0, 1fr) 26px !important;
}

.project-item .project-item-icon {
    width: 24px;
}

.project-item-icon .project-item-arrow {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform 150ms ease;
}

/* 侧栏右上角用户菜单(2026-09-01):与主系统一致,账号入口从底部搬到顶部,
   扫一扫/二维码展示/退出登录都收在这个菜单里。 */
.sidebar-user-menu {
    position: relative;
    flex: none;
}

.sidebar-user-trigger {
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #0a84ff, #5e5ce6);
    color: #fff;
    cursor: pointer;
}

.sidebar-user-avatar {
    font-size: 15px;
    font-weight: 600;
    line-height: 34px;
}

.sidebar-user-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 60;
    min-width: 236px;
    padding: 8px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-panel[hidden] {
    display: none;
}

.sidebar-user-head {
    padding: 8px 10px 10px;
    border-bottom: 1px solid rgba(60, 60, 67, 0.1);
    margin-bottom: 4px;
}

.sidebar-user-head strong {
    display: block;
    font-size: 14px;
}

.sidebar-user-head small {
    color: #86868b;
    font-size: 12px;
}

.sidebar-user-panel > a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 10px;
    color: #1d1d1f;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-user-panel > a:hover {
    background: #f2f2f5;
}

.sidebar-user-panel > a svg {
    width: 18px;
    height: 18px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.sidebar-user-panel > a span {
    display: grid;
}

.sidebar-user-panel > a small {
    color: #86868b;
    font-size: 11px;
}

.sidebar-user-logout {
    color: #d70015 !important;
}

/* 行内三点菜单(项目行/会话行) */
.project-item-group {
    position: relative;
}

.row-menu {
    position: relative;
    flex: none;
}

.project-item-group > .row-menu {
    position: absolute;
    top: 17px;
    right: 10px;
}

.row-menu-trigger {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #86868b;
    cursor: pointer;
}

.row-menu-trigger:hover {
    background: rgba(60, 60, 67, 0.1);
    color: #1d1d1f;
}

.row-menu-trigger svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    stroke: none;
}

.row-menu-panel {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 55;
    min-width: 140px;
    padding: 6px;
    border: 1px solid rgba(60, 60, 67, 0.14);
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.row-menu-panel[hidden] {
    display: none;
}

/* 挂到 body 的浮动面板：高于侧栏抽屉与遮罩 */
.row-menu-panel.is-floating {
    z-index: 160;
}

.row-menu-panel button {
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #1d1d1f;
    font: inherit;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
}

.row-menu-panel button:hover {
    background: #f2f2f5;
}

.row-menu-panel button.danger {
    color: #d70015;
}

/* 会话行:链接占满,三点菜单贴右 */
.project-session-row {
    display: flex;
    align-items: center;
    gap: 2px;
}

.project-session-row > .project-session-item {
    flex: 1;
    min-width: 0;
}

.project-session-row.is-active > .project-session-item {
    background: rgba(10, 132, 255, 0.1);
}

/* 待同步命令列表(2026-09-01) */
.pending-plan-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pending-plan-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid rgba(60, 60, 67, 0.16);
    border-radius: 12px;
    background: #fff;
}

.pending-plan-list li strong {
    display: block;
    font-size: 15px;
}

.pending-plan-list li small {
    color: #6e6e73;
}

/* 删除项目入口(2026-09-01):手机端没有三点菜单,入口直接放进项目展开区。 */
.project-session-delete {
    width: 100%;
    border: 0;
    background: transparent;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.project-session-delete .project-session-icon {
    color: #ff3b30;
    font-weight: 600;
}

.project-session-delete .project-session-copy strong {
    color: #d70015;
}

/* 等待状态单行横排：文案与耗时同格显示 */
.planning-status-list .planning-status-text {
    display: inline;
    min-width: 0;
}

.planning-status-list .planning-status-text em {
    margin-left: 2px;
    font-style: normal;
    opacity: 0.72;
}

/* 等待耗时换行显示：第一行文案已满 */
.planning-status-list .planning-status-text em {
    display: block;
    margin: 2px 0 0;
}

/* 命令失败的驻留红字提示 */
.chat-error-note {
    margin: 6px 2px 0;
    color: #d70015;
    font-size: var(--font-meta);
    line-height: 1.6;
}

.chat-error-note small {
    display: block;
    margin-top: 3px;
    color: #a1595f;
    font-size: 11px;
    opacity: 0.85;
}

/* 会话头部：白板名为主标题，项目名缩小进元信息行 */
.chat-project-name {
    color: var(--muted);
    font-size: 12px;
}

.chat-project-name em {
    font-style: normal;
    color: inherit;
}

.chat-board-name .chat-board-kicker {
    margin-right: 6px;
    color: var(--blue);
    font-size: 0.8em;
}

.qr-validity-note {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
}

/* 生成中横幅与疑似中断提示 */
.chat-generating-note {
    margin: 10px auto 4px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(10, 132, 208, 0.08);
    color: #086cae;
    font-size: 12.5px;
    width: fit-content;
    animation: chat-generating-pulse 1.6s ease-in-out infinite;
}
@keyframes chat-generating-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.55; }
}
.chat-stalled-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #86868b;
}

/* ---------------------------------------- 命令发送方式（二维码/网闸） */
.transmit-channel-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 12px 0 16px;
}

.transmit-channel-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(60, 60, 67, 0.16);
    border-radius: 12px;
    cursor: pointer;
}

.transmit-channel-option:has(input:checked) {
    border-color: rgba(0, 113, 227, 0.55);
    background: rgba(0, 113, 227, 0.06);
}

.transmit-channel-option input { margin-top: 3px; flex: none; }

.transmit-channel-option span {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.transmit-channel-option small {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(60, 60, 67, 0.62);
}

/* ============ 批量需求（电脑端） ============ */
.batch-app {
    background: var(--surface-muted, #f5f5f7);
}

.batch-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 28px 24px 48px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.batch-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.batch-eyebrow {
    color: var(--muted-light);
    font-size: var(--font-note);
    letter-spacing: 0.08em;
}

.batch-head h1 {
    margin: 4px 0 6px;
}

.batch-head p {
    margin: 0;
    max-width: 62ch;
    color: var(--ink-soft);
    font-size: var(--font-meta);
}

.batch-back {
    flex: none;
    color: var(--accent, #0071e3);
    font-size: var(--font-meta);
    text-decoration: none;
}

.batch-channel {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(0, 113, 227, 0.16);
    border-radius: 12px;
    background: rgba(0, 113, 227, 0.05);
}

.batch-channel.is-qr {
    border-color: rgba(255, 149, 0, 0.24);
    background: rgba(255, 149, 0, 0.07);
}

.batch-channel small {
    color: var(--ink-soft);
}

.batch-paste,
.batch-list-panel,
.batch-run,
.batch-result {
    padding: 16px 18px;
    border: 1px solid rgba(0, 0, 0, 0.07);
    border-radius: 14px;
    background: #fff;
}

.batch-paste label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.batch-paste textarea,
.batch-list-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    font: inherit;
    resize: vertical;
}

.batch-paste-actions {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.batch-select {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: var(--font-meta);
}

.batch-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.batch-list-head h2 {
    margin: 0;
    font-size: var(--font-body);
}

.batch-list-head small {
    margin-left: 8px;
    color: var(--muted-light);
    font-weight: 400;
}

.batch-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.batch-list-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.batch-run {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 14px;
}

.batch-progress {
    flex: 1;
    min-width: 200px;
    color: var(--ink-soft);
    font-size: var(--font-meta);
}

.batch-result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 10px 0 0;
    padding-left: 20px;
}

.batch-result-row {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.batch-result-row.is-failed small {
    color: var(--danger, #d92c20);
}

.batch-result-row.is-succeeded small {
    color: var(--ink-soft);
}

.batch-carousel {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.batch-carousel-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.batch-carousel-frame {
    display: block;
    width: min(420px, 100%);
    margin: 0 auto;
    background: #fff;
}

.enabled-model-effort {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted-light);
    font-size: var(--font-note);
    white-space: nowrap;
}

.enabled-model-effort select {
    padding: 2px 6px;
    font-size: var(--font-note);
}

/* ===== 待同步页重排(2026-09-02):顶部状态条、工具条、编号列表、删除动作 ===== */
.pending-summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px 22px;
    align-items: center;
    margin: 18px 0 14px;
    padding: 20px 22px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    border-radius: 22px;
    background:
        radial-gradient(circle at 100% 0%, rgba(10, 132, 255, 0.10), transparent 32%),
        rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 40px rgba(30, 42, 68, 0.08);
}

.pending-summary-count {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.pending-summary-count strong {
    font-size: 44px;
    line-height: 1;
    letter-spacing: -0.04em;
    color: #0066cc;
    font-variant-numeric: tabular-nums;
}

.pending-summary-count span {
    color: #3a3a3c;
    font-size: 14px;
    font-weight: 600;
}

.pending-summary-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.pending-fact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(118, 118, 128, 0.10);
    color: #3a3a3c;
    font-size: 12px;
    font-weight: 600;
}

.pending-fact i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #8e8e93;
}

.pending-fact.is-on i { background: #248a3d; }
.pending-fact.is-warn i { background: #ff9f0a; }
.pending-fact.is-off i { background: #8e8e93; }

.pending-summary-tip {
    grid-column: 1 / -1;
    margin: 0;
    color: #6e6e73;
    font-size: 13px;
    line-height: 1.6;
}

.pending-toolbar {
    margin: 0 0 12px;
}

.pending-stage {
    margin-bottom: 14px;
}

.pending-stage-frame {
    display: block;
    margin-top: 2px;
    color: #8e8e93;
    font-variant-numeric: tabular-nums;
}

.pending-list-section {
    margin-bottom: 24px;
}

.pending-plan-list li {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(60, 60, 67, 0.12);
    background: rgba(255, 255, 255, 0.94);
}

.pending-plan-index {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    background: rgba(0, 113, 227, 0.10);
    color: #0066cc;
    font-size: 12px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.pending-plan-copy { min-width: 0; }
.pending-plan-copy strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pending-plan-actions { flex-wrap: nowrap; }

.schema-scan-actions .danger {
    color: #c62828;
    border-color: rgba(198, 40, 40, 0.28);
    background: rgba(198, 40, 40, 0.06);
}

.schema-scan-actions .danger:hover {
    background: rgba(198, 40, 40, 0.12);
}

.pending-empty { padding: 26px; text-align: center; }

@media (max-width: 640px) {
    .pending-summary { grid-template-columns: 1fr; }
    .pending-plan-list li { grid-template-columns: 30px minmax(0, 1fr); }
    .pending-plan-actions { grid-column: 1 / -1; flex-wrap: wrap; }
}

/* ===== 展示页:待同步角标与积累提示(2026-09-02) ===== */
.qr-pending-link b {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    margin-left: 6px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff9f0a;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.qr-pending-link.has-pending {
    color: #b25000;
}

.qr-display-pending-note {
    margin: 10px 0 0;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(255, 159, 10, 0.12);
    color: #7a3d00;
    font-size: 13px;
    line-height: 1.5;
}

.qr-display-pending-note a { color: #b25000; font-weight: 700; }

.qr-density-note {
    display: block;
    margin-top: 6px;
    color: #8e8e93;
    font-size: 11px;
}

/* ===== 管理中心:离线动态二维码设置卡(2026-09-02) ===== */
.qr-display-settings-form {
    display: grid;
    gap: 14px;
}

.qr-display-settings-form label {
    display: grid;
    gap: 6px;
}

.qr-display-settings-form label > span {
    font-weight: 600;
    font-size: 13px;
}

.qr-display-settings-form input[type="number"] {
    max-width: 220px;
    padding: 9px 11px;
    border: 1px solid rgba(60, 60, 67, 0.2);
    border-radius: 10px;
    font: inherit;
}

.qr-display-settings-form small {
    color: #6e6e73;
    font-size: 12px;
    line-height: 1.5;
}

.qr-display-settings-density {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(118, 118, 128, 0.08);
    font-size: 13px;
}


/* 展示页密度/速度下拉(2026-09-02):按用户保存 */
.qr-pref-select {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #3a3a3c;
}

.qr-pref-select select {
    padding: 6px 8px;
    border: 1px solid rgba(60, 60, 67, 0.2);
    border-radius: 9px;
    background: #fff;
    font: inherit;
    font-size: 12px;
}

[data-add-menu-panel] button{display:flex;width:100%;border:0;background:transparent;color:inherit;font:inherit;text-align:left;padding:12px 14px;cursor:pointer;border-radius:12px}[data-add-menu-panel] button:hover{background:rgba(127,127,127,.12)}

.qr-display-compact{margin:0!important;min-height:0!important;background:#fff!important}.qr-display-compact .qr-display-shell{padding:8px!important;max-width:none!important}.qr-display-compact .qr-display-header,.qr-display-compact .qr-display-intro,.qr-display-compact .qr-display-detail{display:none!important}.qr-display-compact .qr-display-card{display:block!important;padding:0!important;margin:0!important;border:0!important;box-shadow:none!important}.qr-display-compact .qr-display-code-panel{padding:0!important}.qr-display-compact .qr-display-code{width:min(100%,calc(100vh - 65px))!important;margin:auto}.qr-display-compact .qr-display-code img{max-height:calc(100vh - 65px);object-fit:contain}

[data-qr-entry][hidden]{display:none!important}

/* 加号菜单由脚本挂到 body 并限制在可视区域内，不受侧栏裁切。 */
[data-add-menu-panel].is-floating {
    position: fixed;
    right: auto;
    z-index: 90;
    width: 236px;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

/* 手机和桌面保持可见，不依赖长按或鼠标悬浮。 */
.message-copy-button {
    border: 0; background: transparent; color: inherit;
    font: inherit; padding: 3px 6px; cursor: pointer; white-space: nowrap;
}
.message-copy-button:hover, .message-copy-button:focus-visible {
    color: var(--accent, #2864d8); text-decoration: underline;
}

.project-data-batch-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px;padding:12px}.project-data-batch-actions button{min-height:40px;padding:8px 12px}.project-data-batch-actions input{width:20px;height:20px}.project-data-table-card[data-table-state="disabled"]{opacity:.75}.project-data-table-card[hidden]{display:none!important}

/* 紧凑会话：设置进入右上角菜单，空输入只占一行。 */
.chat-header {
    min-height: 50px;
    padding-top: 5px;
    padding-bottom: 5px;
    gap: 8px;
}
.chat-heading {
    display: flex;
    align-items: center;
    gap: 12px;
}
.chat-heading h1 {
    min-width: 0;
    flex: 1;
    font-size: 16px;
    line-height: 24px;
}
.chat-heading-meta {
    min-width: 0;
    max-width: 35%;
    flex: 0 1 auto;
    order: 1;
    font-size: 11px;
}
.chat-project-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chat-context-status { flex-shrink: 0; }
.chat-heading > span { display: none; }
.project-menu:has(.chat-settings) {
    top: 43px;
    width: min(300px, calc(100vw - 32px));
    max-height: calc(100dvh - 70px);
    overflow-y: auto;
}
.chat-settings {
    display: grid;
    gap: 8px;
    padding: 8px 4px 12px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
}
.chat-settings .composer-select {
    width: 100%;
    flex: none;
    height: 40px;
}
.chat-settings .composer-select > span { display: inline; }
.chat-settings .composer-select select { width: 100%; }
.chat-knowledge-select {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: var(--font-note);
    padding: 0 10px;
}
.chat-knowledge-select select {
    width: 100%;
    min-width: 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-subtle);
    color: var(--ink-soft);
}
.compact-composer {
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.compact-composer .chat-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    border-radius: 15px;
}
.compact-composer .chat-composer textarea {
    grid-column: 1;
    grid-row: 1;
    min-height: 44px;
    max-height: 180px;
    padding: 11px 12px;
    font-size: 15px;
    line-height: 22px;
}
.compact-composer .composer-footer {
    display: contents;
}
.compact-composer .composer-model-blocked {
    grid-row: 2;
    grid-column: 1 / -1;
    display: block;
    padding: 6px 10px;
    font-size: 12px;
}
.compact-composer .composer-actions {
    grid-column: 2;
    grid-row: 1;
    width: auto;
    padding: 4px;
}
.compact-composer .composer-footer button {
    width: 36px;
    height: 36px;
    border-radius: 11px;
}
.compact-composer > p { display: none; }
.compact-composer.is-expanded > p { display: block; }
.has-active-project:not(.data-management-mode) .conversation {
    padding-bottom: var(--chat-composer-space, 80px);
}
@media (max-width: 860px) {
    .chat-heading-meta { display: none; }
    .chat-header { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .chat-heading h1 { font-size: 15px; }
    .compact-composer.is-expanded > p {
        font-size: 10px;
        line-height: 14px;
        margin-top: 4px;
    }
}

.compact-composer:not(.is-expanded) textarea { overflow-y: hidden; }

/* 项目名称行的新建入口，与操作菜单并排。 */
.project-item-group > .project-create-inline { position:absolute; top:17px; right:42px; width:26px; height:26px; font-size:22px; }
.project-item-group > .project-item { padding-right:76px; }
.sidebar-brand small { max-width:150px; overflow:hidden; text-overflow:ellipsis; }
.sidebar-user-panel { max-height: min(70vh, 440px); overflow-y:auto; }
