:root {
    --sn-coral: #D97757;
    --sn-coral-deep: #BF5F42;
    --sn-coral-soft: #EFC4B0;
    --sn-coral-wash: #F7E5DA;
    --sn-paper: #F4F1E8;
    --sn-paper-2: #EAE6D8;
    --sn-paper-3: #DCD6C2;
    --sn-white: #FBF9F3;
    --sn-ink: #3D3929;
    --sn-ink-2: #6B6657;
    --sn-ink-3: #9A9485;
    --sn-hairline: #D9D3C2;
    --sn-leaf: #4F9F6E;
    --sn-leaf-deep: #3E8358;
    --sn-leaf-wash: #EAF3EC;
    --sn-slate: #3A4A5A;
    --sn-bg: var(--sn-paper);
    --sn-bg-soft: var(--sn-paper-2);
    --sn-card: var(--sn-white);
    --sn-text: var(--sn-ink);
    --sn-text-muted: var(--sn-ink-2);
    --sn-text-subtle: var(--sn-ink-3);
    --sn-border: var(--sn-hairline);
    --sn-primary: var(--sn-coral);
    --sn-primary-hover: var(--sn-coral-deep);
    --sn-success: var(--sn-leaf);
    --sn-success-hover: var(--sn-leaf-deep);
    --sn-success-soft: var(--sn-leaf-wash);
    --sn-success-border: rgba(79, 159, 110, 0.3);
    --sn-radius-xs: 6px;
    --sn-radius-sm: 8px;
    --sn-radius-md: 10px;
    --sn-radius-lg: 12px;
    --sn-shadow-sm: 0 6px 18px rgba(61, 57, 41, 0.07);
    --sn-shadow-md: 0 12px 28px rgba(61, 57, 41, 0.1);
    --sn-focus: 0 0 0 3px rgba(79, 159, 110, 0.18);
    --sn-ease: cubic-bezier(0.2, 0.6, 0.2, 1);
    --sn-dur-base: 150ms;
    --sn-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-width: 0;
    background: var(--sn-bg);
    color: var(--sn-text);
    font-size: 14px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-width: 0;
    min-height: 100vh;
    font-family: var(--sn-font-sans);
    font-size: 13.5px;
    line-height: 1.58;
    color: var(--sn-text);
    background:
        radial-gradient(circle at 12% 0%, rgba(247, 229, 218, 0.72), transparent 28rem),
        linear-gradient(180deg, var(--sn-paper) 0%, #EFEBDC 100%);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--sn-primary-hover);
    text-decoration: none;
}

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

h1,
h2,
h3,
p {
    margin: 0;
}

h2,
h3 {
    color: var(--sn-text);
    letter-spacing: 0;
}

p {
    color: var(--sn-text-muted);
}

.layout {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 100vh;
    background: transparent;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    width: 248px;
    min-height: 100vh;
    flex: 0 0 248px;
    flex-direction: column;
    padding: 20px 16px;
    color: var(--sn-text);
    background: rgba(251, 249, 243, 0.78);
    border-right: 1px solid var(--sn-border);
    box-shadow: 1px 0 0 rgba(251, 249, 243, 0.55);
    backdrop-filter: blur(12px);
}

.brand {
    margin-bottom: 22px;
    padding: 3px 4px 18px;
    border-bottom: 1px solid rgba(217, 211, 194, 0.82);
}

.brand-title {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--sn-text);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.brand-title::before {
    content: "CH";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    border-radius: var(--sn-radius-sm);
    color: var(--sn-white);
    background: var(--sn-coral);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
}

.brand-subtitle {
    margin-top: 7px;
    padding-left: 42px;
    color: var(--sn-text-subtle);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

.nav a {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 36px;
    padding: 9px 11px;
    color: var(--sn-text-muted);
    border: 1px solid transparent;
    border-radius: var(--sn-radius-sm);
    font-size: 13px;
    font-weight: 650;
    line-height: 1.25;
    transition:
        color var(--sn-dur-base) var(--sn-ease),
        background var(--sn-dur-base) var(--sn-ease),
        border-color var(--sn-dur-base) var(--sn-ease);
}

.nav a:hover {
    color: var(--sn-text);
    background: rgba(234, 230, 216, 0.72);
    border-color: rgba(217, 211, 194, 0.82);
}

.nav a.active {
    color: var(--sn-success-hover);
    background: var(--sn-success-soft);
    border-color: var(--sn-success-border);
}

.nav a.active::before {
    content: "";
    position: absolute;
    left: -5px;
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 99px;
    background: var(--sn-success);
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 20px;
    color: var(--sn-text-subtle);
    font-size: 11px;
    line-height: 1.5;
}

.content {
    min-width: 0;
    max-width: 1440px;
    flex: 1;
    margin: 0 auto;
    padding: 26px 28px 36px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.page-header h1 {
    color: var(--sn-text);
    font-size: 22px;
    font-weight: 800;
    line-height: 1.24;
    letter-spacing: 0;
}

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.page-body {
    min-width: 0;
    padding: 22px;
    background: rgba(251, 249, 243, 0.9);
    border: 1px solid rgba(217, 211, 194, 0.86);
    border-radius: var(--sn-radius-lg);
    box-shadow: var(--sn-shadow-sm);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.hub-entry-grid {
    margin-top: 18px;
}

.card {
    color: var(--sn-text);
    background: var(--sn-card);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-md);
    box-shadow: 0 1px 0 rgba(61, 57, 41, 0.03);
    padding: 16px;
}

.card h3 {
    color: var(--sn-text);
    font-size: 16px;
    line-height: 1.32;
    margin-bottom: 10px;
}

.card p {
    color: var(--sn-text-muted);
    line-height: 1.65;
}

.card-kicker {
    margin-bottom: 8px;
    color: var(--sn-text-subtle);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    margin-top: 10px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: var(--sn-radius-sm);
    background: var(--sn-primary);
    color: var(--sn-white);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    transition:
        background var(--sn-dur-base) var(--sn-ease),
        border-color var(--sn-dur-base) var(--sn-ease),
        color var(--sn-dur-base) var(--sn-ease),
        transform 80ms var(--sn-ease),
        box-shadow var(--sn-dur-base) var(--sn-ease);
}

.btn:hover {
    background: var(--sn-primary-hover);
    color: var(--sn-white);
    box-shadow: 0 5px 12px rgba(191, 95, 66, 0.18);
}

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

.btn:focus-visible,
.nav a:focus-visible {
    outline: none;
    box-shadow: var(--sn-focus);
}

.btn-secondary {
    color: var(--sn-text);
    background: rgba(251, 249, 243, 0.72);
    border-color: var(--sn-border);
}

.btn-secondary:hover {
    color: var(--sn-text);
    background: var(--sn-paper-2);
    border-color: var(--sn-ink-3);
    box-shadow: none;
}

.btn-success,
a.btn-success {
    color: var(--sn-white);
    background: var(--sn-success);
}

.btn-success:hover,
a.btn-success:hover {
    color: var(--sn-white);
    background: var(--sn-success-hover);
    box-shadow: 0 5px 12px rgba(62, 131, 88, 0.16);
}

.btn-small {
    min-height: 28px;
    margin-top: 0;
    padding: 6px 9px;
    border-radius: var(--sn-radius-xs);
    font-size: 12px;
}

.status-pill,
.user-pill {
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    line-height: 1.2;
}

.status-pill {
    padding: 6px 10px;
    color: var(--sn-leaf-deep);
    background: var(--sn-leaf-wash);
    border-color: rgba(79, 159, 110, 0.2);
    font-weight: 700;
}

.user-pill {
    padding: 6px 10px;
    color: var(--sn-text-muted);
    background: rgba(251, 249, 243, 0.72);
    border-color: var(--sn-border);
    font-weight: 650;
}

.notice {
    padding: 13px 14px;
    color: var(--sn-text-muted);
    background: rgba(234, 230, 216, 0.42);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-md);
    line-height: 1.65;
}

.content-type-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.content-type-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.muted-pill {
    color: var(--sn-text-muted);
    background: rgba(251, 249, 243, 0.72);
    border-color: var(--sn-border);
}

.placeholder-card {
    margin-top: 18px;
}

.website-intro {
    flex: 1;
}

.page-action-heading {
    align-items: stretch;
}

.page-action-heading .btn {
    flex: 0 0 auto;
    align-self: center;
    margin-top: 0;
}

.website-filter-card {
    margin-top: 18px;
}

.article-filters {
    display: grid;
    gap: 12px;
}

.filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tabs a {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    padding: 6px 10px;
    color: var(--sn-text-muted);
    background: rgba(251, 249, 243, 0.72);
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-sm);
    font-size: 12px;
    font-weight: 700;
}

.filter-tabs a.active,
.filter-tabs a:hover {
    color: var(--sn-success-hover);
    background: var(--sn-success-soft);
    border-color: var(--sn-success-border);
}

.filter-search-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto auto;
    gap: 8px;
    align-items: end;
}

