/* ============================================
   博客前端样式 - 玻璃拟态 + 英雄区动画
   ============================================ */

:root {
    /* 主题色 */
    --accent: #6ee7b7;
    --accent-2: #60a5fa;
    --accent-rgb: 110, 231, 183;

    /* 文本 */
    --text: #1a202c;
    --text-soft: #4a5568;
    --text-muted: #718096;
    --text-on-dark: #f7fafc;

    /* 背景层 */
    --bg: #f7fafc;
    --bg-alt: #edf2f7;
    --surface: rgba(255, 255, 255, 0.7);
    --surface-solid: #ffffff;
    --surface-border: rgba(0, 0, 0, 0.06);

    /* 阴影 */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px rgba(0, 0, 0, 0.12);

    /* 圆角 */
    --radius: 12px;
    --radius-lg: 20px;
    --radius-pill: 999px;

    /* 过渡 */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* 暗色模式（默认英雄区为暗色） */
body.has-dark-bg {
    --text: #e8edf5;
    --text-soft: #b8c2d6;
    --text-muted: #8b95a8;
    --bg: #0f1419;
    --bg-alt: #161c28;
    --surface: rgba(26, 32, 48, 0.7);
    --surface-solid: #1a2030;
    --surface-border: rgba(255, 255, 255, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    font-size: 15px;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color .5s var(--ease), color .5s var(--ease);
}

/* 站点背景图层（管理员可定义） */
.site-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}
.site-bg-overlay {
    position: fixed;
    inset: 0;
    z-index: -1;
    background: rgba(247, 250, 252, 0.6);
    backdrop-filter: blur(2px);
    transition: background .5s var(--ease);
}
body.has-dark-bg .site-bg-overlay {
    background: rgba(15, 20, 25, 0.55);
}

a { color: inherit; text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent); }

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

/* ============== 英雄区 ============== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transform: scale(1.05);
    transition: transform .8s var(--ease-out);
    will-change: transform;
}

/* 背景下方渐变成透明 */
.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.25) 0%,
        rgba(0, 0, 0, 0.15) 40%,
        rgba(0, 0, 0, 0.05) 60%,
        transparent 100%
    );
}

/* 与下方内容接壤的渐变 */
.hero__fade {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 200px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--bg) 100%
    );
    pointer-events: none;
    z-index: 2;
    transition: background .5s var(--ease);
}

.hero__content {
    text-align: center;
    color: #fff;
    z-index: 3;
    padding: 0 20px;
    animation: heroFadeIn 1.2s var(--ease-out) both;
}

@keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero__avatar {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    margin: 0 auto 24px;
    border: 4px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3), 0 0 0 8px rgba(255, 255, 255, 0.08);
    background-size: cover;
    background-position: center;
    transition: transform .4s var(--ease-bounce), width .6s var(--ease), height .6s var(--ease), border-width .4s, margin .6s var(--ease);
    will-change: transform, width, height;
}
.hero__avatar:hover { transform: scale(1.05) rotate(2deg); }

.hero__name {
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 12px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.hero__tagline {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    font-weight: 300;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero__scroll {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    animation: scrollBounce 2s infinite;
    z-index: 3;
}
.hero__scroll::after {
    content: '';
    display: block;
    width: 1px;
    height: 40px;
    margin: 12px auto 0;
    background: linear-gradient(to bottom, currentColor, transparent);
}
@keyframes scrollBounce {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.8; }
    50% { transform: translateX(-50%) translateY(8px); opacity: 1; }
}

/* ============== 导航栏 ============== */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    /* 初始透明 */
    background: transparent;
    backdrop-filter: blur(0);
    transition: background .5s var(--ease), backdrop-filter .5s var(--ease), padding .4s var(--ease), box-shadow .4s var(--ease);
    transform: translateY(-100%);
    opacity: 0;
}

/* 滚动后显现 */
.navbar.is-visible {
    transform: translateY(0);
    opacity: 1;
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid var(--surface-border);
    box-shadow: var(--shadow-sm);
    padding: 12px 28px;
}

.navbar__left { display: flex; align-items: center; gap: 16px; }

