/* ==========================================================================
   std::cpp — Light Technology Design System
   ========================================================================== */

:root {
    --bg: #f5f8ff;
    --bg-deep: #eef4ff;
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.74);
    --surface-soft: #f8faff;
    --ink: #081428;
    --ink-2: #1e293b;
    --text: #334155;
    --muted: #64748b;
    --muted-2: #94a3b8;
    --line: rgba(37, 99, 235, 0.12);
    --line-strong: rgba(37, 99, 235, 0.24);
    --blue: #2563eb;
    --blue-2: #3b82f6;
    --cyan: #06b6d4;
    --violet: #7c3aed;
    --teal: #0d9488;
    --danger: #ef4444;
    --success: #10b981;
    --grad: linear-gradient(120deg, #2563eb 0%, #06b6d4 52%, #7c3aed 100%);
    --grad-reverse: linear-gradient(120deg, #7c3aed 0%, #06b6d4 48%, #2563eb 100%);
    --grad-soft: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(6, 182, 212, 0.08) 55%, rgba(124, 58, 237, 0.1));
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-sm: 0 6px 18px -8px rgba(30, 64, 175, 0.16);
    --shadow-md: 0 22px 48px -22px rgba(37, 99, 235, 0.28);
    --shadow-lg: 0 44px 90px -36px rgba(30, 64, 175, 0.4);
    --radius: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --container: 1180px;
    --nav-h: 70px;
    --ease: cubic-bezier(0.22, 0.68, 0.24, 1);
    --mono: "Cascadia Code", "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
    --sans: "Inter", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
}

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

html {
    width: 100%;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 20px);
    background: var(--bg);
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    background: transparent;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
    background-size: 64px 64px;
    -webkit-mask-image: radial-gradient(ellipse 95% 70% at 50% 0%, #000 30%, transparent 100%);
    mask-image: radial-gradient(ellipse 95% 70% at 50% 0%, #000 30%, transparent 100%);
}

::selection {
    background: rgba(37, 99, 235, 0.2);
    color: var(--ink);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f0f4ff;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #bfdbfe, #a5b4fc);
    border: 2px solid #f0f4ff;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #93c5fd, #818cf8);
}

a {
    color: var(--blue);
    text-decoration: none;
    transition: color 0.2s ease;
}

img {
    max-width: 100%;
}

button,
input,
textarea {
    font-family: inherit;
}

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

.mono {
    font-family: var(--mono);
}

.text-grad {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   Ambient layers
   -------------------------------------------------------------------------- */

.cursor-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 520px;
    height: 520px;
    margin: -260px 0 0 -260px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, rgba(6, 182, 212, 0.05) 38%, transparent 68%);
    transition: opacity 0.5s ease;
    will-change: transform;
}

.cursor-glow.is-active {
    opacity: 1;
}

.site-nav,
main,
.site-footer {
    position: relative;
    z-index: 1;
}

/* --------------------------------------------------------------------------
   Brand + navigation
   -------------------------------------------------------------------------- */

.site-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(247, 250, 255, 0.72);
    border-bottom: 1px solid transparent;
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    backdrop-filter: blur(18px) saturate(160%);
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.site-nav.is-scrolled {
    background: rgba(255, 255, 255, 0.86);
    border-bottom-color: var(--line);
    box-shadow: 0 10px 30px -22px rgba(37, 99, 235, 0.35);
}

.nav-inner {
    width: calc(100% - 48px);
    height: 100%;
    margin-inline: auto;
    display: flex;
    align-items: center;
    gap: 36px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-family: var(--mono);
    font-weight: 700;
    font-size: 19px;
    letter-spacing: -0.03em;
    white-space: nowrap;
}

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

.brand-logo {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: 0 8px 18px -8px rgba(37, 99, 235, 0.75);
}

.brand-word span {
    color: var(--blue);
}

.brand-cursor {
    display: inline-block;
    width: 7px;
    height: 17px;
    margin-left: 1px;
    border-radius: 1px;
    background: var(--cyan);
    animation: caret-blink 1.1s steps(1) infinite;
}

@keyframes caret-blink {
    0%, 48% { opacity: 1; }
    49%, 100% { opacity: 0; }
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.nav-menu a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease, background 0.2s ease;
}

.nav-menu a::after {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 4px;
    height: 2px;
    border-radius: 2px;
    background: var(--grad);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s var(--ease);
}

.nav-menu a:hover {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.055);
}