.filter-search-row label {
    display: grid;
    gap: 5px;
    color: var(--sn-text-muted);
    font-size: 12px;
    font-weight: 650;
}

.filter-search-row input {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    color: var(--sn-text);
    background: #fff;
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-sm);
}

.filter-search-row .btn {
    margin-top: 0;
}

.article-table-card {
    padding: 0;
}

.table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 9px 10px;
    color: var(--sn-text-muted);
    border-bottom: 1px solid var(--sn-border);
    font-size: 13px;
    line-height: 1.45;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    color: var(--sn-text);
    background: var(--sn-bg-soft);
    font-weight: 800;
    white-space: nowrap;
}

.data-table tbody tr:hover {
    background: rgba(251, 249, 243, 0.72);
}

.article-table td strong {
    display: block;
    color: var(--sn-text);
    font-size: 13px;
}

.article-table td small {
    display: block;
    margin-top: 4px;
    color: var(--sn-text-subtle);
    line-height: 1.45;
}

.article-table code {
    color: var(--sn-text-muted);
    font-family: var(--sn-font-sans);
    font-size: 12px;
    word-break: break-all;
}

.table-actions {
    white-space: nowrap;
}

.table-actions .btn {
    margin-right: 4px;
}

.badge {
    display: inline-flex;
    min-width: 42px;
    justify-content: center;
    padding: 2px 8px;
    color: var(--sn-text-muted);
    background: var(--sn-bg-soft);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.badge-draft,
.badge-pending {
    color: #7a4f12;
    background: #fff7df;
}

.badge-published {
    color: var(--sn-leaf-deep);
    background: var(--sn-leaf-wash);
}

.badge-archived {
    color: var(--sn-text-muted);
    background: var(--sn-bg-soft);
}

.empty-state {
    padding: 16px;
    color: var(--sn-text-muted);
    text-align: center;
}

.article-placeholder-card {
    margin-top: 18px;
}

.article-placeholder-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}

