/* ============================================================
   墨匣 · 公众号写作工作台
   自包含样式：不依赖外部 UI 框架
   ============================================================ */

:root {
    --bg: #f3f6f1;
    --bg-deep: #e9efe7;
    --surface: #ffffff;
    --surface-soft: #f7faf6;
    --surface-muted: #f1f5ef;
    --ink: #1d2b22;
    --ink-soft: #37473d;
    --muted: #6d7b71;
    --muted-2: #94a097;
    --line: #e2e9e1;
    --line-strong: #d3ddd2;
    --brand: #1f6b4f;
    --brand-dark: #15503a;
    --brand-bright: #2d8b67;
    --brand-soft: #e8f2ec;
    --brand-softer: #f2f8f4;
    --sidebar: #123a2c;
    --sidebar-dark: #0c2c21;
    --cream: #f6f1e5;
    --gold: #c5975a;
    --danger: #b3483e;
    --danger-soft: #fbefed;
    --warning: #a46f27;
    --warning-soft: #fdf5e7;
    --info: #4b6f8e;
    --info-soft: #eef4f8;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow: 0 12px 36px rgba(31, 56, 42, .06);
    --shadow-lg: 0 24px 70px rgba(24, 50, 36, .14);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body.app-page {
    background:
        radial-gradient(circle at 82% 4%, rgba(197, 151, 90, .08), transparent 26rem),
        radial-gradient(circle at 12% 90%, rgba(31, 107, 79, .06), transparent 32rem),
        var(--bg);
}

h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd {
    margin: 0;
}

ul, ol {
    padding: 0;
    list-style: none;
}

a {
    color: var(--brand);
    text-decoration: none;
}

a:hover {
    color: var(--brand-bright);
}

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

button {
    cursor: pointer;
}

img {
    max-width: 100%;
}

code, pre, .mono-id {
    font-family: var(--mono);
}

[hidden],
.is-hidden {
    display: none !important;
}

::selection {
    background: rgba(31, 107, 79, .2);
}

:focus-visible {
    outline: 3px solid rgba(45, 139, 103, .28);
    outline-offset: 2px;
}

/* ------------------------- 通用排版 ------------------------- */

.eyebrow {
    display: inline-block;
    margin-bottom: 7px;
    color: var(--brand);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
    text-transform: uppercase;
}

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

.text-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--brand);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
}

.text-link:hover {
    color: var(--brand-bright);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.danger-text {
    color: var(--danger) !important;
}

.mono-id {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: .01em;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 9px;
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

/* ------------------------- 按钮 ------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 9px 16px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: transparent;
    color: var(--ink);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.3;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease, color .18s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled,
.btn.is-loading {
    cursor: not-allowed;
    opacity: .62;
    transform: none;
    box-shadow: none;
}

.btn i {
    font-size: 13px;
}

.btn-primary {
    border-color: var(--brand);
    background: linear-gradient(135deg, var(--brand), #26795a);
    color: #fff;
    box-shadow: 0 8px 18px rgba(31, 107, 79, .18);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    color: #fff;
    box-shadow: 0 10px 22px rgba(31, 107, 79, .24);
}

.btn-secondary {
    border-color: rgba(31, 107, 79, .2);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.btn-secondary:hover {
    border-color: rgba(31, 107, 79, .38);
    background: #dfeee5;
    color: var(--brand-dark);
}

.btn-ghost {
    border-color: var(--line);
    background: var(--surface);
    color: var(--ink-soft);
}

.btn-ghost:hover {
    border-color: var(--line-strong);
    background: var(--surface-soft);
    color: var(--ink);
}

.btn-sm {
    min-height: 33px;
    padding: 6px 11px;
    border-radius: 9px;
    font-size: 12px;
}

.btn-lg {
    min-height: 48px;
    padding: 13px 20px;
    border-radius: 12px;
    font-size: 14px;
}

.btn-block {
    width: 100%;
}

.btn.is-loading i {
    margin-right: 2px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    color: var(--muted);
    font-size: 13px;
    transition: all .18s ease;
}

.icon-btn:hover {
    border-color: rgba(31, 107, 79, .3);
    background: var(--brand-soft);
    color: var(--brand-dark);
}

.icon-btn.is-danger:hover {
    border-color: rgba(179, 72, 62, .25);
    background: var(--danger-soft);
    color: var(--danger);
}

.icon-btn.is-loading {
    color: var(--brand);
}

.inline-form {
    display: inline;
    margin: 0;
}

.row-actions {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* ------------------------- 状态 / 标签 ------------------------- */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .01em;
    white-space: nowrap;
}

.status-pill i {
    font-size: 10px;
}

.status-pill.is-draft {
    background: #f0f3ee;
    color: #69776e;
}

.status-pill.is-ready {
    background: #fdf3e2;
    color: #95611c;
}

.status-pill.is-pushed {
    background: #e7f4ec;
    color: var(--brand);
}

.status-pill.is-archived {
    background: #eef1f4;
    color: #66717b;
}

.pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

.pill-green {
    background: var(--brand-soft);
    color: var(--brand);
}

.pill-neutral {
    background: var(--surface-muted);
    color: var(--muted);
}

.pill-warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.pill-danger {
    background: var(--danger-soft);
    color: var(--danger);
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
}

.status-dot::before {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--muted-2);
    content: "";
}

.status-dot.is-on {
    color: var(--brand);
}

.status-dot.is-on::before {
    background: #35a875;
    box-shadow: 0 0 0 3px rgba(53, 168, 117, .12);
}

.status-dot.is-off {
    color: var(--danger);
}

.status-dot.is-off::before {
    background: #c76458;
}

.status-dot-small {
    display: inline-block;
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--muted-2);
}

.status-dot-small.is-pushed {
    background: #35a875;
}

.status-dot-small.is-ready {
    background: #d29a48;
}

.status-dot-small.is-draft {
    background: #9eaaa2;
}

.role-badge {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 700;
}

.role-admin {
    background: #eaf2ed;
    color: var(--brand);
}

.role-editor {
    background: #eef3f8;
    color: var(--info);
}

.role-viewer {
    background: #f1f2ef;
    color: var(--muted);
}

.is-on {
    color: var(--brand);
}

.is-off {
    color: var(--danger);
}

.is-muted {
    color: var(--muted-2);
}

