:root {
    color-scheme: light;
    --bg: #f3eadf;
    --bg-soft: rgba(255, 250, 242, 0.68);
    --surface: rgba(255, 249, 240, 0.84);
    --surface-strong: #fffaf3;
    --surface-muted: #eadfcd;
    --ink: #241c18;
    --ink-soft: #675a52;
    --ink-faint: #998a7e;
    --accent: #a25b33;
    --accent-strong: #8f4b26;
    --accent-soft: rgba(162, 91, 51, 0.12);
    --success: #3f6f56;
    --success-soft: rgba(63, 111, 86, 0.14);
    --success-line: rgba(63, 111, 86, 0.3);
    --warning: #9a6a24;
    --warning-soft: rgba(154, 106, 36, 0.14);
    --warning-line: rgba(154, 106, 36, 0.32);
    --danger: #8f3a2e;
    --danger-soft: rgba(143, 58, 46, 0.14);
    --danger-line: rgba(143, 58, 46, 0.3);
    --line: rgba(36, 28, 24, 0.12);
    --line-strong: rgba(36, 28, 24, 0.22);
    --divider-line-faint: rgba(123, 83, 59, 0.05);
    --divider-line: rgba(123, 83, 59, 0.22);
    --divider-accent: rgba(162, 91, 51, 0.34);
    --divider-glow: rgba(162, 91, 51, 0.1);
    --shadow: 0 28px 70px rgba(62, 40, 29, 0.12);
    --page-background:
        radial-gradient(circle at top left, rgba(162, 91, 51, 0.2), transparent 32%),
        radial-gradient(circle at 85% 15%, rgba(98, 71, 56, 0.12), transparent 26%),
        linear-gradient(180deg, #efe4d7 0%, #f7f0e7 36%, #f3eadf 100%);
    --grid-line-horizontal: rgba(130, 94, 73, 0.08);
    --grid-line-vertical: rgba(130, 94, 73, 0.06);
    --page-frame-line: rgba(90, 61, 43, 0.08);
    --toolbar-surface: rgba(255, 248, 238, 0.72);
    --button-ink: #fffaf5;
    --button-shadow: 0 16px 24px rgba(143, 75, 38, 0.18);
    --ghost-hover: rgba(36, 28, 24, 0.06);
    --hero-surface:
        linear-gradient(180deg, rgba(255, 250, 243, 0.2), rgba(255, 249, 240, 0.9)),
        radial-gradient(circle at top right, rgba(162, 91, 51, 0.18), transparent 32%),
        radial-gradient(circle at bottom left, rgba(36, 28, 24, 0.08), transparent 36%);
    --hero-frame-surface:
        linear-gradient(180deg, rgba(255, 251, 246, 0.66), rgba(255, 248, 239, 0.9)),
        radial-gradient(circle at top right, rgba(162, 91, 51, 0.12), transparent 30%);
    --hero-line: rgba(162, 91, 51, 0.16);
    --hero-line-soft: rgba(162, 91, 51, 0.08);
    --hero-archive-ink: rgba(162, 91, 51, 0.08);
    --hero-text-shadow: 0 1px 0 rgba(255, 255, 255, 0.38);
    --hero-pill-surface: rgba(162, 91, 51, 0.08);
    --hero-signature-surface: linear-gradient(90deg, rgba(162, 91, 51, 0.06), rgba(255, 250, 242, 0.38));
    --hero-signature-mark: rgba(162, 91, 51, 0.28);
    --chip-surface: rgba(255, 251, 245, 0.86);
    --stream-surface: rgba(255, 251, 245, 0.62);
    --table-surface: rgba(255, 252, 248, 0.8);
    --table-head-surface: rgba(234, 223, 205, 0.52);
    --row-hover: rgba(162, 91, 51, 0.05);
    --topbar-line: rgba(36, 28, 24, 0.1);
    --topbar-surface: rgba(255, 250, 242, 0.92);
    --topbar-shadow: 0 18px 38px rgba(62, 40, 29, 0.1);
    --status-surface: rgba(255, 252, 248, 0.76);
    --control-surface: rgba(255, 252, 248, 0.88);
    --control-surface-soft: rgba(255, 252, 248, 0.66);
    --control-focus-surface: #fffdf8;
    --cover-upload-surface: rgba(255, 252, 248, 0.72);
    --cover-upload-hover: rgba(162, 91, 51, 0.08);
    --cover-upload-line: rgba(162, 91, 51, 0.34);
    --cover-upload-plus: #8f4b26;
    --focus-border: rgba(162, 91, 51, 0.55);
    --focus-ring: 0 0 0 4px rgba(162, 91, 51, 0.1);
    --editor-surface: #fffdf8;
    --editor-cursor: #000;
    --editor-shadow: 0 18px 48px rgba(62, 40, 29, 0.08);
    --editor-toolbar-surface: rgba(245, 236, 225, 0.92);
    --dropdown-surface: #fffaf3;
    --dropdown-hover: rgba(162, 91, 51, 0.08);
    --tooltip-surface: #8f3a2e;
    --tooltip-ink: #fff;
    --tooltip-shadow: 0 14px 24px rgba(143, 58, 46, 0.26);
    --modal-overlay-surface: rgba(31, 23, 19, 0.48);
    --modal-surface: #fffaf3;
    --modal-shadow: 0 32px 60px rgba(36, 28, 24, 0.22);
    --danger-strong: #7a2f24;
    --error-ink: #8f3a2e;
    --error-code-ink: rgba(162, 91, 51, 0.5);
    --pulse-shadow: rgba(162, 91, 51, 0.24);
    --pulse-surface:
        radial-gradient(circle, rgba(162, 91, 51, 0.9) 0 18%, rgba(162, 91, 51, 0.16) 18% 58%, transparent 58%);
    --pre-surface: #201d1b;
    --pre-ink: #f4e8dc;
    --pre-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    --radius-lg: 28px;
    --radius-md: 18px;
    --radius-sm: 12px;
    --font-body: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    --font-display: "Palatino Linotype", "Book Antiqua", "STSong", "SimSun", serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #17110f;
    --bg-soft: rgba(36, 27, 23, 0.72);
    --surface: rgba(39, 30, 26, 0.82);
    --surface-strong: #2d211c;
    --surface-muted: #3d3029;
    --ink: #f2e7db;
    --ink-soft: #c7b6a7;
    --ink-faint: #927f72;
    --accent: #d29162;
    --accent-strong: #efb07a;
    --accent-soft: rgba(210, 145, 98, 0.18);
    --success: #8fcca8;
    --success-soft: rgba(143, 204, 168, 0.16);
    --success-line: rgba(143, 204, 168, 0.3);
    --warning: #d9b264;
    --warning-soft: rgba(217, 178, 100, 0.16);
    --warning-line: rgba(217, 178, 100, 0.3);
    --danger: #df8a76;
    --danger-soft: rgba(223, 138, 118, 0.16);
    --danger-line: rgba(223, 138, 118, 0.3);
    --line: rgba(242, 231, 219, 0.13);
    --line-strong: rgba(242, 231, 219, 0.24);
    --divider-line-faint: rgba(242, 231, 219, 0.04);
    --divider-line: rgba(242, 231, 219, 0.16);
    --divider-accent: rgba(210, 145, 98, 0.42);
    --divider-glow: rgba(210, 145, 98, 0.18);
    --shadow: 0 30px 72px rgba(0, 0, 0, 0.28);
    --page-background:
        radial-gradient(circle at top left, rgba(210, 145, 98, 0.18), transparent 34%),
        radial-gradient(circle at 86% 12%, rgba(239, 176, 122, 0.1), transparent 28%),
        linear-gradient(180deg, #18110f 0%, #201714 42%, #16100e 100%);
    --grid-line-horizontal: rgba(210, 145, 98, 0.08);
    --grid-line-vertical: rgba(242, 231, 219, 0.045);
    --page-frame-line: rgba(242, 231, 219, 0.08);
    --toolbar-surface: rgba(42, 31, 26, 0.74);
    --button-ink: #1d1411;
    --button-shadow: 0 16px 28px rgba(0, 0, 0, 0.28);
    --ghost-hover: rgba(242, 231, 219, 0.08);
    --hero-surface:
        linear-gradient(180deg, rgba(43, 32, 27, 0.72), rgba(29, 21, 18, 0.96)),
        radial-gradient(circle at top right, rgba(210, 145, 98, 0.16), transparent 34%),
        radial-gradient(circle at bottom left, rgba(242, 231, 219, 0.06), transparent 38%);
    --hero-frame-surface:
        linear-gradient(180deg, rgba(52, 40, 34, 0.8), rgba(33, 24, 20, 0.96)),
        radial-gradient(circle at top right, rgba(210, 145, 98, 0.15), transparent 34%);
    --hero-line: rgba(210, 145, 98, 0.22);
    --hero-line-soft: rgba(210, 145, 98, 0.12);
    --hero-archive-ink: rgba(210, 145, 98, 0.12);
    --hero-text-shadow: 0 1px 0 rgba(0, 0, 0, 0.35);
    --hero-pill-surface: rgba(210, 145, 98, 0.13);
    --hero-signature-surface: linear-gradient(90deg, rgba(210, 145, 98, 0.12), rgba(42, 31, 26, 0.68));
    --hero-signature-mark: rgba(210, 145, 98, 0.34);
    --chip-surface: rgba(48, 37, 31, 0.82);
    --stream-surface: rgba(35, 26, 22, 0.72);
    --table-surface: rgba(35, 26, 22, 0.82);
    --table-head-surface: rgba(61, 48, 41, 0.7);
    --row-hover: rgba(210, 145, 98, 0.08);
    --topbar-line: rgba(242, 231, 219, 0.13);
    --topbar-surface: rgba(40, 30, 25, 0.92);
    --topbar-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
    --status-surface: rgba(44, 34, 29, 0.78);
    --control-surface: rgba(43, 33, 28, 0.9);
    --control-surface-soft: rgba(45, 35, 30, 0.68);
    --control-focus-surface: #32251f;
    --cover-upload-surface: rgba(38, 29, 25, 0.72);
    --cover-upload-hover: rgba(210, 145, 98, 0.12);
    --cover-upload-line: rgba(210, 145, 98, 0.38);
    --cover-upload-plus: #efb07a;
    --focus-border: rgba(210, 145, 98, 0.58);
    --focus-ring: 0 0 0 4px rgba(210, 145, 98, 0.16);
    --editor-surface: #241b17;
    --editor-cursor: #fff;
    --editor-shadow: 0 18px 48px rgba(0, 0, 0, 0.26);
    --editor-toolbar-surface: rgba(53, 41, 35, 0.95);
    --dropdown-surface: #2b211c;
    --dropdown-hover: rgba(210, 145, 98, 0.13);
    --tooltip-surface: #df8a76;
    --tooltip-ink: #1f1512;
    --tooltip-shadow: 0 14px 24px rgba(0, 0, 0, 0.28);
    --modal-overlay-surface: rgba(7, 5, 4, 0.64);
    --modal-surface: #2b211c;
    --modal-shadow: 0 32px 68px rgba(0, 0, 0, 0.44);
    --danger-strong: #f0a08f;
    --error-ink: #f0a08f;
    --error-code-ink: rgba(210, 145, 98, 0.55);
    --pulse-shadow: rgba(210, 145, 98, 0.28);
    --pulse-surface:
        radial-gradient(circle, rgba(210, 145, 98, 0.9) 0 18%, rgba(210, 145, 98, 0.18) 18% 58%, transparent 58%);
    --pre-surface: #15110f;
    --pre-ink: #f2e7db;
    --pre-shadow: inset 0 0 0 1px rgba(242, 231, 219, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--page-background);
    font-family: var(--font-body);
    min-height: 100vh;
    transition: background 0.2s ease, color 0.2s ease;
}

body::before,
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
}

body::before {
    background:
        linear-gradient(90deg, var(--grid-line-horizontal) 1px, transparent 1px),
        linear-gradient(var(--grid-line-vertical) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 75%);
}

body::after {
    inset: 18px;
    border: 1px solid var(--page-frame-line);
    border-radius: 32px;
}

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

button,
input,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

p {
    margin: 0;
}

.page-shell {
    width: min(1240px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 72px;
}

.site-toolbar {
    position: relative;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 20px;
    margin-bottom: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--toolbar-surface);
    backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    animation: rise-in 0.7s ease-out both;
}

.brand-lockup {
    display: grid;
    gap: 4px;
}

.brand-overline,
.section-label {
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
}

.brand-name {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 1.7vw, 1.9rem);
    font-weight: 700;
    letter-spacing: 0.04em;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

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

.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--control-surface-soft);
    color: var(--ink);
    box-shadow: none;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.theme-toggle:hover {
    background: var(--ghost-hover);
    transform: translateY(-1px);
}