.article-placeholder-grid > div {
    min-width: 0;
    padding: 12px;
    border-right: 1px solid var(--sn-border);
}

.article-placeholder-grid > div:last-child {
    border-right: 0;
}

.article-placeholder-grid span {
    display: block;
    margin-bottom: 5px;
    color: var(--sn-text-subtle);
    font-size: 12px;
}

.article-placeholder-grid strong {
    display: block;
    color: var(--sn-text);
    line-height: 1.5;
    word-break: break-word;
}

.article-form {
    display: grid;
    gap: 16px;
    margin-top: 18px;
}

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

.form-field {
    display: grid;
    gap: 6px;
    min-width: 0;
    color: var(--sn-text-muted);
    font-size: 12px;
    font-weight: 700;
}

.form-field-wide {
    grid-column: 1 / -1;
}

.form-field span {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.form-field em {
    color: var(--sn-coral-deep);
    font-size: 11px;
    font-style: normal;
    font-weight: 750;
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    min-width: 0;
    color: var(--sn-text);
    background: #fff;
    border: 1px solid var(--sn-border);
    border-radius: var(--sn-radius-sm);
    font-size: 13px;
    line-height: 1.45;
}

.form-field input,
.form-field select {
    height: 36px;
    padding: 0 10px;
}

.form-field textarea {
    resize: vertical;
    min-height: 84px;
    padding: 9px 10px;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--sn-success);
    box-shadow: var(--sn-focus);
}

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

.form-actions .btn {
    margin-top: 0;
}

