:root {
    color-scheme: light;
    --bg: #edf3f1;
    --bg-soft: #e4ece9;
    --surface: #ffffff;
    --surface-soft: #f7faf9;
    --surface-tint: #dce9e5;
    --ink: #16231f;
    --ink-soft: #55645f;
    --ink-faint: #7d8b86;
    --line: #d3dfdb;
    --line-strong: #b8cbc4;
    --primary: #176b60;
    --primary-strong: #0f554c;
    --primary-soft: #d9ece7;
    --accent: #d45b43;
    --accent-soft: #f8e2dc;
    --gold: #a8781d;
    --danger: #b43838;
    --danger-soft: #f8dddd;
    --success: #26704c;
    --success-soft: #dceee3;
    --shadow: 0 20px 50px rgba(29, 52, 45, 0.08);
    --shadow-soft: 0 10px 28px rgba(29, 52, 45, 0.07);
    --font-sans: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, -apple-system, sans-serif;
    --font-serif: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
}

html[data-theme="dark"] {
    color-scheme: dark;
    --bg: #101916;
    --bg-soft: #16211d;
    --surface: #182520;
    --surface-soft: #1d2b26;
    --surface-tint: #213a33;
    --ink: #edf4f0;
    --ink-soft: #b3c2bc;
    --ink-faint: #86968f;
    --line: #2c3e38;
    --line-strong: #415a51;
    --primary: #65c5b5;
    --primary-strong: #8bd8cb;
    --primary-soft: #173b34;
    --accent: #f08368;
    --accent-soft: #44271f;
    --gold: #d9ad56;
    --danger: #ff8989;
    --danger-soft: #442424;
    --success: #82d0a6;
    --success-soft: #20392d;
    --shadow: 0 22px 60px rgba(0, 0, 0, 0.24);
    --shadow-soft: 0 12px 32px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

body.modal-open {
    overflow: hidden;
}

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

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

button {
    cursor: pointer;
}

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

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

a:hover {
    color: var(--primary);
}

:focus-visible {
    outline: 3px solid rgba(23, 107, 96, 0.28);
    outline-offset: 3px;
}

::selection {
    background: var(--primary);
    color: #ffffff;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 200;
    padding: 9px 13px;
    border-radius: 6px;
    background: var(--ink);
    color: var(--surface);
    transform: translateY(-160%);
}

.skip-link:focus {
    transform: translateY(0);
}

.icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.is-spinning {
    animation: spin 0.8s linear infinite;
}

.site-frame {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1;
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
}

/* Detail page guard: keep the whole article inside the centered reading shell
   so a wide image, embed or stale stylesheet can never stretch the viewport. */
body[data-page="post"] #main-content {
    width: min(1180px, calc(100% - 40px));
    max-width: 1180px;
    margin-inline: auto;
    overflow-x: clip;
}

/* The detail header must not float over article media while scrolling. */
body[data-page="post"] .site-header {
    position: relative;
    top: auto;
    z-index: 5;
}

body[data-page="post"] .article-header,
body[data-page="post"] .article-cover,
body[data-page="post"] .article-layout {
    position: relative;
    z-index: 1;
}