.theme-toggle:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.theme-toggle-icon {
    position: relative;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.theme-toggle-icon::after {
    content: "";
    position: absolute;
    top: -2px;
    left: 7px;
    width: 18px;
    height: 18px;
    border-radius: 999px;
    background: var(--control-surface-soft);
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

html[data-theme="dark"] .theme-toggle-icon {
    transform: translateX(-2px) rotate(-12deg);
}

html[data-theme="dark"] .theme-toggle-icon::after {
    opacity: 1;
}

.toolbar-link,
.entry-link {
    color: var(--accent-strong);
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.toolbar-link:hover,
.entry-link:hover {
    color: var(--accent);
    transform: translateX(4px);
}

.header-btn-grp {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.toolbar-button,
.table-action,
.modal-btn {
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--accent);
    color: var(--button-ink);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 18px;
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}

.toolbar-button:hover,
.table-action:hover,
.modal-btn:hover {
    background: var(--accent-strong);
    box-shadow: var(--button-shadow);
    transform: translateY(-1px);
}

.toolbar-button.is-ghost,
.modal-btn.is-secondary {
    background: transparent;
    border-color: var(--line-strong);
    color: var(--ink);
    box-shadow: none;
}

.toolbar-button.is-ghost:hover,
.modal-btn.is-secondary:hover {
    background: var(--ghost-hover);
}

.table-action {
    min-height: 38px;
    padding: 0 16px;
    border: none;
}

.table-action.is-danger,
.modal-btn.is-danger {
    background: var(--danger);
}

.table-action.is-danger:hover,
.modal-btn.is-danger:hover {
    background: var(--danger-strong);
}

.home-cover,
.home-hero,
.home-body,
.reading-shell,
.admin-hero,
.table-shell,
.editor-hero,
.editor-shell,
.writing-workspace,
.error-shell,
.register-stage {
    animation: rise-in 0.7s ease-out both;
}

.home-hero {
    margin-bottom: 22px;
}

.home-cover {
    position: relative;
    z-index: 50;
    margin-bottom: 22px;
    min-height: 112px;
    padding: 12px 14px;
    --cover-bg: #1f1511;
    --cover-bg-soft: #312119;
    --cover-line: rgba(168, 93, 45, 0.8);
    --cover-line-soft: rgba(226, 151, 91, 0.32);
    --cover-ink: #f0e1cf;
    --cover-muted: #ba7548;
    --cover-faint: rgba(232, 168, 109, 0.2);
    border: 1px solid var(--cover-line);
    border-radius: 4px;
    background:
        radial-gradient(circle at 85% 24%, rgba(150, 78, 38, 0.2), transparent 24%),
        radial-gradient(circle at 22% 120%, rgba(232, 168, 109, 0.11), transparent 38%),
        repeating-linear-gradient(135deg, rgba(255, 246, 226, 0.018) 0 1px, transparent 1px 6px),
        linear-gradient(180deg, var(--cover-bg-soft) 0%, var(--cover-bg) 56%, #160e0b 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 203, 141, 0.08),
        inset 0 18px 48px rgba(255, 219, 171, 0.035),
        0 22px 48px rgba(18, 10, 7, 0.22);
    backdrop-filter: blur(10px);
    isolation: isolate;
}

.home-cover::before {
    content: "";
    position: absolute;
    inset: 8px;
    z-index: 1;
    border: 1px solid var(--cover-line-soft);
    border-radius: 2px;
    box-shadow:
        inset 0 0 18px rgba(6, 3, 2, 0.3),
        0 0 18px rgba(232, 168, 109, 0.05);
    pointer-events: none;
}

.home-cover::after {
    content: "";
    position: absolute;
    inset: 1px;
    z-index: 0;
    border-radius: 3px;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.3), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.28)),
        linear-gradient(180deg, rgba(255, 235, 203, 0.06), transparent 28%, rgba(0, 0, 0, 0.1));
    pointer-events: none;
}

html[data-theme="light"] .home-cover {
    --cover-bg: #e8d0ad;
    --cover-bg-soft: #fff2d8;
    --cover-line: rgba(166, 91, 43, 0.72);
    --cover-line-soft: rgba(150, 82, 39, 0.34);
    --cover-ink: #5b321d;
    --cover-muted: #9f5d32;
    --cover-faint: rgba(150, 82, 39, 0.16);
    background:
        radial-gradient(circle at 82% 24%, rgba(194, 122, 66, 0.18), transparent 25%),
        radial-gradient(circle at 24% 120%, rgba(255, 255, 255, 0.28), transparent 38%),
        repeating-linear-gradient(135deg, rgba(116, 73, 42, 0.026) 0 1px, transparent 1px 6px),
        linear-gradient(180deg, var(--cover-bg-soft) 0%, var(--cover-bg) 58%, #d6b789 100%);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.36),
        inset 0 -20px 48px rgba(114, 64, 31, 0.08),
        0 18px 36px rgba(124, 80, 44, 0.18);
}

html[data-theme="light"] .home-cover::before {
    box-shadow:
        inset 0 0 18px rgba(112, 62, 29, 0.12),
        0 0 18px rgba(255, 250, 239, 0.22);
}

html[data-theme="light"] .home-cover::after {
    background:
        linear-gradient(90deg, rgba(104, 58, 27, 0.12), transparent 18%, transparent 82%, rgba(104, 58, 27, 0.12)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 34%, rgba(130, 80, 40, 0.06));
}

html[data-theme="light"] .home-cover-plum {
    opacity: 0.5;
    filter: sepia(0.25) saturate(0.9) brightness(0.86);
}

.home-cover-plum {
    position: absolute;
    top: 50%;
    right: 82px;
    z-index: 2;
    width: 210px;
    height: 92px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 210 96'%3E%3Cg fill='none' stroke='%239a5b2e' stroke-width='2.1' stroke-linecap='round' stroke-linejoin='round' opacity='.45'%3E%3Cpath d='M20 82 C52 66 70 36 112 17 C128 10 149 8 170 2'/%3E%3Cpath d='M72 42 C88 38 96 27 105 13'/%3E%3Cpath d='M56 58 C72 58 82 51 92 39'/%3E%3Cpath d='M118 15 C132 25 144 30 158 31'/%3E%3Cpath d='M132 10 C143 15 152 14 164 9'/%3E%3C/g%3E%3Cg fill='%23c18453' opacity='.36'%3E%3Ccircle cx='73' cy='42' r='3.4'/%3E%3Ccircle cx='84' cy='35' r='2.8'/%3E%3Ccircle cx='99' cy='22' r='3.1'/%3E%3Ccircle cx='123' cy='18' r='3'/%3E%3Ccircle cx='148' cy='29' r='2.6'/%3E%3Ccircle cx='162' cy='9' r='3.2'/%3E%3Ccircle cx='58' cy='59' r='2.8'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.72;
    transform: translateY(-50%);
    pointer-events: none;
}

.home-cover-main {
    position: relative;
    z-index: 3;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr) 92px;
    gap: 24px;
    min-height: 86px;
    align-items: center;
}

.home-cover-brand {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 0 24px 0 16px;
    border-right: 1px solid var(--cover-line-soft);
    color: inherit;
    text-decoration: none;
}

.home-cover-kicker {
    color: var(--cover-muted);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.16em;
    line-height: 1.45;
    text-transform: uppercase;
}

.home-cover-title {
    margin: 0;
    color: var(--cover-ink);
    font-family: var(--font-display);
    font-size: 1.62rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.05;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.28);
    overflow-wrap: anywhere;
}

.home-cover-note {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 16px;
    min-width: 0;
    max-width: 560px;
    padding: 0 18px 0 4px;
    text-align: center;
}

.home-cover-note span {
    flex: 0 0 auto;
    color: rgba(199, 122, 72, 0.48);
    font-family: var(--font-display);
    font-size: 3rem;
    line-height: 0.8;
    transform: translateY(-6px);
}

.home-cover-note p {
    color: var(--cover-ink);
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.04em;
    line-height: 1.65;
    text-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

.home-cover-controls {
    display: inline-flex;
    align-self: stretch;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
    padding-right: 4px;
}

.cover-theme-toggle {
    width: 26px;
    height: 74px;
    margin-top: -10px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--cover-muted);
    box-shadow: none;
}

.cover-theme-toggle:hover {
    background: transparent;
    transform: translateY(1px);
}

.cover-theme-toggle:focus-visible {
    outline: none;
    box-shadow: none;
}

.cover-theme-toggle:focus-visible .pull-light-cord {
    filter: drop-shadow(0 0 8px rgba(239, 176, 122, 0.55));
}

.pull-light-cord {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.pull-light-cord::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 54px;
    background: linear-gradient(180deg, rgba(240, 176, 115, 0.12), rgba(240, 176, 115, 0.76));
    transform: translateX(-50%);
}

