/* ==========================================================================
   Blog theme — inspired by Typecho "handsome"
   ========================================================================== */

:root {
    --header-h: 64px;
    --left-w: 264px;
    --right-w: 312px;
    --radius-sm: 4px;
    --radius: 6px;
    --radius-lg: 8px;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

    --bg: #f2f4f8;
    --bg-soft: #e9edf4;
    --card: #ffffff;
    --card-2: #f8fafc;
    --text: #2c3240;
    --text-soft: #616b7d;
    --muted: #8b95a7;
    --line: #e6eaf1;
    --line-strong: #d8dee9;
    --primary: #5b7cfa;
    --primary-2: #8a6cff;
    --primary-soft: rgba(91, 124, 250, 0.12);
    --header-bg: rgba(255, 255, 255, 0.94);
    --header-text: #2c3240;
    --header-muted: rgba(44, 50, 64, 0.55);
    --header-chip: rgba(44, 50, 64, 0.05);
    --header-chip-border: rgba(44, 50, 64, 0.12);
    --shadow-sm: 0 4px 14px rgba(32, 45, 80, 0.06);
    --shadow: 0 12px 34px rgba(32, 45, 80, 0.09);
    --shadow-lg: 0 24px 60px rgba(32, 45, 80, 0.16);
    --code-bg: #1f2433;
    --hero-grad: linear-gradient(135deg, #6a8dff 0%, #8a6cff 48%, #c479ff 100%);
}

[data-theme="dark"] {
    --bg: #1b1d21;
    --bg-soft: #23262b;
    --card: #26292e;
    --card-2: #2e3238;
    --text: #e6e7ea;
    --text-soft: #b7bcc4;
    --muted: #8e949e;
    --line: rgba(255, 255, 255, 0.06);
    --line-strong: rgba(255, 255, 255, 0.12);
    --primary: #8b93ff;
    --primary-2: #a9b0ff;
    --primary-soft: rgba(139, 147, 255, 0.16);
    --header-bg: #16181c;
    --header-text: #f2f3f5;
    --header-muted: rgba(255, 255, 255, 0.55);
    --header-chip: rgba(255, 255, 255, 0.09);
    --header-chip-border: rgba(255, 255, 255, 0.12);
    --shadow-sm: none;
    --shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    --shadow-lg: 0 22px 50px rgba(0, 0, 0, 0.45);
    --code-bg: #1a1c22;
    --hero-grad: none;
}

[data-theme="dark"] body::before {
    display: none;
}

[data-theme="dark"] .site-header {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-h) + 20px);
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI Emoji",
    "Apple Color Emoji", "Noto Color Emoji", sans-serif;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s var(--ease), color 0.3s var(--ease);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(900px 500px at 15% -10%, rgba(106, 141, 255, 0.14), transparent 60%),
        radial-gradient(800px 500px at 95% 10%, rgba(196, 121, 255, 0.12), transparent 62%);
}

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

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

button,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

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

.svg-sprite {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.icon {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: none;
}

.inline-icon {
    width: 0.92em;
    height: 0.92em;
    vertical-align: -0.1em;
    margin-right: 4px;
}

.muted {
    color: var(--muted);
}

.mobile-only {
    display: none !important;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    height: var(--header-h);
    background: var(--header-bg);
    color: var(--header-text);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    height: 100%;
    padding: 0 22px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    min-width: 0;
}

.brand-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    box-shadow: 0 6px 18px color-mix(in srgb, var(--primary) 45%, transparent);
}

.brand-icon .icon {
    width: 17px;
    height: 17px;
    color: #fff;
}

.brand-text {
    max-width: 32vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-search {
    flex: 1;
    max-width: 460px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    height: 40px;
    border-radius: 12px;
    background: var(--header-chip);
    border: 1px solid var(--header-chip-border);
    transition: background 0.25s, border-color 0.25s;
}

.header-search:focus-within {
    background: var(--header-chip);
    border-color: var(--primary);
}

.header-search .icon {
    width: 16px;
    height: 16px;
    color: var(--header-muted);
}

.header-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--header-text);
    font-size: 14px;
}

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

.header-search button {
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: var(--header-muted);
    padding: 2px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-pane {
    position: fixed;
    z-index: 55;
    top: calc(var(--header-h) + 10px);
    right: 18px;
    width: min(1040px, calc(100vw - 36px));
}

.stat-pane-card {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    max-height: calc(100vh - var(--header-h) - 28px);
    overflow: auto;
    padding: 14px 16px 18px;
}

.stat-pane-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stat-pane-head strong {
    font-size: 15px;
}

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

.stat-block.is-wide {
    grid-column: 1 / -1;
}

.stat-block {
    min-width: 0;
    padding: 10px 12px 12px;
    border-radius: 12px;
    background: var(--card-2);
}

.stat-block h3 {
    margin: 0;
    font-size: 13.5px;
}

.stat-block p {
    margin: 2px 0 10px;
    color: var(--muted);
    font-size: 12px;
}

.stat-loading,
.stat-empty {
    color: var(--muted);
    font-size: 13px;
}

.heat-wrap {
    width: 100%;
    min-width: 0;
}

.heat-months,
.heat-grid {
    display: grid;
    grid-template-columns: repeat(var(--weeks), minmax(0, 1fr));
    gap: 3px;
    width: 100%;
}

.heat-months {
    height: 16px;
    margin-bottom: 4px;
}

.heat-months span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 16px;
    white-space: nowrap;
}

.heat-grid {
    grid-template-rows: repeat(7, auto);
    grid-auto-flow: column;
}

.heat {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 2px;
    background: #ebedf0;
}

.heat-legend {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.heat-legend .heat {
    width: 12px;
    height: 12px;
    aspect-ratio: auto;
}

[data-theme="dark"] .heat { background: #2c3138; }
.heat.pad { background: transparent; }
.heat.h1 { background: #9be9a8; }
.heat.h2 { background: #40c463; }
.heat.h3 { background: #30a14e; }
.heat.h4 { background: #216e39; }

.stat-chart {
    width: 100%;
    height: auto;
    display: block;
    color: var(--text-soft);
}

.stat-radar {
    width: 100%;
    max-width: none;
    margin: 0 auto;
}

.stat-bars {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.stat-bar {
    display: grid;
    grid-template-columns: 72px 1fr 28px;
    gap: 8px;
    align-items: center;
    font-size: 12px;
}

.stat-bar span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat-bar b {
    display: block;
    height: 8px;
    border-radius: 99px;
    background: var(--primary);
}

.stat-bar em {
    font-style: normal;
    color: var(--muted);
    text-align: right;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.article-tags a {
    padding: 2px 10px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12.5px;
}

.icon-btn {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: inherit;
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.icon-btn:hover {
    background: var(--header-chip);
    transform: translateY(-1px);
}

.icon-btn .icon {
    width: 18px;
    height: 18px;
}

#themeToggle .icon-sun {
    display: none;
}


[data-theme="dark"] #themeToggle .icon-sun {
    display: block;
}

[data-theme="dark"] #themeToggle .icon-moon {
    display: none;
}

/* ==========================================================================
   Left sidebar
   ========================================================================== */

.left-sidebar {
    position: fixed;
    z-index: 50;
    top: var(--header-h);
    left: 0;
    bottom: 0;
    width: var(--left-w);
    background: var(--card);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    transition: transform 0.32s var(--ease);
}

.sidebar-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 22px 10px 12px 16px;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
}

.sidebar-scroll::-webkit-scrollbar {
    width: 10px;
}

.sidebar-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--muted) 38%, transparent);
    background-clip: padding-box;
}

.sidebar-scroll:hover::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.sidebar-scroll::-webkit-scrollbar-button,
.sidebar-scroll::-webkit-scrollbar-corner {
    display: none;
    width: 0;
    height: 0;
}

.profile {
    text-align: center;
    padding: 6px 10px 22px;
    border-bottom: 1px dashed var(--line);
    margin-bottom: 16px;
}

.avatar-link {
    display: inline-block;
    position: relative;
    width: 84px;
    height: 84px;
    margin-bottom: 14px;
}

.avatar-link::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: conic-gradient(from 180deg, var(--primary), var(--primary-2), #67d4ff, var(--primary));
    z-index: -1;
    animation: spin-slow 7s linear infinite;
    opacity: 0.85;
}

.avatar-link img {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid var(--card);
    background: var(--bg-soft);
}

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

.profile h2 {
    margin: 0 0 4px;
    font-size: 17px;
    letter-spacing: 0.02em;
}

.profile p {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    line-height: 1.6;
}

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

.nav-section {
    margin-top: 14px;
}

.nav-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--muted);
    text-transform: uppercase;
}