body[data-page="post"] .article,
body[data-page="post"] .article-cover,
body[data-page="post"] .article-layout,
body[data-page="post"] .article-main-column,
body[data-page="post"] .article-content,
body[data-page="post"] .media-section,
body[data-page="post"] .article-aside {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

body[data-page="post"] .article-content img,
body[data-page="post"] .article-content video,
body[data-page="post"] .article-content canvas,
body[data-page="post"] .article-content svg,
body[data-page="post"] .article-content iframe {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

body[data-page="post"] .article-content img {
    position: relative;
    z-index: 1;
    clear: both;
    isolation: isolate;
}

body[data-page="post"] .article-content table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    border-bottom: 1px solid transparent;
    background: rgba(237, 243, 241, 0.86);
    backdrop-filter: blur(18px);
    transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

html[data-theme="dark"] .site-header {
    background: rgba(16, 25, 22, 0.86);
}

.site-header.is-scrolled {
    border-color: var(--line);
    box-shadow: 0 8px 24px rgba(23, 43, 37, 0.06);
}

.header-inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 74px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto minmax(240px, 500px) auto;
    align-items: center;
    gap: 28px;
}

.detail-header .header-inner {
    grid-template-columns: auto 1fr auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: max-content;
    font-family: var(--font-serif);
    font-size: 21px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

.brand:hover {
    color: var(--ink);
}

.brand-name {
    display: inline-block;
    background: linear-gradient(105deg, #5b7cfa 0%, #8b6fe8 18%, #e579b0 36%, #ffc66f 52%, #62cfc0 68%, #6f8df5 84%, #b47fe8 100%);
    background-size: 260% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    animation: brand-name-flow 8s linear infinite;
}

.brand:hover .brand-name {
    animation-duration: 4.6s;
    filter: drop-shadow(0 0 11px rgba(115, 124, 245, 0.28));
}

@keyframes brand-name-flow {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 260% 50%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .brand-name {
        animation: none;
        background-position: 42% 50%;
    }
}
.brand-mark {
    position: relative;
    width: 27px;
    height: 27px;
    display: inline-block;
    border: 2px solid var(--ink);
    border-radius: 50%;
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span {
    position: absolute;
    display: block;
    content: "";
    border-radius: 50%;
}

.brand-mark::before {
    inset: 6px;
    border: 1.5px solid var(--primary);
}

.brand-mark::after {
    width: 7px;
    height: 7px;
    top: 2px;
    right: 2px;
    background: var(--accent);
}

.brand-mark span {
    width: 3px;
    height: 3px;
    left: 4px;
    bottom: 4px;
    background: var(--gold);
}

.header-search {
    position: relative;
    display: flex;
    align-items: center;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.72);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

html[data-theme="dark"] .header-search {
    background: rgba(24, 37, 32, 0.82);
}

.header-search:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(23, 107, 96, 0.1);
}

.search-icon {
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    width: 43px;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
}

.search-icon:hover,
.search-icon:focus-visible {
    outline: 0;
    color: var(--primary);
}
.header-search input {
    width: 100%;
    height: 100%;
    min-width: 0;
    padding: 0 8px 0 0;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
}

.header-search input[type="search"]::-webkit-search-cancel-button,
.header-search input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.header-search input::-ms-clear,
.header-search input::-ms-reveal {
    display: none;
    width: 0;
    height: 0;
}

.header-search input::placeholder {
    color: var(--ink-faint);
}

.search-clear {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    margin-right: 2px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-faint);
}

.search-clear:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

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

.icon-button {
    display: inline-grid;
    place-items: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
    transition: transform 160ms ease, color 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
    color: var(--primary);
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.theme-switch {
    --theme-switch-border: var(--line);
    --theme-switch-surface: var(--surface);
    --theme-switch-color: var(--ink-faint);
    --theme-switch-active-surface: var(--primary-soft);
    --theme-switch-active-color: var(--primary);
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 3px;
    border: 1px solid var(--theme-switch-border);
    border-radius: 10px;
    background: var(--theme-switch-surface);
}

body .theme-switch .js-theme-toggle {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--theme-switch-color);
    box-shadow: none;
    transform: none;
}

body .theme-switch .js-theme-toggle:hover {
    border-color: transparent;
    background: var(--theme-switch-active-surface);
    color: var(--theme-switch-active-color);
    transform: none;
}

body .theme-switch .js-theme-toggle.is-active,
body .theme-switch .js-theme-toggle[aria-pressed="true"] {
    background: var(--theme-switch-active-surface);
    color: var(--theme-switch-active-color);
}

body .theme-switch .js-theme-toggle .icon {
    width: 16px;
    height: 16px;
}

body .theme-switch .js-theme-toggle .theme-toggle-glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

body[data-page="home"] .theme-switch {
    --theme-switch-border: var(--home-line);
    --theme-switch-surface: var(--home-surface);
    --theme-switch-color: var(--home-ink-faint);
    --theme-switch-active-surface: var(--home-primary-soft);
    --theme-switch-active-color: var(--home-primary);
}

body[data-page="timeline"] .theme-switch {
    --theme-switch-border: var(--timeline-line);
    --theme-switch-surface: var(--timeline-surface);
    --theme-switch-color: var(--timeline-ink-soft);
    --theme-switch-active-surface: var(--timeline-primary-soft);
    --theme-switch-active-color: var(--timeline-primary);
}

body[data-page="guestbook"] .theme-switch {
    --theme-switch-border: var(--guestbook-line);
    --theme-switch-surface: var(--guestbook-surface);
    --theme-switch-color: var(--guestbook-ink-soft);
    --theme-switch-active-surface: var(--guestbook-primary-soft);
    --theme-switch-active-color: var(--guestbook-primary);
}

.mobile-search-toggle {
    display: none;
}

.header-account {
    min-width: 74px;
    display: flex;
    justify-content: flex-end;
}

.button {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.button-primary {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(23, 107, 96, 0.18);
}

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

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

.button-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.button-wide {
    width: 100%;
}

.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: max-content;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 700;
}

.back-link:hover {
    color: var(--primary);
}

.account-wrap {
    position: relative;
}

.account-trigger {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 4px 9px 4px 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
}

.account-avatar {
    width: 32px;
    height: 32px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.account-name {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: inherit;
    font-size: 14px;
    font-weight: 700;
}

.account-chevron {
    width: 15px;
    height: 15px;
    color: var(--ink-faint);
}

.account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: 210px;
    padding: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.account-summary {
    display: grid;
    gap: 2px;
    padding: 10px 11px;
    border-bottom: 1px solid var(--line);
}

.account-summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
}

.account-summary span {
    color: var(--ink-faint);
    font-size: 12px;
}

.account-menu-item {
    width: 100%;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 4px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-soft);
    text-align: left;
    font-size: 14px;
}

.account-menu-item:hover {
    background: var(--bg-soft);
    color: var(--danger);
}

html[data-theme="light"] body[data-page] .account-trigger {
    border-color: #c9d4e2;
    background: #ffffff;
    color: #3f4a5a;
}

html[data-theme="light"] body[data-page] .account-name {
    color: #3f4a5a;
}

html[data-theme="light"] body[data-page] .account-chevron {
    color: #4b5565;
}

html[data-theme="light"] body[data-page] .account-menu {
    border-color: #c9d4e2;
    background: #ffffff;
    color: #3f4a5a;
}

html[data-theme="light"] body[data-page] .account-summary strong {
    color: #3f4a5a;
}

html[data-theme="light"] body[data-page] .account-summary span {
    color: #667189;
}

html[data-theme="light"] body[data-page] .account-menu-item {
    color: #3f4a5a;
}

html[data-theme="light"] body[data-page] .account-menu-item:hover {
    color: var(--primary);
}

.home-intro {
    min-height: 270px;
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
    align-items: end;
    gap: 80px;
    padding: 62px 0 52px;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
    text-transform: uppercase;
}

.home-intro h1 {
    max-width: 760px;
    margin: 0;
    font-family: var(--font-serif);
    font-size: 52px;
    font-weight: 700;
    line-height: 1.14;
    letter-spacing: 0;
}

.intro-note {
    max-width: 410px;
    margin: 0 0 5px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.9;
}

.discovery {
    min-height: 62px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 10px 0 18px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.category-row {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.category-row::-webkit-scrollbar {
    display: none;
}

.category-chip {
    min-height: 36px;
    flex: 0 0 auto;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.category-chip:hover {
    color: var(--primary);
    background: var(--primary-soft);
}

.category-chip.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.result-count {
    flex: 0 0 auto;
    color: var(--ink-faint);
    font-size: 13px;
    white-space: nowrap;
}

.featured-region {
    padding: 40px 0 16px;
}

.featured-post {
    animation: rise-in 560ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
}

.featured-link {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.65fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.featured-link:hover {
    color: var(--ink);
}

.featured-media {
    position: relative;
    isolation: isolate;
    min-height: 380px;
    overflow: hidden;
    background: var(--surface-tint);
}

.post-card-media.has-media-backdrop::before,
.featured-media.has-media-backdrop::before,
.gallery-image.has-media-backdrop::before {
    position: absolute;
    inset: -18%;
    z-index: 0;
    content: "";
    background-image: var(--media-backdrop-image);
    background-position: center;
    background-size: cover;
    filter: blur(24px) saturate(1.12) brightness(0.68);
    opacity: 0.82;
    pointer-events: none;
    transform: scale(1.08);
}

.post-card-media img,
.featured-media img,
.gallery-image img {
    position: relative;
    z-index: 1;
}

.featured-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.featured-link:hover .featured-media img {
    transform: scale(1.035);
}

.featured-copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 42px 38px;
}

.featured-copy h2 {
    margin: 0 0 18px;
    font-family: var(--font-serif);
    font-size: 31px;
    line-height: 1.3;
    letter-spacing: 0;
}

.featured-excerpt {
    display: -webkit-box;
    margin: 0 0 30px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.85;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
}

.featured-meta,
.post-card-footer,
.article-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--ink-faint);
    font-size: 13px;
}

.featured-meta > span,
.post-card-footer > span,
.article-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.featured-meta .icon,
.post-card-footer .icon,
.article-meta .icon {
    width: 15px;
    height: 15px;
}

.featured-more {
    margin-left: auto;
    color: var(--primary);
    font-weight: 800;
}

.media-badges {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-badge {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 999px;
    background: rgba(14, 27, 23, 0.72);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.media-badge .icon {
    width: 13px;
    height: 13px;
}

.media-badge-video {
    background: rgba(190, 71, 48, 0.82);
}

.feed-section {
    padding: 38px 0 78px;
}

.section-heading {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.section-heading h2 {
    flex: 0 0 auto;
    margin: 0;
    font-family: var(--font-serif);
    font-size: 23px;
    line-height: 1.2;
    letter-spacing: 0;
}

.section-line {
    width: 100%;
    height: 1px;
    background: var(--line);
}

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

.post-card {
    position: relative;
    min-width: 0;
    animation: rise-in 520ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
}

.post-card-like {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 999px;
    background: rgba(18, 28, 44, 0.62);
    color: #ffffff;
    font-size: 12px;
    font-weight: 850;
    font-variant-numeric: tabular-nums;
    line-height: 1;
    box-shadow: 0 8px 22px rgba(15, 25, 43, 0.18);
    backdrop-filter: blur(12px);
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.post-card-like .icon {
    width: 15px;
    height: 15px;
}

.post-card-like:hover,
.post-card-like:focus-visible {
    outline: 0;
    border-color: rgba(255, 255, 255, 0.68);
    background: rgba(25, 39, 63, 0.8);
    box-shadow: 0 10px 26px rgba(15, 25, 43, 0.24);
    transform: translateY(-2px);
}

.post-card-like.is-liked {
    border-color: rgba(255, 255, 255, 0.72);
    background: linear-gradient(120deg, #f46f9d, #ed7dff 55%, #8f7dff);
    box-shadow: 0 10px 26px rgba(225, 91, 160, 0.28);
}

.post-card-like.is-liked .icon {
    fill: currentColor;
}

.post-card-like:disabled {
    cursor: wait;
    opacity: 0.68;
}
.post-card-link {
    display: block;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 1px 0 rgba(22, 35, 31, 0.02);
    transition: transform 220ms ease, box-shadow 220ms ease, border-color 220ms ease;
}

.post-card-link:hover {
    color: var(--ink);
    transform: translateY(-5px);
    border-color: var(--line-strong);
    box-shadow: var(--shadow);
}

.post-card-media {
    position: relative;
    isolation: isolate;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--surface-tint);
}

.post-card-media.has-media-ratio {
    aspect-ratio: var(--media-display-ratio);
}

.post-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 520ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

/* Wide covers and video posters crop to fill instead of leaving blurred bars. */
.post-card-media img.has-cover-crop {
    object-fit: cover;
}

.cover-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    overflow: hidden;
    padding: 24px;
    background:
        linear-gradient(135deg, rgba(115, 143, 210, 0.18), transparent 38%),
        linear-gradient(315deg, rgba(79, 184, 164, 0.15), transparent 42%),
        linear-gradient(145deg, #182238 0%, #111a2b 56%, #0d1524 100%);
    color: #eef3ff;
    text-align: center;
    isolation: isolate;
}

.cover-placeholder::before {
    position: absolute;
    inset: 13px;
    content: '';
    border: 1px solid rgba(182, 201, 244, 0.15);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.045), transparent 48%);
    clip-path: polygon(0 0, 80% 0, 100% 22%, 100% 100%, 0 100%);
    pointer-events: none;
}

.cover-placeholder::after {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 42px;
    height: 1px;
    content: '';
    background: linear-gradient(90deg, transparent, rgba(149, 177, 255, 0.72));
    pointer-events: none;
}

.cover-placeholder-mark {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(167, 188, 238, 0.24);
    border-radius: 8px;
    background: rgba(123, 151, 224, 0.12);
    color: #b9c9ff;
}

.cover-placeholder-mark .icon {
    width: 20px;
    height: 20px;
}

.cover-placeholder-mark .placeholder-svg {
    width: 22px;
    height: 22px;
}

.cover-placeholder strong {
    position: relative;
    z-index: 1;
    color: #f5f7ff;
    font-size: 17px;
    letter-spacing: 0;
}

.cover-placeholder-copy {
    position: relative;
    z-index: 1;
    color: rgba(223, 230, 249, 0.66);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.post-card-link:hover .cover-placeholder {
    transform: scale(1.025);
}

.post-card-link:hover .post-card-media img {
    transform: none;
}

.post-card-body {
    min-height: 225px;
    display: flex;
    flex-direction: column;
    padding: 20px 20px 18px;
}

.post-card-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--ink-faint);
    font-size: 12px;
}

.post-time {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.post-time-relative {
    color: var(--primary);
    font-weight: 800;
}

.post-time-full::before {
    margin-right: 6px;
    color: var(--line-strong);
    content: "·";
}

.post-category {
    color: var(--primary);
    font-weight: 800;
}

.post-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--line-strong);
}

.post-card-title {
    display: -webkit-box;
    margin: 0 0 10px;
    overflow: hidden;
    font-family: var(--font-serif);
    font-size: 20px;
    line-height: 1.45;
    letter-spacing: 0;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.post-card-excerpt {
    display: -webkit-box;
    flex: 1;
    margin: 0 0 18px;
    overflow: hidden;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.post-card-footer {
    justify-content: space-between;
    gap: 10px;
}

.post-stat-group {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.post-stat {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--ink-faint);
    font-variant-numeric: tabular-nums;
}

.post-card-link:hover .post-stat {
    color: var(--primary);
}

.post-stat .icon {
    width: 14px;
    height: 14px;
}

.post-card-footer .author-line {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compact-grid .post-card-body {
    min-height: 195px;
}

.compact-grid .post-card-title {
    font-size: 18px;
}

.skeleton-card {
    pointer-events: none;
}

.skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bg-soft);
}

.skeleton::after {
    position: absolute;
    inset: 0;
    content: "";
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.5) 50%, transparent 80%);
    transform: translateX(-100%);
    animation: shimmer 1.4s infinite;
}

html[data-theme="dark"] .skeleton::after {
    background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.06) 50%, transparent 80%);
}