.pull-light-cord::after {
    content: "";
    position: absolute;
    top: 50px;
    left: 50%;
    width: 9px;
    height: 14px;
    border: 1px solid rgba(240, 176, 115, 0.64);
    border-radius: 999px;
    background: linear-gradient(180deg, #b76e3c, #6d391f);
    box-shadow:
        inset 0 1px 2px rgba(255, 224, 180, 0.22),
        0 7px 12px rgba(0, 0, 0, 0.32);
    transform: translateX(-50%);
    transition:
        background-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.cover-theme-toggle[data-theme-state="dark"] .pull-light-cord::after {
    background: linear-gradient(180deg, #efb07a, #9a552d);
    box-shadow:
        inset 0 1px 2px rgba(255, 239, 213, 0.28),
        0 0 12px rgba(239, 176, 122, 0.2),
        0 7px 12px rgba(0, 0, 0, 0.32);
}

.cover-theme-toggle:active .pull-light-cord::after {
    transform: translate(-50%, 3px);
}

html[data-theme="light"] .pull-light-cord::before {
    background: linear-gradient(180deg, rgba(133, 75, 38, 0.22), rgba(133, 75, 38, 0.72));
}

html[data-theme="light"] .pull-light-cord::after {
    border-color: rgba(139, 78, 39, 0.58);
    background: linear-gradient(180deg, #c98855, #8c4e2a);
    box-shadow:
        inset 0 1px 2px rgba(255, 245, 226, 0.42),
        0 6px 10px rgba(119, 71, 35, 0.22);
}

.admin-bookmark {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.admin-bookmark-trigger {
    position: relative;
    display: inline-flex;
    align-items: flex-start;
    justify-content: center;
    width: 32px;
    height: 76px;
    padding: 0;
    border: none;
    border-radius: 0 0 14px 14px;
    background: transparent;
    color: var(--accent-strong);
    cursor: pointer;
}

.admin-bookmark-trigger:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.admin-bookmark-trigger.is-login {
    text-decoration: none;
}

.bookmark-icon {
    display: block;
    width: 32px;
    height: 76px;
    background: url("../images/archive-bookmark.png") center top / contain no-repeat;
    filter: drop-shadow(0 10px 12px rgba(0, 0, 0, 0.28));
    transform-origin: top center;
    transition:
        filter 0.2s ease,
        transform 0.2s ease;
}

html[data-theme="light"] .bookmark-icon {
    background-image: url("../images/archive-bookmark-light.png");
    filter: drop-shadow(0 9px 12px rgba(126, 77, 38, 0.22));
}

.has-menu .admin-bookmark-trigger:hover .bookmark-icon,
.admin-bookmark-trigger.is-login:hover .bookmark-icon,
.has-menu .admin-bookmark-trigger[aria-expanded="true"] .bookmark-icon {
    filter: drop-shadow(0 14px 14px rgba(0, 0, 0, 0.34));
    transform: translateY(2px);
}

html[data-theme="light"] .has-menu .admin-bookmark-trigger:hover .bookmark-icon,
html[data-theme="light"] .admin-bookmark-trigger.is-login:hover .bookmark-icon,
html[data-theme="light"] .has-menu .admin-bookmark-trigger[aria-expanded="true"] .bookmark-icon {
    filter: drop-shadow(0 12px 14px rgba(126, 77, 38, 0.28));
}

.admin-bookmark-menu {
    position: absolute;
    top: calc(100% + 7px);
    right: -3px;
    z-index: 40;
    display: none;
    min-width: 138px;
    padding: 7px 0;
    border: 1px solid rgba(214, 143, 84, 0.28);
    border-radius: 16px;
    background: rgba(37, 26, 21, 0.98);
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.36);
    overflow: hidden;
}

html[data-theme="light"] .admin-bookmark-menu {
    border-color: rgba(150, 82, 39, 0.28);
    background: rgba(255, 244, 224, 0.98);
    box-shadow: 0 20px 36px rgba(124, 80, 44, 0.22);
}

.admin-bookmark-menu:not([hidden]) {
    display: grid;
    gap: 4px;
}

.admin-bookmark-menu::before {
    content: "";
    position: absolute;
    top: -6px;
    right: 18px;
    width: 10px;
    height: 10px;
    border-top: 1px solid rgba(214, 143, 84, 0.28);
    border-left: 1px solid rgba(214, 143, 84, 0.28);
    background: rgba(37, 26, 21, 0.98);
    transform: rotate(45deg);
}

html[data-theme="light"] .admin-bookmark-menu::before {
    border-color: rgba(150, 82, 39, 0.28);
    background: rgba(255, 244, 224, 0.98);
}

.admin-bookmark-menu button {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--cover-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 700;
    text-align: left;
    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

html[data-theme="light"] .admin-bookmark-menu button {
    color: var(--cover-ink);
}

.admin-bookmark-menu button + button {
    border-top: 1px solid rgba(214, 143, 84, 0.16);
}

html[data-theme="light"] .admin-bookmark-menu button + button {
    border-top-color: rgba(150, 82, 39, 0.15);
}

.admin-bookmark-menu button:hover,
.admin-bookmark-menu button:focus-visible {
    outline: none;
    background: rgba(210, 145, 98, 0.13);
    color: #ffc38d;
}

html[data-theme="light"] .admin-bookmark-menu button:hover,
html[data-theme="light"] .admin-bookmark-menu button:focus-visible {
    background: rgba(166, 91, 43, 0.1);
    color: #7d421f;
}

.admin-bookmark-menu button:disabled {
    color: rgba(240, 225, 207, 0.38);
    cursor: default;
    opacity: 0.46;
}

.admin-bookmark-menu button:disabled:hover {
    background: transparent;
    color: rgba(240, 225, 207, 0.38);
}

.hero-copyblock,
.feature-article,
.sidebar-block,
.reading-lead,
.reading-article,
.admin-hero,
.table-shell,
.editor-hero,
.editor-shell,
.writing-workspace,
.error-shell,
.register-stage {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    backdrop-filter: blur(10px);
}

.hero-copyblock {
    min-height: 340px;
    padding: clamp(28px, 5vw, 56px);
    background: var(--hero-surface);
}

.hero-composition {
    min-height: 100%;
    display: flex;
    align-items: stretch;
}

.hero-title-group {
    display: grid;
    width: 100%;
    align-self: stretch;
}

.hero-title-frame {
    position: relative;
    display: grid;
    gap: 18px;
    min-height: 100%;
    padding: clamp(28px, 4vw, 40px);
    border: 1px solid var(--hero-line);
    border-radius: calc(var(--radius-lg) - 4px);
    background: var(--hero-frame-surface);
    overflow: hidden;
}

.hero-title-frame::before {
    content: "";
    position: absolute;
    inset: 14px;
    border: 1px solid var(--hero-line-soft);
    border-radius: 18px;
    pointer-events: none;
}

.hero-title-frame::after {
    content: "ARCHIVE";
    position: absolute;
    right: clamp(22px, 4vw, 38px);
    top: 24px;
    color: var(--hero-archive-ink);
    font-family: var(--font-display);
    font-size: clamp(3rem, 7vw, 6.5rem);
    letter-spacing: 0.06em;
    pointer-events: none;
}

.hero-title,
.feature-title,
.stream-heading h2,
.reading-title,
.admin-hero h1,
.editor-hero h1,
.error-shell h1,
.empty-stage h1,
.empty-stage h2 {
    font-family: var(--font-display);
    letter-spacing: 0.02em;
}

.hero-title {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 0;
    margin: 0;
    font-size: clamp(3rem, 7vw, 6rem);
    line-height: 0.9;
    text-wrap: balance;
}

.hero-title-word {
    display: block;
    width: max-content;
    max-width: 100%;
    text-shadow: var(--hero-text-shadow);
}

.hero-title-word-offset {
    margin-left: clamp(22px, 7vw, 150px);
}

.hero-title-tag {
    position: relative;
    z-index: 1;
    display: inline-flex;
    width: max-content;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--hero-pill-surface);
    color: var(--accent-strong);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.hero-title-tag::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
}

.hero-subtitle {
    position: relative;
    z-index: 1;
    max-width: 34rem;
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.85;
}

.hero-summary {
    max-width: none;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(1.28rem, 1.9vw, 1.8rem);
    line-height: 1.6;
}

.hero-signature-line {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 10px;
    padding: 18px 22px 18px 28px;
    border-top: 1px solid var(--hero-line);
    border-bottom: 1px solid var(--hero-line);
    background: var(--hero-signature-surface);
}

.hero-signature-mark {
    flex: 0 0 auto;
    color: var(--hero-signature-mark);
    font-family: var(--font-display);
    font-size: 4.4rem;
    line-height: 1;
}

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

.stat-chip,
.admin-summary {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--chip-surface);
    padding: 16px 18px;
}

.stat-chip strong,
.admin-summary strong {
    display: block;
    margin: 6px 0 2px;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 2.3vw, 2.5rem);
}

.stat-label,
.stat-note,
.feature-meta,
.entry-line-meta,
.reading-meta,
.admin-copy,
.sidebar-copy,
.editor-note,
.empty-stage p {
    color: var(--ink-soft);
}

.feature-article {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 18px;
    padding: 0 0 26px;
    margin-bottom: 22px;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.feature-cover {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 7;
    border-radius: 22px;
    background: var(--surface-muted);
    box-shadow: 0 20px 46px rgba(62, 40, 29, 0.14);
}

.feature-cover img,
.entry-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.feature-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 48%, rgba(31, 23, 19, 0.38));
    pointer-events: none;
}

.feature-title {
    font-size: clamp(2rem, 3vw, 2.8rem);
    line-height: 1.08;
    margin: 0;
}

.feature-title a:hover,
.entry-line-title a:hover {
    color: var(--accent);
}

.feature-meta,
.entry-line-meta,
.reading-meta {
    display: flex;
    gap: 10px 14px;
    flex-wrap: wrap;
    font-size: 0.93rem;
}

.feature-meta span,
.entry-line-meta span,
.reading-meta span {
    position: relative;
}

.feature-meta span + span::before,
.entry-line-meta span + span::before,
.reading-meta span + span::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: var(--accent);
    margin-right: 10px;
    vertical-align: middle;
}

.feature-preview,
.entry-line-preview {
    color: var(--ink-soft);
    overflow: hidden;
}

.feature-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 8;
}

.home-body {
    display: grid;
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
    align-items: start;
}

.archive-sidebar {
    position: sticky;
    top: 16px;
    display: grid;
    gap: 16px;
}

.sidebar-block {
    padding: 22px 20px;
}

.sidebar-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.sidebar-heading h2,
.stream-heading h2 {
    margin: 0;
    font-size: 1.45rem;
}

.sidebar-heading span {
    color: var(--ink-faint);
    font-size: 0.95rem;
}

.archive-list {
    list-style: none;
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
}