.nav-section-title .icon {
    width: 13px;
    height: 13px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 14px;
    color: var(--text-soft);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.nav-item .icon {
    width: 16px;
    height: 16px;
}

.nav-item:hover {
    background: var(--bg-soft);
    color: var(--text);
    transform: translateX(2px);
}

.nav-item.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.category-tree {
    list-style: none;
    margin: 4px 0 0;
    padding: 0;
}

.category-node {
    border-radius: 10px;
}

.cat-row {
    display: flex;
    align-items: center;
}

.cat-link {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 9px;
    font-size: 13.5px;
    color: var(--text-soft);
    transition: background 0.2s, color 0.2s;
}

.cat-link:hover {
    background: var(--bg-soft);
    color: var(--text);
}

.cat-link.active {
    background: var(--primary-soft);
    color: var(--primary);
    font-weight: 600;
}

.cat-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-count {
    font-size: 11px;
    padding: 1px 7px;
    border-radius: 99px;
    background: var(--bg-soft);
    color: var(--muted);
    line-height: 1.5;
}

.cat-link.active .cat-count {
    background: rgba(91, 124, 250, 0.18);
    color: var(--primary);
}

.cat-toggle {
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    transition: background 0.2s, transform 0.25s;
}

.cat-toggle:hover {
    background: var(--bg-soft);
}

.cat-toggle .icon {
    width: 14px;
    height: 14px;
}

.category-node.is-open > .cat-row .cat-toggle {
    transform: rotate(180deg);
}

.cat-children {
    list-style: none;
    margin: 0;
    padding: 0 0 0 14px;
    display: none;
    border-left: 1px dashed var(--line-strong);
    margin-left: 18px;
}

.category-node.is-open > .cat-children {
    display: block;
}

.cat-children .cat-link {
    font-size: 13px;
    padding: 6px 10px;
}

.side-empty {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--muted);
}

.sidebar-foot {
    padding: 12px 16px 16px;
    border-top: 1px solid var(--line);
    font-size: 11.5px;
    color: var(--muted);
    text-align: center;
}

.sidebar-foot p {
    margin: 0;
    line-height: 1.6;
}

.sidebar-foot .icp a {
    color: var(--muted);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: var(--header-h) 0 0;
    z-index: 45;
    background: rgba(10, 14, 24, 0.46);
    backdrop-filter: blur(2px);
}

/* ==========================================================================
   Main shell
   ========================================================================== */

.main-shell {
    margin-left: var(--left-w);
    padding: calc(var(--header-h) + 26px) 26px 30px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--right-w);
    gap: 26px;
    align-items: start;
    max-width: 1520px;
}

.main-content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.right-sidebar {
    position: sticky;
    top: calc(var(--header-h) + 26px);
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
    padding-bottom: 6px;
}

.right-sidebar > * {
    flex-shrink: 0;
}

.side-widgets {
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero-card {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    padding: 2px 2px 0;
    color: var(--text);
    background: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 0;
}

.hero-card.compact {
    min-height: 0;
    padding: 2px 2px 0;
}

.hero-copy {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.hero-art,
.hero-eyebrow,
.hero-stats {
    display: none;
}

.hero-eyebrow {
    display: none;
    font-size: 11px;
    letter-spacing: 0.22em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.25);
    margin-bottom: 12px;
}

.hero-copy h1 {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0;
    color: var(--text);
}

.hero-copy p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.hero-stats {
    display: none;
    flex-wrap: wrap;
    gap: 8px 18px;
    margin-top: 18px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
}

.hero-stats b {
    font-size: 17px;
    color: #fff;
    margin-right: 3px;
}

.hero-art {
    position: relative;
    width: 190px;
    height: 140px;
    flex: none;
}

.hero-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(2px);
    opacity: 0.8;
}

.orb-1 {
    width: 90px;
    height: 90px;
    right: 16px;
    top: 2px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.08) 70%);
    animation: float 6s ease-in-out infinite;
}

.orb-2 {
    width: 46px;
    height: 46px;
    right: 112px;
    bottom: 12px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.04) 70%);
    animation: float 5s ease-in-out infinite 0.8s;
}

.orb-3 {
    width: 26px;
    height: 26px;
    right: 6px;
    bottom: 6px;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.04) 70%);
    animation: float 4.2s ease-in-out infinite 0.4s;
}

.hero-ring {
    position: absolute;
    right: 28px;
    top: 18px;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    border: 1px dashed rgba(255, 255, 255, 0.45);
    animation: spin-slow 16s linear infinite;
}

.hero-code {
    position: absolute;
    right: 66px;
    top: 56px;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 28px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

/* ==========================================================================
   Carousel
   ========================================================================== */

.hero-carousel {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    height: 320px;
    background: var(--card);
    box-shadow: var(--shadow);
}

.carousel-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    transform: scale(1.04);
    transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), visibility 0.7s;
}

.carousel-slide.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carousel-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(15, 20, 34, 0.86) 0%, rgba(15, 20, 34, 0.5) 48%, rgba(15, 20, 34, 0.12) 100%),
    linear-gradient(0deg, rgba(15, 20, 34, 0.76), transparent 55%);
}

.carousel-copy {
    position: absolute;
    left: 34px;
    right: 34px;
    bottom: 34px;
    max-width: 620px;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.carousel-tag {
    align-self: flex-start;
    font-size: 11px;
    letter-spacing: 0.12em;
    padding: 3px 9px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.24);
}

.carousel-copy strong {
    font-size: clamp(20px, 2.4vw, 27px);
    line-height: 1.35;
    text-shadow: 0 3px 20px rgba(0, 0, 0, 0.35);
}

.carousel-copy small {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carousel-ctrl {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    background: rgba(16, 20, 33, 0.28);
    color: #fff;
    backdrop-filter: blur(6px);
    opacity: 0;
    transition: opacity 0.25s, background 0.25s;
}

.hero-carousel:hover .carousel-ctrl {
    opacity: 1;
}

.carousel-ctrl:hover {
    background: rgba(16, 20, 33, 0.6);
}

.carousel-ctrl.prev {
    left: 16px;
}

.carousel-ctrl.next {
    right: 16px;
}

.carousel-dots {
    position: absolute;
    right: 24px;
    bottom: 22px;
    display: flex;
    gap: 7px;
}

.carousel-dots button {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.4);
    transition: width 0.25s, background 0.25s;
}

.carousel-dots button.active {
    width: 24px;
    background: #fff;
}

/* ==========================================================================
   Notice
   ========================================================================== */

.notice-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
}

.notice-card > .icon {
    width: 16px;
    height: 16px;
    color: var(--muted);
    margin-top: 0;
}

.notice-card div {
    flex: 1;
}

.notice-card strong {
    font-size: 13px;
    color: var(--primary);
}

.notice-card p {
    margin: 0;
    font-size: 13px;
    color: var(--text-soft);
}

.notice-close {
    border: 0;
    background: transparent;
    color: var(--muted);
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.notice-close:hover {
    background: var(--bg-soft);
}

/* ==========================================================================
   List heading / posts
   ========================================================================== */

.list-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 2px 4px;
}

