/* ═══════════════════════════════════════════
   斑斑的个人网站 — 共享设计系统
   纯黑白灰 · 零彩色 · 毛玻璃美学
   ═══════════════════════════════════════════ */

/* ── 字体 ──────────────────────────────────── */
@font-face {
    font-family: 'Adrenocromo';
    src: url('../fonts/Adrenocromo.otf');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ── CSS 变量 ──────────────────────────────── */
:root {
    --bg-deepest:    #050505;
    --bg-dark:       #0a0a0a;
    --bg-panel:      #0f0f0f;
    --bg-card:       rgba(18, 18, 18, 0.55);
    --bg-card-hover: rgba(22, 22, 22, 0.70);
    --bg-input:      rgba(255, 255, 255, 0.04);

    --text-primary:   rgba(255, 255, 255, 0.88);
    --text-secondary: rgba(255, 255, 255, 0.55);
    --text-muted:     rgba(255, 255, 255, 0.30);
    --text-inverse:   #0a0a0a;

    --border-subtle:  rgba(255, 255, 255, 0.06);
    --border-card:    rgba(255, 255, 255, 0.10);
    --border-hover:   rgba(255, 255, 255, 0.20);
    --border-active:  rgba(255, 255, 255, 0.60);

    --glass-blur:     16px;
    --shadow-card:    0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-glow:    0 0 30px rgba(255, 255, 255, 0.04);

    /* ── 液态玻璃材质（Liquid Glass）──
       原则：只用于导航/控件/卡片，内容保持清晰可读；
       降低透明度偏好下由文末兜底规则退化为不透明 */
    --lg-bg:          rgba(255, 255, 255, 0.055);   /* 玻璃底色：轻微提亮的半透明 */
    --lg-bg-hover:    rgba(255, 255, 255, 0.10);
    --lg-bg-panel:    rgba(24, 24, 24, 0.55);       /* 大面板：略深保证可读 */
    --lg-border:      rgba(255, 255, 255, 0.14);    /* 玻璃边缘 */
    --lg-blur:        blur(22px) saturate(160%);    /* 折射感：模糊 + 提饱和 */
    --lg-blur-sm:     blur(14px) saturate(150%);    /* 小控件用轻一档 */

    /* ── 圆角（Apple 风格：连续圆角感，弧度随控件尺寸递进）── */
    --radius-xs:   8px;    /* 小标签 / chip */
    --radius-sm:   10px;   /* 按钮 / 输入框 / 导航项 */
    --radius-md:   16px;   /* 卡片 */
    --radius-lg:   20px;   /* 大面板 / modal */
    --radius-pill: 999px;  /* 胶囊按钮 */
    /* 玻璃棱线：顶部一道高光 + 底部微弱反光 */
    --lg-edge:        inset 0 1px 0 rgba(255, 255, 255, 0.14),
                      inset 0 -1px 0 rgba(255, 255, 255, 0.04);
    --lg-shadow:      0 8px 32px rgba(0, 0, 0, 0.35);

    --sidebar-w:      120px;
    --sidebar-w-expanded: 380px;
    --transition-fast: 0.2s ease;
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --ease-out-expo:  cubic-bezier(0.16, 1, 0.3, 1);

    /* 页面内容顶部起始节奏（各内容页统一引用） */
    --page-top:        30vh;
    --page-top-mobile: 22vh;
}

/* ── Reset ──────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: #0a0a0a;
}

body {
    /* 平底页面加两束极淡的环境光，让液态玻璃有物可透（diary/guestbook 有各自背景图，不受影响） */
    background:
        radial-gradient(1000px 600px at 15% -10%, rgba(255, 255, 255, 0.05), transparent 60%),
        radial-gradient(800px 500px at 90% 110%, rgba(255, 255, 255, 0.035), transparent 60%),
        var(--bg-dark);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Courier New', 'SimHei', 'PingFang SC', 'Microsoft YaHei', monospace;
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ── 排版 ──────────────────────────────────── */
h1, h2, h3, h4 {
    font-weight: 900;
    letter-spacing: 0.08em;
    color: var(--text-primary);
}

a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
}
a:hover { color: var(--text-primary); }

