.publish-page {
    max-width: 72rem;
}

.publish-eyebrow {
    margin: 0;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 800;
}

.publish-hero h1 {
    margin: 0.55rem 0 0;
    color: #0f172a;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.6rem);
    font-weight: 800;
    line-height: 1.2;
}

.publish-hero p,
.publish-hint,
.publish-wechat {
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.75;
}

.publish-status,
.publish-card {
    margin-top: 1.25rem;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    background: #fff;
    padding: 1.1rem 1.2rem 1.25rem;
}

.publish-status h2,
.publish-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.publish-status p {
    margin: 0.45rem 0 0;
    color: #475569;
    line-height: 1.7;
}

.publish-status a,
.publish-empty a {
    color: #2563eb;
    font-weight: 700;
}

.publish-status.is-missing {
    border-color: #fdba74;
    background: #fff7ed;
}

.publish-status.is-ready {
    border-color: #86efac;
    background: #f0fdf4;
}

.publish-status.is-trust {
    border-color: #93c5fd;
    background: #eff6ff;
}

.publish-layout {
    display: grid;
    gap: 1rem;
}

@media (min-width: 960px) {
    .publish-layout {
        grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr);
        align-items: start;
    }
}

.publish-card label {
    display: grid;
    gap: 0.35rem;
    margin-top: 0.9rem;
}

.publish-card label span {
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.publish-cover {
    display: grid;
    gap: 0.65rem;
    margin-top: 0.9rem;
}

.publish-cover > span {
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.publish-cover-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.6rem;
}

.publish-cover-picker .publish-cover-choose + .publish-cover-choose {
    background: #0f172a;
}

.publish-cover-picker .publish-cover-choose + .publish-cover-choose:hover {
    background: #1e293b;
}

.publish-cover-choose:disabled {
    opacity: 0.65;
    cursor: wait;
}

.publish-cover .publish-cover-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.publish-cover-choose {
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 0.55rem 1.05rem;
    cursor: pointer;
}

.publish-cover-choose:hover {
    background: #1d4ed8;
}

.publish-cover-picker p {
    margin: 0;
    color: #64748b;
    font-size: 0.85rem;
}

.publish-cover-preview {
    width: 180px;
    height: 112px;
    object-fit: cover;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
}

.publish-body-preview-wrap {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.9rem;
}

.publish-body-preview-wrap > span {
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
}

.publish-body-hint {
    margin: 0;
    color: #64748b;
    font-size: 0.82rem;
    line-height: 1.5;
}

.publish-article-preview {
    min-height: 14rem;
    max-height: 36rem;
    overflow: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    background: #fff;
    color: #334155;
    padding: 1rem 1.1rem 1.2rem;
    font-size: 0.92rem;
    line-height: 1.8;
}

.publish-article-preview__empty,
.publish-article-preview__digest {
    margin: 0 0 0.85rem;
    color: #64748b;
    font-size: 0.88rem;
}

.publish-article-preview__empty {
    margin: 0;
    color: #94a3b8;
}

.publish-article-preview h1,
.publish-article-preview h2,
.publish-article-preview h3 {
    color: #0f172a;
    font-family: Manrope, Inter, sans-serif;
    font-weight: 800;
    line-height: 1.35;
}

.publish-article-preview h1 {
    margin: 0 0 0.7rem;
    font-size: 1.3rem;
}

.publish-article-preview h2 {
    margin: 1.15rem 0 0.5rem;
    padding-top: 0.8rem;
    border-top: 1px solid #eef4fb;
    font-size: 1.02rem;
}

.publish-article-preview h3 {
    margin: 0.9rem 0 0.35rem;
    font-size: 0.95rem;
}

.publish-article-preview p,
.publish-article-preview ul,
.publish-article-preview ol {
    margin: 0.5rem 0;
}

.publish-article-preview ul,
.publish-article-preview ol {
    padding-left: 1.2rem;
}

.publish-article-preview img {
    display: block;
    width: 100%;
    max-width: 40rem;
    height: auto;
    margin: 0.8rem 0 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    background: #f8fafc;
}

.publish-cover-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.publish-cover-meta p {
    margin: 0;
    color: #475569;
    font-size: 0.85rem;
}

.publish-cover.is-required.is-missing {
    padding: 0.75rem 0.85rem;
    border: 1px solid #fecaca;
    border-radius: 0.85rem;
    background: #fff7f7;
}

.publish-cover-hint {
    margin: 0;
    color: #b42318;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.45;
}

.publish-card input,
.publish-card textarea {
    width: 100%;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    padding: 0.7rem 0.8rem;
    color: #0f172a;
    font: inherit;
}

.publish-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.publish-text-button,
.publish-trust,
.publish-submit {
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
}

.publish-text-button,
.publish-trust {
    background: #e2e8f0;
    color: #0f172a;
    padding: 0.45rem 0.8rem;
}

.publish-submit {
    width: 100%;
    margin-top: 1rem;
    background: #2563eb;
    color: #fff;
    padding: 0.8rem 1rem;
}

.publish-submit:disabled {
    cursor: not-allowed;
    background: #94a3b8;
}

.publish-platforms {
    display: grid;
    gap: 0.55rem;
    max-height: 28rem;
    overflow: auto;
    margin-top: 0.75rem;
}

.publish-platform {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    padding: 0.65rem 0.75rem;
}

.publish-platform.is-disabled {
    cursor: not-allowed;
    background: #f8fafc;
}

.publish-platform.is-disabled input {
    cursor: not-allowed;
}

.publish-platform img,
.publish-platform-fallback {
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.25rem;
    object-fit: contain;
}

.publish-platform-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #eff6ff;
    color: #2563eb;
    font-size: 0.72rem;
    font-weight: 800;
}