/* ------------------------- 表单 ------------------------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 650;
}

.label-optional {
    color: var(--muted-2);
    font-size: 10px;
    font-weight: 500;
}

.field-hint {
    display: block;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
}

.input,
.select,
.textarea,
.input-wrap input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 13px;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.input,
.select,
.input-wrap input {
    height: 40px;
    padding: 8px 12px;
}

.textarea {
    min-height: 86px;
    padding: 10px 12px;
    line-height: 1.75;
    resize: vertical;
}

.select {
    appearance: none;
    padding-right: 34px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236d7b71' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5 11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.select-sm {
    width: auto;
    height: 36px;
    min-width: 120px;
    padding: 6px 32px 6px 11px;
    font-size: 12px;
}

.input-wrap {
    position: relative;
    display: block;
}

.input-wrap > i {
    position: absolute;
    top: 50%;
    left: 13px;
    color: var(--muted-2);
    font-size: 13px;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    padding-left: 38px;
    padding-right: 38px;
}

.input-action {
    position: absolute;
    top: 50%;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted);
    transform: translateY(-50%);
}

.input-action:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.input:focus,
.select:focus,
.textarea:focus,
.input-wrap input:focus {
    border-color: rgba(31, 107, 79, .42);
    outline: none;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(31, 107, 79, .07);
}

.input::placeholder,
.textarea::placeholder,
.input-wrap input::placeholder {
    color: #a5b0a8;
}

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

.form-grid-tight {
    gap: 12px;
}

.field-full {
    grid-column: 1 / -1;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 4px;
}

.form-hint {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.form-hint i {
    margin-top: 2px;
    color: var(--brand);
}

.check-field {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
    cursor: pointer;
}

.check-field input[type="checkbox"] {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    accent-color: var(--brand);
}

.check-field span {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.check-field strong {
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 650;
}

.check-field small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.45;
}

.check-field-compact {
    padding: 9px 10px;
}

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

.form-details {
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface-soft);
}

.form-details summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 13px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.form-details summary::-webkit-details-marker {
    display: none;
}

.form-details[open] summary {
    border-bottom: 1px solid var(--line);
}

.details-body {
    display: grid;
    gap: 12px;
    padding: 14px;
}

.search-inline {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 190px;
    height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
}

.search-inline i {
    color: var(--muted-2);
    font-size: 12px;
}

.search-inline input {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 12px;
    outline: none;
}

.filter-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.filter-search {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 1 1 230px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.filter-search i {
    color: var(--muted-2);
    font-size: 12px;
}

.filter-search input {
    width: 100%;
    border: 0;
    background: transparent;
    font-size: 12px;
    outline: none;
}

.filter-count {
    margin-left: auto;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.strength-bar {
    display: block;
    overflow: hidden;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: var(--surface-muted);
}

.strength-bar i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--danger);
    transition: width .2s ease, background .2s ease;
}

.strength-bar i.is-medium {
    background: var(--gold);
}

.strength-bar i.is-strong {
    background: #35a875;
}

/* ------------------------- 提示条 ------------------------- */

.alert {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin: 0 0 16px;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12px;
    line-height: 1.65;
}

.alert > i {
    flex: 0 0 auto;
    margin-top: 2px;
    font-size: 15px;
}

.alert > div {
    flex: 1;
    min-width: 0;
}

.alert-success {
    border-color: #cfe6d8;
    background: #f1faf4;
    color: #205e42;
}

.alert-success > i {
    color: #2c8c60;
}

.alert-error {
    border-color: #f0d2ce;
    background: var(--danger-soft);
    color: #84372f;
}

.alert-error > i {
    color: var(--danger);
}

.alert-warning {
    border-color: #f0dfc3;
    background: var(--warning-soft);
    color: #7e581f;
}

.alert-warning > i {
    color: var(--warning);
}

.alert-info {
    border-color: #d7e4ed;
    background: var(--info-soft);
    color: #3e5d77;
}

.alert-info > i {
    color: var(--info);
}

.alert-link {
    display: inline-flex;
    margin-left: 6px;
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.alert-close {
    flex: 0 0 auto;
    padding: 2px;
    border: 0;
    background: transparent;
    color: currentColor;
    opacity: .55;
}

.alert-close:hover {
    opacity: 1;
}

.flash-message.is-leaving {
    opacity: 0;
    transform: translateY(-4px);
    transition: all .22s ease;
}

.reminder-due {
    align-items: flex-start;
}

.reminder-due-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 6px 10px 0 0;
    padding: 4px 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .6);
    font-size: 11px;
}

.reminder-due-item a {
    color: inherit;
    font-weight: 700;
}

.reminder-due-item small {
    opacity: .7;
}

.notice-box {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    margin-top: 16px;
    padding: 13px 14px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--brand-softer);
}

.notice-box > i {
    margin-top: 2px;
    color: var(--brand);
}

.notice-box strong {
    display: block;
    margin-bottom: 2px;
    color: var(--ink-soft);
    font-size: 12px;
}

.notice-box p {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

/* ------------------------- 应用骨架 ------------------------- */

.app-shell {
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    width: 248px;
    padding: 22px 15px 16px;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 255, 255, .08), transparent 16rem),
        linear-gradient(180deg, var(--sidebar), var(--sidebar-dark));
    color: #d4e2d8;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 7px 22px;
    color: #f5f2e8;
}

.brand:hover {
    color: #fff;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 13px;
    background: var(--cream);
    color: var(--sidebar);
    font-family: "STSong", "SimSun", serif;
    font-size: 22px;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .15);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.brand-copy strong {
    font-family: "STSong", "SimSun", serif;
    font-size: 21px;
    font-weight: 700;
    letter-spacing: .08em;
}

.brand-copy small {
    margin-top: 3px;
    color: #9db5a6;
    font-size: 9px;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.nav-caption {
    padding: 0 11px 7px;
    color: #789685;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: .18em;
}

.nav-caption-space {
    margin-top: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 11px;
    border-radius: 10px;
    color: #c0d2c6;
    font-size: 13px;
    font-weight: 550;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav-item i {
    width: 17px;
    color: #8eab99;
    font-size: 13px;
    text-align: center;
}

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

.nav-item.is-active {
    background: rgba(246, 241, 229, .12);
    color: #fff;
    box-shadow: inset 3px 0 0 var(--gold);
}

.nav-item.is-active i {
    color: var(--gold);
}

.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    margin-left: auto;
    padding: 0 5px;
    border-radius: 999px;
    background: #d39b52;
    color: #1f2b23;
    font-size: 9px;
    font-weight: 800;
}

.sidebar-note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 24px 5px 0;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    background: rgba(255, 255, 255, .04);
}

.sidebar-note i {
    margin-top: 2px;
    color: #8eab99;
    font-size: 11px;
}

.sidebar-note p {
    color: #91aa9a;
    font-size: 10px;
    line-height: 1.65;
}

.sidebar-bottom {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 5px 12px;
}

.avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 37px;
    height: 37px;
    border-radius: 11px;
    background: rgba(246, 241, 229, .14);
    color: var(--cream);
    font-size: 14px;
    font-weight: 700;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 12px;
}

.user-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.25;
}