/* 汉堡菜单 */
.hamburger {
    width: 42px;
    height: 42px;
    border: 1px solid var(--surface-border);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: all .3s var(--ease);
}
body.has-dark-bg .hamburger { background: rgba(26, 32, 48, 0.5); }
.hamburger:hover { background: rgba(255, 255, 255, 0.8); transform: scale(1.05); }
body.has-dark-bg .hamburger:hover { background: rgba(26, 32, 48, 0.8); }
.hamburger__line {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--text);
    position: relative;
    transition: all .3s var(--ease);
}
.hamburger__line::before,
.hamburger__line::after {
    content: '';
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--text);
    transition: all .3s var(--ease);
}
.hamburger__line::before { top: -6px; }
.hamburger__line::after { top: 6px; }
.hamburger.is-open .hamburger__line { background: transparent; }
.hamburger.is-open .hamburger__line::before { top: 0; transform: rotate(45deg); }
.hamburger.is-open .hamburger__line::after { top: 0; transform: rotate(-45deg); }

/* 导航中间菜单 */
.navbar__menu {
    display: flex;
    gap: 4px;
    list-style: none;
}
.navbar__menu a {
    display: block;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    transition: all .2s var(--ease);
}
.navbar__menu a:hover,
.navbar__menu a.is-active {
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
}

.navbar__right { display: flex; align-items: center; gap: 14px; }

/* 导航栏右侧的用户区域（从英雄区动画过来） */
.navbar__user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 5px 16px 5px 5px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all .3s var(--ease);
    text-decoration: none;
    color: var(--text);
}
body.has-dark-bg .navbar__user { background: rgba(26, 32, 48, 0.4); }
.navbar__user:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}
body.has-dark-bg .navbar__user:hover { background: rgba(26, 32, 48, 0.8); }

.navbar__user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.navbar__user-name {
    font-size: 14px;
    font-weight: 600;
    max-width: 140px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 英雄区初始时用户区域是隐藏的（因为英雄区中心已经有头像了） */
.hero-active .navbar__user { opacity: 0; pointer-events: none; }

/* ============== 侧滑菜单 ============== */
.drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: min(320px, 80vw);
    height: 100vh;
    background: var(--surface);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-right: 1px solid var(--surface-border);
    transform: translateX(-100%);
    transition: transform .4s var(--ease-out);
    z-index: 200;
    overflow-y: auto;
    padding: 80px 24px 32px;
}
.drawer.is-open { transform: translateX(0); box-shadow: var(--shadow-lg); }

.drawer__close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px; height: 36px;
    border: 1px solid var(--surface-border);
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    color: var(--text);
    font-size: 18px;
    display: grid; place-items: center;
    transition: all .2s var(--ease);
}
.drawer__close:hover { background: var(--surface-border); }

.drawer__brand {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--surface-border);
}

.drawer__menu { list-style: none; }
.drawer__menu li { margin-bottom: 4px; }
.drawer__menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 500;
    transition: all .2s var(--ease);
}
.drawer__menu a:hover { background: rgba(var(--accent-rgb), 0.1); color: var(--accent); }
.drawer__menu a.is-active { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.drawer__menu .ico { width: 20px; text-align: center; }

.drawer__section { margin-top: 28px; }
.drawer__section-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
    padding: 0 16px;
}

.drawer__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s var(--ease);
}
.drawer__overlay.is-open { opacity: 1; pointer-events: auto; }

/* ============== 容器与布局 ============== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}
.container-narrow { max-width: 800px; }
.container-wide { max-width: 1400px; }

.section { padding: 80px 0; }
.section-sm { padding: 40px 0; }

.section-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}
.section-subtitle {
    color: var(--text-muted);
    margin-bottom: 40px;
}

/* ============== 玻璃面板 ============== */
.glass {
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

/* ============== 文章卡片 ============== */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.article-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all .4s var(--ease-out);
    display: flex;
    flex-direction: column;
}
.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(var(--accent-rgb), 0.3);
}

.article-card__cover {
    aspect-ratio: 16/9;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-alt);
    position: relative;
    overflow: hidden;
}
.article-card__cover::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.2), transparent);
}
.article-card__cover-placeholder {
    width: 100%; height: 100%;
    display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(96, 165, 250, 0.1));
    color: var(--accent);
    font-size: 36px;
    font-weight: 700;
}

.article-card__body { padding: 22px; flex: 1; display: flex; flex-direction: column; }

.article-card__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.article-card__cat {
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 600;
    font-size: 11px;
}
.article-card__top-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 11px;
}