p { color: var(--text-secondary); line-height: 1.8; }

/* ── 通用卡片（液态玻璃）─────────────────── */
.card {
    position: relative;
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--radius-md);
    box-shadow: var(--lg-shadow), var(--lg-edge);
    transition: transform var(--transition-smooth),
                background var(--transition-smooth),
                border-color var(--transition-smooth),
                box-shadow var(--transition-smooth);
}
/* 扫光层：background-position 移动，无需 overflow:hidden */
.card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(105deg,
        transparent 42%,
        rgba(255, 255, 255, 0.055) 50%,
        transparent 58%);
    background-size: 260% 100%;
    background-position: 130% 0;
    pointer-events: none;
    transition: background-position 0.9s var(--ease-out-expo);
}
.card:hover {
    transform: translateY(-4px);
    background: var(--lg-bg-hover);
    border-color: var(--border-hover);
    box-shadow: var(--lg-shadow), var(--shadow-glow), var(--lg-edge);
}
.card:hover::after {
    background-position: -30% 0;
}

/* ── 通用按钮 ──────────────────────────────── */
.btn {
    display: inline-block;
    position: relative;
    padding: 10px 24px;
    font-family: 'SimHei', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    font-size: 13px;
    font-weight: bold;
    letter-spacing: 0.12em;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur-sm);
    -webkit-backdrop-filter: var(--lg-blur-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transition: all var(--transition-smooth);
    outline: none;
    user-select: none;
    overflow: hidden;
}
/* 斜向扫光 */
.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        transparent 40%,
        rgba(255, 255, 255, 0.14) 50%,
        transparent 60%);
    background-size: 280% 100%;
    background-position: 140% 0;
    pointer-events: none;
    transition: background-position 0.7s var(--ease-out-expo);
}
.btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.35);
}
.btn:hover::before { background-position: -40% 0; }
.btn:active { transform: scale(0.97); }

.btn--primary {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-inverse);
    border-color: transparent;
}
.btn--primary:hover {
    background: rgba(255, 255, 255, 1);
    color: #000;
}

.btn--sm { padding: 6px 14px; font-size: 11px; letter-spacing: 0.08em; }

/* ── 通用输入框 ────────────────────────────── */
input[type="text"],
input[type="url"],
input[type="search"],
textarea {
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur-sm);
    -webkit-backdrop-filter: var(--lg-blur-sm);
    border: 1px solid var(--lg-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'SimSun', 'Songti SC', Georgia, serif;
    font-size: 15px;
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast);
    width: 100%;
}
input::placeholder, textarea::placeholder {
    color: var(--text-muted);
}
input:focus, textarea:focus {
    border-color: rgba(255, 255, 255, 0.30);
}