.user-meta strong {
    overflow: hidden;
    color: #f2f6f3;
    font-size: 12px;
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-meta small {
    margin-top: 2px;
    color: #8fa99a;
    font-size: 10px;
}

.user-online {
    width: 7px;
    height: 7px;
    margin-left: auto;
    border-radius: 50%;
    background: #57c694;
    box-shadow: 0 0 0 3px rgba(87, 198, 148, .13);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-action {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 7px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #8fa99a;
    font-size: 10px;
}

.user-action:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
}

.app-main {
    min-height: 100vh;
    margin-left: 248px;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 14px;
    height: 74px;
    padding: 0 28px;
    border-bottom: 1px solid rgba(219, 227, 218, .8);
    background: rgba(246, 249, 244, .88);
    backdrop-filter: blur(18px);
}

.topbar-menu {
    display: none;
}

.topbar-heading {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.2;
}

.topbar-kicker {
    color: var(--muted-2);
    font-size: 8px;
    font-weight: 800;
    letter-spacing: .17em;
}

.topbar-heading h1 {
    margin-top: 3px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -.01em;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.page-content {
    width: 100%;
    max-width: 1540px;
    margin: 0 auto;
    padding: 24px 28px 60px;
}

.app-footer {
    max-width: 1540px;
    margin: 0 auto;
    padding: 0 28px 26px;
    color: var(--muted-2);
    font-size: 9px;
    line-height: 1.7;
    text-align: center;
}

.sidebar-backdrop {
    display: none;
}

/* ------------------------- 页头 / 统计 ------------------------- */

.page-heading-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.page-heading-row h2 {
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(24px, 2.2vw, 32px);
    font-weight: 700;
    line-height: 1.28;
    letter-spacing: -.015em;
}

.page-heading-row > div > p {
    max-width: 720px;
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.heading-actions {
    display: flex;
    align-items: center;
    gap: 9px;
    flex: 0 0 auto;
}

.workbench-heading {
    align-items: center;
}

.workbench-heading-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

.save-state {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
}

.save-state i {
    font-size: 8px;
}

.save-state.is-dirty {
    color: var(--warning);
}

.save-state.is-saved {
    color: var(--brand);
}

.stat-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 18px;
}

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

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

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 5px 20px rgba(31, 56, 42, .035);
    color: var(--ink);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.stat-card:hover {
    border-color: var(--line-strong);
    color: var(--ink);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(31, 56, 42, .06);
}

.stat-card.is-active {
    border-color: rgba(31, 107, 79, .3);
    background: linear-gradient(135deg, #fff, var(--brand-softer));
    box-shadow: inset 0 -2px 0 var(--brand);
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 14px;
}

.stat-icon.is-admin {
    background: var(--brand-soft);
    color: var(--brand);
}

.stat-icon.is-editor {
    background: #eef4f8;
    color: var(--info);
}

.stat-icon.is-viewer {
    background: #f2f0e8;
    color: #94733e;
}

.stat-icon.is-success {
    background: #e8f5ee;
    color: #2c8c60;
}

.stat-icon.is-warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.stat-icon.is-muted {
    background: var(--surface-muted);
    color: var(--muted);
}

.stat-card strong {
    display: block;
    color: var(--ink);
    font-size: 21px;
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.stat-card small {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

/* ------------------------- 面板 / 表格 ------------------------- */

.panel {
    margin-bottom: 18px;
    padding: 21px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-soft {
    background: var(--surface-soft);
    box-shadow: none;
}

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

.panel-heading h2,
.panel-heading h3 {
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.01em;
}

.panel-heading p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

.panel-heading-compact {
    margin-bottom: 13px;
}

.panel-heading-compact h3 {
    font-size: 15px;
}

.panel-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    background: var(--brand-soft);
    color: var(--brand);
}

.panel-subtitle {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.plain-list {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.plain-list li {
    position: relative;
    padding-left: 14px;
}

.plain-list li::before {
    position: absolute;
    top: .62em;
    left: 0;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--brand);
    content: "";
}

.page-narrow {
    max-width: 760px;
    margin: 0 auto;
}

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

.split-wide {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.side-panel {
    position: sticky;
    top: 94px;
}

.table-wrap {
    overflow-x: auto;
    margin: 0 -21px -21px;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.data-table th {
    padding: 9px 12px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .03em;
    text-align: left;
    white-space: nowrap;
}

.data-table td {
    padding: 11px 12px;
    border-bottom: 1px solid #edf1ec;
    vertical-align: middle;
}

.data-table tr:last-child td {
    border-bottom: 0;
}

.data-table tr.is-highlighted td {
    background: #f7fbf8;
}

.data-table .align-right {
    text-align: right;
}

.entity-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 140px;
}

.entity-cell > span:last-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.3;
}

.entity-cell strong {
    color: var(--ink);
    font-weight: 650;
}

.entity-cell small {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.self-tag {
    font-size: 10px;
}

.empty-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 10px;
    color: var(--muted);
    font-size: 12px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 20px;
    text-align: center;
}

.empty-state-compact {
    padding: 36px 20px;
}

.empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    border-radius: 16px;
    background: var(--brand-softer);
    color: var(--brand);
    font-size: 20px;
}

.empty-state h3 {
    margin-bottom: 5px;
    color: var(--ink);
    font-size: 16px;
    font-weight: 700;
}

.empty-state p {
    max-width: 380px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 18px;
}

.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 11px;
}

.page-btn:hover {
    border-color: rgba(31, 107, 79, .3);
    color: var(--brand);
}

.page-btn.is-active {
    border-color: var(--brand);
    background: var(--brand);
    color: #fff;
}

.page-info {
    margin-left: 8px;
    color: var(--muted);
    font-size: 10px;
}

/* ------------------------- 登录 / 初始化 ------------------------- */

.auth-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 85% 10%, rgba(197, 151, 90, .1), transparent 25rem),
        #edf2ea;
}

.auth-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(420px, .95fr);
    min-height: 100vh;
}

.auth-story {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding: 64px clamp(40px, 7vw, 110px);
    background:
        radial-gradient(circle at 15% 15%, rgba(255, 255, 255, .1), transparent 20rem),
        radial-gradient(circle at 80% 90%, rgba(197, 151, 90, .14), transparent 28rem),
        linear-gradient(145deg, #174632, #0b2a1f 72%);
    color: #e9f0e8;
}

.auth-story::after {
    position: absolute;
    right: -110px;
    bottom: -160px;
    width: 430px;
    height: 430px;
    border: 1px solid rgba(246, 241, 229, .12);
    border-radius: 50%;
    box-shadow: 0 0 0 45px rgba(246, 241, 229, .025), 0 0 0 95px rgba(246, 241, 229, .018);
    content: "";
    pointer-events: none;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 44px;
}

.auth-brand .brand-mark {
    width: 48px;
    height: 48px;
    font-size: 24px;
}

.brand-text {
    font-family: "STSong", "SimSun", serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: .04em;
}

.auth-story h1 {
    max-width: 620px;
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(34px, 4.2vw, 56px);
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.025em;
}

.auth-lead {
    max-width: 530px;
    margin-top: 20px;
    color: #a9c0b0;
    font-size: 14px;
    line-height: 1.85;
}

.auth-points {
    display: grid;
    gap: 13px;
    margin-top: 30px;
}

.auth-points li {
    display: flex;
    align-items: center;
    gap: 11px;
    color: #cbdbcf;
    font-size: 12px;
}

.auth-points i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(246, 241, 229, .08);
    color: var(--gold);
    font-size: 11px;
}

.auth-boundary {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 540px;
    margin-top: 38px;
    padding: 13px 14px;
    border: 1px solid rgba(246, 241, 229, .1);
    border-radius: 11px;
    background: rgba(246, 241, 229, .04);
}

.auth-boundary i {
    margin-top: 2px;
    color: var(--gold);
}

.auth-boundary p {
    color: #94ac9c;
    font-size: 10px;
    line-height: 1.7;
}

.auth-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: min(480px, calc(100% - 48px));
    margin: 0 auto;
    padding: 38px 0;
}

