:root {
    --ink: #1f2925;
    --muted: #67716c;
    --paper: #f7f7f2;
    --surface: #ffffff;
    --line: #dde2de;
    --forest: #315c4b;
    --forest-dark: #214236;
    --mint: #e5eee9;
    --danger: #b33a3a;
    --danger-soft: #f9e9e7;
    --success: #2d6b4d;
    --success-soft: #e7f2eb;
    --shadow: 0 18px 45px rgba(31, 41, 37, 0.07);
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: var(--paper);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

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

button,
input {
    font: inherit;
}

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

.container {
    width: min(1100px, calc(100% - 40px));
    margin-inline: auto;
}

.site-header {
    border-bottom: 1px solid rgba(49, 92, 75, 0.12);
    background: rgba(247, 247, 242, 0.92);
    backdrop-filter: blur(14px);
}

.header-inner,
.admin-header-inner {
    min-height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: var(--forest-dark);
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.55rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.site-header nav,
.admin-actions {
    display: flex;
    align-items: center;
    gap: 28px;
    color: var(--muted);
    font-size: 0.92rem;
}

.site-header nav a:hover,
.admin-actions a:hover,
.text-button:hover {
    color: var(--forest);
}

.site-main {
    min-height: calc(100vh - 158px);
}

.hero {
    padding: 108px 0 94px;
    max-width: 760px;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--forest);
    font-size: 0.76rem;
    font-weight: 750;
    letter-spacing: 0.17em;
}

.hero h1 {
    max-width: 720px;
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2.7rem, 7vw, 5.3rem);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.12;
}

.hero > p:last-child {
    margin: 28px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.article-section {
    padding: 0 0 110px;
}

.section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.section-heading h2 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.6rem;
}

.section-heading span {
    color: var(--muted);
    font-size: 0.88rem;
}

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

.article-card {
    padding: 44px 0 40px;
    border-bottom: 1px solid var(--line);
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.82rem;
}

.tag {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 2px 10px;
    border-radius: 999px;
    color: var(--forest-dark);
    background: var(--mint);
    font-size: 0.76rem;
    font-weight: 650;
    white-space: nowrap;
}

.article-card h3 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(1.55rem, 3vw, 2.05rem);
    line-height: 1.35;
}

.article-card h3 a:hover {
    color: var(--forest);
}

.article-card > p {
    min-height: 3.4em;
    margin: 15px 0 23px;
    color: var(--muted);
}

.read-more,
.back-link {
    color: var(--forest);
    font-size: 0.9rem;
    font-weight: 650;
}

.read-more span {
    display: inline-block;
    margin-left: 4px;
    transition: transform 160ms ease;
}

.read-more:hover span {
    transform: translateX(4px);
}

.empty-state,
.admin-empty {
    padding: 72px 24px;
    text-align: center;
    border: 1px dashed #c7cfca;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.42);
}

.empty-state {
    margin-top: 34px;
}

.empty-state h3,
.admin-empty h2 {
    margin: 0 0 8px;
    font-family: Georgia, "Noto Serif TC", serif;
}

.empty-state p,
.admin-empty p {
    margin: 0 0 24px;
    color: var(--muted);
}

.site-footer {
    min-height: 80px;
    display: flex;
    align-items: center;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.85rem;
}

.article-page {
    max-width: 780px;
    margin: 0 auto;
    padding: 66px 0 110px;
}

.article-page-header {
    padding: 64px 0 48px;
    border-bottom: 1px solid var(--line);
}

.article-page-header h1 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2.5rem, 7vw, 4.6rem);
    font-weight: 500;
    letter-spacing: -0.04em;
    line-height: 1.18;
}

.article-content {
    padding-top: 44px;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.08rem;
    line-height: 1.95;
}

.article-content p,
.article-content ul,
.article-content ol,
.article-content blockquote,
.article-content pre {
    margin: 0 0 1.65em;
}

.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 2.1em 0 0.7em;
    line-height: 1.35;
}

.article-content h2 {
    padding-bottom: 0.45em;
    border-bottom: 2px solid var(--forest);
    color: var(--forest-dark);
    font-size: clamp(1.75rem, 4vw, 2.2rem);
}