.list-heading h2 {
    margin: 0;
    font-size: 19px;
    letter-spacing: 0.02em;
    position: relative;
    padding-left: 14px;
}

.list-heading h2::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
}

.list-heading span {
    font-size: 12.5px;
    color: var(--muted);
}

.post-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.post-card {
    display: flex;
    gap: 16px;
    padding: 14px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.post-card:hover {
    border-color: var(--line-strong);
}

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

.post-thumb {
    position: relative;
    flex: none;
    width: 168px;
    height: 112px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-soft);
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease), filter 0.4s;
}

.post-card:hover .post-thumb img {
    transform: scale(1.07);
    filter: saturate(1.08);
}

.post-thumb-glow {
    position: absolute;
    inset: 0;
    background: linear-gradient(160deg, transparent 40%, rgba(20, 26, 44, 0.42));
    opacity: 0;
    transition: opacity 0.3s;
}

.post-card:hover .post-thumb-glow {
    opacity: 1;
}

.post-info {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2px 2px 2px 0;
}

.post-title {
    margin: 0 0 8px;
    font-size: 18px;
    line-height: 1.45;
    letter-spacing: 0.01em;
}

.post-title a {
    display: inline;
    transition: color 0.2s;
}

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

.badge-sticky {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #fff;
    background: linear-gradient(135deg, #ff7a7a, #ff4d6d);
    padding: 1px 7px;
    border-radius: 5px;
    margin-right: 6px;
    vertical-align: 1px;
}

.post-summary {
    margin: 0 0 auto;
    font-size: 13.5px;
    color: var(--text-soft);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--muted);
}

.post-meta a,
.post-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

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

.post-meta .icon {
    width: 13px;
    height: 13px;
}

.post-category {
    margin-left: auto;
    padding: 2px 9px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary) !important;
    font-size: 11.5px;
}

.empty-state {
    padding: 64px 24px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px dashed var(--line-strong);
    text-align: center;
    color: var(--muted);
}

.empty-state > .icon {
    width: 42px;
    height: 42px;
    color: var(--primary);
    opacity: 0.6;
    margin-bottom: 12px;
}

.empty-state h3 {
    margin: 0 0 6px;
    color: var(--text);
    font-size: 18px;
}

.empty-state p {
    margin: 0 0 18px;
    font-size: 13.5px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px 20px;
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(106, 108, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(106, 108, 255, 0.42);
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 8px 0 4px;
}

.page-btn {
    display: inline-grid;
    place-items: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 13px;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-1px);
}

.page-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    border-color: transparent;
    color: #fff;
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(106, 108, 255, 0.32);
}

.page-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-btn .icon {
    width: 15px;
    height: 15px;
}

.page-ellipsis {
    color: var(--muted);
    padding: 0 2px;
}

/* ==========================================================================
   Article
   ========================================================================== */

.article-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 30px 38px 34px;
    box-shadow: var(--shadow-sm);
    min-width: 0;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 18px;
}

.breadcrumb a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color 0.2s;
}

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

.breadcrumb .icon {
    width: 13px;
    height: 13px;
}

.crumb-sep {
    opacity: 0.5;
}

.crumb-current {
    color: var(--text-soft);
}

.article-header {
    padding-bottom: 22px;
    border-bottom: 1px dashed var(--line-strong);
}

.article-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.badge-category {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 12px;
}

.badge-category .icon {
    width: 12px;
    height: 12px;
}

.article-title {
    margin: 0 0 14px;
    font-size: clamp(25px, 3.2vw, 34px);
    line-height: 1.32;
    letter-spacing: 0.01em;
    word-break: break-word;
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 20px;
    font-size: 12.5px;
    color: var(--muted);
}

.article-meta > a,
.article-meta > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

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

.article-meta .icon {
    width: 14px;
    height: 14px;
}

.article-content {
    padding: 26px 0 4px;
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--text);
    word-break: break-word;
    overflow-wrap: anywhere;
}

.article-content > :first-child {
    margin-top: 0;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.6em 0 0.7em;
    line-height: 1.4;
    letter-spacing: 0.01em;
    scroll-margin-top: calc(var(--header-h) + 24px);
}

.article-content h1 {
    font-size: 1.8em;
}

.article-content h2 {
    font-size: 1.5em;
    padding-bottom: 0.45em;
    border-bottom: 1px solid var(--line);
}

.article-content h2::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 0.8em;
    border-radius: 99px;
    background: linear-gradient(180deg, var(--primary), var(--primary-2));
    margin-right: 9px;
    vertical-align: -0.08em;
}

.article-content h3 {
    font-size: 1.28em;
}

.article-content h4 {
    font-size: 1.1em;
}

.article-content p {
    margin: 0 0 1.1em;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(91, 124, 250, 0.4);
}

.article-content a:hover {
    text-decoration-color: var(--primary);
}

.article-content ul,
.article-content ol {
    padding-left: 1.6em;
    margin: 0 0 1.1em;
}

.article-content li {
    margin: 0.3em 0;
}

.article-content li::marker {
    color: var(--primary);
}