.nav-menu a:hover::after,
.nav-menu a.active::after {
    transform: scaleX(1);
}

.nav-menu a.active {
    color: var(--blue);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-login {
    padding: 7px 10px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
}

.nav-bell {
    position: relative;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.8);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-bell:hover {
    color: var(--blue);
    border-color: rgba(37, 99, 235, 0.28);
}

.nav-bell svg {
    width: 17px;
    height: 17px;
}

.nav-bell-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    background: #ef4444;
    font-family: var(--mono);
    font-size: 8.5px;
    font-weight: 700;
    line-height: 13px;
    text-align: center;
}

.nav-login:hover {
    color: var(--blue);
}

.user-chip {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    height: 38px;
    padding: 4px 13px 4px 4px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: inherit;
    background: rgba(255, 255, 255, 0.8);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.user-chip:hover {
    border-color: rgba(37, 99, 235, 0.28);
    box-shadow: 0 8px 20px -14px rgba(37, 99, 235, 0.55);
}

.user-chip .avatar {
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: #fff;
    font-family: var(--mono);
    font-size: 12px;
    font-weight: 700;
    background: var(--grad);
    overflow: hidden;
}

.user-chip .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-chip .user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 12.5px;
    white-space: nowrap;
}

.nav-logout {
    color: var(--muted-2);
    font-size: 13px;
}

.nav-logout:hover {
    color: var(--danger);
}

.nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.nav-toggle span {
    display: block;
    width: 17px;
    height: 1.8px;
    margin: 4px auto;
    border-radius: 2px;
    background: var(--ink-2);
    transition: transform 0.3s var(--ease), opacity 0.3s ease;
}

body.nav-open .nav-toggle span:first-child {
    transform: translateY(5.8px) rotate(45deg);
}

body.nav-open .nav-toggle span:last-child {
    transform: translateY(-5.8px) rotate(-45deg);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 10px 21px;
    border: 1px solid transparent;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.01em;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.25s var(--ease), box-shadow 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.btn svg {
    width: 16px;
    height: 16px;
    flex: none;
    transition: transform 0.25s var(--ease);
}

.btn:hover svg {
    transform: translateX(2px);
}

.btn:active {
    transform: translateY(1px) scale(0.99);
}

.btn-sm {
    min-height: 38px;
    padding: 8px 15px;
    border-radius: 9px;
    font-size: 13px;
}

.btn-primary {
    color: #fff;
    background: var(--grad);
    background-size: 160% 160%;
    box-shadow: 0 12px 26px -12px rgba(37, 99, 235, 0.7);
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 28%, rgba(255, 255, 255, 0.38) 50%, transparent 72%);
    transform: translateX(-130%);
    transition: transform 0.65s var(--ease);
}

.btn-primary:hover {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 18px 34px -14px rgba(37, 99, 235, 0.8);
    background-position: 100% 50%;
}

.btn-primary:hover::after {
    transform: translateX(130%);
}

.btn-ghost {
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.78);
    border-color: var(--line);
    box-shadow: var(--shadow-xs);
}

.btn-ghost:hover {
    color: var(--blue);
    background: #fff;
    border-color: var(--line-strong);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.btn-outline-light {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
}

.btn-outline-light:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.btn-light {
    color: var(--ink);
    background: #fff;
    box-shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.5);
}

.btn-light:hover {
    color: var(--blue);
    transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Chips, tags, badges
   -------------------------------------------------------------------------- */

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--blue);
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.pulse-dot {
    position: relative;
    display: inline-block;
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 0 4px rgba(6, 182, 212, 0.12);
}

.pulse-dot::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(6, 182, 212, 0.5);
    animation: pulse-ring 2.2s ease-out infinite;
}

@keyframes pulse-ring {
    0% { transform: scale(0.6); opacity: 1; }
    100% { transform: scale(1.8); opacity: 0; }
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 11px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 999px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.055);
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 1.4;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tag:hover {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
    transform: translateY(-1px);
}

.tag-neutral {
    color: var(--muted);
    background: #f8fafc;
    border-color: #e2e8f0;
}

.tag-violet {
    color: var(--violet);
    background: rgba(124, 58, 237, 0.06);
    border-color: rgba(124, 58, 237, 0.16);
}

.tag-cyan {
    color: #0891b2;
    background: rgba(6, 182, 212, 0.07);
    border-color: rgba(6, 182, 212, 0.2);
}