.skeleton-card {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.skeleton-card-media {
    aspect-ratio: 4 / 3;
    border-radius: 0;
}

.skeleton-card-body {
    display: grid;
    gap: 12px;
    padding: 20px;
}

.skeleton-kicker {
    width: 28%;
    height: 11px;
}

.skeleton-title {
    width: 82%;
    height: 22px;
}

.skeleton-title.short {
    width: 58%;
}

.skeleton-line {
    width: 100%;
    height: 13px;
}

.skeleton-line.short {
    width: 64%;
}

.skeleton-meta {
    width: 48%;
    height: 13px;
    margin-bottom: 24px;
}

.skeleton-cover {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin-bottom: 34px;
}

.empty-state {
    max-width: 540px;
    margin: 42px auto 0;
    text-align: center;
}

.empty-visual {
    position: relative;
    width: min(100%, 390px);
    aspect-ratio: 16 / 9;
    margin: 0 auto 26px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.empty-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.86;
}

.empty-icon {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
}

.empty-icon .icon {
    width: 34px;
    height: 34px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.28));
}

.empty-state h3 {
    margin: 0 0 6px;
    font-family: var(--font-serif);
    font-size: 23px;
}

.empty-state p {
    margin: 0 0 20px;
    color: var(--ink-soft);
}