.article-content blockquote {
    margin: 1.2em 0;
    padding: 12px 18px;
    border-left: 4px solid var(--primary);
    border-radius: 0 10px 10px 0;
    background: var(--primary-soft);
    color: var(--text-soft);
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content img {
    border-radius: 12px;
    margin: 1.2em auto;
    box-shadow: var(--shadow-sm);
    cursor: zoom-in;
}

.article-content hr {
    border: 0;
    height: 1px;
    margin: 2em 0;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.article-content .table-scroll {
    width: 100%;
    max-width: 100%;
    margin: 1.2em 0;
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 10px;
    -webkit-overflow-scrolling: touch;
}

.article-content .table-scroll table {
    width: max-content;
    min-width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 14px;
}

.article-content .table-scroll th,
.article-content .table-scroll td {
    min-width: 6.5em;
    padding: 9px 13px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.article-content .table-scroll th {
    background: var(--card-2);
    font-weight: 700;
}

.article-content .table-scroll tr:nth-child(even) td {
    background: rgba(120, 140, 180, 0.04);
}

.article-content :not(pre) > code {
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    font-size: 0.88em;
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--primary-soft);
    color: var(--primary);
}

.article-content pre,
.highlight {
    position: relative;
    margin: 1.2em 0;
    border-radius: 12px;
    background: var(--code-bg);
    color: #dce3f0;
    overflow: hidden;
    box-shadow: 0 12px 30px rgba(8, 12, 22, 0.22);
}

.highlight pre {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.article-content pre {
    padding: 16px 18px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.7;
}

.article-content pre code {
    font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.highlight .highlighttable,
.highlight .codehilitetable {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    margin: 0;
}

.highlight .highlighttable td,
.highlight .codehilitetable td {
    min-width: 0;
    padding: 0;
    border: 0;
    vertical-align: top;
    background: transparent;
}

.highlight .linenos {
    width: 1%;
    user-select: none;
}

.highlight .linenodiv pre {
    margin: 0;
    padding: 16px 12px;
    color: #5f6c86;
    border-right: 1px solid rgba(255, 255, 255, 0.07);
    text-align: right;
}

.highlight td.code pre {
    padding: 16px 18px;
}

/* 行号表会按最长一行撑开，外层 overflow:hidden 会把超出的代码裁掉。
   把表格收进正文宽度，只在代码列里横向滚动。 */
.article-content .highlighttable,
.article-content .codehilitetable {
    display: block;
    width: 100%;
    max-width: 100%;
}

.article-content .highlighttable > tbody,
.article-content .codehilitetable > tbody,
.article-content .highlighttable > tbody > tr,
.article-content .codehilitetable > tbody > tr {
    display: flex;
    max-width: 100%;
}

.article-content td.linenos {
    flex: none;
}

.article-content td.code {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.article-content td.code > .highlight {
    overflow: visible;
    width: max-content;
    min-width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.article-content td.code pre {
    width: max-content;
    min-width: 100%;
    overflow: visible;
}

.article-content pre,
.article-content pre code {
    white-space: pre;
    word-break: normal;
    overflow-wrap: normal;
}

.article-content td.code .code-copy-btn {
    display: none;
}

.code-copy-btn {
    position: absolute;
    top: 9px;
    right: 9px;
    z-index: 2;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 7px;
    background: rgba(255, 255, 255, 0.07);
    color: #c7d1e4;
    font-size: 11.5px;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.highlight:hover .code-copy-btn,
.article-content pre:hover .code-copy-btn {
    opacity: 1;
}

@media (hover: none) {
    .code-copy-btn {
        opacity: 1;
    }
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* pygments tokens */
.highlight .hll { background-color: rgba(255, 255, 255, 0.06); }
.highlight .c, .highlight .ch, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs { color: #6b7a94; font-style: italic; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kt { color: #c792ea; }
.highlight .o, .highlight .ow { color: #89ddff; }
.highlight .p, .highlight .punctuation { color: #a6b1c4; }
.highlight .n, .highlight .na, .highlight .nb, .highlight .bp, .highlight .nc, .highlight .nd, .highlight .ne, .highlight .nf, .highlight .fm, .highlight .ni, .highlight .nl, .highlight .nn, .highlight .nt, .highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi, .highlight .vm { color: #82aaff; }
.highlight .nb { color: #ffcb6b; }
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .se, .highlight .sh, .highlight .si, .highlight .sx, .highlight .sr, .highlight .s1, .highlight .ss { color: #c3e88d; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo { color: #f78c6c; }
.highlight .gh, .highlight .gu { color: #ffcb6b; font-weight: 700; }
.highlight .gd { color: #ff5370; }
.highlight .gi { color: #c3e88d; }

.article-end {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 6px;
    color: var(--muted);
}

.article-end span {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
}

.article-end .icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.article-footer {
    margin-top: 18px;
}

.article-footer-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    font-size: 12.5px;
    color: var(--muted);
    padding-bottom: 18px;
    border-bottom: 1px dashed var(--line);
}

.article-footer-meta a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary);
}

.article-footer-meta .icon {
    width: 13px;
    height: 13px;
}

.post-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 20px;
}

.post-nav-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 13px 16px;
    border-radius: 12px;
    background: var(--card-2);
    border: 1px solid var(--line);
    min-width: 0;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.post-nav-item:not(.disabled):hover {
    border-color: rgba(91, 124, 250, 0.38);
    transform: translateY(-2px);
    background: var(--primary-soft);
}

.post-nav-item.next {
    text-align: right;
}

.post-nav-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    color: var(--muted);
}

.post-nav-item.next .post-nav-label {
    justify-content: flex-end;
}

.post-nav-label .icon {
    width: 13px;
    height: 13px;
}

.post-nav-item strong {
    font-size: 13.5px;
    color: var(--text-soft);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.post-nav-item.disabled {
    opacity: 0.55;
}

.form-error {
    padding: 8px 14px;
    margin-bottom: 14px;
    border-radius: 9px;
    background: rgba(255, 77, 109, 0.12);
    border: 1px solid rgba(255, 77, 109, 0.3);
    color: #e6405f;
    font-size: 13px;
}

/* Password */
.password-panel {
    margin: 34px auto 20px;
    max-width: 440px;
    padding: 34px 28px;
    border-radius: var(--radius);
    background: var(--card-2);
    border: 1px solid var(--line);
    text-align: center;
}

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

.password-icon .icon {
    width: 26px;
    height: 26px;
}

.password-panel h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.password-panel p {
    margin: 0 0 18px;
    font-size: 13.5px;
    color: var(--muted);
}

.password-panel form {
    display: flex;
    gap: 10px;
}

.password-panel input {
    flex: 1;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--card);
    color: var(--text);
    outline: 0;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.password-panel input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

/* Related */
.related-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.related-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.related-cover {
    display: block;
    height: 112px;
    overflow: hidden;
    background: var(--bg-soft);
}

.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease);
}

.related-card:hover .related-cover img {
    transform: scale(1.06);
}

.related-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 14px 14px;
}

.related-info strong {
    font-size: 13.5px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-info small {
    font-size: 11.5px;
    color: var(--muted);
}

/* Comments */
.comments-card {
    padding: 24px 28px;
    border-radius: var(--radius);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.comments-head h3 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 16px;
    font-size: 17px;
}

.comments-head .icon {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.comments-head span {
    font-size: 12px;
    color: var(--muted);
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--bg-soft);
}

.comments-empty {
    padding: 28px;
    border-radius: 12px;
    background: var(--card-2);
    border: 1px dashed var(--line-strong);
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
}

.comments-empty .icon {
    width: 28px;
    height: 28px;
    margin-bottom: 8px;
    opacity: 0.5;
}

.comments-empty p {
    margin: 0;
}

/* ==========================================================================
   Archive / About
   ========================================================================== */

.archive-card {
    padding: 8px 30px 26px;
    border-radius: var(--radius-lg);
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}

.archive-year {
    padding-top: 20px;
}

.archive-year > h2 {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 6px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.archive-year-num {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, var(--primary), var(--primary-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.archive-year-count {
    font-size: 12px;
    color: var(--muted);
    font-weight: 400;
}

.archive-month {
    position: relative;
    padding-left: 26px;
    margin-top: 14px;
}

.archive-month::before {
    content: "";
    position: absolute;
    left: 5px;
    top: 8px;
    bottom: 0;
    width: 2px;
    border-radius: 99px;
    background: var(--line);
}

.archive-month h3 {
    position: relative;
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.archive-month h3::before {
    content: "";
    position: absolute;
    left: -25px;
    top: 50%;
    width: 9px;
    height: 9px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--card);
    border: 2px solid var(--primary);
}

.archive-month ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.archive-month li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 12px;
    padding: 6px 0;
    border-bottom: 1px dashed transparent;
    font-size: 14px;
}

.archive-month li:hover {
    border-bottom-color: var(--line);
}

.archive-month time {
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    min-width: 46px;
}

.archive-month li a {
    flex: 1;
    min-width: 180px;
    transition: color 0.2s, transform 0.2s;
}

.archive-month li a:hover {
    color: var(--primary);
    transform: translateX(2px);
}

.archive-cat {
    font-size: 11px;
    padding: 1px 8px;
    border-radius: 99px;
    background: var(--bg-soft);
    color: var(--muted);
}

.about-card {
    padding-top: 30px;
}

.about-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px dashed var(--line-strong);
}

.about-profile img {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-soft);
    border: 4px solid var(--card);
    box-shadow: 0 0 0 2px var(--primary-soft), var(--shadow-sm);
}

.about-profile h2 {
    margin: 0 0 4px;
    font-size: 23px;
}

.about-profile p {
    margin: 0 0 10px;
    font-size: 13.5px;
    color: var(--muted);
}

.about-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.about-badges span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 10px;
    border-radius: 99px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 11.5px;
}

.about-badges .icon {
    width: 12px;
    height: 12px;
}

.about-links {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px dashed var(--line-strong);
}

.about-links h3 {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0 0 14px;
    font-size: 16px;
}

.about-links .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.about-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 10px;
}

.about-link-grid a {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 14px;
    border-radius: 10px;
    background: var(--card-2);
    border: 1px solid var(--line);
    transition: border-color 0.2s, transform 0.2s;
}

.about-link-grid a:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.about-link-grid strong {
    font-size: 13.5px;
}

.about-link-grid small {
    font-size: 11.5px;
    color: var(--muted);
}

/* ==========================================================================
   Widgets
   ========================================================================== */

.widget {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 15px 18px 12px;
    font-size: 14.5px;
    font-weight: 700;
    border-bottom: 1px solid var(--line);
}

.widget-title .icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.widget-tabs-head {
    display: flex;
    border-bottom: 1px solid var(--line);
}

.widget-tab-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    position: relative;
    transition: color 0.2s, background 0.2s;
}

.widget-tab-btn .icon {
    width: 14px;
    height: 14px;
}

.widget-tab-btn::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -1px;
    width: 0;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--primary), var(--primary-2));
    transform: translateX(-50%);
    transition: width 0.24s var(--ease);
}

.widget-tab-btn:hover {
    color: var(--text);
    background: var(--card-2);
}

.widget-tab-btn.active {
    color: var(--primary);
    font-weight: 700;
}

.widget-tab-btn.active::after {
    width: 46%;
}

.widget-tab-panel {
    display: none;
    padding: 8px 10px 12px;
}

.widget-tab-panel.active {
    display: block;
    animation: fade-in 0.3s var(--ease);
}

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

.mini-post-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.mini-post-list li {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 7px 8px;
    border-radius: 10px;
    transition: background 0.2s;
}

.mini-post-list li:hover {
    background: var(--card-2);
}

.mini-thumb {
    flex: none;
    width: 52px;
    height: 40px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--bg-soft);
}

.mini-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--ease);
}

.mini-post-list li:hover .mini-thumb img {
    transform: scale(1.08);
}

.mini-info {
    min-width: 0;
    flex: 1;
}

.mini-title {
    display: block;
    font-size: 12.5px;
    line-height: 1.5;
    transition: color 0.2s;
}

.mini-title:hover {
    color: var(--primary);
}

.mini-meta {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-top: 2px;
    font-size: 11px;
    color: var(--muted);
}

.mini-meta .icon {
    width: 11px;
    height: 11px;
}

.widget-empty {
    padding: 16px;
    text-align: center;
    font-size: 12.5px;
    color: var(--muted);
}

.stats-list {
    list-style: none;
    margin: 0;
    padding: 8px 18px 14px;
}

.stats-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--line);
    font-size: 13px;
    color: var(--text-soft);
}