.auth-mobile-brand {
    display: none;
}

.auth-heading {
    margin-bottom: 22px;
}

.auth-heading h2 {
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.auth-heading p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.auth-form {
    display: grid;
    gap: 15px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: var(--shadow-lg);
}

.auth-form .btn-block {
    margin-top: 3px;
}

.auth-footnote {
    margin-top: 14px;
    color: var(--muted-2);
    font-size: 10px;
    text-align: center;
}

.auth-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 18px;
    color: var(--muted-2);
    font-size: 9px;
    text-align: center;
}

.auth-footer .dot {
    opacity: .5;
}

.setup-checklist {
    display: grid;
    gap: 8px;
    margin-bottom: 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.setup-checklist p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.65;
}

.setup-checklist code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--surface-muted);
    color: var(--brand-dark);
    font-size: 11px;
}

/* ------------------------- 工作台 ------------------------- */

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

.editor-column {
    min-width: 0;
}

.editor-panel {
    padding: 23px;
}

.title-block {
    padding-bottom: 4px;
}

.title-input {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(26px, 2.4vw, 34px);
    font-weight: 700;
    line-height: 1.35;
    letter-spacing: -.015em;
    outline: none;
}

.title-input::placeholder {
    color: #b4beb6;
}

.title-subline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 9px;
    color: var(--muted-2);
    font-size: 10px;
}

.title-subline i {
    margin-right: 3px;
}

.word-count {
    color: var(--muted);
    font-weight: 600;
}

.editor-meta {
    display: grid;
    grid-template-columns: minmax(150px, 1.1fr) minmax(110px, .75fr) minmax(180px, 1.3fr);
    gap: 11px;
    margin: 17px 0;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.editor-meta .input,
.editor-meta .select {
    height: 37px;
    background: #fbfcf9;
}

.cover-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}

.cover-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 170px;
    height: 72px;
    overflow: hidden;
    border: 1px dashed #ccd9ce;
    border-radius: 9px;
    background-color: #eef3ec;
    background-position: center;
    background-size: cover;
}

.cover-preview.has-image {
    border-style: solid;
    border-color: var(--line);
    box-shadow: 0 4px 12px rgba(31, 56, 42, .08);
}

.cover-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #9aaa9e;
}

.cover-placeholder i {
    font-size: 17px;
}

.cover-placeholder small {
    font-size: 9px;
}

.cover-copy {
    min-width: 0;
}

.cover-copy strong {
    display: block;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 700;
}

.cover-copy p {
    margin: 2px 0 6px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.cover-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.cover-actions .text-link {
    font-size: 11px;
}

.editor-toolbar {
    display: flex;
    align-items: center;
    gap: 3px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 11px 11px 0 0;
    background: var(--surface-soft);
}

.tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 29px;
    height: 28px;
    padding: 0 7px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
}

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

.tool-btn.is-active {
    background: var(--brand);
    color: #fff;
}

.tool-btn-text {
    width: auto;
    padding: 0 10px;
    font-size: 10px;
    font-weight: 650;
}

.toolbar-spacer {
    flex: 1;
}

.editor-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 610px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0 0 12px 12px;
    background: var(--surface);
}

.editor-pane {
    display: flex;
    min-width: 0;
    min-height: 610px;
}

.editor-split.is-preview-only,
.editor-split.is-edit-only {
    grid-template-columns: minmax(0, 1fr);
}

.editor-split.is-preview-only .editor-pane {
    display: none;
}

.editor-split.is-edit-only .preview-pane {
    display: none;
}

.markdown-input {
    display: block;
    width: 100%;
    min-height: 610px;
    padding: 21px 20px;
    border: 0;
    background: #fff;
    color: var(--ink-soft);
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.95;
    outline: none;
    resize: vertical;
}

.markdown-input::placeholder {
    color: #aeb9b0;
}

.preview-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 610px;
    padding: 13px;
    border-left: 1px solid var(--line);
    background: #edf1eb;
}

.preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 1px 4px 10px;
    color: var(--muted);
    font-size: 10px;
}

.preview-head span:first-child {
    color: var(--brand);
    font-weight: 650;
}

.preview-head i {
    margin-right: 4px;
}

.preview-note {
    color: var(--muted-2);
    font-size: 9px;
}

.phone-frame {
    position: relative;
    flex: 1;
    min-height: 520px;
    overflow: hidden;
    margin: 0 auto;
    width: 100%;
    max-width: 390px;
    border: 1px solid #dbe3da;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(31, 56, 42, .08);
}

.preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 520px;
    border: 0;
    background: #fff;
}

.preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255, 255, 255, .82);
    color: var(--muted);
    font-size: 11px;
    backdrop-filter: blur(2px);
}

.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 2px 0;
    color: var(--muted-2);
    font-size: 9px;
    line-height: 1.6;
}

.editor-footer i {
    margin-right: 3px;
}

.advanced-box {
    margin-top: 13px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface-soft);
}

.advanced-box summary {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 10px 12px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.advanced-box summary::-webkit-details-marker {
    display: none;
}

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

.advanced-box .textarea {
    margin: 11px;
    width: calc(100% - 22px);
    background: #fff;
}

/* 工作台右侧 */

.workbench-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.workbench-side .panel {
    margin-bottom: 0;
}

.workbench-side .panel-heading h3 {
    display: flex;
    align-items: center;
    gap: 7px;
}

.workbench-side .panel-heading h3 i {
    color: var(--brand);
    font-size: 13px;
}

.ai-panel {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 100% 0%, rgba(197, 151, 90, .1), transparent 13rem),
        var(--surface);
}

.ai-panel::before {
    position: absolute;
    top: 0;
    left: 21px;
    right: 21px;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand), var(--gold));
    content: "";
}