/* --------------------------------------------------------------------------
   Shared section headings
   -------------------------------------------------------------------------- */

.section-head {
    max-width: 660px;
    margin: 0 auto 48px;
    text-align: center;
}

.section-head.left {
    margin: 0;
    text-align: left;
}

.section-head h2 {
    margin: 14px 0 12px;
    color: var(--ink);
    font-size: clamp(28px, 3.4vw, 42px);
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.section-head p {
    margin: 0;
    color: var(--muted);
    font-size: 15.5px;
    line-height: 1.8;
}

.section-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: none;
    padding-bottom: 4px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 12.5px;
}

.link-arrow svg {
    width: 14px;
    height: 14px;
    transition: transform 0.25s var(--ease);
}

.link-arrow:hover {
    color: var(--blue);
}

.link-arrow:hover svg {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.glass-card {
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md), inset 0 0 0 1px rgba(37, 99, 235, 0.035);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.side-card {
    position: relative;
    overflow: hidden;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: var(--shadow-sm);
}

.side-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -2px 0 16px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-head::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 2px;
    background: var(--grad);
    transform: rotate(45deg);
}

/* --------------------------------------------------------------------------
   Reveal + motion
   -------------------------------------------------------------------------- */

/* Only hide reveal targets when scripting is available; without JS the
   content renders immediately instead of staying invisible forever. */
@media (scripting: enabled) {
    [data-reveal] {
        opacity: 0;
        transform: translateY(26px);
        transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
        transition-delay: var(--reveal-delay, 0s);
        will-change: opacity, transform;
    }

    [data-reveal="left"] {
        transform: translateX(-30px);
    }

    [data-reveal="right"] {
        transform: translateX(30px);
    }

    [data-reveal="scale"] {
        transform: scale(0.94);
    }

    [data-reveal].is-visible {
        opacity: 1;
        transform: none;
        will-change: auto;
    }
}

@keyframes float-y {
    0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
    50% { transform: translateY(-14px) rotate(var(--rot, 0deg)); }
}

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

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

@keyframes shimmer {
    0% { background-position: -600px 0; }
    100% { background-position: 600px 0; }
}

.skeleton {
    border-radius: 7px;
    background: linear-gradient(90deg, #eef4ff 20%, #ffffff 40%, #eef4ff 60%);
    background-size: 600px 100%;
    animation: shimmer 1.6s linear infinite;
}

/* --------------------------------------------------------------------------
   Toast + back to top
   -------------------------------------------------------------------------- */

.toast-stack {
    position: fixed;
    left: 50%;
    top: calc(var(--nav-h) + 16px);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transform: translateX(-50%);
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(90vw, 460px);
    padding: 11px 18px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 18px 44px -18px rgba(15, 23, 42, 0.3);
    color: var(--ink-2);
    font-size: 13.5px;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    animation: toast-in 0.4s var(--ease) both;
}

.toast::before {
    content: "";
    width: 7px;
    height: 7px;
    flex: none;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.toast.success::before {
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.toast.error::before {
    background: var(--danger);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.toast.is-out {
    animation: toast-out 0.3s ease forwards;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateY(-14px) scale(0.96); }
    to { opacity: 1; transform: none; }
}

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

/* ------------------------------------------------------------------ confirm */

.confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(8, 20, 40, 0.45);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.confirm-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.confirm-dialog {
    width: 100%;
    max-width: 380px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 28px 60px -24px rgba(15, 23, 42, 0.35);
    transform: scale(0.96) translateY(10px);
    transition: transform 0.3s var(--ease);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
}

.confirm-overlay.is-active .confirm-dialog {
    transform: scale(1) translateY(0);
}

.confirm-body {
    padding: 28px;
    text-align: center;
}

.confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.06);
    color: var(--blue);
}

.confirm-icon svg {
    width: 24px;
    height: 24px;
}

.confirm-title {
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
}

.confirm-msg {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
}

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

.backtop {
    position: fixed;
    right: 26px;
    bottom: 26px;
    z-index: 80;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--ink-2);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s var(--ease);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.backtop.is-visible {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.backtop:hover {
    color: #fff;
    background: var(--blue);
    border-color: var(--blue);
}

/* --------------------------------------------------------------------------
   Admin sidebar layout
   -------------------------------------------------------------------------- */

body.page-admin,
body.page-admin-edit {
    --admin-sidebar-w: 228px;
}

.admin-layout {
    display: flex;
    min-height: calc(100vh - var(--nav-h));
}

.admin-sidebar {
    position: sticky;
    top: var(--nav-h);
    flex: 0 0 var(--admin-sidebar-w);
    width: var(--admin-sidebar-w);
    height: calc(100vh - var(--nav-h));
    padding: 18px 12px 6px;
    border-right: 1px solid var(--line);
    background: rgba(247, 250, 255, 0.7);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-side-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 16px;
    padding: 0 10px;
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.admin-side-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--line);
}

.admin-sidenav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 8px;
}

