:root {
    --bg: #f4f1ea;
    --panel: #fffdf8;
    --panel-alt: #f0ece4;
    --ink: #1f2a32;
    --muted: #60717f;
    --line: #d9d0c2;
    --primary: #115e59;
    --primary-strong: #0f4a46;
    --accent: #b86a2b;
    --accent-soft: #f1d7be;
    --steel: #dce5eb;
    --ok: #1f7a52;
    --danger: #aa4134;
    --shadow: 0 18px 50px rgba(31, 42, 50, 0.08);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: linear-gradient(180deg, #f8f5ef 0%, #f3efe7 100%);
    font: 16px/1.65 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

code {
    padding: 2px 6px;
    border-radius: 6px;
    background: #edf1f4;
    font-size: 13px;
}

.shell {
    width: min(1180px, calc(100vw - 40px));
    margin: 0 auto;
}

.eyebrow {
    display: inline-block;
    font-size: 12px;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--primary);
    background: rgba(17, 94, 89, 0.12);
    border: 1px solid rgba(17, 94, 89, 0.16);
    padding: 6px 10px;
    border-radius: 999px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 30;
    backdrop-filter: blur(14px);
    background: rgba(248, 245, 239, 0.88);
    border-bottom: 1px solid rgba(217, 208, 194, 0.8);
}

.header-shell {
    display: grid;
    grid-template-columns: 230px 1fr 150px;
    align-items: center;
    gap: 20px;
    min-height: 74px;
}

.brand-lockup {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.brand-kicker {
    font-size: 11px;
    color: var(--accent);
}

.brand-name {
    font-size: 18px;
    font-weight: 700;
}

.main-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 16px;
}

.main-nav a {
    font-size: 14px;
    color: var(--muted);
    padding: 8px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a.is-active,
.main-nav a:hover {
    color: var(--ink);
    border-color: var(--accent);
}

.header-phone {
    justify-self: end;
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--panel);
    border: 1px solid var(--line);
}

.hero-band,
.section-band,
.page-hero {
    padding: 42px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr;
    gap: 24px;
}

.hero-panel,
.hero-metrics article,
.content-card,
.stack-item,
.page-side .service-card,
.article-content,
.article-aside .aside-box,
.summary-card,
.admin-table-card,
.login-card,
.flash,
.error-list {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-panel {
    padding: 34px;
}

.hero-panel h1,
.page-main h1,
.login-card h1,
.admin-topbar h1,
.not-found-shell h1 {
    margin: 14px 0 14px;
    font-size: clamp(32px, 4vw, 50px);
    line-height: 1.1;
}

.hero-copy p,
.page-summary,
.section-head p,
.stack-item span,
.content-card p,
.article-content p,
.article-content li,
.article-content h2,
.article-content h3,
.article-content blockquote,
.service-card p {
    color: var(--muted);
}

.hero-actions,
.form-actions,
.install-links,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    border: 1px solid transparent;
    cursor: pointer;
    font: inherit;
}

.button-primary {
    color: #fff;
    background: var(--primary);
}

.button-primary:hover {
    background: var(--primary-strong);
}

.button-secondary {
    background: var(--panel);
    border-color: var(--line);
}

.button-block {
    width: 100%;
}

.hero-metrics {
    display: grid;
    gap: 16px;
}

.hero-metrics article {
    padding: 22px;
}

.hero-metrics span,
.summary-card span,
.footer-title,
.aside-title {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.hero-metrics strong,
.summary-card strong {
    display: block;
    font-size: 22px;
    line-height: 1.25;
    margin-bottom: 8px;
}

.section-contrast {
    background: linear-gradient(180deg, rgba(220, 229, 235, 0.34) 0%, rgba(241, 215, 190, 0.24) 100%);
    border-top: 1px solid rgba(217, 208, 194, 0.9);
    border-bottom: 1px solid rgba(217, 208, 194, 0.9);
}

.section-head {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: end;
    margin-bottom: 22px;
}

.section-head.compact {
    margin-bottom: 16px;
}

.section-head h2,
.table-head h2 {
    margin: 8px 0 0;
    font-size: 28px;
}

.card-grid {
    display: grid;
    gap: 18px;
}

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

.content-card {
    padding: 22px;
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

.chip,
.meta-inline,
.page-meta-row span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--panel-alt);
    border: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.content-card h3 {
    margin: 0 0 10px;
    font-size: 20px;
    line-height: 1.3;
}

.split-grid,
.page-hero-shell,
.article-shell,
.footer-grid,
.admin-summary-grid {
    display: grid;
    gap: 18px;
}

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

.stack-list {
    display: grid;
    gap: 14px;
}

.stack-item {
    display: block;
    padding: 18px;
}

.stack-item.compact {
    padding: 16px;
}

.stack-item strong {
    display: block;
    margin-bottom: 8px;
    font-size: 17px;
}

.page-hero-shell {
    grid-template-columns: minmax(0, 1.4fr) 380px;
    align-items: start;
}

.page-main,
.page-side .service-card {
    padding: 28px;
}

.page-summary {
    max-width: 760px;
    font-size: 18px;
}

.page-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.article-shell {
    grid-template-columns: minmax(0, 1.5fr) 320px;
    align-items: start;
}

.article-content,
.article-aside .aside-box {
    padding: 28px;
}

.article-content h2 {
    margin-top: 32px;
    margin-bottom: 10px;
    font-size: 28px;
    color: var(--ink);
}

.article-content h3 {
    margin-top: 22px;
    margin-bottom: 8px;
    font-size: 22px;
    color: var(--ink);
}

.article-content ul {
    padding-left: 20px;
}

.cover-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 22px;
    background: var(--steel);
}

.service-card a {
    color: var(--primary);
}

.site-footer {
    padding: 28px 0 42px;
    border-top: 1px solid rgba(217, 208, 194, 0.9);
}

.footer-grid {
    grid-template-columns: 1fr 1.2fr 0.9fr;
}

.footer-grid p {
    margin: 0 0 8px;
    color: var(--muted);
}

.login-body,
.admin-body {
    background: linear-gradient(180deg, #eef2f0 0%, #f4efe8 100%);
}

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px;
}

.login-card {
    width: min(520px, 100%);
    padding: 34px;
}

.install-card {
    width: min(620px, 100%);
}

.login-form,
.editor-form {
    display: grid;
    gap: 16px;
}

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

.login-form label,
.editor-form label {
    display: grid;
    gap: 8px;
}

.login-form span,
.editor-form span {
    font-size: 14px;
    color: var(--muted);
}

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

input[type="text"],
input[type="password"],
input[type="number"],
textarea,
select {
    width: 100%;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 8px;
    padding: 12px 14px;
    color: var(--ink);
}

textarea {
    resize: vertical;
}

small {
    color: var(--muted);
    font-size: 13px;
}

.admin-wrap {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
}

.admin-side {
    background: #20313a;
    color: #eaf0f2;
    padding: 28px 20px;
}

.admin-logo {
    display: block;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
}

.admin-nav {
    display: grid;
    gap: 10px;
}

.admin-nav a {
    display: block;
    padding: 12px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.admin-main {
    padding: 28px;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin-bottom: 22px;
}

.admin-user {
    padding: 10px 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.admin-summary-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 18px;
}

.summary-card {
    padding: 18px;
}

.admin-table-card {
    padding: 22px;
}

.tool-card,
.docs-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.tool-card {
    padding: 18px;
}

.editor-tools {
    display: grid;
    gap: 14px;
    position: sticky;
    top: 18px;
}

.score-ring {
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    margin: 8px 0 14px;
    color: #fff;
    background: conic-gradient(var(--primary) 0 78%, var(--accent-soft) 78% 100%);
    font-size: 28px;
    font-weight: 800;
}

.check-list {
    display: grid;
    gap: 8px;
}

.check-list div {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: #fff;
}

.check-list span {
    font-size: 12px;
    color: #fff;
    text-align: center;
    border-radius: 999px;
    padding: 2px 6px;
}

.check-list strong {
    font-size: 13px;
    font-weight: 600;
}

.check-ok span {
    background: var(--ok);
}

.check-warn span {
    background: var(--accent);
}

.tool-muted,
.tool-list {
    color: var(--muted);
    font-size: 14px;
}

.tool-list {
    margin: 0;
    padding-left: 18px;
}

.snippet-box {
    min-height: 170px;
    font-size: 13px;
}

.docs-card h2,
.docs-card h3 {
    margin-top: 0;
}

.docs-card pre {
    overflow: auto;
    padding: 14px;
    border-radius: 8px;
    background: #17242b;
    color: #eef6f2;
}

.docs-card code {
    white-space: pre-wrap;
}

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

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

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

.data-table th,
.data-table td {
    text-align: left;
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.table-actions a,
.table-actions button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--primary);
    cursor: pointer;
}

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

.span-2 {
    grid-column: span 2;
}

.toggle-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.rich-editor-wrap {
    display: grid;
    gap: 10px;
}

.editor-label-row,
.editor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.editor-mode-tabs,
.rich-toolbar,
.snippet-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mini-button,
.rich-toolbar button,
.snippet-toolbar button {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 13px;
}

.mini-button.is-active {
    color: #fff;
    border-color: var(--primary);
    background: var(--primary);
}

.rich-toolbar {
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-alt);
}