.ai-row-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.ai-panel .input,
.ai-panel .select {
    height: 36px;
    font-size: 12px;
}

.ai-panel .textarea {
    min-height: 72px;
    font-size: 12px;
}

.ai-details {
    border: 1px dashed var(--line-strong);
    border-radius: 9px;
    background: var(--surface-soft);
}

.ai-details summary {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 10px;
    color: var(--muted);
    font-size: 10px;
    cursor: pointer;
    list-style: none;
}

.ai-details summary::-webkit-details-marker {
    display: none;
}

.ai-details[open] summary {
    border-bottom: 1px solid var(--line);
}

.ai-details .textarea {
    width: calc(100% - 16px);
    margin: 8px;
    background: #fff;
}

.ai-footnote {
    color: var(--muted-2);
    font-size: 9px;
    line-height: 1.6;
    text-align: center;
}

.ai-footnote i {
    margin-right: 3px;
    color: var(--brand);
}

.inline-empty {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 12px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background: var(--surface-soft);
}

.inline-empty i {
    margin-top: 2px;
    color: var(--gold);
}

.inline-empty p {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.65;
}

.inline-empty code {
    padding: 1px 4px;
    border-radius: 4px;
    background: var(--surface-muted);
    color: var(--brand-dark);
    font-size: 9px;
}

.inline-empty-small {
    padding: 18px 10px;
    justify-content: center;
    text-align: center;
}

.action-panel .action-stack {
    display: grid;
    gap: 8px;
}

.action-note {
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed var(--line);
    color: var(--muted-2);
    font-size: 9px;
    line-height: 1.65;
}

.action-note i {
    margin-right: 3px;
    color: var(--brand);
}

.danger-zone {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 12px;
    padding-top: 11px;
    border-top: 1px dashed var(--line);
}

.danger-zone .text-link {
    font-size: 10px;
}

.schedule-panel .field {
    margin-bottom: 9px;
}

.schedule-panel .input {
    height: 37px;
    font-size: 12px;
}

.schedule-current {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 8px;
    padding: 7px 9px;
    border-radius: 7px;
    background: var(--brand-softer);
    color: var(--brand-dark);
    font-size: 10px;
}

.schedule-tip {
    margin-top: 10px;
    color: var(--muted-2);
    font-size: 9px;
    line-height: 1.6;
}

.schedule-tip i {
    margin-right: 3px;
}

.mini-list {
    display: grid;
    gap: 5px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
}

.mini-caption {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 650;
    letter-spacing: .05em;
}

.mini-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--ink-soft);
    font-size: 10px;
    line-height: 1.5;
}

.mini-item:hover {
    color: var(--brand);
}

.mini-item span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mini-item small {
    flex: 0 0 auto;
    color: var(--muted-2);
    font-size: 9px;
}

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

.recent-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 5px;
    border-radius: 7px;
    color: var(--ink-soft);
    font-size: 11px;
}

.recent-item:hover,
.recent-item.is-current {
    background: var(--brand-softer);
    color: var(--brand-dark);
}

.recent-title {
    overflow: hidden;
    flex: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item small {
    flex: 0 0 auto;
    color: var(--muted-2);
    font-size: 9px;
}

/* ------------------------- 文章库 ------------------------- */

.article-list {
    display: grid;
    gap: 11px;
}

.article-card {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr) auto;
    gap: 15px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.article-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 8px 24px rgba(31, 56, 42, .055);
    transform: translateY(-1px);
}

.article-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 126px;
    height: 82px;
    border-radius: 9px;
    background-color: #eaf0e8;
    background-position: center;
    background-size: cover;
    color: #9eada1;
}

.article-cover i {
    font-size: 19px;
}

.article-body {
    min-width: 0;
}

.article-topline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.article-title {
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.45;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.article-title a {
    color: var(--ink);
}

.article-title a:hover {
    color: var(--brand);
}

.article-excerpt {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 7px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    color: var(--muted-2);
    font-size: 9px;
}

.article-meta i {
    margin-right: 3px;
}

.article-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    max-width: 190px;
}

.article-actions .btn {
    padding: 6px 9px;
}

.article-actions .icon-btn {
    width: 31px;
    height: 31px;
}

/* ------------------------- 模板 ------------------------- */

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

.template-card {
    display: flex;
    flex-direction: column;
    min-height: 230px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(197, 151, 90, .07), transparent 12rem),
        var(--surface);
    box-shadow: var(--shadow);
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.template-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 16px 42px rgba(31, 56, 42, .08);
    transform: translateY(-2px);
}

.template-top {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.template-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
}

.template-title {
    min-width: 0;
}

.template-title h3 {
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.4;
}

.template-badges {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.template-desc {
    margin-top: 11px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.65;
}

.template-prompt {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    padding: 10px;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
    line-height: 1.7;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.template-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 14px;
}

.template-foot .text-muted {
    overflow: hidden;
    max-width: 130px;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.template-foot .text-muted i {
    margin-right: 3px;
}

.template-editor {
    max-width: 920px;
}

.template-editor .panel {
    padding: 23px;
}

.prompt-examples {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-top: 11px;
    color: var(--muted-2);
    font-size: 10px;
}

.chip {
    padding: 4px 9px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 10px;
}

.chip:hover {
    border-color: rgba(31, 107, 79, .3);
    background: var(--brand-soft);
    color: var(--brand);
}

.sticky-actions {
    position: sticky;
    bottom: 18px;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 18px;
    padding: 12px 16px;
    border: 1px solid rgba(219, 227, 218, .9);
    border-radius: 14px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 12px 30px rgba(31, 56, 42, .09);
    backdrop-filter: blur(12px);
}

/* ------------------------- 公众号账号 ------------------------- */

.account-list {
    display: grid;
    gap: 10px;
}

.account-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    transition: border-color .18s ease, background .18s ease;
}

.account-card:hover {
    border-color: var(--line-strong);
}

.account-card.is-highlighted {
    border-color: rgba(31, 107, 79, .3);
    background: linear-gradient(135deg, #fff, var(--brand-softer));
}

.account-main {
    display: flex;
    align-items: flex-start;
    gap: 11px;
    min-width: 0;
}

.account-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e8f5ec;
    color: #2c9e66;
    font-size: 18px;
}

.account-info {
    min-width: 0;
}

.account-title {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.account-title h3 {
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.account-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
    color: var(--muted-2);
    font-size: 9px;
}

.account-meta i {
    margin-right: 3px;
}

.account-error {
    display: flex;
    align-items: flex-start;
    gap: 5px;
    margin-top: 6px;
    padding: 5px 7px;
    border-radius: 6px;
    background: var(--danger-soft);
    color: #8f3b32;
    font-size: 9px;
    line-height: 1.55;
}

.account-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    justify-content: flex-end;
    flex: 0 0 auto;
}

.account-actions .btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 10px;
}