.form-error-card {
    margin-top: 18px;
    color: #7a2418;
    background: #fff1ec;
    border-color: rgba(191, 95, 66, 0.32);
}

.form-error-card h3 {
    color: #7a2418;
}

.form-error-list {
    margin: 8px 0 0;
    padding-left: 18px;
    color: #7a2418;
}

.editor-placeholder {
    padding: 13px 14px;
    color: var(--sn-text-muted);
    background: rgba(234, 230, 216, 0.42);
    border: 1px dashed var(--sn-border);
    border-radius: var(--sn-radius-md);
    line-height: 1.65;
}

.module-section {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.section-heading h2 {
    color: var(--sn-text);
    font-size: 17px;
    line-height: 1.3;
}

.section-heading span {
    color: var(--sn-text-subtle);
    font-size: 12px;
    font-weight: 650;
}

.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.module-card {
    min-height: 148px;
}

.module-card .status-pill {
    display: inline-flex;
    margin-top: 12px;
}

.status-summary-card {
    padding: 0;
}

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

.status-summary-grid > div {
    min-width: 0;
    padding: 16px;
    border-right: 1px solid var(--sn-border);
}

.status-summary-grid > div:last-child {
    border-right: 0;
}

.status-summary-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--sn-text-subtle);
    font-size: 12px;
    font-weight: 650;
}

.status-summary-grid strong {
    display: block;
    color: var(--sn-text);
    font-size: 14px;
    line-height: 1.55;
}

.login-body {
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell {
    width: min(100%, 460px);
}

.login-card {
    padding: 24px;
    color: var(--sn-text);
    background: rgba(251, 249, 243, 0.92);
    border: 1px solid rgba(217, 211, 194, 0.86);
    border-radius: var(--sn-radius-lg);
    box-shadow: var(--sn-shadow-md);
}

.login-brand {
    margin-bottom: 18px;
}

.login-status {
    display: inline-flex;
    margin-bottom: 16px;
}

.login-card h1 {
    color: var(--sn-text);
    font-size: 22px;
    line-height: 1.3;
    margin-bottom: 12px;
}

.login-card p {
    line-height: 1.7;
}

.login-action {
    width: 100%;
    margin-top: 18px;
}

.login-notice {
    margin-top: 18px;
}

.login-footnote {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--sn-border);
    color: var(--sn-text-subtle);
    font-size: 12px;
    line-height: 1.6;
}

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

    .sidebar {
        position: relative;
        width: 100%;
        min-height: 0;
        padding: 14px 14px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--sn-border);
    }

    .brand {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .brand-title {
        font-size: 16px;
    }

    .brand-subtitle {
        font-size: 10.5px;
    }

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

    .nav a {
        min-height: 34px;
        padding: 8px 10px;
        font-size: 12.5px;
    }

    .nav a.active::before {
        display: none;
    }

    .sidebar-footer {
        margin-top: 12px;
        padding-top: 12px;
    }

    .content {
        padding: 18px 14px 28px;
    }

    .page-header {
        align-items: flex-start;
        margin-bottom: 12px;
    }

    .page-header h1 {
        font-size: 20px;
    }

    .header-actions {
        width: 100%;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .page-body {
        padding: 16px;
        border-radius: var(--sn-radius-md);
    }

    .content-type-card {
        align-items: flex-start;
        flex-direction: column;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .page-action-heading .btn {
        align-self: flex-start;
    }

    .filter-search-row {
        grid-template-columns: 1fr;
    }

    .status-summary-grid {
        grid-template-columns: 1fr;
    }

    .status-summary-grid > div {
        border-right: 0;
        border-bottom: 1px solid var(--sn-border);
    }

    .status-summary-grid > div:last-child {
        border-bottom: 0;
    }

    .article-placeholder-grid {
        grid-template-columns: 1fr;
    }

    .article-placeholder-grid > div {
        border-right: 0;
        border-bottom: 1px solid var(--sn-border);
    }

    .article-placeholder-grid > div:last-child {
        border-bottom: 0;
    }

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

@media (max-width: 520px) {
    .nav {
        grid-template-columns: 1fr;
    }

    .page-body {
        padding: 14px;
    }
}