.article-content h3 {
    padding-left: 0.7em;
    border-left: 4px solid var(--forest);
    color: var(--forest-dark);
    font-size: clamp(1.45rem, 3vw, 1.75rem);
}

.article-content h4 {
    color: var(--forest-dark);
    font-size: 1.3rem;
}

.article-content h4::after {
    display: block;
    width: 36px;
    margin-top: 0.45em;
    border-top: 2px solid #9fb8ab;
    content: '';
}

.article-content h5 {
    color: #405b4f;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 1.08rem;
    letter-spacing: 0.04em;
}

.article-content h6 {
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.94rem;
    letter-spacing: 0.08em;
}

.article-content li + li {
    margin-top: 0.4em;
}

.article-content a {
    color: var(--forest-dark);
    text-decoration-color: rgba(39, 87, 67, 0.45);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.article-content mark {
    padding: 0.08em 0.16em;
    border-radius: 3px;
    background: #fff1a8;
}

.article-content :not(pre) > code {
    padding: 0.14em 0.38em;
    border: 1px solid #dfe8e2;
    border-radius: 5px;
    color: #8a3e35;
    background: #f8efec;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.88em;
}

.runvoy-color-tool {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-size: 17px;
    font-weight: 700;
    line-height: 1;
}

.runvoy-color-tool i {
    display: block;
    width: 15px;
    height: 3px;
    margin-top: 2px;
    border-radius: 2px;
    background: var(--forest);
}

.runvoy-color-palette {
    display: grid;
    width: max-content;
    grid-template-columns: repeat(7, 24px);
    align-items: center;
    gap: 7px;
    padding: 9px 10px;
}

.runvoy-color-swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px #c8d2cc;
    cursor: pointer;
}

.runvoy-color-swatch:hover,
.runvoy-color-swatch:focus-visible {
    outline: 2px solid var(--forest);
    outline-offset: 2px;
}

.runvoy-color-clear {
    grid-column: 1 / -1;
    margin-left: 3px;
    padding: 5px 7px;
    border: 0;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-size: 0.76rem;
    white-space: nowrap;
}

.article-content blockquote {
    padding: 4px 0 4px 26px;
    border-left: 3px solid var(--forest);
    color: #405048;
}

.article-content blockquote p {
    margin-bottom: 0.4em;
}

.article-content cite {
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
    font-style: normal;
}

.article-content pre {
    overflow-x: auto;
    padding: 22px;
    border-radius: 12px;
    color: #e9f2ed;
    background: #20342c;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.9rem;
    line-height: 1.65;
}

.article-content hr {
    width: 48px;
    margin: 52px auto;
    border: 0;
    border-top: 2px solid var(--line);
}

.article-image {
    margin: 2.2em 0;
    text-align: center;
}

.article-image img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
    border-radius: 12px;
}

.article-image--bordered img {
    border: 1px solid var(--line);
}

.article-image--background {
    padding: 24px;
    border-radius: 14px;
    background: var(--mint);
}

.article-image--stretched {
    position: relative;
    left: 50%;
    width: min(1040px, calc(100vw - 40px));
    transform: translateX(-50%);
}

.article-image figcaption {
    margin-top: 10px;
    color: var(--muted);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.82rem;
}

.article-table-scroll {
    overflow-x: auto;
    margin: 2em 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
}

.article-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.92rem;
}