.article-card__title {
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}
.article-card__title a:hover { color: var(--accent); }

.article-card__excerpt {
    color: var(--text-soft);
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid var(--surface-border);
    font-size: 12px;
    color: var(--text-muted);
}

.article-card__author { display: flex; align-items: center; gap: 8px; }
.article-card__author-avatar {
    width: 24px; height: 24px;
    border-radius: 50%;
    background-size: cover;
}
.article-card__stats { display: flex; gap: 12px; }
.article-card__stat { display: flex; align-items: center; gap: 4px; }

/* ============== 文章详情 ============== */
.article-detail { padding: 60px 0 80px; }
.article-detail__header { text-align: center; margin-bottom: 40px; }
.article-detail__title {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 18px;
}
.article-detail__meta {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
}
.article-detail__meta .dot { color: var(--surface-border); }
.article-detail__cover {
    margin: 32px 0 40px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 21/9;
    background-size: cover;
    background-position: center;
    box-shadow: var(--shadow-lg);
}

.article-content {
    font-size: 16px;
    line-height: 1.85;
    color: var(--text);
}
.article-content h1, .article-content h2, .article-content h3,
.article-content h4, .article-content h5, .article-content h6 {
    margin: 1.6em 0 0.6em;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
    scroll-margin-top: 90px;
}
.article-content h1 { font-size: 1.8em; padding-bottom: 0.3em; border-bottom: 2px solid var(--surface-border); }
.article-content h2 { font-size: 1.5em; padding-bottom: 0.3em; border-bottom: 1px solid var(--surface-border); }
.article-content h3 { font-size: 1.25em; }
.article-content h4 { font-size: 1.1em; }
.article-content p { margin: 0 0 1.2em; }
.article-content ul, .article-content ol { margin: 0 0 1.2em 1.5em; }
.article-content li { margin-bottom: 0.4em; }
.article-content li > ul, .article-content li > ol { margin: 0.4em 0 0.4em 1.5em; }
.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding: 14px 20px;
    margin: 1.5em 0;
    background: rgba(var(--accent-rgb), 0.05);
    border-radius: 0 var(--radius) var(--radius) 0;
    color: var(--text-soft);
    font-style: italic;
}
.article-content blockquote p { margin: 0; }
.article-content code {
    background: var(--bg-alt);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.88em;
}
body.has-dark-bg .article-content code { background: rgba(255,255,255,0.08); }
.article-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px 24px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin: 1.5em 0;
    font-size: 14px;
    line-height: 1.6;
}
.article-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
    font-size: inherit;
}
.article-content a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}
.article-content img {
    border-radius: var(--radius);
    margin: 1.5em auto;
    box-shadow: var(--shadow);
}
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 14px;
}
.article-content th, .article-content td {
    border: 1px solid var(--surface-border);
    padding: 10px 14px;
    text-align: left;
}
.article-content th { background: var(--bg-alt); font-weight: 600; }
.article-content hr {
    border: none;
    border-top: 2px solid var(--surface-border);
    margin: 2em 0;
}
.article-content input[type="checkbox"] {
    margin-right: 8px;
    accent-color: var(--accent);
}

/* 文章底部 */
.article-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--surface-border);
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.article-tag {
    background: var(--bg-alt);
    padding: 5px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    color: var(--text-soft);
    transition: all .2s var(--ease);
}
.article-tag:hover { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }
.article-tag::before { content: '# '; opacity: 0.6; }

.article-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 32px 0;
}
.article-nav__item {
    padding: 18px 22px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all .3s var(--ease);
}
.article-nav__item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: rgba(var(--accent-rgb), 0.3);
}
.article-nav__item.next { text-align: right; }
.article-nav__label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.article-nav__title { font-size: 15px; font-weight: 600; }

/* ============== 评论 ============== */
.comments { margin-top: 60px; }
.comments__title { font-size: 22px; font-weight: 700; margin-bottom: 24px; }

.comment-form { margin-bottom: 40px; }
.comment-form textarea {
    width: 100%;
    min-height: 110px;
    padding: 14px 18px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(20px);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    transition: all .2s var(--ease);
}
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.comment-form__row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 12px;
}
.comment-form__input {
    padding: 10px 14px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
}
.comment-form__input:focus {
    outline: none;
    border-color: var(--accent);
}
.comment-form__actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}
.comment-form__hint { font-size: 12px; color: var(--text-muted); }