.feed-error {
    grid-column: 1 / -1;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 46px 20px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--ink-soft);
    text-align: center;
}

.feed-error > .icon {
    width: 28px;
    height: 28px;
    color: var(--danger);
}

.feed-error strong {
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 20px;
}

.feed-error p {
    margin: 0 0 10px;
}

.load-more-wrap {
    display: flex;
    justify-content: center;
    padding-top: 34px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: var(--bg-soft);
}

.footer-inner {
    width: min(1180px, calc(100% - 40px));
    min-height: 100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.footer-inner > div {
    display: grid;
    gap: 2px;
}

.footer-inner strong {
    font-family: var(--font-serif);
    font-size: 17px;
}

.footer-inner span,
.footer-link {
    color: var(--ink-faint);
    font-size: 13px;
}

.footer-link:hover {
    color: var(--primary);
}

.footer-top {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink-soft);
}

.footer-top:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.auth-modal,
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
}

.modal-backdrop,
.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 18, 15, 0.56);
    backdrop-filter: blur(7px);
    animation: fade-in 180ms ease both;
}

.modal-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    width: min(520px, calc(100% - 28px));
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 32px 90px rgba(0, 0, 0, 0.24);
    transform: translate(-50%, -50%);
    animation: modal-in 260ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-faint);
}

.modal-close:hover {
    background: var(--bg-soft);
    color: var(--ink);
}

.modal-heading {
    padding-right: 42px;
}

.modal-heading h2 {
    margin: 0 0 8px;
    font-family: var(--font-serif);
    font-size: 29px;
    line-height: 1.25;
    letter-spacing: 0;
}

.modal-heading p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 14px;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 25px 0 22px;
    padding: 4px;
    border-radius: 8px;
    background: var(--bg-soft);
}

.auth-tab {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--ink-soft);
    font-size: 14px;
    font-weight: 800;
}

.auth-tab.is-active {
    background: var(--surface);
    color: var(--primary);
    box-shadow: 0 3px 12px rgba(29, 52, 45, 0.08);
}

.auth-form {
    display: grid;
    gap: 16px;
}

.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field {
    display: grid;
    gap: 7px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.field-control {
    height: 46px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink-faint);
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.field-control:focus-within {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(23, 107, 96, 0.1);
}

.field-control input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
}

.field-control input::placeholder {
    color: var(--ink-faint);
}