.article-table th,
.article-table td {
    padding: 12px 15px;
    text-align: left;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.article-table th:last-child,
.article-table td:last-child {
    border-right: 0;
}

.article-table tr:last-child th,
.article-table tr:last-child td {
    border-bottom: 0;
}

.article-table th {
    color: var(--forest-dark);
    background: var(--mint);
    font-weight: 700;
}

.article-checklist {
    display: grid;
    gap: 0.7em;
    padding: 0;
    list-style: none;
}

.article-checklist__item {
    display: flex;
    gap: 0.7em;
    align-items: flex-start;
}

.article-checklist__box {
    display: inline-flex;
    width: 1.3em;
    height: 1.3em;
    flex: 0 0 1.3em;
    align-items: center;
    justify-content: center;
    margin-top: 0.3em;
    border: 1.5px solid #9aaba2;
    border-radius: 4px;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.72em;
    font-weight: 800;
    line-height: 1;
}

.article-checklist__item.is-checked .article-checklist__box {
    border-color: var(--forest);
    background: var(--forest);
}

.article-checklist__item.is-checked > span:last-child {
    color: var(--muted);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}

.article-warning {
    margin: 2em 0;
    padding: 20px 22px;
    border: 1px solid #e6d69e;
    border-left: 4px solid #c79c28;
    border-radius: 10px;
    background: #fff9e8;
}

.article-warning__title {
    display: block;
    margin-bottom: 0.35em;
    color: #6d5312;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 0.95rem;
}

.article-warning p {
    margin: 0;
}

.button {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--forest);
    border-radius: 10px;
    color: #fff;
    background: var(--forest);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 650;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.button:hover {
    border-color: var(--forest-dark);
    background: var(--forest-dark);
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.65;
}

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

.button-secondary:hover {
    color: var(--forest);
    border-color: #aab9b1;
    background: var(--surface);
}

.button-danger {
    border-color: var(--danger);
    background: var(--danger);
}

.button-danger:hover {
    border-color: #912c2c;
    background: #912c2c;
}

.button-full {
    width: 100%;
}

.admin-body {
    background: #f4f6f4;
}

.admin-header {
    border-bottom: 1px solid var(--line);
    background: var(--surface);
}

.admin-header-inner > div,
.admin-actions {
    display: flex;
    align-items: center;
}

.admin-label {
    margin-left: 12px;
    padding-left: 12px;
    border-left: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.admin-actions {
    gap: 20px;
}

.admin-actions form {
    margin: 0;
}

.text-button,
.danger-link {
    padding: 0;
    border: 0;
    color: var(--muted);
    background: none;
    cursor: pointer;
}

.admin-main {
    padding-block: 54px 90px;
}

.admin-page-heading,
.editor-page-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 32px;
}

.admin-page-heading h1,
.editor-page-heading h1 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.2;
}

.admin-page-heading > div > p:last-child {
    margin: 8px 0 0;
    color: var(--muted);
}

.alert {
    margin-bottom: 24px;
    padding: 13px 16px;
    border: 1px solid;
    border-radius: 10px;
    font-size: 0.9rem;
}

.alert-error {
    color: #882e2e;
    border-color: #e8c3c0;
    background: var(--danger-soft);
}

.alert-success {
    color: var(--success);
    border-color: #bdd9c8;
    background: var(--success-soft);
}

.article-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.article-table {
    width: 100%;
    border-collapse: collapse;
}

.article-table th,
.article-table td {
    padding: 18px 20px;
    text-align: left;
    border-bottom: 1px solid var(--line);
}

.article-table th {
    color: var(--muted);
    background: #fafbfa;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

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

.article-table td:first-child {
    width: 46%;
}

.article-table td:nth-child(3) {
    color: var(--muted);
    font-size: 0.86rem;
    white-space: nowrap;
}

.row-actions {
    text-align: right !important;
    white-space: nowrap;
}

.row-actions a,
.row-actions button {
    margin-left: 15px;
    font-size: 0.86rem;
    font-weight: 600;
}

.row-actions a:hover {
    color: var(--forest);
}

.danger-link {
    color: var(--danger);
}

.mobile-meta {
    display: none;
}

.admin-empty .button {
    margin-top: 4px;
}

.login-body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 20px;
    background:
        radial-gradient(circle at 15% 15%, rgba(49, 92, 75, 0.1), transparent 30%),
        var(--paper);
}

.login-card {
    width: min(450px, 100%);
    padding: 42px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.login-heading {
    margin: 46px 0 28px;
}

.login-heading h1 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 2rem;
}

.login-heading > p:last-child {
    margin: 9px 0 0;
    color: var(--muted);
}

.stack-form {
    display: grid;
    gap: 20px;
}

.stack-form label,
.delete-dialog label,
.tag-field {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-size: 0.87rem;
    font-weight: 650;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    min-height: 46px;
    padding: 10px 13px;
    border: 1px solid #cbd3ce;
    border-radius: 9px;
    color: var(--ink);
    outline: 0;
    background: var(--surface);
}

input:focus {
    border-color: var(--forest);
    box-shadow: 0 0 0 3px rgba(49, 92, 75, 0.11);
}