.comment-list { list-style: none; }
.comment-item {
    padding: 18px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--surface-border);
    margin-bottom: 16px;
    transition: all .2s var(--ease);
}
.comment-item:hover { box-shadow: var(--shadow); }
.comment-item__header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}
.comment-item__avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background-size: cover;
    flex-shrink: 0;
}
.comment-item__author { font-weight: 600; font-size: 14px; }
.comment-item__time { font-size: 12px; color: var(--text-muted); }
.comment-item__content { color: var(--text-soft); font-size: 14px; line-height: 1.7; white-space: pre-wrap; }
.comment-item__actions {
    margin-top: 10px;
    display: flex;
    gap: 12px;
    font-size: 12px;
}
.comment-item__action {
    color: var(--text-muted);
    cursor: pointer;
    transition: color .2s var(--ease);
}
.comment-item__action:hover { color: var(--accent); }

.comment-children {
    list-style: none;
    margin-left: 50px;
    margin-top: 16px;
    border-left: 2px solid var(--surface-border);
    padding-left: 20px;
}

/* ============== 留言纸条墙 ============== */
.message-wall {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 32px;
}
.note {
    padding: 22px 24px;
    border-radius: var(--radius);
    position: relative;
    transition: all .3s var(--ease-out);
    box-shadow: var(--shadow);
    min-height: 180px;
    display: flex;
    flex-direction: column;
    transform: rotate(var(--rot, 0deg));
}
.note:hover {
    transform: rotate(0) translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-lg);
    z-index: 1;
}
.note::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.note__content {
    flex: 1;
    font-size: 14px;
    line-height: 1.65;
    color: rgba(0,0,0,0.78);
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 12px;
}
.note__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(0,0,0,0.55);
}
.note__author { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.note__avatar {
    width: 22px; height: 22px;
    border-radius: 50%;
    background-size: cover;
}
.note__like {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    background: rgba(255,255,255,0.4);
    transition: all .2s var(--ease);
}
.note__like:hover { background: rgba(255,255,255,0.7); }
.note__like.liked { color: #e11d48; }

.message-form {
    margin-bottom: 32px;
    padding: 24px;
}
.message-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 14px 18px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    background: var(--surface-solid);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
}
.message-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.color-picker {
    display: flex;
    gap: 8px;
    margin: 14px 0;
    flex-wrap: wrap;
}
.color-swatch {
    width: 28px; height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .2s var(--ease);
}
.color-swatch:hover { transform: scale(1.15); }
.color-swatch.is-selected { border-color: var(--text); transform: scale(1.15); }

/* ============== 侧边栏 ============== */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}
.sidebar { position: sticky; top: 100px; }
.widget {
    padding: 22px;
    margin-bottom: 24px;
}
.widget__title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-border);
}

.widget-list { list-style: none; }
.widget-list li { margin-bottom: 10px; }
.widget-list a { font-size: 14px; transition: all .2s var(--ease); }
.widget-list a:hover { color: var(--accent); padding-left: 4px; }

.widget-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.widget-tags a {
    font-size: 12px;
    padding: 4px 12px;
    background: var(--bg-alt);
    border-radius: var(--radius-pill);
    transition: all .2s var(--ease);
}
.widget-tags a:hover { background: rgba(var(--accent-rgb), 0.15); color: var(--accent); }

.widget-archive li { display: flex; justify-content: space-between; font-size: 13px; }
.widget-archive .count { color: var(--text-muted); }