.field-control input[type="password"]::-ms-reveal,
.field-control input[type="password"]::-ms-clear {
    display: none;
    width: 0;
    height: 0;
}

.password-toggle {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-right: -7px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--ink-faint);
    cursor: pointer;
    transition: color 160ms ease, background 160ms ease, transform 160ms ease;
}

.password-toggle:hover {
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.password-toggle:active {
    transform: scale(0.94);
}

.password-toggle:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.password-toggle .icon {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.captcha-field {
    display: grid;
    gap: 7px;
}

.captcha-label {
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 700;
}

.captcha-control {
    min-height: 46px;
    display: grid;
    grid-template-columns: minmax(100px, 1fr) 86px auto;
    align-items: center;
    gap: 9px;
    padding: 6px 7px 6px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.captcha-question {
    color: var(--ink);
    font-size: 15px;
    font-weight: 850;
    letter-spacing: 0;
}

.captcha-control input {
    width: 100%;
    height: 34px;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    background: var(--surface);
    color: var(--ink);
    font: inherit;
    font-size: 14px;
    text-align: center;
}

.captcha-control input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(23, 107, 96, 0.1);
}

.captcha-refresh {
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 750;
}

.captcha-refresh:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.captcha-refresh:disabled {
    cursor: wait;
    opacity: 0.56;
}

.captcha-refresh .icon {
    width: 14px;
    height: 14px;
}

.form-status {
    min-height: 20px;
    margin: -3px 0 0;
    color: var(--ink-faint);
    font-size: 13px;
    line-height: 1.5;
}

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

.form-status.is-success {
    color: var(--success);
}

.toast-region {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 180;
    display: grid;
    gap: 10px;
    pointer-events: none;
}

.toast {
    min-width: 230px;
    max-width: min(390px, calc(100vw - 44px));
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: var(--shadow);
    font-size: 14px;
    animation: toast-in 240ms ease both;
}

.toast-success .icon {
    color: var(--success);
}

.toast-error .icon {
    color: var(--danger);
}

.toast.is-leaving {
    animation: toast-out 220ms ease both;
}

.detail-main {
    padding-top: 42px;
    padding-bottom: 88px;
}

.detail-loading {
    padding-top: 12px;
}

.article {
    animation: rise-in 520ms cubic-bezier(0.22, 0.72, 0.18, 1) both;
}

.article-header {
    max-width: 1180px;
    margin: 0 auto 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.article-category {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-bottom: 16px;
    padding: 0 11px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}

.article-category:hover {
    background: var(--primary);
    color: #ffffff;
}

.article-header h1 {
    max-width: 980px;
    margin: 0 0 16px;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-family: var(--font-sans);
    font-size: clamp(30px, 3.25vw, 42px);
    font-weight: 800;
    line-height: 1.22;
    letter-spacing: 0;
    text-wrap: pretty;
}

.article-excerpt {
    max-width: 780px;
    margin: 0 0 20px;
    color: var(--ink-soft);
    font-size: 15px;
    line-height: 1.85;
}

.article-meta {
    justify-content: flex-start;
    gap: 8px;
}

.article-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.article-actions {
    display: inline-flex;
    margin-left: auto;
}

.article-cover {
    position: relative;
    width: 100%;
    max-width: 1180px;
    margin: 0 auto;
    height: auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-tint);
    box-shadow: var(--shadow-soft);
}

body[data-page="post"] .article-cover {
    width: fit-content;
    max-width: min(100%, 1180px);
}

.article-cover img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: clamp(360px, 62vh, 720px);
    object-fit: contain;
    object-position: center;
    transition: transform 600ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.article-cover:hover img {
    transform: none;
}

.article-cover:hover,
.article-cover:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), var(--shadow-soft);
}

.article-cover:focus-visible {
    outline: none;
}

.article-cover.is-placeholder {
    min-height: 0;
    cursor: default;
}

.article-cover.is-placeholder .cover-placeholder {
    padding: 34px;
}

.cover-action {
    position: absolute;
    right: 14px;
    bottom: 14px;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 7px;
    background: rgba(13, 26, 22, 0.76);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    backdrop-filter: blur(10px);
}

.article-layout {
    display: grid;
    width: 100%;
    min-width: 0;
    grid-template-columns: minmax(0, 760px) 210px;
    justify-content: center;
    align-items: start;
    gap: 56px;
    padding-top: 46px;
}

.article-main-column {
    width: 100%;
    max-width: 760px;
    min-width: 0;
}

.article-content {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    color: var(--ink);
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 2;
    overflow-wrap: anywhere;
}

.article-content > *,
.article-content figure,
.article-content figcaption {
    max-width: 100%;
    min-width: 0;
}

.article-content p {
    margin: 0 0 1.45em;
    white-space: pre-wrap;
}


.article-content img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 1.2em auto;
    border-radius: 8px;
    object-fit: contain;
}

.article-content video,
.article-content canvas,
.article-content svg {
    max-width: 100%;
    height: auto;
}

.article-content pre {
    max-width: 100%;
    overflow-x: auto;
}

.article-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

.article-content-image {
    display: block;
    cursor: zoom-in;
}

.article-content-image:focus-visible {
    outline: 3px solid rgba(23, 107, 96, 0.32);
    outline-offset: 4px;
}

.article-aside {
    position: sticky;
    top: 104px;
    display: grid;
    gap: 10px;
}

.aside-block {
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.aside-label {
    color: var(--ink-faint);
    font-size: 12px;
}

.aside-block strong {
    font-size: 14px;
}

.article-like {
    display: grid;
    gap: 8px;
}

.like-button {
    width: 100%;
    justify-content: center;
    border-color: rgba(204, 71, 96, 0.24);
    background: rgba(204, 71, 96, 0.08);
    color: #b83b58;
}

.like-button:hover,
.like-button.is-liked {
    border-color: rgba(204, 71, 96, 0.38);
    background: #cc4760;
    color: #ffffff;
}

.like-button strong {
    font-variant-numeric: tabular-nums;
}

.article-like-summary {
    color: var(--ink-faint);
    font-size: 12px;
    text-align: center;
}

.share-button {
    width: 100%;
}

.media-section {
    margin-top: 54px;
}

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

.gallery-item {
    position: relative;
    isolation: isolate;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-tint);
}