.admin-sidenav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease, background 0.2s ease;
    text-decoration: none;
}

.admin-sidenav a:hover {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.055);
}

.admin-sidenav a.active {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.085);
    font-weight: 600;
}

.admin-sidenav a svg {
    width: 17px;
    height: 17px;
    flex: none;
    opacity: 0.7;
}

.admin-sidenav a:hover svg,
.admin-sidenav a.active svg {
    opacity: 1;
}

.admin-sidenav .sidenav-label {
    flex: 1;
}

.admin-sidenav .sidenav-badge {
    padding: 1px 7px;
    border-radius: 999px;
    color: #fff;
    background: var(--grad);
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 600;
    line-height: 1.6;
}

/* ==================== 多级菜单 ==================== */

.admin-sidenav .menu-group {
    display: flex;
    flex-direction: column;
}

.admin-sidenav .menu-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 9px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease, background 0.2s ease;
    text-decoration: none;
    cursor: pointer;
}

.admin-sidenav .menu-toggle:hover {
    color: var(--blue);
    background: rgba(37, 99, 235, 0.055);
}

.admin-sidenav .menu-toggle svg {
    width: 17px;
    height: 17px;
    flex: none;
    opacity: 0.7;
}

.admin-sidenav .menu-toggle:hover svg {
    opacity: 1;
}

.admin-sidenav .menu-toggle .sidenav-chevron {
    width: 14px;
    height: 14px;
    margin-left: auto;
    opacity: 0.5;
    transition: transform 0.2s ease;
    flex: none;
}

.admin-sidenav .menu-group.expanded .menu-toggle .sidenav-chevron {
    transform: rotate(180deg);
}

.admin-sidenav .menu-children {
    display: none;
    padding-left: 12px;
    padding-top: 2px;
}

.admin-sidenav .menu-group.expanded .menu-children {
    display: block;
}

.admin-sidenav .menu-children a {
    padding-left: 39px;
    font-size: 13px;
}

.admin-sidenav .menu-children .menu-children a {
    padding-left: 54px;
}

.admin-side-foot {
    flex: none;
    padding: 16px 10px 0;
    border-top: 1px solid var(--line);
}

.admin-side-foot .user-mini {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-family: var(--mono);
    font-size: 11px;
}

.admin-side-foot .user-mini .avatar-sm {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    background: var(--grad);
}

.admin-main {
    flex: 1;
    min-width: 0;
    padding: 34px 36px 60px;
}

/* ===================================== responsive ===================================== */

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.admin-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 36px 28px 30px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: transform 0.3s var(--ease), box-shadow 0.3s ease, border-color 0.3s ease;
    overflow: hidden;
}

.admin-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: var(--shadow-md);
    border-color: rgba(37, 99, 235, 0.22);
}

.admin-card:active {
    transform: translateY(-1px) scale(0.99);
}

.admin-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--grad);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.admin-card:hover::before {
    opacity: 1;
}

.admin-card .icon-box {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 16px;
    border-radius: 15px;
    background: var(--grad-soft);
    color: var(--blue);
}

.admin-card .icon-box svg {
    width: 22px;
    height: 22px;
}

.admin-card h3 {
    margin: 0 0 6px;
    color: var(--ink-2);
    font-size: 16px;
    font-weight: 660;
}

.admin-card p {
    margin: 0 0 20px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.7;
}

.admin-card .btn {
    margin-top: auto;
}

.admin-term-bar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 18px;
    padding: 6px 12px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    border-radius: 8px;
    background: rgba(37, 99, 235, 0.04);
    color: var(--muted-2);
    font-family: var(--mono);
    font-size: 10px;
}

.admin-term-bar .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e2e8f0;
}