.login-back {
    display: inline-block;
    margin-top: 28px;
}

.delete-dialog {
    width: min(480px, calc(100% - 32px));
    padding: 0;
    border: 0;
    border-radius: 16px;
    color: var(--ink);
    box-shadow: 0 24px 80px rgba(20, 30, 25, 0.25);
}

.delete-dialog::backdrop {
    background: rgba(22, 30, 26, 0.54);
    backdrop-filter: blur(3px);
}

.delete-dialog form {
    padding: 30px;
}

.delete-dialog h2 {
    margin: 0;
    font-family: Georgia, "Noto Serif TC", serif;
}

.delete-dialog form > p:nth-of-type(2) {
    margin: 10px 0 24px;
    color: var(--muted);
}

.dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 28px;
}

.editor-page-heading {
    align-items: center;
}

.editor-page-heading .back-link {
    display: inline-block;
    margin-bottom: 14px;
}

.save-status {
    color: var(--muted);
    font-size: 0.86rem;
}

.save-status.is-error {
    color: var(--danger);
}

.article-editor-form {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.editor-fields {
    padding: 42px 52px 30px;
    border-bottom: 1px solid var(--line);
}

.title-field input {
    min-height: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    letter-spacing: -0.035em;
}

.title-field input:focus {
    box-shadow: none;
}

.tag-field {
    grid-template-columns: auto minmax(120px, 230px) auto;
    align-items: center;
    margin-top: 24px;
    color: var(--muted);
}

.tag-field input {
    min-height: 38px;
}

.tag-field small {
    font-weight: 400;
}

.editor-shell {
    min-height: 430px;
    padding: 32px 42px;
}

.codex-editor {
    font-family: Georgia, "Noto Serif TC", serif;
    font-size: 1.05rem;
}

.ce-block__content,
.ce-toolbar__content {
    max-width: 760px;
}

.ce-header {
    line-height: 1.35;
}

.editor-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 20px 28px;
    border-top: 1px solid var(--line);
    background: #fafbfa;
}

.error-page {
    display: grid;
    min-height: 100vh;
    align-content: center;
    justify-items: start;
}

.error-page h1 {
    margin: 0;
    font-family: Georgia, serif;
    font-size: clamp(5rem, 16vw, 10rem);
    line-height: 0.95;
}

.error-page > p:not(.eyebrow) {
    margin: 24px 0 32px;
    color: var(--muted);
    font-size: 1.2rem;
}

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

@media (max-width: 720px) {
    .container {
        width: min(100% - 28px, 1100px);
    }

    .header-inner,
    .admin-header-inner {
        min-height: 66px;
    }

    .site-header nav {
        gap: 15px;
        font-size: 0.82rem;
    }

    .site-header nav a:last-child {
        display: none;
    }

    .hero {
        padding: 72px 0 66px;
    }

    .hero h1 {
        font-size: clamp(2.55rem, 13vw, 4rem);
    }

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

    .article-card {
        padding: 34px 0;
    }

    .article-card > p {
        min-height: auto;
    }

    .article-page {
        padding: 42px 0 80px;
    }

    .article-page-header {
        padding: 45px 0 34px;
    }

    .article-content {
        padding-top: 32px;
        font-size: 1rem;
    }

    .admin-label,
    .admin-actions > a {
        display: none;
    }

    .admin-main {
        padding-block: 38px 70px;
    }

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

    .article-table thead,
    .article-table td:nth-child(2),
    .article-table td:nth-child(3) {
        display: none;
    }

    .article-table td {
        padding: 17px 15px;
    }

    .article-table td:first-child {
        width: auto;
    }

    .mobile-meta {
        display: block;
        margin-top: 4px;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 400;
    }

    .row-actions a,
    .row-actions button {
        margin-left: 10px;
    }

    .login-card {
        padding: 30px 24px;
    }

    .login-heading {
        margin: 35px 0 25px;
    }

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

    .editor-fields {
        padding: 28px 22px 23px;
    }

    .tag-field {
        grid-template-columns: auto 1fr;
    }

    .tag-field small {
        display: none;
    }

    .editor-shell {
        min-height: 390px;
        padding: 22px 4px;
    }

    .editor-footer {
        padding: 15px;
    }
}