.archive-list li a {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    transition: color 0.2s ease, transform 0.2s ease;
}

.archive-list li:first-child a {
    padding-top: 0;
    border-top: none;
}

.archive-list li a:hover {
    color: var(--accent-strong);
    transform: translateX(6px);
}

.archive-list li a em {
    font-style: normal;
    color: var(--ink-faint);
}

.entry-stream {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--stream-surface);
    box-shadow: var(--shadow);
    padding: 28px;
}

.mobile-archive-controls,
.mobile-archive-details {
    display: none;
}

.stream-heading {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.stream-heading-compact {
    padding-bottom: 0;
    border-bottom: none;
}

.entry-line {
    display: grid;
    grid-template-columns: 170px minmax(0, 1fr);
    gap: 20px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
    transition: transform 0.2s ease;
}

.entry-line:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.entry-line:hover {
    transform: translateX(6px);
}

.entry-line.has-cover {
    grid-template-columns: 170px minmax(132px, 156px) minmax(0, 1fr);
    align-items: start;
}

.entry-cover {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 5 / 4;
    border-radius: 18px;
    background: var(--surface-muted);
    box-shadow: 0 16px 34px rgba(62, 40, 29, 0.12);
}

.entry-line-main {
    display: grid;
    gap: 12px;
}

.entry-line-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 2.2vw, 2rem);
    line-height: 1.18;
    margin: 0;
}

.entry-line-preview {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.feature-article.has-cover .feature-preview img,
.entry-line.has-cover .entry-line-preview img {
    display: none;
}

.entry-line.has-cover .entry-line-preview {
    -webkit-line-clamp: 3;
}

.reading-shell {
    display: grid;
    gap: 18px;
    max-width: 920px;
    margin: 0 auto;
}

.reading-lead,
.reading-article {
    padding: clamp(24px, 4vw, 40px);
}

.reading-lead {
    display: grid;
    gap: 16px;
}

.reading-title {
    font-size: clamp(2.4rem, 4vw, 4.2rem);
    line-height: 1.05;
    margin: 0;
}

.reading-article {
    line-height: 1.95;
}

.markdown-fallback {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.reading-cover {
    margin: 0;
    padding: 0 clamp(24px, 4vw, 40px) clamp(24px, 4vw, 40px);
}

.reading-cover-button {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--table-surface);
    cursor: zoom-in;
    box-shadow: var(--panel-shadow);
}

.reading-cover-button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--panel-shadow);
}

.reading-cover img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(75vh, 720px);
    margin: 0 auto;
    object-fit: contain;
}

.back-link {
    justify-self: start;
}

.admin-hero,
.editor-hero {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
    padding: 28px;
}

.admin-hero h1,
.editor-hero h1 {
    margin: 10px 0 12px;
    font-size: clamp(2.2rem, 3vw, 3.2rem);
}

.admin-copy {
    max-width: 38rem;
    line-height: 1.8;
}

.table-shell,
.editor-shell {
    padding: 24px;
}

.table-toolbar,
.editor-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

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

.manage_table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

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

.manage_table th {
    color: var(--ink-soft);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: var(--table-head-surface);
}

.manage_table tbody tr:hover {
    background: var(--row-hover);
}

.panel-title {
    margin: 4px 0 0;
    font-size: 1.28rem;
}

.analytics-shell + .analytics-shell {
    margin-top: 18px;
}

.analytics-table {
    min-width: 820px;
}

.excluded-ip-add-form {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) auto;
    align-items: end;
    gap: 14px;
    margin-bottom: 18px;
}

.excluded-ip-table {
    min-width: 720px;
}

.excluded-ip-table .form-input {
    min-height: 42px;
}

.excluded-ip-input {
    max-width: 220px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.excluded-ip-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.recent-views-table {
    min-width: 920px;
}

.table-link {
    color: var(--accent-strong);
    font-weight: 700;
    text-decoration: none;
}

.table-link:hover {
    text-decoration: underline;
}

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

.analytics-table code {
    display: inline-block;
    max-width: 15rem;
    overflow-wrap: anywhere;
    padding: 3px 7px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--control-surface-soft);
    color: var(--ink);
    font-family: Consolas, "Liberation Mono", monospace;
    font-size: 0.92rem;
}

.manage-opera-col {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.edit-page .page-shell {
    width: min(1380px, calc(100% - 32px));
    padding-bottom: 48px;
}

.edit-page .site-toolbar {
    margin-bottom: 14px;
}

.writing-workspace {
    min-height: calc(100vh - 142px);
    padding: clamp(16px, 2vw, 24px);
}

.writing-form {
    gap: 16px;
}

.writing-topbar {
    position: sticky;
    top: 12px;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: -8px -8px 2px;
    padding: 14px 16px;
    border: 1px solid var(--topbar-line);
    border-radius: 20px;
    background: var(--topbar-surface);
    backdrop-filter: blur(16px);
    box-shadow: var(--topbar-shadow);
}

.writing-titleblock {
    min-width: 0;
}

.writing-titleblock h1 {
    margin: 5px 0 4px;
    font-size: clamp(1.45rem, 2vw, 2rem);
    line-height: 1.12;
}

.writing-titleblock p {
    color: var(--ink-soft);
    line-height: 1.5;
}

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

.save-status {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--status-surface);
    color: var(--ink-soft);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.save-status.is-dirty,
.save-status.is-saving {
    border-color: var(--warning-line);
    background: var(--warning-soft);
    color: var(--warning);
}

.save-status.is-saved {
    border-color: var(--success-line);
    background: var(--success-soft);
    color: var(--success);
}

.save-status.is-error {
    border-color: var(--danger-line);
    background: var(--danger-soft);
    color: var(--danger);
}

.submit-button:disabled {
    cursor: not-allowed;
    opacity: 0.72;
    transform: none;
}

.writing-fields {
    display: grid;
    grid-template-columns: minmax(280px, 1.45fr) minmax(190px, 0.78fr) minmax(190px, 0.78fr);
    gap: 14px;
    align-items: end;
}

.field-title .form-input {
    font-size: 1.08rem;
    font-weight: 650;
}

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

.cover-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cover-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    width: min(100%, 420px);
    aspect-ratio: 16 / 9;
    padding: 0;
    overflow: hidden;
    border: 1px dashed var(--cover-upload-line);
    border-radius: var(--radius-sm);
    background: var(--cover-upload-surface);
    color: var(--cover-upload-plus);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.cover-dropzone:hover,
.cover-dropzone:focus-visible,
.cover-dropzone.is-dragover {
    outline: none;
    border-color: var(--focus-border);
    background: var(--cover-upload-hover);
    box-shadow: var(--focus-ring);
}

.cover-dropzone.is-error {
    border-color: var(--danger);
    background: var(--danger-soft);
}

.cover-dropzone.is-uploading {
    cursor: wait;
    opacity: 0.72;
}

.cover-dropzone.is-uploading::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent),
        rgba(0, 0, 0, 0.16);
    animation: cover-upload-pulse 1.1s linear infinite;
}

.cover-plus {
    position: relative;
    display: block;
    width: 56px;
    height: 56px;
    border: 1px solid var(--cover-upload-line);
    border-radius: 50%;
}

.cover-plus::before,
.cover-plus::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    border-radius: 999px;
    background: currentColor;
    transform: translate(-50%, -50%);
}

.cover-plus::before {
    width: 22px;
    height: 2px;
}

.cover-plus::after {
    width: 2px;
    height: 22px;
}

.cover-preview-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-plus[hidden],
.cover-preview-image[hidden],
.cover-remove-button[hidden] {
    display: none;
}

.cover-remove-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--control-surface);
    color: var(--ink-soft);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.cover-remove-button:hover,
.cover-remove-button:focus-visible {
    outline: none;
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

.cover-remove-button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.cover-upload-status {
    min-height: 1.4em;
    color: var(--ink-faint);
    font-size: 0.86rem;
}

.cover-upload-status.is-saved {
    color: var(--success);
}

.cover-upload-status.is-uploading {
    color: var(--warning);
}

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

.writing-workspace .editor-stage {
    min-height: 460px;
    border-color: var(--topbar-line);
    border-radius: 18px;
    background: var(--editor-surface);
    box-shadow: var(--editor-shadow);
}

.writing-workspace .editor-stage .editormd {
    margin-bottom: 0 !important;
    border: none;
}

.writing-workspace .editor-stage .CodeMirror {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.72;
}

.writing-workspace .editor-stage .CodeMirror-scroll {
    padding: 8px 0;
}

.writing-workspace .editor-stage .editormd-preview-container {
    padding: 24px 28px;
}

.writing-footer {
    margin-bottom: 0;
    padding-top: 0;
}

.writing-metrics {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    color: var(--ink-faint);
    font-size: 0.9rem;
    font-weight: 700;
}

.writing-metrics span {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--control-surface-soft);
}

.editor-form {
    display: grid;
    gap: 22px;
}

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

.field-block {
    display: grid;
    gap: 10px;
    color: var(--ink-soft);
    font-size: 0.96rem;
    font-weight: 600;
}

.field-block-wide {
    grid-column: span 1;
}

.form-input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: var(--control-surface);
    color: var(--ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--focus-border);
    box-shadow: var(--focus-ring);
    background: var(--control-focus-surface);
}

.editor-stage {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--table-surface);
}

.mobile-markdown-editor {
    display: none;
}

.mobile-editor-shell {
    display: none;
}

.mobile-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border-bottom: 1px solid var(--line);
    background: var(--editor-toolbar-surface);
}

.mobile-editor-tool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: var(--ink-soft);
    font: 700 14px/1 var(--font-body);
    cursor: pointer;
    touch-action: manipulation;
}

.mobile-editor-tool:hover,
.mobile-editor-tool:focus-visible {
    border-color: var(--line-strong);
    background: var(--ghost-hover);
    color: var(--accent-strong);
    outline: none;
}

.mobile-editor-tool:active {
    background: var(--accent-soft);
}

.mobile-editor-tool:disabled {
    cursor: wait;
    opacity: 0.62;
}

.mobile-editor-tool.is-uploading {
    color: var(--accent-strong);
}

.mobile-image-upload-status {
    flex: 1 0 100%;
    min-height: 16px;
    padding: 1px 2px 0;
    color: var(--ink-muted);
    font-size: 12px;
    line-height: 1.35;
}

.mobile-image-upload-status.is-saved {
    color: var(--success);
}

.mobile-image-upload-status.is-error {
    color: var(--danger);
}

.editor-surface,
.editor-stage .editormd {
    width: 100% !important;
}

.editor-stage .editormd-toolbar {
    background: var(--editor-toolbar-surface);
    border-bottom: 1px solid var(--line);
}

.editor-stage .editormd-menu > li > a {
    color: var(--ink-soft);
}

.editor-stage .editormd-menu > li > a:hover,
.editor-stage .editormd-menu > li > a.active {
    background: var(--dropdown-hover);
    color: var(--accent-strong);
}