.stats-list li:last-child {
    border-bottom: 0;
}

.stats-list li span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.stats-list .icon {
    width: 14px;
    height: 14px;
    color: var(--primary);
}

.stats-list b {
    font-size: 13.5px;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 12px 16px 18px;
    line-height: 1.7;
}

.tag-word {
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.2;
    transition: color 0.2s;
}

.tag-word.is-m { font-size: 16px; }
.tag-word.is-l { font-size: 20px; color: var(--text); }
.tag-word.is-xl { font-size: 26px; color: var(--text); }

.tag-word:hover {
    color: var(--primary);
}

.friend-list {
    list-style: none;
    margin: 0;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friend-list a {
    display: block;
    min-width: 0;
    padding: 8px 10px;
    border-radius: 10px;
    background: var(--card-2);
    transition: background 0.2s, color 0.2s;
}

.friend-list a:hover {
    background: var(--primary-soft);
    color: var(--primary);
}

.friend-list strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.friend-list span {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
}

/* 目录不占右侧栏，改由右侧浮动按钮展开 */
.toc-widget {
    display: none;
}

.toc-widget > .widget-title {
    flex-shrink: 0;
}

.article-toc {
    flex: 0 1 auto;
    min-height: 0;
    padding: 10px 12px 14px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--muted) 42%, transparent) transparent;
}

.article-toc::-webkit-scrollbar {
    width: 10px;
}

.article-toc::-webkit-scrollbar-track {
    background: transparent;
}

.article-toc::-webkit-scrollbar-thumb {
    border: 3px solid transparent;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--muted) 38%, transparent);
    background-clip: padding-box;
}

.article-toc:hover::-webkit-scrollbar-thumb {
    background-color: color-mix(in srgb, var(--muted) 72%, transparent);
}

.article-toc::-webkit-scrollbar-button,
.article-toc::-webkit-scrollbar-corner {
    display: none;
    width: 0;
    height: 0;
}

.article-toc > ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.article-toc ul ul {
    list-style: none;
    margin: 0;
    padding-left: 12px;
    border-left: 1px solid var(--line);
}

.article-toc a {
    display: block;
    padding: 4px 8px;
    border-radius: 7px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-soft);
    border-left: 2px solid transparent;
    transition: all 0.2s;
}

.article-toc a:hover {
    background: var(--card-2);
    color: var(--primary);
}

.article-toc a.active {
    color: var(--primary);
    background: var(--primary-soft);
    border-left-color: var(--primary);
    font-weight: 600;
}