/* ── 通用 Modal ────────────────────────────── */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-overlay--open {
    opacity: 1;
    pointer-events: auto;
}
.modal-panel {
    background: var(--lg-bg-panel);
    backdrop-filter: var(--lg-blur);
    -webkit-backdrop-filter: var(--lg-blur);
    border: 1px solid var(--lg-border);
    border-radius: var(--radius-lg);
    padding: 28px;
    max-width: 520px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), var(--lg-edge);
}
.modal-panel h3 {
    font-size: 16px;
    margin-bottom: 20px;
    letter-spacing: 0.1em;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

/* ── 标签 ──────────────────────────────────── */
.tag {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    letter-spacing: 0.06em;
    border: 1px solid var(--lg-border);
    border-radius: var(--radius-xs);
    color: var(--text-secondary);
    background: var(--lg-bg);
    backdrop-filter: var(--lg-blur-sm);
    -webkit-backdrop-filter: var(--lg-blur-sm);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    cursor: pointer;
    user-select: none;
    transition: all var(--transition-fast);
}
.tag:hover { background: var(--lg-bg-hover); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.tag--active {
    background: rgba(255, 255, 255, 0.88);
    color: var(--text-inverse);
    border-color: transparent;
}

/* ═══════════════════════════════════════════
   侧边栏
   ═══════════════════════════════════════════ */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: rgba(20, 20, 20, 0.70);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-right: 1px solid rgba(255, 255, 255, 0.04);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 0 16px;
    transition: width var(--transition-smooth);
    overflow: hidden;
    contain: layout style paint;
    will-change: transform;
}
/* 侧边栏 hover 不再变宽 */

/* 品牌标记（Logo 图片） */
.sidebar__brand {
    margin-bottom: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    transition: opacity 0.3s;
}
.sidebar__logo {
    width: 100%;
    max-width: 90px;
    height: auto;
    display: block;
    opacity: 0.75;
    transition: opacity 0.3s;
}
.sidebar:hover .sidebar__logo {
    opacity: 0.90;
}

/* 导航列表 */
.sidebar__nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    width: 100%;
    padding: 0 10px;
}

.sidebar__item {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    position: relative;
    color: var(--text-muted);
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}
.sidebar__item:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

/* 激活态 — 左侧白色竖线 */
.sidebar__item--active {
    color: var(--text-primary);
}
.sidebar__item--active::before {
    content: '';
    position: absolute;
    left: -10px; top: 8px; bottom: 8px;
    width: 2px;
    background: rgba(255, 255, 255, 0.60);
    border-radius: 1px;
}

/* 图标 */
.sidebar__icon {
    width: 20px;
    text-align: center;
    font-size: 15px;
    flex-shrink: 0;
    transition: transform var(--transition-fast);
}
.sidebar__item:hover .sidebar__icon {
    transform: scale(1.15) rotate(-6deg);
}

/* 文字（默认隐藏，展开显示） */
.sidebar__label {
    margin-left: 14px;
    font-size: 12px;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.15s ease 0.1s;
}
.sidebar:hover .sidebar__label { opacity: 1; }

/* 底部 — 更多切换按钮 */
.sidebar__bottom {
    flex-shrink: 0;
    width: 100%;
    padding: 0 12px;
    margin-bottom: 16px;
}

.sidebar__toggle {
    display: flex;
    align-items: center;
    height: 44px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    transition: color var(--transition-fast), background var(--transition-fast);
    white-space: nowrap;
}
.sidebar__toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.04);
}

/* 当次要导航有激活项时，toggle 图标微微亮起 */
.sidebar__toggle--has-active {
    color: rgba(255, 255, 255, 0.50);
}