.admin-term-bar .dot:nth-child(1) { background: #f87171; }
.admin-term-bar .dot:nth-child(2) { background: #fbbf24; }
.admin-term-bar .dot:nth-child(3) { background: #34d399; }

@media (max-width: 900px) {
    .admin-sidebar {
        display: none;
    }

    .admin-main {
        padding: 24px 20px 50px;
    }

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

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    margin-top: 100px;
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
}

.footer-inner {
    width: min(var(--container), calc(100% - 48px));
    margin-inline: auto;
    padding: 54px 0 26px;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    padding-bottom: 38px;
}

.footer-brand .brand {
    font-size: 18px;
}

.footer-brand p {
    max-width: 380px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 13.5px;
    line-height: 1.8;
}

.footer-links {
    display: flex;
    gap: 64px;
}

.footer-links h4 {
    margin: 0 0 14px;
    color: var(--ink-2);
    font-family: var(--mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

.footer-links a,
.footer-links span {
    display: block;
    margin-bottom: 9px;
    color: var(--muted);
    font-size: 13px;
}

.footer-links a:hover {
    color: var(--blue);
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 22px;
    border-top: 1px solid rgba(37, 99, 235, 0.08);
    color: var(--muted-2);
    font-size: 12px;
}

.footer-bottom p {
    margin: 0;
}

.footer-bottom code {
    padding: 2px 7px;
    border-radius: 5px;
    color: var(--blue);
    background: rgba(37, 99, 235, 0.06);
    font-family: var(--mono);
    font-size: 11px;
}

.footer-build {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
}

.footer-build .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 960px) {
    .nav-inner {
        gap: 18px;
    }

    .nav-menu {
        gap: 0;
    }

    .nav-menu a {
        padding-inline: 9px;
        font-size: 13.5px;
    }

    .nav-menu a::after {
        left: 9px;
        right: 9px;
    }
}

@media (max-width: 820px) {
    :root {
        --nav-h: 64px;
    }

    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-h);
        left: 14px;
        right: 14px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        margin: 0;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.97);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.98);
        transition: all 0.25s var(--ease);
        -webkit-backdrop-filter: blur(20px);
        backdrop-filter: blur(20px);
    }

    body.nav-open .nav-menu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-menu a {
        padding: 12px 14px;
        font-size: 14.5px;
    }

    .nav-menu a::after {
        display: none;
    }

    .user-chip .user-name {
        display: none;
    }

    .footer-top {
        flex-direction: column;
        gap: 34px;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

@media (max-width: 560px) {
    .container,
    .nav-inner,
    .footer-inner {
        width: calc(100% - 32px);
    }

    .brand {
        font-size: 17px;
    }

    .brand-logo {
        width: 31px;
        height: 31px;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-login {
        display: none;
    }

    .user-chip {
        padding-right: 4px;
    }

    .footer-links {
        gap: 36px;
    }

    .backtop {
        right: 16px;
        bottom: 16px;
    }
}

/* ============================== Blocked Content ============================== */
.blocked-placeholder {
    margin-top: 6px;
    padding: 10px 13px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 9px;
    background: rgba(248, 250, 252, 0.7);
    color: var(--muted-2);
    font-size: 12px;
    line-height: 1.6;
}

.blocked-placeholder__text {
    margin: 0;
}

.blocked-placeholder__badge {
    display: inline-flex;
    align-items: center;
    margin-right: 7px;
    padding: 1px 7px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(148, 163, 184, 0.08);
    font-family: var(--mono);
    font-size: 9.5px;
    font-weight: 600;
    vertical-align: 1px;
}

.blocked-placeholder__reason {
    margin: 3px 0 0;
    color: var(--muted-2);
    font-size: 11px;
}

.blocked-placeholder--compact {
    padding-top: 8px;
    padding-bottom: 8px;
}

.comment-item.is-blocked .comment-avatar,
.post-item.is-blocked .post-avatar {
    filter: grayscale(0.7);
    opacity: 0.65;
}

.comment-item.is-blocked .comment-meta strong,
.post-item.is-blocked .post-header strong {
    color: var(--muted-2);
}

.me-item.is-blocked .blocked-placeholder {
    margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    /* 首页的动效属于核心视觉体验，不受系统“减少动态效果”影响；
       其余页面仍按用户偏好关闭动画，避免影响阅读与操作。 */
    body:not(.page-home) *,
    body:not(.page-home) *::before,
    body:not(.page-home) *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body:not(.page-home) [data-reveal] {
        opacity: 1;
        transform: none;
    }

    body:not(.page-home) .cursor-glow {
        display: none;
    }
}