.editor-stage .CodeMirror,
.editor-stage .editormd-preview {
    font-family: var(--font-body);
}

.editor-stage .CodeMirror,
.editor-stage .editormd-preview,
.editor-stage .editormd-preview-container,
.editor-stage .editormd-html-preview {
    background: var(--editor-surface) !important;
    color: var(--ink);
}

.editor-stage .CodeMirror-gutters {
    background: var(--editor-toolbar-surface);
    border-right-color: var(--line);
}

.editor-stage .CodeMirror-linenumber {
    color: var(--ink-faint);
}

.editor-stage .CodeMirror div.CodeMirror-cursor {
    border-left: 2px solid var(--editor-cursor);
}

.editor-stage .CodeMirror-selected {
    background: var(--accent-soft) !important;
}

.editor-stage .CodeMirror-activeline-background {
    background: var(--ghost-hover);
}

.editor-stage.is-mobile-native-editor {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.editor-stage.is-mobile-native-editor .editormd {
    height: auto !important;
    min-height: 0;
}

.editor-stage.is-mobile-native-editor .editormd-toolbar,
.editor-stage.is-mobile-native-editor .CodeMirror,
.editor-stage.is-mobile-native-editor .editormd-preview,
.editor-stage.is-mobile-native-editor .editormd-preview-container,
.editor-stage.is-mobile-native-editor .editormd-html-preview {
    display: none !important;
}

.editor-stage.is-mobile-native-editor .mobile-editor-shell {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--editor-surface);
}

.editor-stage.is-mobile-native-editor .mobile-markdown-editor {
    display: block;
    width: 100%;
    min-height: 420px;
    padding: 18px;
    border: 0;
    outline: 0;
    resize: vertical;
    background: var(--editor-surface);
    color: var(--ink);
    font: 15px/1.72 var(--font-body);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    touch-action: auto;
}

.editor-stage.is-mobile-native-editor .mobile-markdown-editor:focus {
    box-shadow: var(--focus-ring);
}

.editor-note {
    line-height: 1.7;
}

.submit-button {
    border: none;
}

.category-container {
    position: relative;
}

.category-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 8px 0;
    list-style: none;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--dropdown-surface);
    box-shadow: var(--shadow);
    display: none;
    z-index: 20;
    max-height: 220px;
    overflow-y: auto;
}

.category-dropdown.is-open {
    display: block;
}

.dropdown-item {
    padding: 10px 14px;
    color: var(--ink-soft);
    cursor: pointer;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background: var(--dropdown-hover);
    color: var(--accent-strong);
}

.dropdown-empty {
    padding: 10px 14px;
    color: var(--ink-faint);
}

.tooltip {
    position: absolute;
    display: none;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--tooltip-surface);
    color: var(--tooltip-ink);
    font-size: 12px;
    box-shadow: var(--tooltip-shadow);
    z-index: 30;
}

.modal-open {
    overflow: hidden;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    background: var(--modal-overlay-surface);
    backdrop-filter: blur(10px);
    z-index: 40;
    opacity: 0;
    transition: opacity 0.22s ease;
}

.modal-overlay.is-visible {
    opacity: 1;
}

.article-image-viewer {
    position: fixed;
    inset: 0;
    z-index: 70;
    display: none;
    place-items: center;
    padding: clamp(12px, 3vw, 32px);
}

.article-image-viewer.is-visible {
    display: grid;
}

.article-image-viewer-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background: var(--modal-overlay-surface);
    backdrop-filter: blur(12px);
    cursor: zoom-out;
}

.article-image-viewer-panel {
    position: relative;
    z-index: 1;
    display: grid;
    gap: 10px;
    max-width: min(1120px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    margin: 0;
}

.article-image-viewer-panel img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 92px);
    object-fit: contain;
    border-radius: 14px;
    background: var(--table-surface);
    box-shadow: var(--modal-shadow);
}

.article-image-viewer-panel figcaption {
    justify-self: center;
    max-width: min(720px, 100%);
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--modal-surface);
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.article-image-viewer-panel figcaption[hidden] {
    display: none;
}

.article-image-viewer-close {
    position: absolute;
    top: -14px;
    right: -14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--modal-surface);
    color: var(--ink);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: var(--modal-shadow);
}

.article-image-viewer-close:hover,
.article-image-viewer-close:focus-visible {
    outline: none;
    background: var(--ghost-hover);
}

.modal {
    width: min(460px, calc(100vw - 32px));
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, calc(-50% + 20px));
    border: 1px solid var(--line);
    border-radius: 24px;
    background: var(--modal-surface);
    box-shadow: var(--modal-shadow);
    opacity: 0;
    transition: transform 0.22s ease, opacity 0.22s ease;
    z-index: 41;
}

.modal.is-visible {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.modal-header,
.modal-body,
.modal-footer {
    padding: 20px 22px;
}

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

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-body {
    line-height: 1.8;
    color: var(--ink-soft);
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--line);
}

.empty-stage,
.error-shell,
.register-stage {
    display: grid;
    justify-items: center;
    text-align: center;
}

.empty-stage,
.error-shell {
    padding: clamp(42px, 8vw, 92px);
}

.empty-stage.compact {
    margin: 0;
}

.error-code {
    font-family: var(--font-display);
    font-size: clamp(5rem, 12vw, 9rem);
    line-height: 1;
    color: var(--error-code-ink);
}

.register-stage {
    min-height: calc(100vh - 180px);
    align-content: center;
    gap: 14px;
    padding: clamp(42px, 8vw, 92px);
}

.login-stage {
    max-width: 520px;
    margin: 0 auto;
}

.login-form {
    width: min(100%, 420px);
    display: grid;
    gap: 18px;
}

.form-error {
    margin: 0;
    color: var(--error-ink);
    line-height: 1.6;
}

.register-pulse {
    width: 72px;
    height: 72px;
    border-radius: 999px;
    border: 1px solid var(--hero-line);
    background: var(--pulse-surface);
    animation: pulse 1.8s ease-out infinite;
}

.markdown-body {
    color: var(--ink);
    background: transparent !important;
    font-family: var(--font-body);
}

.markdown-body a {
    color: var(--accent-strong);
}

.markdown-body img.article-image {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 1.6rem auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--table-surface);
    box-shadow: var(--panel-shadow);
    cursor: zoom-in;
}

.markdown-body img.article-image:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring), var(--panel-shadow);
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4 {
    font-family: var(--font-display);
    color: var(--ink);
    border-bottom-color: var(--line);
}

.markdown-body p,
.markdown-body li,
.markdown-body blockquote {
    line-height: 1.95;
}

.markdown-body hr {
    height: 1px;
    padding: 0;
    border: 0;
    margin: 2.7rem 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--divider-line-faint) 14%,
        var(--divider-line) 34%,
        var(--divider-accent) 50%,
        var(--divider-line) 66%,
        var(--divider-line-faint) 86%,
        transparent 100%
    );
    box-shadow: 0 1px 0 var(--divider-glow);
}

.markdown-body blockquote {
    color: var(--ink-soft);
    border-left-color: var(--line-strong);
}

.markdown-body pre {
    padding: 18px;
    border-radius: 18px;
    color: var(--pre-ink);
    background: var(--pre-surface);
    box-shadow: var(--pre-shadow);
}

.markdown-body :not(pre) > code {
    color: var(--ink);
    background: var(--accent-soft);
    border-radius: 6px;
    padding: 0.16em 0.36em;
}

.markdown-body code,
.markdown-body pre code {
    font-family: "Cascadia Code", "Consolas", monospace;
}

.markdown-body pre code {
    color: inherit;
    background: transparent;
    padding: 0;
}

.markdown-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
}

.markdown-body table tr,
.editor-stage .editormd-preview-container table tr,
.editor-stage .editormd-html-preview table tr {
    background-color: transparent;
    border-top-color: var(--line);
}

.markdown-body table thead tr,
.editor-stage .editormd-preview-container table thead tr,
.editor-stage .editormd-html-preview table thead tr {
    background-color: var(--table-head-surface);
}

.markdown-body table tr:nth-child(2n),
.editor-stage .editormd-preview-container table tbody tr:nth-child(2n),
.editor-stage .editormd-html-preview table tbody tr:nth-child(2n) {
    background-color: var(--row-hover);
}

.markdown-body table th,
.markdown-body table td {
    border-color: var(--line);
}