/* ------------------------- 预览 ------------------------- */

.preview-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 20px;
    align-items: start;
}

.preview-stage {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 760px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .9), transparent 26rem),
        linear-gradient(135deg, #e9efe6, #f2f5ef);
}

.preview-phone {
    width: min(390px, 100%);
    height: 720px;
    overflow: hidden;
    border: 8px solid #16261d;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(20, 45, 30, .22);
}

.preview-phone-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 26px;
    padding: 0 15px;
    background: #16261d;
    color: #dce9df;
    font-size: 8px;
}

.preview-phone-bar span:last-child {
    display: flex;
    gap: 5px;
    font-size: 7px;
}

.preview-phone-content {
    display: block;
    width: 100%;
    height: calc(100% - 26px);
    border: 0;
    background: #fff;
}

.preview-side {
    position: sticky;
    top: 94px;
}

.preview-status-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.preview-title {
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: 25px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.015em;
}

.preview-author {
    margin-top: 7px;
    color: var(--brand);
    font-size: 11px;
    font-weight: 650;
}

.preview-digest {
    margin-top: 10px;
    padding: 11px;
    border-radius: 9px;
    background: var(--surface-soft);
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.preview-cover {
    height: 110px;
    margin-top: 12px;
    border-radius: 10px;
    background-position: center;
    background-size: cover;
}

.meta-list {
    display: grid;
    gap: 7px;
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.meta-list > div {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 10px;
}

.meta-list dt {
    flex: 0 0 auto;
    color: var(--muted-2);
}

.meta-list dd {
    overflow: hidden;
    color: var(--ink-soft);
    text-align: right;
    text-overflow: ellipsis;
}

/* ------------------------- 公众号草稿 ------------------------- */

.remote-list {
    display: grid;
    gap: 10px;
}

.remote-card {
    display: flex;
    align-items: flex-start;
    gap: 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.remote-card:hover {
    border-color: var(--line-strong);
    box-shadow: 0 7px 22px rgba(31, 56, 42, .05);
}

.remote-card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: #e8f5ec;
    color: #2c9e66;
    font-size: 18px;
}

.remote-card-body {
    flex: 1;
    min-width: 0;
}

.remote-card-body h3 {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.remote-card-body > p {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.remote-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 9px;
}

.remote-meta i {
    margin-right: 3px;
}

.remote-card-body .pill {
    margin-top: 7px;
}

.remote-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.remote-actions .btn {
    min-height: 30px;
    padding: 5px 8px;
    font-size: 10px;
}

.remote-actions .icon-btn {
    width: 31px;
    height: 31px;
}

.remote-preview-page {
    min-height: 100vh;
    padding: 0 20px 50px;
    background:
        radial-gradient(circle at 50% 0%, rgba(197, 151, 90, .08), transparent 28rem),
        #edf2ea;
}

.remote-preview-topbar {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 900px;
    margin: 0 auto;
    padding: 18px 0;
}

.remote-account {
    color: var(--brand);
    font-size: 11px;
    font-weight: 650;
}

.remote-account i {
    margin-right: 4px;
}

.remote-id {
    margin-left: auto;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9px;
}

.remote-preview-head {
    max-width: 760px;
    margin: 0 auto 20px;
    text-align: center;
}

.remote-preview-head h1 {
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: clamp(24px, 3vw, 34px);
    font-weight: 700;
    line-height: 1.4;
}

.remote-preview-head p {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
}

.remote-phone {
    width: min(430px, 100%);
    height: 740px;
    margin: 0 auto;
    overflow: hidden;
    border: 8px solid #16261d;
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 28px 70px rgba(20, 45, 30, .22);
}

.remote-phone-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #fff;
}

.remote-preview-foot {
    max-width: 500px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 10px;
    text-align: center;
}

/* ------------------------- 弹窗 / Toast ------------------------- */

body.modal-open {
    overflow: hidden;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(12, 30, 21, .48);
    backdrop-filter: blur(4px);
}

.modal-card {
    position: relative;
    z-index: 1;
    width: min(480px, 100%);
    max-height: calc(100vh - 36px);
    overflow-y: auto;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 18px;
    background: var(--surface);
    box-shadow: 0 30px 90px rgba(8, 24, 15, .3);
    animation: modal-in .22s ease both;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-muted);
    color: var(--muted);
}

.modal-close:hover {
    background: var(--brand-soft);
    color: var(--brand);
}

.modal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 13px;
    border-radius: 13px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 18px;
}

.modal-icon.is-success {
    background: #e7f5ed;
    color: #2c8c60;
}

.modal-card h3 {
    margin-bottom: 6px;
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.35;
}

.modal-card > p {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.7;
}

.modal-card .field {
    margin: 12px 0;
}

.modal-media {
    display: grid;
    gap: 8px;
    margin: 12px 0;
}

.modal-media-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: var(--surface-soft);
    font-size: 10px;
}

.modal-media-row span {
    flex: 0 0 auto;
    color: var(--muted-2);
}

.modal-media-row code {
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.modal-warnings {
    padding: 10px;
    border: 1px solid #f0dfc3;
    border-radius: 8px;
    background: var(--warning-soft);
    color: #7e581f;
    font-size: 10px;
    line-height: 1.6;
}

.modal-warnings strong {
    display: block;
    margin-bottom: 4px;
}

.modal-warnings ul {
    display: grid;
    gap: 2px;
    padding-left: 14px;
    list-style: disc;
}

.modal-checklist {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface-soft);
}

.modal-checklist p {
    margin-bottom: 4px;
    color: var(--ink-soft);
    font-size: 11px;
}

.modal-checklist ol {
    display: grid;
    gap: 3px;
    padding-left: 16px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    list-style: decimal;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 18px;
}

.toast-stack {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 11px 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 11px;
    line-height: 1.6;
    box-shadow: 0 16px 45px rgba(17, 42, 26, .18);
    pointer-events: auto;
    animation: toast-in .22s ease both;
}

.toast > i {
    flex: 0 0 auto;
    margin-top: 2px;
    color: var(--info);
    font-size: 14px;
}

.toast > span {
    flex: 1;
    min-width: 0;
}

.toast-success {
    border-color: #cfe6d8;
    background: #f4fbf7;
}

.toast-success > i {
    color: #2c8c60;
}

.toast-error {
    border-color: #f0d2ce;
    background: #fdf7f6;
}

.toast-error > i {
    color: var(--danger);
}

.toast-warning {
    border-color: #f0dfc3;
    background: #fffaf1;
}

.toast-warning > i {
    color: var(--warning);
}

.toast-close {
    flex: 0 0 auto;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--muted-2);
}