.scode {
    margin: 16px 0;
    padding: 12px 16px 14px;
    border-radius: 8px;
    border-left: 4px solid var(--scode, #8b95a7);
    background: color-mix(in srgb, var(--scode, #8b95a7) 16%, var(--card));
}

.scode.is-red { --scode: #e35d5d; }
.scode.is-yellow { --scode: #d4a017; }
.scode.is-green { --scode: #2f9e6b; }
.scode.is-lblue { --scode: #3d7ec9; }
.scode.is-share { --scode: #8b95a7; }
.scode.is-simple { padding: 8px 12px; }
.scode-label {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--scode, #8b95a7);
}
.scode-body > :first-child { margin-top: 0; }
.scode-body > :last-child { margin-bottom: 0; }

.hs-collapse {
    margin: 16px 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--card-2);
}
.hs-collapse summary {
    cursor: pointer;
    padding: 12px 14px;
    font-weight: 700;
}
.hs-collapse-body { padding: 0 14px 12px; }
.hs-collapse-body > :first-child { margin-top: 0; }

.hs-tabs {
    margin: 8px 0 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 88%, var(--bg));
    overflow: hidden;
}

.hs-tab-bar {
    display: flex;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    border-bottom: 1px solid var(--line);
    background: var(--card-2);
}

.hs-tab-btn {
    appearance: none;
    border: 0;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: transparent;
    color: var(--muted);
    padding: 12px 18px;
    font: inherit;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}

.hs-tab-btn.is-active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 650;
}

.hs-tab-pane {
    padding: 16px 18px 6px;
}

.hs-tab-pane[hidden] {
    display: none;
}

.hs-timeline {
    margin: 8px 0 18px;
}

.hs-timeline-title {
    margin: 0 0 14px;
    font-weight: 700;
}

.hs-item {
    position: relative;
    margin-left: 8px;
    padding: 0 0 18px 18px;
    border-left: 2px solid var(--tl, #23b7e5);
}

.hs-item::before {
    content: "";
    position: absolute;
    left: -6px;
    top: 5px;
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border: 2px solid var(--tl, #23b7e5);
    border-radius: 50%;
    background: var(--card);
}

.hs-item:nth-child(6n+2) { --tl: #23b7e5; }
.hs-item:nth-child(6n+3) { --tl: #7266ba; }
.hs-item:nth-child(6n+4) { --tl: #27c24c; }
.hs-item:nth-child(6n+5) { --tl: #fad733; }
.hs-item:nth-child(6n+6) { --tl: #f05050; }
.hs-item:nth-child(6n+7) { --tl: #3a3f51; }

[data-theme="dark"] .hs-item:nth-child(6n+7) { --tl: #9aa3b2; }

.hs-timeline.is-small .hs-item {
    padding-bottom: 14px;
}

.hs-item time {
    display: block;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.hs-item-body > :first-child {
    margin-top: 0;
}

.hs-item-body > :last-child {
    margin-bottom: 0;
}

.hs-album {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 14px 16px;
    margin: 16px 0;
}
.hs-album p {
    display: contents;
}
.hs-album br {
    display: none;
}
.hs-album figure {
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    margin: 0;
}
.article-content .hs-album img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    min-width: 0;
    margin: 0;
    object-fit: contain;
}
.hs-album figcaption {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.hs-post { margin: 16px 0; }
.hs-post a {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--card-2);
}
.hs-post img {
    width: 120px;
    height: 80px;
    max-width: 120px;
    margin: 0;
    object-fit: cover;
    border-radius: 8px;
    flex: 0 0 120px;
    box-shadow: none;
}
.hs-post-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hs-post-copy strong { font-size: 15px; }
.hs-post-copy small, .hs-post-copy em { color: var(--muted); font-style: normal; font-size: 12px; }
.hs-post-copy small {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}
.hs-post-missing { color: var(--muted); }

.hs-btn {
    display: inline-block;
    margin: 4px 6px 4px 0;
    padding: 6px 14px;
    border-radius: 6px;
    background: #5c6578;
    color: #fff !important;
    font-size: 13px;
}
.hs-btn.is-danger { background: #c44747; }
.hs-btn.is-info, .hs-btn.is-primary { background: #3d7ec9; }
.hs-btn.is-success { background: #2f9e6b; }
.hs-btn.is-warning { background: #c49216; color: #1c1915 !important; }

.hs-font { font-weight: 650; }

/* ==========================================================================
   Footer / misc
   ========================================================================== */

.site-footer {
    margin-left: var(--left-w);
    padding: 22px 26px 30px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    justify-content: center;
    font-size: 12px;
    color: var(--muted);
}

.footer-dot {
    opacity: 0.5;
}

.footer-extra {
    width: 100%;
    text-align: center;
}

.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 26px;
    z-index: 40;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
    color: var(--text-soft);
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.28s var(--ease);
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

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

.back-to-top .icon {
    width: 18px;
    height: 18px;
}

.toc-float {
    position: fixed;
    z-index: 42;
    right: 0;
    bottom: 84px;
    display: flex;
    align-items: flex-end;
    pointer-events: auto;
}

.toc-float-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-right: 0;
    border-radius: 12px 0 0 12px;
    background: var(--card);
    color: var(--text-soft);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: color 0.2s;
}

.toc-float-tab:hover,
.toc-float.is-open .toc-float-tab {
    color: var(--primary);
}

.toc-float-tab .icon {
    width: 16px;
    height: 16px;
}

.toc-float-tab span {
    writing-mode: vertical-rl;
    letter-spacing: 0.2em;
    font-size: 13px;
    font-weight: 600;
}

.toc-float-panel {
    position: absolute;
    right: 100%;
    bottom: 0;
    width: min(300px, calc(100vw - 64px));
    max-height: min(64vh, calc(100vh - var(--header-h) - 96px));
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateX(8px);
    transition: opacity 0.2s var(--ease), transform 0.2s var(--ease), visibility 0.2s;
}

.toc-float:hover .toc-float-panel,
.toc-float:focus-within .toc-float-panel,
.toc-float.is-open .toc-float-panel {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.toc-float-head {
    padding: 12px 14px 8px;
    font-size: 13px;
    font-weight: 700;
}

.toc-float-panel .article-toc {
    flex: 1 1 auto;
    min-height: 0;
    max-height: min(60vh, 520px);
    overflow-y: auto;
}

/* Lightbox */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 30px;
    background: rgba(8, 11, 18, 0.9);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 94vw;
    max-height: calc(88vh - 72px);
    border-radius: 10px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
    transform: scale(0.96);
    transition: transform 0.25s var(--ease);
}

.lightbox-caption {
    margin: 0;
    max-width: min(760px, 92vw);
    color: #f7f4ee;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

.lightbox-caption:empty {
    display: none;
}

.lightbox.open img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 22px;
    right: 24px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.lightbox-close .icon {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1280px) {
    :root {
        --right-w: 280px;
        --left-w: 244px;
    }

    .post-thumb {
        width: 190px;
        height: 132px;
    }

    .main-shell {
        padding-left: 20px;
        padding-right: 20px;
        gap: 20px;
    }
}

@media (max-width: 1080px) {
    .main-shell {
        grid-template-columns: minmax(0, 1fr);
        max-width: 900px;
        margin: 0 auto;
        margin-left: var(--left-w);
    }

    .right-sidebar,
    .right-sidebar:has(.toc-widget) {
        position: static;
        max-height: none;
        overflow: visible;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .side-widgets {
        display: contents;
    }

}

@media (max-width: 860px) {
    :root {
        --header-h: 58px;
    }

    .mobile-only {
        display: inline-grid !important;
    }

    .desktop-only {
        display: none !important;
    }

    .header-inner {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        padding: 0 12px;
        gap: 8px;
    }

    .header-left,
    .header-actions {
        flex: none;
        min-width: auto;
    }

    .header-left .icon-btn,
    .brand-icon,
    .header-left .brand {
        flex: none;
    }

    .header-search {
        width: auto;
        max-width: none;
        margin: 0;
        min-width: 0;
    }

    .brand-text {
        max-width: 40vw;
        font-size: 14px;
    }

    .brand-icon {
        width: 30px;
        height: 30px;
    }

    .header-search {
        height: 36px;
        padding: 0 10px;
        border-radius: 10px;
    }

    .header-search input,
    .comment-form input,
    .comment-form textarea,
    .password-panel input {
        font-size: 16px;
    }

    .icon-btn {
        width: 34px;
        height: 34px;
    }

    .left-sidebar {
        transform: translateX(-100%);
        box-shadow: var(--shadow-lg);
    }

    body.sidebar-open .left-sidebar {
        transform: translateX(0);
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .sidebar-overlay {
        display: block;
    }

    .main-shell,
    .site-footer {
        margin-left: 0;
    }

    .main-shell {
        padding: calc(var(--header-h) + 16px) 14px 24px;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .right-sidebar {
        grid-template-columns: minmax(0, 1fr);
    }

    .stat-pane {
        left: 12px;
        right: 12px;
        width: auto;
    }

    .stat-layout {
        grid-template-columns: 1fr;
    }

    .hero-card {
        padding: 2px 0 0;
        min-height: 0;
    }

    .hero-art {
        display: none;
    }

    .hero-carousel {
        height: 260px;
    }

    .carousel-copy {
        left: 20px;
        right: 20px;
        bottom: 24px;
    }

    .post-card {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }

    .post-thumb {
        width: 100%;
        height: 186px;
    }

    .post-title {
        font-size: 17px;
    }

    .post-category {
        margin-left: 0;
    }

    .article-card {
        padding: 22px 18px 26px;
    }

    .article-content {
        font-size: 15px;
    }

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

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

    .related-card {
        flex-direction: row;
    }

    .related-cover {
        width: 120px;
        height: auto;
        flex: none;
    }

    .archive-card {
        padding: 4px 18px 20px;
    }

    .about-profile {
        flex-direction: column;
        text-align: center;
    }

    .about-badges {
        justify-content: center;
    }

    .password-panel form {
        flex-direction: column;
    }

    .site-footer {
        padding: 18px 14px 26px;
    }

    .site-header {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    .back-to-top {
        right: calc(14px + env(safe-area-inset-right));
        bottom: calc(16px + env(safe-area-inset-bottom));
    }

    .toc-float {
        bottom: calc(84px + env(safe-area-inset-bottom));
        right: env(safe-area-inset-right);
    }
}

@media (max-width: 560px) {
    .header-inner {
        padding: 0 8px;
        gap: 6px;
    }

    .header-search {
        max-width: none;
    }

    .header-search button {
        display: none;
    }

    .brand-text {
        display: none;
    }

    .comment-children {
        margin-left: 10px;
        padding-left: 10px;
    }

    .hero-copy h1 {
        font-size: 23px;
    }

    .hero-stats {
        gap: 6px 14px;
        font-size: 12px;
    }

    .hero-stats b {
        font-size: 15px;
    }

    .hero-carousel {
        height: 220px;
    }

    .carousel-copy small {
        display: none;
    }

    .carousel-ctrl {
        display: none;
    }

    .post-thumb {
        height: 156px;
    }

    .article-title {
        font-size: 23px;
    }

    .article-meta {
        gap: 6px 14px;
    }

    .archive-month li a {
        min-width: 0;
        width: 100%;
    }
}

.badge-draft {
    display: inline-block;
    margin-right: 6px;
    padding: 0 6px;
    border-radius: 3px;
    background: #8a6a2f;
    color: #fff;
    font-size: 12px;
    vertical-align: 1px;
}

.comment-mini-list {
    list-style: none;
    margin: 0;
    padding: 6px 12px 10px;
}

.comment-mini-list a {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 2px;
}

.comment-mini-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex: none;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 13px;
    background: hsl(var(--avatar-hue, 210), 42%, 42%);
}

.comment-mini-body {
    min-width: 0;
    flex: 1;
}

.comment-mini-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    line-height: 1.45;
}

.comment-mini-meta {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.access-gate {
    margin: 18px 0;
    padding: 22px 18px;
    text-align: center;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--card-2);
}

.access-gate strong {
    display: block;
    margin-bottom: 6px;
    font-size: 15px;
}

.access-gate p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
}

.access-gate a {
    display: inline-block;
    margin-top: 10px;
    font-size: 13px;
}

.comment-list,
.comment-children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-children {
    margin-left: 28px;
    border-left: 2px solid var(--line);
    padding-left: 14px;
}

.comment-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.comment-children .comment-item:last-child {
    border-bottom: 0;
}

.comment-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 12px;
}

.comment-meta strong {
    color: var(--text);
    font-size: 14px;
}

.comment-text {
    margin: 0;
    line-height: 1.7;
    word-break: break-word;
}

.comment-chip {
    --chip: #5b8def;
    display: inline-flex;
    align-items: center;
    margin: 0 6px 2px 0;
    padding: 0 8px;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, var(--chip) 40%, transparent);
    background: color-mix(in srgb, var(--chip) 16%, transparent);
    color: var(--chip);
    font-size: 12px;
    line-height: 22px;
    vertical-align: 1px;
}

.comment-chip[data-tone="0"] { --chip: #5b8def; }
.comment-chip[data-tone="1"] { --chip: #3aa6a0; }
.comment-chip[data-tone="2"] { --chip: #d98a2b; }
.comment-chip[data-tone="3"] { --chip: #d4656a; }
.comment-chip[data-tone="4"] { --chip: #8b74d6; }
.comment-chip[data-tone="5"] { --chip: #4f9d5d; }
.comment-chip[data-tone="6"] { --chip: #c46b9a; }
.comment-chip[data-tone="7"] { --chip: #4c8fd4; }
.comment-chip[data-tone="8"] { --chip: #b0893e; }
.comment-chip[data-tone="9"] { --chip: #6a8f71; }
.comment-chip[data-tone="10"] { --chip: #c47a4a; }
.comment-chip[data-tone="11"] { --chip: #6d7ea8; }

.comment-secret {
    display: block;
    margin: 8px 0;
    padding: 8px 12px;
    border-radius: 8px;
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.comment-secret.is-locked {
    color: var(--muted);
    font-size: 13px;
}

.comment-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-top: 14px;
}

.comment-pager a,
.comment-pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 8px;
    border-radius: 8px;
    color: var(--text);
    text-decoration: none;
}

.comment-pager a {
    border: 1px solid var(--line);
}

.comment-pager a:hover,
.comment-pager .is-current {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.comment-gap {
    min-width: 16px;
    color: var(--muted);
}

.repo-board h2 {
    margin: 0 0 14px;
    font-size: 22px;
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
    margin-bottom: 8px;
}

.repo-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 148px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--card);
}

.repo-card header {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.repo-card h3 {
    margin: 0;
    font-size: 16px;
    flex: 1;
}

.repo-card header span,
.repo-lang {
    color: var(--muted);
    font-size: 12px;
}

.repo-card p {
    margin: 0;
    flex: 1;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.6;
}

.repo-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.repo-card a {
    color: var(--primary);
    font-size: 13px;
}

.comment-reply,
.comment-replying button {
    border: 0;
    background: transparent;
    color: var(--primary);
    padding: 0;
    font-size: 12px;
}

.comment-pending {
    color: #e0b15a;
}

.comment-form {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.comment-form input,
.comment-form textarea,
.password-panel input {
    width: 100%;
    border: 1px solid var(--line-strong);
    background: var(--bg);
    color: var(--text);
    border-radius: 4px;
    padding: 8px 10px;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--muted);
    font-size: 12px;
}

.comment-tag-picker {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--text-soft);
    font-size: 13px;
}

.comment-tag-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.comment-tag-option {
    border: 1px solid var(--line-strong);
    background: transparent;
    color: var(--text);
    border-radius: 999px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 13px;
}

.comment-tag-option.is-selected {
    background: var(--primary);
    border-color: transparent;
    color: #fff;
}

.comment-form .comment-tag-custom {
    width: 9.5em;
    flex: 0 0 auto;
}

.comment-secret-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

.comment-form .comment-secret-toggle input {
    width: auto;
    margin: 0;
}

.comment-as,
.comment-closed,
.comment-replying {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
}

.form-ok {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 4px;
    background: rgba(72, 160, 110, 0.15);
    color: #7dcea0;
}

.hp-field {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

@media (max-width: 860px) {
    .comment-fields {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   Box model (visitor toggle)
   ========================================================================== */

html[data-box="1"] {
    --box-gap: 16px;
}

html[data-box="1"] .left-sidebar {
    top: calc(var(--header-h) + var(--box-gap));
    left: var(--box-gap);
    bottom: var(--box-gap);
    border: 1px solid var(--line);
    border-right: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

html[data-box="1"] .main-shell {
    margin-left: calc(var(--left-w) + var(--box-gap) * 2);
    padding: calc(var(--header-h) + var(--box-gap)) var(--box-gap) var(--box-gap);
    gap: var(--box-gap);
}

html[data-box="1"] .site-footer {
    margin-left: calc(var(--left-w) + var(--box-gap) * 2);
}

html[data-box="1"] .right-sidebar {
    top: calc(var(--header-h) + var(--box-gap));
}

html[data-box="1"] .hero-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow);
    padding: 22px 26px;
}

html[data-box="1"] .post-card,
html[data-box="1"] .article-card,
html[data-box="1"] .comments-card,
html[data-box="1"] .widget,
html[data-box="1"] .archive-card,
html[data-box="1"] .notice-card {
    border-radius: 16px;
    box-shadow: var(--shadow);
}

@media (max-width: 1080px) {
    html[data-box="1"] .main-shell {
        margin-left: calc(var(--left-w) + var(--box-gap) * 2);
    }
}

@media (max-width: 860px) {
    html[data-box="1"] .left-sidebar {
        top: var(--header-h);
        left: 0;
        bottom: 0;
        border-radius: 0;
        border: 0;
        border-right: 1px solid var(--line);
    }

    html[data-box="1"] .main-shell,
    html[data-box="1"] .site-footer {
        margin-left: 0;
    }

    html[data-box="1"] .main-shell {
        padding: calc(var(--header-h) + 16px) 14px 24px;
    }
}

/* ==========================================================================
   Visitor look: accent, header, glass, cursor, click
   ========================================================================== */

html[data-accent="teal"] {
    --primary: #0f766e;
    --primary-2: #14b8a6;
    --primary-soft: rgba(15, 118, 110, 0.14);
    --accent-glow: rgba(20, 184, 166, 0.24);
    --accent-glow-2: rgba(45, 212, 191, 0.16);
}

html[data-accent="emerald"] {
    --primary: #15803d;
    --primary-2: #22c55e;
    --primary-soft: rgba(21, 128, 61, 0.14);
    --accent-glow: rgba(34, 197, 94, 0.22);
    --accent-glow-2: rgba(74, 222, 128, 0.16);
}

html[data-accent="amber"] {
    --primary: #b45309;
    --primary-2: #f59e0b;
    --primary-soft: rgba(180, 83, 9, 0.14);
    --accent-glow: rgba(245, 158, 11, 0.24);
    --accent-glow-2: rgba(251, 191, 36, 0.16);
}

html[data-accent="rose"] {
    --primary: #e11d48;
    --primary-2: #fb7185;
    --primary-soft: rgba(225, 29, 72, 0.14);
    --accent-glow: rgba(244, 63, 94, 0.22);
    --accent-glow-2: rgba(251, 113, 133, 0.16);
}

html[data-accent="violet"] {
    --primary: #7c3aed;
    --primary-2: #a855f7;
    --primary-soft: rgba(124, 58, 237, 0.14);
    --accent-glow: rgba(168, 85, 247, 0.24);
    --accent-glow-2: rgba(192, 132, 252, 0.16);
}

html[data-accent="sky"] {
    --primary: #0369a1;
    --primary-2: #0ea5e9;
    --primary-soft: rgba(3, 105, 161, 0.14);
    --accent-glow: rgba(14, 165, 233, 0.22);
    --accent-glow-2: rgba(56, 189, 248, 0.16);
}

html[data-theme="dark"][data-accent="teal"] {
    --primary: #5eead4;
    --primary-2: #2dd4bf;
    --primary-soft: rgba(45, 212, 191, 0.18);
}

html[data-theme="dark"][data-accent="emerald"] {
    --primary: #4ade80;
    --primary-2: #86efac;
    --primary-soft: rgba(74, 222, 128, 0.18);
}

html[data-theme="dark"][data-accent="amber"] {
    --primary: #fbbf24;
    --primary-2: #fcd34d;
    --primary-soft: rgba(251, 191, 36, 0.18);
}

html[data-theme="dark"][data-accent="rose"] {
    --primary: #fb7185;
    --primary-2: #fda4af;
    --primary-soft: rgba(251, 113, 133, 0.18);
}

html[data-theme="dark"][data-accent="violet"] {
    --primary: #c4b5fd;
    --primary-2: #ddd6fe;
    --primary-soft: rgba(196, 181, 253, 0.18);
}

html[data-theme="dark"][data-accent="sky"] {
    --primary: #38bdf8;
    --primary-2: #7dd3fc;
    --primary-soft: rgba(56, 189, 248, 0.18);
}

html[data-accent] body::before {
    background:
        radial-gradient(900px 500px at 15% -10%, var(--accent-glow), transparent 60%),
        radial-gradient(800px 500px at 95% 10%, var(--accent-glow-2), transparent 62%);
}

html[data-theme="dark"][data-accent] body::before,
html[data-theme="dark"][data-glass="1"] body::before {
    display: block;
    opacity: 0.5;
}

html[data-header="flow"] .site-header {
    position: absolute;
}

html[data-header="flow"] .right-sidebar {
    top: 18px;
}

html[data-header="flow"][data-box="1"] .right-sidebar {
    top: var(--box-gap);
}

html[data-glass="1"] .site-header {
    background: color-mix(in srgb, var(--header-bg) 58%, transparent);
    backdrop-filter: blur(22px) saturate(1.45);
}

html[data-glass="1"] .left-sidebar,
html[data-glass="1"] .post-card,
html[data-glass="1"] .article-card,
html[data-glass="1"] .comments-card,
html[data-glass="1"] .widget,
html[data-glass="1"] .archive-card,
html[data-glass="1"] .notice-card,
html[data-glass="1"] .stat-pane-card,
html[data-glass="1"] .look-card {
    background: color-mix(in srgb, var(--card) 72%, transparent);
    backdrop-filter: blur(18px) saturate(1.35);
}

html[data-glass="1"][data-box="1"] .hero-card {
    background: color-mix(in srgb, var(--card) 72%, transparent);
    backdrop-filter: blur(18px) saturate(1.35);
}

.look-pane {
    position: fixed;
    z-index: 70;
    top: calc(var(--header-h) + 8px);
    right: 16px;
    width: min(320px, calc(100vw - 24px));
}

.look-card {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    padding: 12px 14px 14px;
}

.look-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.look-card .icon-btn {
    color: var(--text);
}

.look-card .icon-btn:hover {
    background: var(--primary-soft);
}

.look-hint {
    margin: 0 0 4px;
    font-size: 12px;
    color: var(--muted);
}

.look-row,
.look-block {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    font-size: 13.5px;
}

.look-block {
    align-items: flex-start;
    flex-direction: column;
}

.look-swatches,
.look-seg {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.look-check {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--primary);
}

.swatch {
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.swatch[aria-pressed="true"] {
    box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary);
}

.look-seg button,
.look-reset {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--text-soft);
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
}

.look-seg button[aria-pressed="true"] {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.look-reset {
    width: 100%;
    margin-top: 8px;
    border-radius: 8px;
    padding: 6px 10px;
}

.look-reset:hover,
.look-seg button:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.look-seg button[aria-pressed="true"]:hover {
    color: #fff;
}

html[data-cursor="ring"] body,
html[data-cursor="ring"] a,
html[data-cursor="ring"] button {
    cursor: none;
}

html[data-cursor="dot"],
html[data-cursor="dot"] * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Ccircle cx='16' cy='16' r='9' fill='%23111827'/%3E%3Ccircle cx='16' cy='16' r='6' fill='%23ffffff'/%3E%3C/svg%3E") 16 16, auto;
}

html[data-cursor="cross"],
html[data-cursor="cross"] * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32'%3E%3Cpath d='M16 3v26M3 16h26' stroke='%23111827' stroke-width='6' stroke-linecap='round'/%3E%3Cpath d='M16 3v26M3 16h26' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E") 16 16, auto;
}

html[data-cursor="dot"] input,
html[data-cursor="dot"] textarea,
html[data-cursor="dot"] select,
html[data-cursor="ring"] input,
html[data-cursor="ring"] textarea,
html[data-cursor="ring"] select,
html[data-cursor="cross"] input,
html[data-cursor="cross"] textarea,
html[data-cursor="cross"] select {
    cursor: text;
}

.cursor-follower {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 90;
    pointer-events: none;
    border-radius: 50%;
    transform: translate(-40px, -40px);
}

.cursor-follower.is-ring {
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 2px solid var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.cursor-follower.is-hidden {
    opacity: 0;
}

.click-fx {
    position: fixed;
    z-index: 85;
    pointer-events: none;
}

.click-fx-ripple {
    width: 12px;
    height: 12px;
    margin: -6px 0 0 -6px;
    border-radius: 50%;
    border: 2px solid var(--primary);
    animation: click-ripple 0.55s ease-out forwards;
}

.click-fx-burst i {
    position: absolute;
    width: 6px;
    height: 6px;
    margin: -3px 0 0 -3px;
    border-radius: 50%;
    background: var(--primary);
    animation: click-burst 0.55s ease-out forwards;
}

.click-fx-heart::before {
    content: "♥";
    display: block;
    margin: -12px 0 0 -8px;
    color: var(--primary);
    font-size: 18px;
    line-height: 1;
    animation: click-heart 0.7s ease-out forwards;
}

@keyframes click-ripple {
    to {
        transform: scale(6);
        opacity: 0;
    }
}

@keyframes click-burst {
    to {
        transform: translate(var(--dx), var(--dy));
        opacity: 0;
    }
}

@keyframes click-heart {
    to {
        transform: translateY(-36px) scale(1.35);
        opacity: 0;
    }
}

@media (pointer: coarse) {
    html[data-cursor] body,
    html[data-cursor] a,
    html[data-cursor] button {
        cursor: auto;
    }

    .cursor-follower {
        display: none;
    }
}

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