.publish-platform strong,
.publish-platform small {
    display: block;
}

.publish-platform strong {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.publish-tier {
    position: sticky;
    top: 0;
    z-index: 1;
    margin: 0.35rem 0 0;
    padding: 0.45rem 0.15rem 0.35rem;
    background: #fff;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
}

.publish-tier.is-high {
    color: #166534;
}

.publish-tier.is-mid {
    color: #a16207;
}

.publish-ai-tag {
    border-radius: 999px;
    padding: 0.05rem 0.4rem;
    font-style: normal;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.4;
}

.publish-ai-tag.is-high {
    background: #dcfce7;
    color: #166534;
}

.publish-ai-tag.is-mid {
    background: #fef9c3;
    color: #854d0e;
}

.publish-ai-tag.is-low {
    background: #f1f5f9;
    color: #64748b;
}

.publish-tier-more {
    margin-top: 0.35rem;
}

.publish-tier-more summary {
    cursor: pointer;
    padding: 0.55rem 0.15rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 800;
}

.publish-tier-more summary:hover {
    color: #334155;
}

.publish-platform small {
    color: #64748b;
    line-height: 1.45;
}

.publish-platform small.is-logged-in {
    color: #15803d;
}

.publish-result {
    min-height: 1.4rem;
    margin: 0.75rem 0 0;
    color: #334155;
    font-size: 0.9rem;
}

.publish-history {
    margin-top: 1rem;
}

.publish-history-list {
    display: grid;
    gap: 0.65rem;
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.publish-history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    border: 1px solid #e6eef9;
    border-radius: 0.85rem;
    background: #f8fbff;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.publish-history-row:hover,
.publish-history-row.is-active {
    border-color: #93c5fd;
    background: #eff6ff;
}

.publish-history-item {
    display: grid;
    gap: 0.25rem;
    width: 100%;
    border: 0;
    border-radius: 0.85rem 0 0 0.85rem;
    background: transparent;
    padding: 0.8rem 0.35rem 0.8rem 0.9rem;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.publish-history-item strong {
    color: #0f172a;
    font-size: 0.92rem;
    font-weight: 750;
}

.publish-history-item small {
    color: #64748b;
    font-size: 0.76rem;
    line-height: 1.45;
}

.publish-history-delete {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    margin: 0.55rem 0.55rem 0 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.publish-history-delete .material-symbols-outlined {
    font-size: 1.1rem;
    line-height: 1;
}

.publish-history-delete:hover,
.publish-history-delete:focus-visible {
    background: #fee2e2;
    color: #dc2626;
    outline: none;
}

.publish-outcomes {
    margin: 0.5rem 0 0;
    padding: 0;
    list-style: none;
}

.publish-outcomes li {
    margin: 0.35rem 0;
    color: #15803d;
    font-size: 0.9rem;
    line-height: 1.5;
}

.publish-outcomes a {
    margin-left: 0.35rem;
    color: #1d4ed8;
}

.publish-outcomes li.is-pending,
.publish-outcomes li.is-unconfirmed {
    color: #475569;
}

.publish-mask {
    position: fixed;
    inset: 0;
    z-index: 12000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(8px);
}

.publish-mask:not([hidden]) {
    display: flex;
}

.publish-mask-card {
    width: min(26rem, 100%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 1.25rem;
    background: #fff;
    padding: 1.35rem 1.4rem 1.2rem;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
}

.publish-mask-head {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.publish-mask-spinner {
    width: 1.15rem;
    height: 1.15rem;
    border: 2px solid #dbeafe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: publish-spin 0.8s linear infinite;
    flex: none;
}

@keyframes publish-spin {
    to {
        transform: rotate(360deg);
    }
}

.publish-mask-title {
    margin: 0;
    color: #0f172a;
    font-family: Manrope, Inter, sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
}

.publish-mask-card > p {
    margin: 0.7rem 0 0;
    color: #475569;
    line-height: 1.65;
}

.publish-mask-list {
    display: grid;
    gap: 0.45rem;
    margin: 1rem 0 0;
    padding: 0;
    list-style: none;
}

.publish-mask-list li {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
    padding: 0.6rem 0.75rem;
    border-radius: 0.75rem;
    background: #eff6ff;
    color: #1e3a8a;
    line-height: 1.45;
}

.publish-mask-list li::before {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 50%;
    background: #2563eb;
    flex: none;
}

.publish-mask-list li.is-success {
    background: #f0fdf4;
    color: #166534;
}

.publish-mask-list li.is-success::before {
    background: #16a34a;
}

.publish-mask-list li.is-draft {
    background: #eff6ff;
    color: #1d4ed8;
}

.publish-mask-list li.is-unconfirmed {
    background: #f8fafc;
    color: #475569;
}

.publish-mask-list li.is-unconfirmed::before {
    background: #94a3b8;
}


.publish-install {
    margin-top: 1.25rem;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #f8fbff;
    padding: 1.15rem 1.25rem 1.3rem;
}

.publish-install h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.publish-install > p {
    margin: 0.55rem 0 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.75;
}

.publish-install-actions {
    margin: 0.9rem 0 0;
}

/* a.publish-download must beat .publish-status a { color: #2563eb },
   otherwise default text is the same blue as the button background. */
a.publish-download,
.publish-status a.publish-download,
.publish-empty a.publish-download,
.publish-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.15rem;
    border-radius: 999px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

a.publish-download:hover,
a.publish-download:focus-visible,
a.publish-download:visited,
.publish-status a.publish-download:hover,
.publish-empty a.publish-download:hover,
.publish-download:hover {
    background: #1d4ed8;
    color: #ffffff;
}

.publish-install-steps,
.publish-status .publish-install-steps {
    margin: 0.85rem 0 0;
    padding-left: 1.25rem;
    color: #334155;
    line-height: 1.75;
}

.publish-install-steps li + li {
    margin-top: 0.65rem;
}

.publish-install-steps--compact {
    margin-top: 0.6rem;
}

.publish-copy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem 0.6rem;
    margin-top: 0.45rem;
}

.publish-copy-row code {
    padding: 0.15rem 0.45rem;
    border-radius: 0.4rem;
    background: #eef2ff;
    color: #1e3a8a;
    font-size: 0.9rem;
    user-select: all;
}

.publish-copy {
    border: 0;
    border-radius: 999px;
    background: #e2e8f0;
    color: #0f172a;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.25rem 0.7rem;
    cursor: pointer;
}

.publish-copy:hover {
    background: #cbd5e1;
}

.publish-install-note {
    margin-top: 0.9rem;
    color: #64748b;
    font-size: 0.88rem;
}

.publish-install {
    margin-top: 1.25rem;
    border: 1px solid #dbeafe;
    border-radius: 1rem;
    background: #f8fbff;
    padding: 1rem 1.15rem;
}

.publish-install-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem 1.25rem;
}

.publish-install-bar__text {
    flex: 1 1 18rem;
    min-width: 0;
}

.publish-install-bar__text h2,
.publish-install h2 {
    margin: 0;
    color: #0f172a;
    font-size: 1.05rem;
}

.publish-install-bar__text p,
.publish-install > p {
    margin: 0.35rem 0 0;
    color: #475569;
    font-size: 0.92rem;
    line-height: 1.7;
}

.publish-install-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin: 0;
}

.publish-status .publish-install-actions {
    margin-top: 0.85rem;
}

.publish-install-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 1.05rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.publish-install-open:hover {
    background: #f1f5f9;
}

body.publish-modal-open {
    overflow: hidden;
}

.publish-install-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
}

.publish-install-modal[hidden] {
    display: none;
}

.publish-install-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.publish-install-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(36rem, 100%);
    max-height: min(86vh, 40rem);
    overflow: auto;
    border-radius: 1.1rem;
    background: #ffffff;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.22);
    padding: 1.35rem 1.4rem 1.5rem;
}

.publish-install-modal__dialog h2 {
    margin: 0 1.8rem 0 0;
    color: #0f172a;
    font-size: 1.15rem;
}

.publish-install-modal__dialog > p {
    margin: 0.55rem 0 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.75;
}

.publish-install-modal__close {
    position: absolute;
    top: 0.7rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #0f172a;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}

.publish-install-modal__close:hover {
    background: #e2e8f0;
}

.publish-install-modal .publish-install-actions {
    margin-top: 0.9rem;
}

.publish-install-modal .publish-install-steps {
    margin: 0.9rem 0 0;
}

.publish-install-modal .publish-install-note {
    margin-top: 0.9rem;
}

.publish-card label.publish-cite-official {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.55rem;
    margin: 0.75rem 0 0;
    padding: 0.55rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.8rem;
    background: #fff;
    cursor: pointer;
}

.publish-card label.publish-cite-official input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: #2563eb;
}

.publish-card label.publish-cite-official span {
    color: #0f172a;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.4;
}