/* ── 双线图标：等号 → X ── */
.toggle-icon {
    width: 90px;
    height: 28px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.toggle-icon__bar {
    display: block;
    width: 100%;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* hover → 双线交叉成 X */
.sidebar__toggle:hover .toggle-icon__bar:first-child {
transform: translateY(13px) rotate(45deg);
}
.sidebar__toggle:hover .toggle-icon__bar:last-child {
transform: translateY(-13px) rotate(-45deg);
}

.sidebar__toggle-label {
    margin-left: 14px;
    font-size: 12px;
    letter-spacing: 0.1em;
    opacity: 0;
    transition: opacity 0.15s ease 0.1s;
}
.sidebar:hover .sidebar__toggle-label { opacity: 1; }

/* ═══════════════════════════════════════════
   毛玻璃弹出面板（次要导航）
   左对齐 · 大字 · 纯文字
   ═══════════════════════════════════════════ */
.subnav-overlay {
    position: fixed;
    top: 0; left: var(--sidebar-w);
    width: calc(100% - var(--sidebar-w)); height: 100%;
    background: rgba(0, 0, 0, 0.50);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    z-index: 10040;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.subnav-overlay--open {
    opacity: 1;
    pointer-events: auto;
}

.subnav-panel {
    position: absolute;
    top: 0; left: var(--sidebar-w);
    height: 100%;
    width: 520px;
    padding: 60px 24px 40px;
    display: flex;
    flex-direction: column;
    animation: fadeInPanel 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
@keyframes fadeInPanel {
    from { opacity: 0; transform: translateX(-20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.subnav-panel__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 19px;
    margin-top: 24px;
    flex: 1;
}

/* ── 面板内的导航项：大字纯文字 ── */
.subnav-item {
    display: inline-flex;
    align-items: flex-start;
    padding: 10px 0;
    cursor: pointer;
    user-select: none;
    color: rgba(255,255,255,0.80);
    transition: color 0.25s, transform 0.25s;
    position: relative;
}
.subnav-item:hover {
    color: #fff;
    transform: translateX(6px);
}
.subnav-item--locked {
    color: rgba(255,255,255,0.20) !important;
    cursor: default;
}
.subnav-item--locked:hover {
    color: rgba(255,255,255,0.25) !important;
    transform: none;
}

.subnav-item__wrap {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 10px;
    line-height: 1;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.subnav-item__text {
    white-space: nowrap;
    font-family: 'Adrenocromo', 'SimHei', 'PingFang SC', 'Microsoft YaHei', sans-serif !important;
    font-size: 52px;
    font-weight: 700;
    letter-spacing: 0.12em;
}

.subnav-item__sub {
    font-family: 'Courier New', 'SimHei', 'PingFang SC', sans-serif;
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.48em;
    color: inherit;
    opacity: 0.55;
    margin-top: 2px;
}

/* hover → 白色半透明填充条从左到右 */
.subnav-item__wrap {
    position: relative;
}
.subnav-item__wrap::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0;
    height: 18px;
    background: rgba(255, 255, 255, 0.18);
    transition: width 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
.subnav-item:hover .subnav-item__wrap::after {
    width: 100%;
}

/* 激活态 — 左侧白色短线 */
.subnav-item--active {
    color: #fff;
}
.subnav-item--active::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, 0.60);
    margin-right: 16px;
    flex-shrink: 0;
}

.subnav-item__text {
    white-space: nowrap;
    font-family: inherit;
}

/* ── 移动端 ── */
@media (max-width: 768px) {
    .subnav-overlay {
        left: 0;
        width: 100%;
    }
    .subnav-panel {
        left: 0;
        width: 100%;
        padding: 40px 28px;
    }
    .subnav-item {
        font-size: 34px;
    }
}


/* ── 页面内容区（侧边栏右侧） ── */
.page-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
}

/* ── SPA 过渡：双容器交叉淡入淡出 ── */
.content-stage {
    position: relative;
    margin-left: var(--sidebar-w);
    min-height: 100vh;
}
.content-stage .page-content {
    margin-left: 0;  /* wrapper 已处理侧边栏偏移 */
}
.page-content.is-leaving {
    position: absolute !important;
    top: 0; left: 0;
    width: 100%;
    opacity: 1;
    z-index: 1;
    pointer-events: none;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-content.is-entering {
    position: absolute !important;
    top: 0; left: 0;
    width: 100%;
    opacity: 0;
    z-index: 2;
    background: #0a0a0a;
    transition: opacity 2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* 旧版叠加层样式（保留兼容，不再使用） */
.page-content--transition {
    position: fixed;
    top: 60px;                /* 不覆盖顶部横栏 */
    left: var(--sidebar-w);   /* 不覆盖侧边栏 */
    right: 0;
    bottom: 0;
    z-index: 5;               /* 低于 top-bar(500) 和 sidebar(1000) */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.page-content--transition.page-content--visible {
    opacity: 1;
}

/* ── 顶部横栏：页标题 + 横行导航 ── */
.top-bar {
    position: fixed;
    top: 0;
    left: var(--sidebar-w);
    right: 0;
    height: 60px;
    z-index: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
    background: rgba(10,10,10,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

/* ── 页标题（缩小50%） ── */
.page-title__wrap {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 6px;
    line-height: 1;
    flex-wrap: nowrap;
    white-space: nowrap;
    flex-shrink: 0;
}
.page-title__main {
    font-family: 'Adrenocromo', 'SimHei', 'PingFang SC', sans-serif !important;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 0 10px rgba(255,255,255,0.12);
}
.page-title__sub {
    font-family: 'Courier New', 'SimHei', 'PingFang SC', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.48em;
    color: rgba(255,255,255,0.55);
    opacity: 0.55;
}

/* ── 横行导航 ── */
.top-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-shrink: 0;
}
.top-nav a {
    font-family: 'Courier New', 'SimHei', 'PingFang SC', monospace;
    font-size: 11px;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    transition: color 0.25s;
    white-space: nowrap;
    position: relative;
    padding-bottom: 3px;
}
/* 下划线生长 */
.top-nav a::after {
    content: '';
    position: absolute;
    left: 0; bottom: 0;
    width: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.55);
    transition: width 0.35s var(--ease-out-expo);
    pointer-events: none;
}
.top-nav a:hover::after,
.top-nav a.top-nav--active::after {
    width: 100%;
}
.top-nav a:hover {
    color: rgba(255,255,255,0.90);
}
.top-nav a.top-nav--active {
    color: rgba(255,255,255,0.90);
}
.top-nav a.top-nav--locked {
    color: rgba(255,255,255,0.20);
    pointer-events: none;
}
.top-nav a.top-nav--locked:hover {
    color: rgba(255,255,255,0.25);
}
.top-nav a.top-nav--shake {
    animation: lockShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

/* ── 移动端 ── */
@media (max-width: 768px) {
    .top-bar {
        left: 0;
        padding: 0 14px;
        height: 48px;
    }
    .page-title__main { font-size: 20px; }
    .page-title__sub  { font-size: 7px; }
    .top-nav { gap: 14px; }
    .top-nav a { font-size: 10px; }
}

/* ═══════════════════════════════════════════
   加载条
   ═══════════════════════════════════════════ */
.loading-bar {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 10000;
    width: 0;
    transition: width 1.2s cubic-bezier(0.1, 0.8, 0.2, 1);
    pointer-events: none;
}
.loading-bar--done {
    width: 100%;
    opacity: 0;
    transition: width 0.3s ease, opacity 0.4s ease 0.3s;
}

/* ── 访客锁图标 ────────────────────────────── */
.subnav-lock {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
    color: rgba(255, 255, 255, 0.30);
    transition: color 0.3s;
    flex-shrink: 0;
}
.subnav-item:hover .subnav-lock {
    color: rgba(255, 255, 255, 0.55);
}

/* 锁定项悬停：文字保持灰色 */
.subnav-item--locked:hover .subnav-item__wrap {
    color: rgba(255, 255, 255, 0.45);
}

/* 锁颤动动画 */
.subnav-lock--shake {
    animation: lockShake 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}
@keyframes lockShake {
    0%, 100% { transform: translateX(0); }
    10%  { transform: translateX(-4px); }
    20%  { transform: translateX(4px); }
    30%  { transform: translateX(-3px); }
    40%  { transform: translateX(3px); }
    50%  { transform: translateX(-2px); }
    60%  { transform: translateX(2px); }
    70%  { transform: translateX(-1px); }
    80%  { transform: translateX(1px); }
    90%  { transform: translateX(0); }
}

/* ═══════════════════════════════════════════
   动画 @keyframes
   ═══════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes fadeInPage {
    to { opacity: 1; }
}
@keyframes whiteFlash {
    0%   { opacity: 0; }
    40%  { opacity: 0.08; }
    100% { opacity: 0; }
}

/* ── 内容入场动画 ── */
.animate-in {
    opacity: 0;
    animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ═══════════════════════════════════════════
   滚动入场（reveal）— 由 transitions.js 驱动
   ═══════════════════════════════════════════ */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.8s var(--ease-out-expo),
                transform 0.8s var(--ease-out-expo);
    transition-delay: var(--reveal-delay, 0s);
    will-change: opacity, transform;
}
.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}
/* 变体：左滑入 / 缩放浮现 */
.reveal--left  { transform: translateX(-24px); }
.reveal--scale { transform: scale(0.94); }
.reveal--left.reveal--visible,
.reveal--scale.reveal--visible { transform: none; }

/* ═══════════════════════════════════════════
   全局细节打磨
   ═══════════════════════════════════════════ */
/* 选区 */
::selection {
    background: rgba(255, 255, 255, 0.85);
    color: #0a0a0a;
}

/* 细暗色滚动条 */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    transition: background 0.25s;
}
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
html { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.12) transparent; }

/* 键盘焦点态 */
:focus-visible {
    outline: 1px solid rgba(255, 255, 255, 0.55);
    outline-offset: 2px;
    border-radius: 2px;
}

/* 图片加载淡入（配合 JS 控制 opacity 时平滑过渡） */
img { transition: opacity 0.6s ease; }

/* ═══════════════════════════════════════════
   液态玻璃降级兜底
   不支持 backdrop-filter，或用户开启"降低透明度"时，
   玻璃材质退化为不透明深色，保证可读性
   ═══════════════════════════════════════════ */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .card, .btn, .tag, .modal-panel, .lightbox__content,
    .input-section, .search-section, .diary-card,
    .bubble--ai, .bubble--user,
    input[type="text"], input[type="url"], input[type="search"], textarea, select {
        background: rgba(22, 22, 22, 0.97);
    }
}
@media (prefers-reduced-transparency: reduce) {
    .card, .btn, .tag, .modal-panel, .lightbox__content,
    .input-section, .search-section, .diary-card,
    .bubble--ai, .bubble--user,
    input[type="text"], input[type="url"], input[type="search"], textarea, select {
        background: rgba(22, 22, 22, 0.97);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

/* ═══════════════════════════════════════════
   减弱动态偏好 — 关停动画与过渡
   ═══════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════
   响应式 — 移动端
   ═══════════════════════════════════════════ */
@media (max-width: 768px) {
    .sidebar {
        top: auto; bottom: 0; left: 0;
        width: 100%; height: 56px;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        padding: 0 8px;
        border-right: none;
        border-top: 1px solid rgba(255, 255, 255, 0.04);
    }
    .sidebar:hover { width: 100%; }

    .sidebar__brand { display: none; }
    .sidebar__toggle { flex-direction: column; height: auto; padding: 4px 8px; gap: 2px; min-width: 44px; justify-content: center; }
    .sidebar__bottom { padding: 0 4px; margin-bottom: 0; }
    .sidebar__toggle-label { margin-left: 0; font-size: 9px; opacity: 1; }
    .sidebar:hover .sidebar__toggle-label { opacity: 1; }

    .sidebar__nav {
        flex-direction: row;
        gap: 2px;
        padding: 0;
        justify-content: center;
        width: auto;
    }
    .sidebar__item {
        flex-direction: column;
        height: auto;
        padding: 4px 8px;
        gap: 2px;
        min-width: 44px;
        justify-content: center;
    }
    .sidebar__item--active::before {
        left: 4px; right: 4px; top: auto; bottom: 0;
        width: auto; height: 2px;
    }
    .sidebar__label {
        margin-left: 0;
        font-size: 9px;
        opacity: 1;
    }
    /* 侧边栏不展开，文字始终可见 */
    .sidebar:hover .sidebar__label { opacity: 1; }

    .page-content {
        margin-left: 0;
        margin-bottom: 60px;
        padding: 0 16px;
    }
}