.markdown-body table th,
.editor-stage .editormd-preview-container table th,
.editor-stage .editormd-html-preview table th {
    color: var(--ink);
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cover-upload-pulse {
    from {
        transform: translateX(-100%);
    }

    to {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0% {
        transform: scale(0.96);
        box-shadow: 0 0 0 0 var(--pulse-shadow);
    }

    70% {
        transform: scale(1);
        box-shadow: 0 0 0 20px transparent;
    }

    100% {
        transform: scale(0.96);
        box-shadow: 0 0 0 0 transparent;
    }
}

@media (max-width: 1080px) {
    .home-hero,
    .home-body,
    .field-grid,
    .admin-hero,
    .editor-hero {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .archive-sidebar {
        position: static;
    }

    .hero-composition {
        display: block;
    }

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

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

@media (max-width: 760px) {
    .page-shell {
        width: min(100% - 20px, 100%);
        padding-top: 12px;
        padding-bottom: 40px;
    }

    body::after {
        inset: 10px;
        border-radius: 20px;
    }

    .site-toolbar,
    .home-cover,
    .hero-copyblock,
    .entry-stream,
    .reading-lead,
    .reading-article,
    .admin-hero,
    .table-shell,
    .editor-hero,
    .editor-shell,
    .writing-workspace,
    .error-shell,
    .register-stage {
        border-radius: 22px;
    }

    .site-toolbar {
        align-items: flex-start;
    }

    .home-cover {
        min-height: auto;
        padding: 14px;
        border-radius: 8px;
    }

    .home-cover::before {
        inset: 8px;
        border-radius: 4px;
    }

    .home-cover-plum {
        display: none;
    }

    .home-cover-main {
        grid-template-columns: minmax(0, 1fr) 76px;
        grid-template-areas:
            "brand controls"
            "note note";
        gap: 12px 10px;
        min-height: auto;
    }

    .home-cover-brand {
        grid-area: brand;
        gap: 6px;
        padding-right: 0;
        border-right: none;
    }

    .home-cover-kicker {
        max-width: 13rem;
        font-size: 0.58rem;
        line-height: 1.45;
    }

    .home-cover-controls {
        grid-area: controls;
        align-self: start;
        gap: 6px;
        padding-right: 0;
    }

    .cover-theme-toggle {
        width: 22px;
        height: 56px;
        margin-top: -8px;
    }

    .pull-light-cord::before {
        height: 40px;
    }

    .pull-light-cord::after {
        top: 36px;
        width: 8px;
        height: 12px;
    }

    .admin-bookmark-trigger {
        width: 26px;
        height: 58px;
    }

    .bookmark-icon {
        width: 24px;
        height: 58px;
    }

    .admin-bookmark-menu {
        top: calc(100% + 8px);
        min-width: 120px;
    }

    .admin-bookmark-menu button {
        min-height: 38px;
        padding: 0 18px;
        font-size: 0.96rem;
    }

    .home-cover-title {
        font-size: 1.72rem;
        line-height: 1;
    }

    .home-cover-note {
        grid-area: note;
        gap: 10px;
        justify-self: stretch;
        padding: 12px 6px 2px;
        border-top: 1px solid var(--cover-line-soft);
        text-align: left;
    }

    .home-cover-note span {
        font-size: 2.2rem;
        transform: translateY(-4px);
    }

    .home-cover-note p {
        font-size: 1rem;
        line-height: 1.65;
    }

    .edit-page .site-toolbar {
        gap: 10px;
        margin-bottom: 10px;
        padding: 12px;
    }

    .edit-page .brand-overline {
        display: none;
    }

    .edit-page .brand-name {
        font-size: 1.22rem;
    }

    .edit-page .toolbar-actions {
        gap: 8px;
    }

    .edit-page .header-btn-grp {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 6px;
        width: 100%;
    }

    .edit-page .header-btn-grp .toolbar-button {
        min-height: 36px;
        padding: 0 8px;
        font-size: 0.84rem;
    }

    .toolbar-actions,
    .header-btn-grp,
    .table-toolbar,
    .writing-actions,
    .editor-footer,
    .modal-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-copyblock,
    .entry-stream,
    .reading-lead,
    .reading-article,
    .table-shell,
    .editor-shell,
    .writing-workspace {
        padding: 20px;
    }

    .edit-page .page-shell {
        width: min(100% - 20px, 100%);
        padding-bottom: 36px;
    }

    .writing-topbar {
        position: static;
        align-items: stretch;
        flex-direction: column;
        margin: -8px -8px 0;
        gap: 10px;
        padding: 12px;
    }

    .writing-titleblock h1 {
        margin-bottom: 0;
        font-size: 1.38rem;
    }

    .writing-titleblock p {
        display: none;
    }

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

    .writing-actions .toolbar-button,
    .writing-actions .save-status {
        width: 100%;
    }

    .writing-actions .save-status {
        grid-column: 1 / -1;
        min-height: 30px;
        justify-content: center;
    }

    .writing-actions .toolbar-button {
        min-height: 38px;
        padding: 0 12px;
    }

    .writing-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

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

    .writing-workspace .field-block {
        gap: 8px;
        font-size: 0.9rem;
    }

    .writing-workspace .form-input {
        min-height: 48px;
        padding: 0 12px;
    }

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

    .cover-dropzone {
        width: 100%;
    }

    .writing-workspace .editor-stage {
        min-height: 420px;
    }

    .writing-workspace .editor-stage .editormd-preview-container {
        padding: 18px;
    }

    .entry-line {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .entry-line.has-cover {
        grid-template-columns: 1fr;
    }

    .entry-cover {
        max-width: 100%;
        aspect-ratio: 16 / 9;
        border-radius: 18px;
    }

    .feature-cover {
        aspect-ratio: 16 / 9;
        border-radius: 18px;
    }

    .feature-article {
        padding-bottom: 22px;
    }

    .hero-title-frame {
        padding: 24px 20px;
    }

    .hero-title-frame::after {
        right: 18px;
        top: 40px;
        font-size: 3.9rem;
    }

    .hero-title-word-offset {
        margin-left: clamp(14px, 8vw, 40px);
    }

    .hero-signature-line {
        align-items: flex-start;
        padding: 16px 16px 16px 18px;
    }

    .hero-signature-mark {
        font-size: 3.2rem;
    }

    .field-grid {
        gap: 14px;
    }

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

    .excluded-ip-input {
        max-width: none;
    }

    .manage_table {
        min-width: 640px;
    }

    .modal {
        width: calc(100vw - 20px);
    }

    .detail-page .home-cover-note {
        display: none;
    }

    .detail-page .home-cover-main {
        grid-template-columns: minmax(0, 1fr) 76px;
        grid-template-areas: "brand controls";
        min-height: auto;
        gap: 10px;
    }

    .detail-page .reading-shell {
        gap: 10px;
    }

    .detail-page .reading-lead,
    .detail-page .reading-article {
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .detail-page .reading-lead {
        gap: 10px;
        padding: 18px 10px 10px;
    }

    .detail-page .reading-title {
        font-size: 2.1rem;
        line-height: 1.15;
    }

    .detail-page .reading-meta {
        gap: 6px 10px;
        font-size: 0.84rem;
    }

    .detail-page .back-link {
        margin-top: 2px;
        font-size: 0.95rem;
    }

    .detail-page .reading-cover {
        padding: 0 8px 4px;
    }

    .detail-page .reading-cover-button {
        border-radius: 8px;
        box-shadow: none;
    }

    .detail-page .reading-article {
        padding: 18px 8px 32px;
        font-size: 1rem;
        line-height: 1.9;
    }

    .detail-page .reading-article.markdown-body p,
    .detail-page .reading-article.markdown-body li,
    .detail-page .reading-article.markdown-body blockquote {
        line-height: 1.9;
    }

    .detail-page .reading-article.markdown-body blockquote {
        margin: 1rem 0;
        padding-left: 0.9rem;
    }

    .detail-page .reading-article.markdown-body ul,
    .detail-page .reading-article.markdown-body ol {
        padding-left: 1.35rem;
    }

    .detail-page .reading-article.markdown-body pre {
        overflow-x: auto;
        padding: 12px;
        border-radius: 8px;
    }

    .detail-page .reading-article.markdown-body table {
        max-width: 100%;
        overflow-x: auto;
    }

    .detail-page .reading-article.markdown-body img.article-image {
        max-width: 100%;
        margin: 1.2rem auto;
        border-radius: 8px;
        box-shadow: none;
    }

    .home-page .mobile-archive-controls {
        display: grid;
        gap: 12px;
        margin: 0 2px 18px;
    }

    .home-page .mobile-filter-heading {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 12px;
    }

    .home-page .mobile-filter-heading h2 {
        margin: 0;
        font-family: var(--font-display);
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .home-page .mobile-filter-heading > span {
        flex: 0 0 auto;
        color: var(--ink-faint);
        font-size: 0.78rem;
    }

    .home-page .mobile-filter-chips {
        display: flex;
        flex-wrap: nowrap;
        gap: 8px;
        margin: 0 -2px;
        padding: 1px 2px 5px;
        overflow-x: auto;
        overscroll-behavior-inline: contain;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .home-page .mobile-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .home-page .mobile-filter-chip {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        gap: 7px;
        min-height: 36px;
        padding: 0 13px;
        border: 1px solid var(--line-strong);
        border-radius: 999px;
        background: var(--chip-surface);
        color: var(--ink-soft);
        font-size: 0.82rem;
        line-height: 1;
        white-space: nowrap;
        transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
    }

    .home-page .mobile-filter-chip:hover {
        border-color: var(--accent);
        color: var(--accent-strong);
    }

    .home-page .mobile-filter-chip.is-active {
        border-color: var(--accent);
        background: var(--accent);
        color: var(--button-ink);
    }

    .home-page .mobile-filter-chip-count {
        color: var(--ink-faint);
        font-size: 0.72rem;
    }

    .home-page .mobile-filter-chip.is-active .mobile-filter-chip-count {
        color: inherit;
        opacity: 0.82;
    }

    .home-page .home-body {
        display: block;
    }

    .home-page .archive-sidebar {
        display: none;
    }

    .home-page .entry-stream {
        padding: 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .home-page .feature-article {
        --mobile-feature-bg: var(--surface-strong);
        --mobile-feature-line: var(--line-strong);
        --mobile-feature-ink: var(--ink);
        --mobile-feature-muted: var(--ink-soft);
        --mobile-feature-accent: var(--accent-strong);
        gap: 13px;
        margin: 0 0 22px;
        padding: 24px 20px 21px;
        border: 1px solid var(--mobile-feature-line);
        border-top: 3px solid var(--accent);
        border-radius: 8px;
        background: var(--mobile-feature-bg);
        color: var(--mobile-feature-ink);
        box-shadow: 0 8px 20px rgba(62, 40, 29, 0.08);
    }

    html[data-theme="dark"] .home-page .feature-article {
        background: var(--mobile-feature-bg);
        color: var(--mobile-feature-ink);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .home-page .feature-article .stream-heading-compact {
        gap: 0;
        padding: 0;
    }

    .home-page .feature-article .stream-heading-compact h2 {
        display: none;
    }

    .home-page .feature-article .section-label {
        color: var(--mobile-feature-accent);
        font-size: 0.72rem;
    }

    .home-page .feature-article .feature-cover {
        aspect-ratio: 16 / 9;
        border-radius: 6px;
        background: rgba(0, 0, 0, 0.16);
        box-shadow: none;
    }

    .home-page .feature-article .feature-cover img,
    .home-page .entry-line .entry-cover img {
        object-fit: contain;
    }

    .home-page .feature-title {
        font-size: 2rem;
        line-height: 1.14;
    }

    .home-page .feature-title a {
        color: var(--mobile-feature-ink);
    }

    .home-page .feature-meta {
        color: var(--mobile-feature-muted);
        font-size: 0.78rem;
    }

    .home-page .feature-preview {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        max-height: 7.2em;
        color: var(--mobile-feature-muted);
        font-size: 0.94rem;
        line-height: 1.8;
    }

    .home-page .feature-preview h1,
    .home-page .feature-preview h2,
    .home-page .feature-preview h3,
    .home-page .feature-preview h4 {
        color: var(--mobile-feature-ink);
    }

    .home-page .feature-preview p,
    .home-page .feature-preview li,
    .home-page .feature-preview blockquote {
        line-height: 1.8;
    }

    .home-page .feature-preview p {
        margin-bottom: 0.35rem;
    }

    .home-page .feature-preview > :last-child {
        margin-bottom: 0;
    }

    .home-page .feature-preview img,
    .home-page .entry-line-preview img {
        display: none;
    }

    .home-page .feature-article .entry-link {
        color: var(--mobile-feature-accent);
        font-size: 0.84rem;
    }

    .home-page .feature-article .entry-link::after,
    .home-page .entry-line .entry-link::after {
        content: " →";
    }

    .home-page .entry-stream > .stream-heading {
        position: relative;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 2px 10px;
        border-bottom: 0;
    }

    .home-page .stream-heading-copy {
        display: grid;
        gap: 0;
        min-width: 0;
    }

    .home-page .entry-stream > .stream-heading .section-label {
        display: none;
    }

    .home-page .entry-stream > .stream-heading h2 {
        font-size: 1.55rem;
        line-height: 1.2;
    }

    .home-page .mobile-archive-details {
        position: relative;
        display: block;
        flex: 0 0 auto;
    }

    .home-page .mobile-archive-details summary {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 36px;
        padding: 0 12px;
        border: 1px solid var(--line-strong);
        border-radius: 6px;
        background: var(--chip-surface);
        color: var(--ink-soft);
        cursor: pointer;
        font-size: 0.8rem;
        list-style: none;
        white-space: nowrap;
    }

    .home-page .mobile-archive-details summary::-webkit-details-marker {
        display: none;
    }

    .home-page .mobile-archive-details summary::after {
        content: "⌄";
        color: var(--accent);
        font-size: 0.9rem;
        line-height: 1;
    }

    .home-page .mobile-archive-details[open] summary::after {
        content: "⌃";
    }

    .home-page .mobile-archive-panel {
        position: absolute;
        top: calc(100% + 8px);
        right: 0;
        z-index: 20;
        width: min(310px, calc(100vw - 40px));
        max-height: min(60vh, 450px);
        overflow-y: auto;
        padding: 14px;
        border: 1px solid var(--line-strong);
        border-radius: 8px;
        background: var(--surface-strong);
        box-shadow: var(--shadow);
    }

    .home-page .mobile-archive-group + .mobile-archive-group {
        margin-top: 14px;
        padding-top: 14px;
        border-top: 1px solid var(--line);
    }

    .home-page .mobile-archive-group-heading {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 8px;
    }

    .home-page .mobile-archive-group-heading h3 {
        margin: 0;
        font-family: var(--font-display);
        font-size: 1.05rem;
    }

    .home-page .mobile-archive-group-heading span {
        color: var(--ink-faint);
        font-size: 0.76rem;
    }

    .home-page .mobile-archive-list {
        display: grid;
        gap: 0;
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .home-page .mobile-archive-link {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 9px 0;
        border-top: 1px solid var(--line);
        color: var(--ink-soft);
        font-size: 0.84rem;
    }

    .home-page .mobile-archive-list li:first-child .mobile-archive-link {
        border-top: 0;
    }

    .home-page .mobile-archive-link:hover,
    .home-page .mobile-archive-link.is-active {
        color: var(--accent-strong);
    }

    .home-page .mobile-archive-link em {
        flex: 0 0 auto;
        color: var(--ink-faint);
        font-size: 0.76rem;
        font-style: normal;
    }

    .home-page .entry-line,
    .home-page .entry-line.has-cover {
        grid-template-columns: 1fr;
        gap: 11px;
        padding: 17px 2px 20px;
        border-bottom: 1px solid var(--line);
    }

    .home-page .entry-line:hover {
        transform: none;
    }

    .home-page .entry-line-meta {
        gap: 6px 10px;
        color: var(--ink-faint);
        font-size: 0.76rem;
    }

    .home-page .entry-line-main {
        gap: 8px;
    }

    .home-page .entry-line-title {
        font-size: 1.45rem;
        line-height: 1.2;
    }

    .home-page .entry-line-preview {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        max-height: 5.4em;
        font-size: 0.9rem;
        line-height: 1.8;
    }

    .home-page .entry-line-preview p,
    .home-page .entry-line-preview li,
    .home-page .entry-line-preview blockquote {
        line-height: 1.8;
    }

    .home-page .entry-line-preview p {
        margin-bottom: 0.3rem;
    }

    .home-page .entry-line-preview > :last-child {
        margin-bottom: 0;
    }

    .home-page .entry-line .entry-link {
        justify-self: end;
        font-size: 0.82rem;
    }

    .home-page .entry-line .entry-cover {
        aspect-ratio: 16 / 9;
        border-radius: 8px;
        box-shadow: none;
    }
}

@media (max-width: 360px) {
    .edit-page .header-btn-grp,
    .writing-fields,
    .writing-actions {
        grid-template-columns: 1fr;
    }

    .home-cover-title {
        font-size: 1.55rem;
    }

    .home-cover-note p {
        font-size: 0.92rem;
    }

    .field-title,
    .writing-actions .save-status {
        grid-column: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Diary */
.diary-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.diary-page .home-cover-section-title {
    display: none;
    align-items: center;
    width: max-content;
    max-width: 100%;
    padding: 3px 8px;
    border: 1px solid var(--cover-line-soft);
    border-radius: 4px;
    color: var(--cover-ink);
    font-family: var(--font-display);
    font-size: 0.88rem;
    line-height: 1.2;
}

.diary-shell,
.diary-detail-shell {
    display: grid;
    gap: 22px;
    width: min(100%, 1080px);
    margin: 0 auto;
}

.diary-overview {
    display: flex;
    align-items: end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 24px;
    padding: 4px 0 22px;
    border-bottom: 1px solid var(--line);
}

.diary-date-display {
    display: grid;
    gap: 5px;
}

.diary-date-display h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.05;
}

.diary-detail-heading h1 {
    margin: 0;
    font-family: var(--font-display);
    font-size: 5.6rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 0.9;
}

.diary-date-display h2 time,
.diary-detail-heading h1 time {
    font: inherit;
}

.diary-date-note {
    color: var(--ink-soft);
    font-size: 0.98rem;
    line-height: 1.6;
}

.diary-month-form {
    display: grid;
    grid-template-columns: minmax(158px, 190px) 42px;
    gap: 8px;
    align-items: end;
}

.diary-month-form > label {
    grid-column: 1 / -1;
    color: var(--ink-soft);
    font-size: 0.84rem;
    font-weight: 700;
}

.diary-month-control {
    display: flex;
    align-items: center;
    min-height: 42px;
    gap: 8px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--control-surface);
    color: var(--accent-strong);
}

.diary-month-control input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
}

.diary-month-control:focus-within {
    border-color: var(--focus-border);
    box-shadow: var(--focus-ring);
}

.diary-month-submit,
.diary-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: 6px;
    background: var(--control-surface);
    color: var(--accent-strong);
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.diary-month-submit:hover,
.diary-icon-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.diary-month-submit:focus-visible,
.diary-icon-button:focus-visible,
.diary-save-button:focus-visible,
.diary-edit-today:focus-visible,
.diary-back-link:focus-visible,
.diary-detail-pagination a:focus-visible,
.diary-read-more:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.diary-week-strip {
    display: none;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.diary-week-day {
    display: grid;
    place-items: center;
    align-content: center;
    min-height: 84px;
    gap: 6px;
    padding: 10px 6px;
    border-right: 1px solid var(--line);
    color: var(--ink-soft);
    text-align: center;
}

.diary-week-day:last-child {
    border-right: 0;
}

.diary-week-day > span {
    font-size: 0.78rem;
    line-height: 1;
}

.diary-week-day strong {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1;
}

a.diary-week-day {
    transition: background-color 0.2s ease, color 0.2s ease;
}

a.diary-week-day:hover,
a.diary-week-day:focus-visible {
    outline: none;
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.diary-week-day.is-empty {
    color: var(--ink-faint);
}

.diary-week-day.is-today {
    background: var(--accent-soft);
}

.diary-week-day.is-today strong {
    color: var(--accent-strong);
}

.diary-composer {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding: 18px 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: none;
}

.diary-composer-date {
    display: none;
}

.diary-composer-date p {
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 700;
}

.diary-composer-date strong {
    font-family: var(--font-display);
    font-size: 2.1rem;
    line-height: 1.08;
}

.diary-composer-date span {
    color: var(--ink-soft);
    font-size: 0.93rem;
}

.diary-form {
    display: grid;
    min-width: 0;
    gap: 12px;
}

.diary-form-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    min-height: 42px;
}

.diary-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.diary-image-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding: 0 12px 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.diary-image-button .diary-icon {
    width: 16px;
    height: 16px;
}

.diary-image-button:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.diary-image-button:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.diary-image-name {
    max-width: 200px;
    min-width: 0;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 0.86rem;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.diary-image-name:empty {
    display: none;
}

.diary-image-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.diary-image-remove .diary-icon {
    width: 16px;
    height: 16px;
}

.diary-image-remove:hover {
    background: var(--accent-soft);
    color: var(--danger);
}

.diary-image-remove:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.diary-image-remove[hidden] {
    display: none;
}

.diary-image-preview-panel {
    overflow: hidden;
    max-height: 280px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--table-surface);
}

.diary-image-preview-panel[hidden] {
    display: none;
}

.diary-image-preview-panel img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: contain;
}

#diary-content {
    display: block;
    width: 100%;
    min-height: 200px;
    padding: 18px;
    resize: vertical;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    outline: none;
    background: var(--control-surface);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.8;
}

#diary-content::placeholder {
    color: var(--ink-faint);
}

#diary-content:focus {
    border-color: var(--focus-border);
    box-shadow: var(--focus-ring);
}

.diary-status {
    flex: 1 1 160px;
    min-width: 0;
    min-height: 1.4em;
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9rem;
    line-height: 1.4;
    text-align: right;
}

.diary-status[data-tone="warning"] {
    color: var(--warning);
}

.diary-status[data-tone="success"] {
    color: var(--success);
}

.diary-status[data-tone="error"] {
    color: var(--danger);
}

.diary-save-button,
.diary-edit-today {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid var(--accent);
    border-radius: 6px;
    background: var(--accent);
    color: var(--button-ink);
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.diary-save-button:hover,
.diary-edit-today:hover {
    border-color: var(--accent-strong);
    background: var(--accent-strong);
}

.diary-save-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.diary-readonly-note {
    margin: 0;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
    line-height: 1.65;
}

.diary-entry-list {
    display: grid;
}

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

.diary-list-heading h2 {
    margin: 6px 0 0;
    font-family: var(--font-display);
    font-size: 1.7rem;
    line-height: 1.2;
}

.diary-list-heading > span {
    color: var(--ink-faint);
    font-size: 0.92rem;
}

.diary-entry {
    position: relative;
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 22px;
    padding: 26px 0;
    border-bottom: 1px solid var(--line);
}

.diary-entry-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 12px;
}

.diary-entry-link:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

.diary-entry:has(.diary-entry-link:hover) .diary-entry-date strong {
    color: var(--accent-strong);
}

.diary-entry .diary-read-more,
.diary-entry .diary-entry-image {
    position: relative;
    z-index: 2;
}

.diary-entry.has-image {
    grid-template-columns: 160px minmax(0, 1fr) 176px;
}

.diary-entry-date {
    display: grid;
    align-content: start;
    gap: 6px;
    color: var(--ink-soft);
    font-family: var(--font-display);
    line-height: 1;
}

.diary-entry-date strong {
    color: var(--ink);
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 0.9;
}

.diary-entry-weekday {
    color: var(--ink-soft);
    font-size: 1rem;
    line-height: 1.3;
}

.diary-entry-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 4 / 3;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--table-surface);
}

.diary-entry-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.diary-entry-main {
    display: grid;
    align-content: start;
    gap: 12px;
    min-width: 0;
}

.diary-entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    color: var(--ink-soft);
    font-size: 0.88rem;
    line-height: 1.45;
}

.diary-entry-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.diary-entry-meta .diary-entry-calendar-date {
    display: none;
}

.diary-entry-meta .diary-icon {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

.diary-entry-summary {
    --diary-summary-line-step: 1.78rem;
    max-height: 28.48rem;
    max-height: calc(var(--diary-summary-line-step) * 16);
    overflow: hidden;
}

.diary-entry-summary-inner {
    color: var(--ink);
    font-size: 1rem;
    line-height: var(--diary-summary-line-step);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.diary-read-more {
    display: inline-flex;
    align-items: center;
    width: max-content;
    gap: 6px;
    color: var(--accent-strong);
    font-size: 0.92rem;
    font-weight: 700;
}

.diary-read-more:hover {
    color: var(--accent);
}

.diary-read-more .diary-icon {
    width: 16px;
    height: 16px;
}

.diary-read-more[hidden] {
    display: none;
}

.diary-empty-state {
    padding: 46px 0;
    color: var(--ink-soft);
    text-align: center;
}

.diary-detail-lead {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.diary-detail-heading {
    display: grid;
    gap: 8px;
}

.diary-detail-date-mobile {
    display: none;
}

.diary-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent-strong);
    font-weight: 700;
}

.diary-back-link .diary-icon {
    width: 16px;
    height: 16px;
}

.diary-detail-lead .diary-back-link {
    order: -1;
}

.diary-detail-entry {
    display: grid;
    gap: 28px;
    padding: clamp(22px, 4vw, 40px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.diary-detail-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 24px;
    margin: 0;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--line);
}

.diary-detail-facts > div {
    display: grid;
    gap: 5px;
}

.diary-detail-facts dt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink-soft);
    font-size: 0.86rem;
    font-weight: 700;
}

.diary-detail-facts dt .diary-icon {
    width: 15px;
    height: 15px;
    color: var(--accent);
}

.diary-detail-facts dd {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 10px;
    margin: 0;
    color: var(--ink);
    line-height: 1.65;
}

.diary-detail-facts dd span + span::before {
    content: "·";
    margin-right: 10px;
    color: var(--ink-faint);
}

.diary-detail-image {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--table-surface);
}

.diary-detail-image img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: min(70vh, 760px);
    height: auto;
    margin: 0 auto;
    object-fit: contain;
}

.diary-detail-content {
    color: var(--ink);
    font-size: 1.05rem;
    line-height: 1.9;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.diary-detail-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.diary-detail-pagination a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
}

.diary-detail-pagination .diary-detail-next {
    justify-content: flex-end;
    text-align: right;
}

.diary-detail-pagination a:hover {
    color: var(--accent-strong);
}

.diary-detail-pagination strong {
    color: var(--ink);
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: 700;
}

@media (max-width: 767px) {
    .diary-page .home-cover {
        min-height: 94px;
        padding: 12px;
    }

    .diary-page .home-cover-plum {
        display: block;
        top: 48%;
        right: auto;
        left: -30px;
        width: 158px;
        height: 76px;
        opacity: 0.42;
        transform: translateY(-50%) rotate(-7deg);
    }

    .diary-page .home-cover-main {
        grid-template-columns: minmax(0, 1fr) 62px;
        grid-template-areas: "brand controls";
        min-height: 68px;
        gap: 8px;
    }

    .diary-page .home-cover-brand {
        grid-area: brand;
        gap: 5px;
        padding: 0 0 0 60px;
        border: 0;
    }

    .diary-page .home-cover-kicker,
    .diary-page .home-cover-note {
        display: none;
    }

    .diary-page .home-cover-title {
        font-size: 1.62rem;
    }

    .diary-page .home-cover-section-title {
        display: inline-flex;
        padding: 2px 7px;
        font-size: 0.82rem;
    }

    .diary-page .home-cover-controls {
        grid-area: controls;
        gap: 4px;
    }

    .diary-page .cover-theme-toggle {
        width: 20px;
        height: 54px;
        margin-top: -8px;
    }

    .diary-page .pull-light-cord::before {
        height: 38px;
    }

    .diary-page .pull-light-cord::after {
        top: 34px;
    }

    .diary-page .admin-bookmark-trigger,
    .diary-page .bookmark-icon {
        width: 24px;
        height: 56px;
    }

    .diary-shell,
    .diary-detail-shell {
        gap: 16px;
    }

    .diary-overview {
        display: block;
        padding: 0;
        border-bottom: 0;
    }

    .diary-detail-lead {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 14px 12px;
        padding-bottom: 0;
        border-bottom: 0;
    }

    .diary-detail-lead .diary-back-link {
        grid-column: 1;
        grid-row: 1;
        min-height: 44px;
        justify-self: start;
    }

    .diary-detail-lead .diary-edit-today {
        grid-column: 2;
        grid-row: 1;
        min-height: 44px;
        padding: 8px 14px;
        border: 1px solid var(--line-strong);
        background: var(--surface);
        color: var(--accent-strong);
        box-shadow: none;
        font-size: 0.875rem;
    }

    .diary-detail-heading {
        grid-column: 1 / -1;
        grid-row: 2;
        min-width: 0;
        gap: 0;
        padding: 18px;
        border: 1px solid var(--line);
        border-left: 3px solid var(--accent);
        border-radius: 8px;
        background: var(--surface-strong);
    }

    .diary-detail-heading .section-label,
    .diary-detail-date-full {
        display: none;
    }

    .diary-detail-date-mobile {
        display: flex;
        align-items: center;
        gap: 18px;
    }

    .diary-detail-day {
        flex: 0 0 auto;
        padding-right: 18px;
        border-right: 1px solid var(--line-strong);
        color: var(--accent-strong);
        font-size: 4.5rem;
        font-variant-numeric: lining-nums tabular-nums;
        line-height: 1;
    }

    .diary-detail-date-context {
        display: grid;
        gap: 8px;
        color: var(--ink);
        font-family: var(--font-body);
        line-height: 1.4;
    }

    .diary-detail-year-month {
        font-size: 1.125rem;
        font-weight: 700;
    }

    .diary-detail-weekday {
        display: flex;
        align-items: center;
        gap: 10px;
        color: var(--ink-soft);
        font-size: 0.875rem;
        font-weight: 400;
    }

    .diary-detail-today {
        padding: 2px 7px;
        border-radius: 4px;
        background: var(--accent-soft);
        color: var(--accent-strong);
        font-size: 0.75rem;
        font-weight: 700;
    }

    .diary-date-display {
        display: none;
    }

    .diary-detail-heading h1 {
        font-size: 3.2rem;
    }

    .diary-month-form {
        grid-template-columns: minmax(0, 1fr) 42px;
        width: 100%;
    }

    .diary-month-form > label {
        display: none;
    }

    .diary-week-strip {
        display: grid;
    }

    .diary-week-day {
        min-height: 68px;
        padding: 8px 2px;
    }

    .diary-week-day > span {
        font-size: 0.7rem;
    }

    .diary-week-day strong {
        font-size: 1.2rem;
    }

    .diary-composer {
        display: block;
        padding: 10px 0 0;
        border: 0;
        border-radius: 0;
        background: transparent;
        box-shadow: none;
    }

    .diary-composer-date {
        display: flex;
        align-items: baseline;
        gap: 8px;
        margin-bottom: 10px;
        padding: 0;
        border: 0;
    }

    .diary-composer-date strong {
        font-size: 1.56rem;
    }

    .diary-form {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    #diary-content {
        --diary-line-step: 2rem;
        min-height: 14rem;
        min-height: calc(var(--diary-line-step) * 7);
        padding: 8px 14px;
        border-radius: 6px;
        background-attachment: local;
        background-image: linear-gradient(to bottom, transparent calc(var(--diary-line-step) - 1px), var(--line) 1px);
        background-position: 0 8px;
        background-repeat: repeat-y;
        background-size: 100% var(--diary-line-step);
        font-size: 16px;
        line-height: var(--diary-line-step);
    }

    .diary-form-footer {
        gap: 10px;
    }

    .diary-status {
        flex-basis: 100%;
        order: -1;
        min-height: 0;
        text-align: left;
    }

    .diary-status:empty {
        display: none;
    }

    .diary-image-name {
        max-width: 110px;
    }

    .diary-save-button {
        flex: 1 1 auto;
        margin-left: auto;
    }

    .diary-list-heading {
        padding-bottom: 14px;
    }

    .diary-entry,
    .diary-entry.has-image {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 14px 16px;
        padding: 20px 0;
    }

    .diary-entry-date {
        grid-column: 1;
        grid-row: 1;
        align-self: start;
        display: block;
        min-height: 58px;
        padding-right: 12px;
        border-right: 1px solid var(--line-strong);
        line-height: 1;
    }

    .diary-entry-date strong {
        display: block;
        color: var(--accent-strong);
        font-size: 2.625rem;
        font-variant-numeric: lining-nums tabular-nums;
        line-height: 1;
    }

    .diary-entry-weekday {
        display: none;
    }

    .diary-entry-main {
        display: contents;
    }

    .diary-entry-meta {
        grid-column: 2;
        grid-row: 1;
        align-content: start;
        gap: 6px 14px;
        font-size: 0.8125rem;
        line-height: 1.5;
    }

    .diary-entry-meta .diary-entry-calendar-date {
        display: flex;
        flex-basis: 100%;
        flex-wrap: wrap;
        color: var(--ink);
        font-size: 0.875rem;
    }

    .diary-entry-meta .diary-entry-location {
        flex-basis: 100%;
        min-width: 0;
        align-items: flex-start;
        overflow-wrap: anywhere;
    }

    .diary-entry-meta .diary-icon {
        flex: 0 0 15px;
    }

    .diary-entry-location .diary-icon {
        margin-top: 2px;
    }

    .diary-entry-summary,
    .diary-entry .diary-read-more,
    .diary-entry-image {
        grid-column: 1 / -1;
    }

    .diary-entry-image {
        max-width: 100%;
        max-height: 240px;
    }

    .diary-entry-image img {
        object-fit: contain;
    }

    .diary-entry-summary {
        max-height: 28.48rem;
    }

    .diary-detail-lead .diary-back-link {
        order: 0;
    }

    .diary-detail-entry {
        gap: 22px;
        padding: 18px;
    }

    .diary-detail-facts {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-bottom: 18px;
    }

    .diary-detail-content {
        font-size: 1rem;
        line-height: 1.85;
    }

    .diary-detail-pagination {
        gap: 10px;
    }

    .diary-detail-pagination a {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .diary-detail-pagination .diary-detail-next {
        align-items: flex-end;
    }
}