.gallery-image {
    display: block;
    padding: 0;
    cursor: zoom-in;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.gallery-image:hover,
.gallery-image:focus-visible {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft), 0 14px 30px rgba(9, 34, 29, 0.14);
}

.gallery-image:focus-visible {
    outline: none;
}

.gallery-image img {
    width: 100%;
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
    transition: transform 520ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.gallery-image:hover img {
    transform: none;
}

.gallery-image.is-wide {
    grid-column: 1 / -1;
}

.gallery-image.is-wide img {
    width: auto;
    max-width: 100%;
    max-height: 720px;
    margin: 0 auto;
    aspect-ratio: auto;
}

.gallery-overlay {
    z-index: 2;
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #ffffff;
    background: rgba(9, 20, 16, 0);
    opacity: 0;
    transition: opacity 180ms ease, background 180ms ease;
    pointer-events: none;
}

.gallery-image:hover .gallery-overlay,
.gallery-image:focus-visible .gallery-overlay {
    background: transparent;
    opacity: 1;
}

.gallery-overlay .icon {
    width: 27px;
    height: 27px;
    box-sizing: content-box;
    padding: 11px;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(8, 29, 25, 0.64);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
}


.gallery-video-wrap {
    grid-column: 1 / -1;
    padding: 8px;
    position: relative;
}

.gallery-video-placeholder {
    z-index: 1;
}

.gallery-video {
    width: 100%;
    max-height: 600px;
    border-radius: 6px;
    background: #050807;
}

.video-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 10px 6px 3px;
    color: var(--ink-faint);
    font-size: 12px;
}

.comments-section {
    width: min(760px, 100%);
    margin: 68px auto 0;
    padding-top: 34px;
    border-top: 1px solid var(--line);
}

.comments-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 22px;
}

.comments-heading .eyebrow {
    margin-bottom: 7px;
}

.comments-heading h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 25px;
    line-height: 1.25;
}

.comments-heading h2 span {
    color: var(--ink-faint);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
}

.comments-heading-icon {
    width: 42px;
    height: 42px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    background: var(--primary-soft);
    color: var(--primary);
}

.comments-heading-icon .icon {
    width: 20px;
    height: 20px;
}

.comment-login-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
}

.comment-login-prompt strong {
    display: block;
    font-size: 15px;
}

.comment-login-prompt p {
    margin: 4px 0 0;
    color: var(--ink-soft);
    font-size: 13px;
}

.comment-form {
    margin-bottom: 28px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
}

.emoji-picker {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.emoji-trigger {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-soft);
    color: var(--ink-soft);
}

.emoji-trigger:hover,
.emoji-trigger[aria-expanded="true"] {
    border-color: var(--primary);
    color: var(--primary);
}

.emoji-panel {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 0;
    z-index: 30;
    width: min(348px, calc(100vw - 48px));
    overflow: hidden;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background:
        radial-gradient(circle at 12% -8%, rgba(91, 124, 250, 0.16), transparent 42%),
        linear-gradient(145deg, var(--surface), var(--surface-soft));
    box-shadow: 0 24px 60px rgba(12, 28, 23, 0.2);
}

.emoji-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 0 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--line);
    scrollbar-width: thin;
}

.emoji-tab {
    flex: 0 0 auto;
    min-height: 28px;
    padding: 0 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--surface-soft);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.emoji-tab:hover,
.emoji-tab:focus-visible {
    outline: 0;
    border-color: rgba(91, 124, 250, 0.32);
    color: var(--primary);
    transform: translateY(-1px);
}

.emoji-tab.is-active {
    border-color: transparent;
    background: linear-gradient(120deg, rgba(91, 124, 250, 0.18), rgba(221, 123, 167, 0.18));
    color: var(--primary);
    box-shadow: 0 5px 14px rgba(91, 124, 250, 0.12);
}