.toast.is-leaving {
    opacity: 0;
    transform: translateY(5px);
    transition: all .2s ease;
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------- 响应式 ------------------------- */

@media (max-width: 1320px) {
    .workbench-grid {
        grid-template-columns: minmax(0, 1fr) 326px;
    }

    .editor-meta {
        grid-template-columns: 1fr 1fr;
    }

    .editor-meta .field-grow {
        grid-column: 1 / -1;
    }

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

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

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

    .recent-panel {
        grid-column: 1 / -1;
    }

    .side-panel {
        position: static;
    }

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

    .split-layout,
    .split-wide {
        grid-template-columns: minmax(0, 1fr);
    }

    .preview-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .preview-side {
        position: static;
    }
}

@media (max-width: 980px) {
    .sidebar {
        transform: translateX(-104%);
        transition: transform .25s ease;
        box-shadow: 18px 0 45px rgba(8, 24, 15, .18);
    }

    body.sidebar-open .sidebar {
        transform: none;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    .sidebar-backdrop {
        position: fixed;
        inset: 0;
        z-index: 35;
        display: none;
        background: rgba(10, 25, 16, .4);
        backdrop-filter: blur(2px);
    }

    body.sidebar-open .sidebar-backdrop {
        display: block;
    }

    .app-main {
        margin-left: 0;
    }

    .topbar-menu {
        display: inline-flex;
    }

    .topbar {
        padding: 0 20px;
    }

    .page-content {
        padding: 20px 20px 54px;
    }

    .article-card {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .article-cover {
        width: 110px;
        height: 74px;
    }

    .article-actions {
        grid-column: 1 / -1;
        max-width: none;
        justify-content: flex-start;
        padding-top: 3px;
        border-top: 1px dashed var(--line);
    }
}

@media (max-width: 900px) {
    .auth-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    .tool-btn-split {
        display: none;
    }

    .auth-story {
        display: none;
    }

    .auth-card {
        width: min(460px, calc(100% - 34px));
        padding: 34px 0;
    }

    .auth-mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;
        margin-bottom: 25px;
        color: var(--ink);
        font-family: "STSong", "SimSun", serif;
        font-size: 19px;
        font-weight: 700;
    }

    .auth-mobile-brand .brand-mark {
        width: 38px;
        height: 38px;
        background: var(--sidebar);
        color: var(--cream);
        font-size: 19px;
    }

    .editor-split {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
    }

    .editor-pane {
        min-height: 0;
    }

    .markdown-input {
        min-height: 480px;
    }

    .preview-pane {
        display: none;
        min-height: 0;
        border-top: 1px solid var(--line);
        border-left: 0;
    }

    .editor-split.is-preview-only .editor-pane {
        display: none;
    }

    .editor-split.is-preview-only .preview-pane {
        display: flex;
    }

    .editor-split.is-edit-only .preview-pane {
        display: none;
    }

    .preview-frame {
        min-height: 480px;
    }

    .phone-frame {
        min-height: 480px;
    }
}

@media (max-width: 760px) {
    .page-content {
        padding: 16px 14px 46px;
    }

    .topbar {
        height: 64px;
        padding: 0 14px;
    }

    .topbar-kicker {
        display: none;
    }

    .topbar-heading h1 {
        font-size: 15px;
    }

    .topbar-new span {
        display: none;
    }

    .topbar-new {
        width: 36px;
        height: 36px;
        min-height: 0;
        padding: 0;
        border-radius: 9px;
    }

    .topbar-avatar {
        display: none;
    }

    .page-heading-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .page-heading-row h2 {
        font-size: 25px;
    }

    .heading-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .heading-actions .btn {
        flex: 1;
    }

    .workbench-heading-actions {
        justify-content: flex-start;
    }

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

    .stat-card {
        padding: 11px;
    }

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

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

    .editor-panel {
        padding: 16px;
    }

    .title-input {
        font-size: 27px;
    }

    .editor-meta {
        grid-template-columns: 1fr;
    }

    .editor-meta .field-grow {
        grid-column: auto;
    }

    .cover-row {
        align-items: flex-start;
    }

    .cover-preview {
        width: 120px;
        height: 62px;
    }

    .cover-copy p {
        display: none;
    }

    .cover-actions .btn {
        padding: 5px 7px;
        font-size: 10px;
    }

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

    .field-full {
        grid-column: auto;
    }

    .check-grid {
        grid-template-columns: 1fr;
    }

    .workbench-side {
        grid-template-columns: minmax(0, 1fr);
    }

    .recent-panel {
        grid-column: auto;
    }

    .article-card {
        grid-template-columns: 88px minmax(0, 1fr);
        gap: 10px;
        padding: 10px;
    }

    .article-cover {
        width: 88px;
        height: 66px;
    }

    .article-title {
        font-size: 14px;
    }

    .article-excerpt {
        -webkit-line-clamp: 2;
    }

    .article-meta {
        gap: 7px;
    }

    .article-actions {
        gap: 4px;
    }

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

    .account-card {
        flex-direction: column;
        align-items: stretch;
    }

    .account-actions {
        justify-content: flex-start;
        padding-top: 9px;
        border-top: 1px dashed var(--line);
    }

    .remote-card {
        flex-wrap: wrap;
    }

    .remote-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px dashed var(--line);
    }

    .preview-stage {
        padding: 12px;
        min-height: 0;
    }

    .preview-phone {
        height: 620px;
    }

    .preview-phone-content {
        height: calc(100% - 26px);
    }

    .remote-phone {
        height: 620px;
    }

    .filter-bar {
        align-items: stretch;
    }

    .filter-search {
        flex-basis: 100%;
    }

    .filter-count {
        margin-left: 0;
    }

    .auth-form {
        padding: 19px;
    }

    .auth-heading h2 {
        font-size: 26px;
    }

    .modal-card {
        padding: 22px;
    }

    .modal-actions {
        flex-wrap: wrap;
    }

    .modal-actions .btn {
        flex: 1;
    }

    .remote-preview-page {
        padding: 0 12px 36px;
    }

    .remote-preview-topbar {
        flex-wrap: wrap;
        padding: 12px 0;
    }

    .remote-id {
        width: 100%;
        margin-left: 0;
    }

    .remote-preview-head {
        text-align: left;
    }

    .split-layout,
    .split-wide {
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .stat-grid-3,
    .stat-grid-4,
    .stat-grid-5 {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .stat-icon {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

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

    .stat-card small {
        font-size: 9px;
    }

    .editor-toolbar {
        gap: 1px;
        padding: 5px;
    }

    .tool-btn {
        min-width: 27px;
        padding: 0 5px;
    }

    .tool-btn-text {
        padding: 0 7px;
    }

    .cover-row {
        flex-direction: column;
    }

    .cover-preview {
        width: 100%;
        height: 90px;
    }

    .cover-actions {
        width: 100%;
    }

    .cover-actions .btn {
        flex: 1;
    }

    .article-card {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .article-cover {
        width: 74px;
        height: 60px;
    }

    .article-meta span:nth-child(n+4) {
        display: none;
    }

    .title-input {
        font-size: 24px;
    }

    .panel-heading h3 {
        font-size: 14px;
    }

    .toast-stack {
        right: 10px;
        bottom: 10px;
        width: calc(100vw - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ============================================================
   1.1 新增：品牌设置、审批、个人中心、AI 定时任务、移动端修复
   ============================================================ */

button,
a,
input,
select,
textarea {
    touch-action: manipulation;
}

.brand-mark.has-logo {
    overflow: hidden;
    background: transparent;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}

.brand-mark.has-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.avatar.has-avatar,
.topbar-avatar.has-avatar,
.profile-avatar.has-avatar {
    overflow: hidden;
    padding: 0;
    background: var(--brand-soft);
}

.avatar.has-avatar img,
.topbar-avatar.has-avatar img,
.profile-avatar.has-avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.auth-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 13px;
    font-size: 11px;
}

.auth-links a {
    color: var(--brand);
    font-weight: 650;
}

.auth-footer {
    flex-wrap: wrap;
    line-height: 1.7;
}

.settings-tabs {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    margin-bottom: 18px;
    padding: 5px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 5px 18px rgba(31, 56, 42, .035);
}

.settings-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

.settings-tab:hover {
    background: var(--surface-soft);
    color: var(--ink);
}

.settings-tab.is-active {
    background: var(--brand);
    color: #fff;
}

.settings-form {
    max-width: 1100px;
}

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

.brand-asset {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}

.brand-asset-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    overflow: hidden;
    width: 100px;
    height: 72px;
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    background-color: var(--surface-muted);
    background-position: center;
    background-size: cover;
}

.brand-asset-preview.logo-preview {
    width: 76px;
    height: 76px;
    background: #fff;
}

.brand-asset-preview.logo-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.brand-asset-copy {
    min-width: 0;
}

.brand-asset-copy > strong {
    display: block;
    color: var(--ink-soft);
    font-size: 12px;
}

.brand-asset-copy > p {
    margin: 3px 0 8px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
}

.brand-asset-copy input[type="file"] {
    max-width: 100%;
    font-size: 10px;
}

.check-field-inline {
    width: auto;
    margin-top: 9px;
    padding: 7px 9px;
}

.provider-list {
    display: grid;
    gap: 12px;
}

.provider-card {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface-soft);
}

.provider-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.provider-head h3 {
    margin-top: 4px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
}

.provider-card .form-grid {
    gap: 11px;
}

.template-import-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    padding: 13px 15px;
    border: 1px dashed var(--line-strong);
    border-radius: 12px;
    background: var(--brand-softer);
}

.template-import-copy {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.template-import-copy > i {
    margin-top: 2px;
    color: var(--brand);
    font-size: 15px;
}

.template-import-copy strong {
    display: block;
    color: var(--ink-soft);
    font-size: 12px;
}

.template-import-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.template-import-form input[type="file"] {
    max-width: 190px;
    font-size: 10px;
}

.approval-panel {
    border-color: #eddab9;
    background: linear-gradient(180deg, #fffdf8, var(--surface));
}

.approval-list {
    display: grid;
    gap: 9px;
}

.approval-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid #f0e1c8;
    border-radius: 11px;
    background: #fff;
}

.approval-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 13px;
}

.approval-icon.is-warn {
    background: var(--warning-soft);
    color: var(--warning);
}

.approval-body {
    flex: 1;
    min-width: 0;
}

.approval-title {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.approval-title strong {
    color: var(--ink);
    font-size: 13px;
}

.approval-body p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
}

.approval-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

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

.profile-card {
    text-align: left;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--line);
}

.profile-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 27px;
    font-weight: 700;
}

.profile-identity {
    min-width: 0;
}

.profile-identity h3 {
    margin-top: 5px;
    color: var(--ink);
    font-family: "STSong", "SimSun", serif;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.profile-identity p {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
}

.job-list {
    display: grid;
    gap: 10px;
}

.job-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 13px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--surface);
}

.job-card.is-paused {
    background: var(--surface-soft);
}

.job-main {
    flex: 1;
    min-width: 0;
}

.job-title-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.job-main h3 {
    overflow: hidden;
    color: var(--ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.job-topic {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.job-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 9px;
}

.job-meta i {
    margin-right: 3px;
}

.job-main .text-link {
    margin-top: 7px;
    font-size: 10px;
}

.job-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.job-actions .icon-btn {
    width: 31px;
    height: 31px;
}

@media (max-width: 980px) {
    .brand-assets {
        grid-template-columns: minmax(0, 1fr);
    }

    .profile-layout {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    input,
    select,
    textarea,
    .input-wrap input,
    .input,
    .select,
    .textarea {
        font-size: 16px !important;
    }

    .table-wrap {
        overflow: visible;
        margin: 0;
    }

    .settings-tabs {
        border-radius: 10px;
    }

    .template-import-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .template-import-form {
        width: 100%;
        flex-wrap: wrap;
    }

    .template-import-form input[type="file"] {
        flex: 1;
        max-width: none;
    }

    .approval-card {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .approval-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px dashed var(--line);
    }

    .job-card {
        flex-direction: column;
    }

    .job-actions {
        width: 100%;
        justify-content: flex-end;
        padding-top: 8px;
        border-top: 1px dashed var(--line);
    }

    .brand-asset {
        flex-direction: column;
    }

    .brand-asset-preview,
    .brand-asset-preview.logo-preview {
        width: 100%;
        height: 110px;
    }

    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 10px;
        padding: 10px 12px;
        border: 1px solid var(--line);
        border-radius: 11px;
        background: var(--surface);
    }

    .responsive-table td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 7px 0;
        border: 0;
        text-align: right;
    }

    .responsive-table td::before {
        flex: 0 0 auto;
        color: var(--muted-2);
        font-size: 10px;
        font-weight: 650;
        text-align: left;
        content: attr(data-label);
    }

    .responsive-table td[data-label="用户"] {
        display: block;
        padding-bottom: 9px;
        border-bottom: 1px dashed var(--line);
        text-align: left;
    }

    .responsive-table td[data-label="用户"]::before {
        display: none;
    }

    .responsive-table td.align-right {
        display: block;
        padding-top: 9px;
        border-top: 1px dashed var(--line);
        text-align: left;
    }

    .responsive-table td.align-right::before {
        display: none;
    }

    .responsive-table .row-actions {
        justify-content: flex-start;
    }

    .responsive-table .entity-cell {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .auth-links {
        gap: 12px;
    }

    .settings-tab {
        padding: 8px 10px;
        font-size: 11px;
    }

    .approval-actions .btn {
        flex: 1;
    }
}