.rich-toolbar button:hover,
.snippet-toolbar button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.snippet-toolbar button {
    background: rgba(17, 94, 89, 0.08);
}

.rich-editor,
.source-editor {
    width: 100%;
    min-height: 460px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    padding: 18px;
    color: var(--ink);
}

.rich-editor {
    overflow: auto;
    outline: none;
}

.rich-editor:focus,
.source-editor:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(17, 94, 89, 0.12);
}

.rich-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--muted);
}

.rich-editor h2,
.rich-editor h3 {
    color: var(--ink);
    line-height: 1.35;
}

.rich-editor h2 {
    margin: 24px 0 10px;
    font-size: 24px;
}

.rich-editor h3 {
    margin: 18px 0 8px;
    font-size: 20px;
}

.rich-editor p,
.rich-editor li {
    color: var(--muted);
}

.rich-editor figure {
    margin: 18px 0;
}

.rich-editor figure img {
    border-radius: 8px;
    border: 1px solid var(--line);
}

.rich-editor figcaption {
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.rich-editor table {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0;
}

.rich-editor th,
.rich-editor td {
    border: 1px solid var(--line);
    padding: 10px;
    text-align: left;
}

.rich-editor th {
    background: var(--panel-alt);
}

.source-editor {
    display: none;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 13px;
}

.is-source-mode .rich-editor {
    display: none;
}

.is-source-mode .source-editor {
    display: block;
}

.editor-foot {
    color: var(--muted);
    font-size: 13px;
}

.flash,
.error-list {
    padding: 14px 16px;
    margin-bottom: 18px;
}

.flash-success {
    border-color: rgba(31, 122, 82, 0.28);
    background: rgba(31, 122, 82, 0.08);
}

.flash-error,
.error-list {
    border-color: rgba(170, 65, 52, 0.28);
    background: rgba(170, 65, 52, 0.08);
}

.error-list p,
.flash p {
    margin: 0;
}

.not-found {
    min-height: 62vh;
    display: grid;
    place-items: center;
    padding: 42px 0;
}

.not-found-shell {
    text-align: center;
    max-width: 620px;
}

@media (max-width: 1080px) {
    .header-shell,
    .hero-grid,
    .page-hero-shell,
    .article-shell,
    .footer-grid,
    .admin-wrap,
    .split-grid,
    .editor-layout {
        grid-template-columns: 1fr;
    }

    .editor-tools {
        position: static;
    }

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

    .header-phone {
        justify-self: start;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100vw - 24px, 1180px);
    }

    .header-shell,
    .section-head,
    .table-head,
    .admin-topbar {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        justify-content: flex-start;
    }

    .card-grid-3,
    .admin-summary-grid,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .hero-panel,
    .page-main,
    .page-side .service-card,
    .article-content,
    .article-aside .aside-box,
    .admin-table-card,
    .login-card {
        padding: 22px;
    }

    .hero-panel h1,
    .page-main h1,
    .login-card h1,
    .admin-topbar h1,
    .not-found-shell h1 {
        font-size: 30px;
    }
}