.emoji-grid {
    max-height: 238px;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.emoji-option {
    width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    font-size: 23px;
    line-height: 1;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.emoji-option:hover,
.emoji-option:focus-visible {
    outline: 0;
    background: linear-gradient(145deg, rgba(91, 124, 250, 0.15), rgba(221, 123, 167, 0.14));
    box-shadow: 0 7px 16px rgba(91, 124, 250, 0.14);
    transform: translateY(-2px) scale(1.06);
}
.comment-field {
    display: block;
}

.comment-field-label {
    display: block;
    margin-bottom: 9px;
    color: var(--ink-soft);
    font-size: 13px;
    font-weight: 800;
}

.comment-field textarea {
    width: 100%;
    min-height: 116px;
    resize: vertical;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: 0;
    background: var(--surface-soft);
    color: var(--ink);
    font-size: 14px;
    line-height: 1.75;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.comment-field textarea:focus {
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 4px rgba(23, 107, 96, 0.1);
}

.comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 12px;
}

.comment-status {
    margin-right: auto;
    color: var(--danger);
    font-size: 12px;
}

.comment-status.is-success {
    color: var(--success);
}

.comment-page-ellipsis {
    min-width: 20px;
    color: var(--ink-faint);
    text-align: center;
}

.comment-counter {
    color: var(--ink-faint);
    font-size: 12px;
}

.comment-loading {
    display: grid;
    gap: 9px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

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

.comment-item {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.comment-item-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.comment-avatar {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
    font-weight: 850;
}

.comment-author {
    min-width: 0;
}

.comment-author strong {
    display: inline-block;
    margin-right: 7px;
    font-size: 14px;
}

.comment-badge {
    display: inline-flex;
    align-items: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 10px;
    font-weight: 800;
}

.comment-author time {
    display: block;
    margin-top: 2px;
    color: var(--ink-faint);
    font-size: 11px;
}

.comment-delete {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
    margin-left: auto;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-faint);
}

.comment-delete:hover {
    border-color: var(--danger);
    background: var(--danger-soft);
    color: var(--danger);
}

.comment-delete .icon {
    width: 15px;
    height: 15px;
}

.comment-body {
    margin: 13px 0 0 50px;
    color: var(--ink-soft);
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.comment-list {
    max-height: min(620px, 68vh);
    padding: 4px 10px 12px 2px;
    overflow-y: auto;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.comment-list::-webkit-scrollbar {
    width: 8px;
}

.comment-list::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: var(--line-strong);
}

.comment-item {
    position: relative;
    margin-left: 14px;
    overflow: visible;
    border: 0;
    border-radius: 8px 8px 8px 2px;
    background: linear-gradient(145deg, var(--surface), var(--surface-soft));
    box-shadow: 0 12px 28px rgba(12, 28, 23, 0.09);
    animation: comment-rise 420ms cubic-bezier(0.2, 0.75, 0.25, 1) var(--comment-delay, 0ms) both;
}

.comment-item::after {
    content: '';
    position: absolute;
    left: 14px;
    bottom: -7px;
    width: 14px;
    height: 14px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    transform: rotate(45deg);
}

@keyframes comment-rise {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.initial-cover {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    isolation: isolate;
    color: #f7f9ff;
    background: linear-gradient(145deg, #314b82 0%, #16243d 100%);
}

.initial-cover::before {
    position: absolute;
    inset: 0;
    content: "";
    background:
        linear-gradient(115deg, rgba(255, 255, 255, 0.16), transparent 42%),
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.045) 0 1px, transparent 1px 18px);
    pointer-events: none;
}

.initial-cover::after {
    position: absolute;
    inset: 12px;
    content: "";
    border: 1px solid rgba(255, 255, 255, 0.16);
    clip-path: polygon(0 0, 78% 0, 100% 20%, 100% 100%, 0 100%);
    pointer-events: none;
}

.initial-cover-content {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 8px;
    padding: 22px;
    text-align: center;
}

.initial-cover-initial {
    font-family: var(--font-serif);
    font-size: clamp(54px, 7vw, 86px);
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.initial-cover-category {
    color: rgba(255, 255, 255, 0.78);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.activation-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 18px;
    background: var(--page-bg, #eef3f8);
}

.activation-card {
    width: min(100%, 520px);
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.activation-brand {
    margin-bottom: 28px;
}

.activation-card h1 {
    margin: 8px 0 14px;
    color: var(--ink);
    font-size: 30px;
}

.activation-copy {
    margin: 0 0 16px;
    color: var(--ink-soft);
    line-height: 1.8;
}

.activation-card .button {
    margin-top: 8px;
}

.activation-back {
    display: inline-block;
    margin-top: 20px;
    color: var(--ink-faint);
    font-size: 13px;
}

@media (prefers-reduced-motion: reduce) {
    .comment-item {
        animation: none;
    }
}

.comment-state {
    padding: 24px;
    border: 1px dashed var(--line-strong);
    border-radius: 8px;
    color: var(--ink-faint);
    font-size: 13px;
    text-align: center;
}

.comment-error {
    display: grid;
    justify-items: center;
    gap: 12px;
    color: var(--danger);
}

.comment-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 22px;
}

.comment-page-button {
    min-width: 34px;
    height: 34px;
    display: inline-grid;
    place-items: center;
    padding: 0 9px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: var(--surface);
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 800;
}

.comment-page-button:hover:not(:disabled) {
    border-color: var(--primary);
    color: var(--primary);
}

.comment-page-button.is-current {
    border-color: var(--primary);
    background: var(--primary);
    color: #ffffff;
}

.comment-page-button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.comment-page-button .icon {
    width: 14px;
    height: 14px;
}

@media (max-width: 680px) {
    .comments-section {
        margin-top: 52px;
    }

    .comment-login-prompt {
        align-items: flex-start;
        flex-direction: column;
    }

    .comment-form,
    .comment-item {
        padding: 16px;
    }

    .comment-form-footer {
        align-items: flex-end;
        flex-wrap: wrap;
    }

    .comment-body {
        margin-left: 0;
    }

    .comment-item {
        margin-left: 0;
        border-radius: 8px;
    }

    .comment-item::after {
        display: none;
    }

    .comment-list {
        max-height: 58vh;
        padding-right: 6px;
    }
}

.state-panel {
    max-width: 660px;
    margin: 36px auto 0;
    padding: 62px 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.state-icon {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: 0 auto 18px;
    border-radius: 50%;
    background: var(--primary-soft);
    color: var(--primary);
}

.state-icon .icon {
    width: 27px;
    height: 27px;
}

.state-panel h1 {
    margin: 0 0 12px;
    font-family: var(--font-serif);
    font-size: 32px;
    line-height: 1.3;
    letter-spacing: 0;
}

.state-panel > p:not(.eyebrow) {
    max-width: 480px;
    margin: 0 auto 24px;
    color: var(--ink-soft);
}

.restricted-panel .state-icon {
    background: var(--accent-soft);
    color: var(--accent);
}

.error-panel .state-icon {
    background: var(--danger-soft);
    color: var(--danger);
}

.state-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.related-section {
    margin-top: 84px;
    padding-top: 44px;
    border-top: 1px solid var(--line);
}

.lightbox-panel {
    position: absolute;
    inset: 34px;
    z-index: 1;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
    object-fit: contain;
    box-shadow: 0 28px 80px rgba(0, 0, 0, 0.36);
    pointer-events: auto;
}

.lightbox-close,
.lightbox-nav {
    position: fixed;
    z-index: 2;
    pointer-events: auto;
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    background: rgba(8, 18, 15, 0.62);
    color: #ffffff;
    backdrop-filter: blur(10px);
}

.lightbox-close {
    top: 22px;
    right: 22px;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev {
    left: 22px;
}

.lightbox-next {
    right: 22px;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(8, 18, 15, 0.88);
}

.lightbox-caption {
    position: fixed;
    right: 24px;
    bottom: 20px;
    left: 24px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 13px;
    text-align: center;
    pointer-events: none;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes shimmer {
    to {
        transform: translateX(100%);
    }
}

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

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modal-in {
    from {
        opacity: 0;
        transform: translate(-50%, -47%) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toast-out {
    to {
        opacity: 0;
        transform: translateY(8px);
    }
}

@media (max-width: 980px) {
    .header-inner {
        grid-template-columns: auto minmax(180px, 1fr) auto;
        gap: 18px;
    }

    .home-intro {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 52px 0 42px;
    }

    .home-intro h1 {
        font-size: 45px;
    }

    .intro-note {
        max-width: 620px;
    }

    .featured-link {
        grid-template-columns: 1fr;
    }

    .featured-media {
        min-height: auto;
        aspect-ratio: 16 / 10;
    }

    .featured-copy {
        padding: 34px;
    }

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

    .article-layout {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .article-aside {
        position: static;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .share-button {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    #main-content,
    .header-inner,
    .footer-inner {
        width: min(100% - 28px, 1180px);
    }

    body[data-page="post"] #main-content {
        width: min(100% - 28px, 1180px);
    }

    .site-header {
        position: sticky;
    }

    .header-inner {
        min-height: 66px;
        grid-template-columns: 1fr auto;
        gap: 12px;
    }

    .header-search {
        position: absolute;
        top: calc(100% + 8px);
        right: 14px;
        left: 14px;
        z-index: 70;
        height: 46px;
        opacity: 0;
        pointer-events: none;
        transform: translateY(-8px);
        transition: opacity 160ms ease, transform 160ms ease;
    }

    .site-header.search-open .header-search {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .mobile-search-toggle {
        display: inline-grid;
    }

    .detail-header .header-inner {
        grid-template-columns: auto 1fr auto;
    }

    .detail-header .back-link span:last-child {
        display: none;
    }

    .account-name,
    .account-chevron {
        display: none;
    }

    .account-trigger {
        padding: 4px;
        border-color: transparent;
        background: transparent;
    }

    .home-intro {
        min-height: auto;
        padding: 42px 0 34px;
    }

    .home-intro h1 {
        font-size: 38px;
    }

    .intro-note {
        font-size: 14px;
    }

    .discovery {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding-bottom: 14px;
    }

    .result-count {
        padding-left: 2px;
    }

    .featured-region {
        padding-top: 28px;
    }

    .featured-media {
        aspect-ratio: 4 / 3;
    }

    .featured-copy {
        padding: 27px 24px 30px;
    }

    .featured-copy h2 {
        font-size: 26px;
    }

    .post-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .post-card-body {
        min-height: auto;
    }

    .feed-section {
        padding-bottom: 58px;
    }

    .site-footer {
        margin-top: 0;
    }

    .footer-inner {
        min-height: 88px;
    }

    .detail-main {
        padding-top: 36px;
        padding-bottom: 58px;
    }

    .article-header {
        margin-bottom: 24px;
        padding-bottom: 18px;
        text-align: left;
    }

    .article-header h1 {
        margin-bottom: 14px;
        font-size: 30px;
        line-height: 1.28;
    }

    .article-excerpt {
        margin-left: 0;
        margin-bottom: 18px;
    }

    .article-meta {
        justify-content: flex-start;
        gap: 7px;
}

    .article-header-tools {
        justify-content: flex-start;
        margin-top: 15px;
        padding-top: 14px;
    }

    .article-cover {
        width: fit-content;
        max-width: min(100%, 1180px);
        height: auto;
        border-radius: 10px;
    }

    .article-cover img {
        height: auto;
        max-height: clamp(300px, 62vh, 520px);
    }

    .cover-action {
        right: 10px;
        bottom: 10px;
    }

    .article-layout {
        padding-top: 40px;
    }

    .article-content {
        font-size: 17px;
        line-height: 1.95;
    }

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

    .share-button {
        grid-column: 1 / -1;
    }

    .media-gallery {
        grid-template-columns: 1fr;
    }

    .gallery-image.is-wide,
    .gallery-video-wrap {
        grid-column: auto;
    }

    .state-panel {
        padding: 46px 24px;
    }

    .state-panel h1 {
        font-size: 28px;
    }

    .lightbox-panel {
        inset: 72px 14px 58px;
    }

    .lightbox-close {
        top: 14px;
        right: 14px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .toast-region {
        right: 14px;
        bottom: 14px;
        left: 14px;
    }

    .toast {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .modal-panel {
        width: calc(100% - 20px);
        padding: 25px 20px 22px;
    }

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

    .captcha-control {
        grid-template-columns: minmax(90px, 1fr) 74px;
    }

    .captcha-refresh {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 460px) {
    .brand-name {
        font-size: 19px;
    }

    .header-actions {
        gap: 6px;
    }

    .icon-button {
        width: 40px;
        height: 40px;
    }

    .home-intro h1 {
        font-size: 34px;
    }

    .featured-copy h2 {
        font-size: 23px;
    }

    .featured-meta {
        gap: 10px;
    }

    .featured-more {
        width: 100%;
        margin-left: 0;
    }

    .article-header h1 {
        font-size: 29px;
    }

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

    .share-button {
        grid-column: auto;
    }

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

    .auth-tabs {
        margin-top: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