/* ============== 表单与按钮 ============== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s var(--ease);
    text-decoration: none;
    font-family: inherit;
    line-height: 1;
}
.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #0f1419;
    box-shadow: 0 4px 14px rgba(var(--accent-rgb), 0.3);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.4); color: #0f1419; }
.btn-ghost {
    background: var(--surface);
    backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    color: var(--text);
}
.btn-ghost:hover { background: var(--surface-solid); }
.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 15px; }
.btn-block { width: 100%; }

.form-group { margin-bottom: 18px; }
.form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
}
.form-input, .form-textarea, .form-select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    background: var(--surface);
    backdrop-filter: blur(20px);
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: all .2s var(--ease);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.15);
}
.form-textarea { min-height: 140px; resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ============== 提示框 ============== */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert-success { background: rgba(74, 222, 128, 0.1); border-color: rgba(74, 222, 128, 0.3); color: #16a34a; }
.alert-error, .alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.3); color: #dc2626; }
.alert-info { background: rgba(96, 165, 250, 0.1); border-color: rgba(96, 165, 250, 0.3); color: #2563eb; }
.alert-warning { background: rgba(251, 191, 36, 0.1); border-color: rgba(251, 191, 36, 0.3); color: #d97706; }

/* ============== 分页 ============== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 50px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    color: var(--text);
    transition: all .2s var(--ease);
}
.pagination a:hover { background: var(--surface-solid); border-color: var(--accent); color: var(--accent); }
.pagination .is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #0f1419; border-color: transparent; }
.pagination .is-disabled { opacity: 0.4; pointer-events: none; }

/* ============== 页脚 ============== */
.footer {
    margin-top: 80px;
    padding: 50px 0 30px;
    background: var(--surface);
    backdrop-filter: blur(20px);
    border-top: 1px solid var(--surface-border);
}
.footer__grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer__brand h3 { font-size: 20px; margin-bottom: 10px; }
.footer__brand p { color: var(--text-muted); font-size: 14px; }
.footer__col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 14px; }
.footer__col ul { list-style: none; }
.footer__col li { margin-bottom: 8px; }
.footer__col a { font-size: 14px; color: var(--text-soft); }
.footer__col a:hover { color: var(--accent); }
.footer__bottom {
    padding-top: 24px;
    border-top: 1px solid var(--surface-border);
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
}

/* ============== 工具类 ============== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 32px; }
.mt-2 { margin-top: 16px; }
.mt-4 { margin-top: 32px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.hidden { display: none !important; }
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-pill);
    font-size: 11px;
    font-weight: 600;
    background: var(--bg-alt);
    color: var(--text-soft);
}
.badge-success { background: rgba(74, 222, 128, 0.15); color: #16a34a; }
.badge-warning { background: rgba(251, 191, 36, 0.15); color: #d97706; }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #dc2626; }
.badge-info { background: rgba(96, 165, 250, 0.15); color: #2563eb; }

/* ============== 搜索框 ============== */
.search-box {
    position: relative;
    margin-bottom: 32px;
}
.search-box input {
    width: 100%;
    padding: 14px 18px 14px 48px;
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    backdrop-filter: blur(20px);
    color: var(--text);
    font-size: 15px;
}
.search-box input:focus { outline: none; border-color: var(--accent); }
.search-box__icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* ============== 空状态 ============== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty-state__icon { font-size: 48px; margin-bottom: 16px; opacity: 0.5; }
.empty-state__title { font-size: 18px; font-weight: 600; color: var(--text-soft); margin-bottom: 6px; }

/* ============== 友链 ============== */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
}
.link-card {
    padding: 20px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius);
    transition: all .3s var(--ease);
    text-align: center;
}
.link-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(var(--accent-rgb), 0.3);
}
.link-card__logo {
    width: 48px; height: 48px;
    border-radius: 50%;
    margin: 0 auto 12px;
    background-size: cover;
    background-color: var(--bg-alt);
    display: grid; place-items: center;
    color: var(--accent);
    font-weight: 700;
}
.link-card__name { font-weight: 600; margin-bottom: 4px; }
.link-card__desc { font-size: 12px; color: var(--text-muted); }

/* ============== 响应式 ============== */
@media (max-width: 960px) {
    .layout-with-sidebar { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .footer__grid { grid-template-columns: 1fr 1fr; gap: 28px; }
    .navbar__menu { display: none; }
}

@media (max-width: 640px) {
    .container { padding: 0 16px; }
    .section { padding: 50px 0; }
    .section-title { font-size: 24px; }
    .article-grid { grid-template-columns: 1fr; }
    .comment-form__row { grid-template-columns: 1fr; }
    .article-nav { grid-template-columns: 1fr; }
    .footer__grid { grid-template-columns: 1fr; }
    .navbar { padding: 12px 16px; }
    .navbar.is-visible { padding: 10px 16px; }
    .navbar__user-name { display: none; }
    .grid-2 { grid-template-columns: 1fr; }
    .hero__avatar { width: 110px; height: 110px; }
    .message-wall { grid-template-columns: 1fr; }
}
