/* CZG 星际博客 - 前台页面样式（依赖 base.css 的变量与通用组件） */

/* ---------- 页面横幅 ---------- */
.page-banner {
    text-align: center;
    padding: 2.2rem 1rem 2.6rem;
    margin-bottom: 2rem;
}

.page-title {
    font-size: clamp(1.5rem, 4vw, 2.1rem);
    font-weight: 700;
    letter-spacing: .04em;
    background: linear-gradient(90deg, var(--neon), var(--nebula));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.page-count {
    margin-top: .5rem;
    color: var(--text-sub);
    font-size: .9rem;
    letter-spacing: .06em;
}

/* ---------- 双栏布局 ---------- */
.layout-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
}

@media (min-width: 1024px) {
    .layout-columns {
        grid-template-columns: minmax(0, 1fr) 320px;
    }
}

/* ---------- 文章卡片 ---------- */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.article-card {
    overflow: hidden;
    transition: transform .28s, border-color .28s, box-shadow .28s;
}

.article-card:hover {
    transform: translateY(-3px);
    border-color: rgba(var(--neon-rgb), .45);
    box-shadow: 0 8px 32px rgba(var(--neon-rgb), .12), 0 4px 18px rgba(var(--bg-deep-rgb), .5);
}

.card-cover {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 7;
}

.card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .45s;
}

.article-card:hover .card-cover img {
    transform: scale(1.04);
}

.card-body {
    padding: 1.3rem 1.5rem 1.2rem;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: .9rem;
    margin-bottom: .55rem;
    font-size: .82rem;
    color: var(--text-sub);
}

.meta-category {
    padding: .12rem .7rem;
    color: var(--neon);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    font-size: .78rem;
    letter-spacing: .04em;
}

.meta-category:hover {
    background: rgba(var(--neon-rgb), .1);
}

.card-title {
    font-size: clamp(1.15rem, 2.4vw, 1.35rem);
    line-height: 1.45;
    margin-bottom: .45rem;
}

.card-title a {
    color: var(--text-main);
}

.card-title a:hover {
    text-shadow: 0 0 14px rgba(var(--neon-rgb), .35);
}

.card-summary {
    color: var(--text-sub);
    font-size: .93rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: .9rem;
    font-size: .84rem;
    color: var(--text-faint);
}

.read-more {
    font-size: .85rem;
    letter-spacing: .05em;
}

/* ---------- 侧栏 ---------- */
.column-side {
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
}

.side-panel {
    padding: 1.3rem 1.4rem;
}

/* 星区导航：全息边框条目（整行可点击） */
.side-category-list {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.side-category-list li {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 .55rem;
    background:
        linear-gradient(120deg, rgba(var(--neon-rgb), .06), transparent 48%),
        rgba(var(--bg-input-rgb), .42);
    border: 1px solid rgba(var(--neon-rgb), .22);
    border-radius: 4px;
    transition: border-color .22s, background-color .22s, box-shadow .22s;
}

.side-category-list li:hover {
    border-color: rgba(var(--neon-rgb), .5);
    background:
        linear-gradient(120deg, rgba(var(--neon-rgb), .12), transparent 55%),
        rgba(var(--bg-input-rgb), .55);
    box-shadow:
        0 0 14px rgba(var(--neon-rgb), .14),
        inset 0 0 14px rgba(var(--neon-rgb), .06);
}

.side-category-list a {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding-block: .52rem;
    color: var(--text-main);
    font-size: .94rem;
}

/* 整行可点击：名称与计数同属一个链接，hover / 键盘聚焦覆盖整行 */
.side-category-list a:hover {
    color: var(--neon);
}

.side-category-list a:focus-visible {
    outline: 2px solid rgba(var(--neon-rgb), .55);
    outline-offset: -2px;
    border-radius: 2px;
}

.side-category-list li:has(a:focus-visible) {
    border-color: rgba(var(--neon-rgb), .55);
    box-shadow: 0 0 0 2px rgba(var(--neon-rgb), .12);
}

.side-count {
    flex-shrink: 0;
    margin-left: .8rem;
    min-width: 28px;
    text-align: center;
    padding: .05rem .4rem;
    font-family: var(--font-mono);
    font-size: .72rem;
    letter-spacing: .04em;
    color: var(--neon);
    background: rgba(var(--neon-rgb), .08);
    border: 1px solid rgba(var(--neon-rgb), .3);
    border-radius: 3px;
    transition: border-color .22s, box-shadow .22s;
}

.side-category-list li:hover .side-count {
    border-color: rgba(var(--neon-rgb), .6);
    box-shadow: 0 0 10px rgba(var(--neon-rgb), .25);
}

.side-hot-list li {
    display: flex;
    align-items: baseline;
    gap: .7rem;
    padding: .42rem .1rem;
}

.side-hot-list a {
    color: var(--text-sub);
    font-size: .9rem;
    line-height: 1.5;
}

.side-hot-list a:hover {
    color: var(--text-main);
}

.hot-rank {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: center;
    font-size: .74rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--text-faint);
    border: 1px solid rgba(var(--muted-rgb), .3);
    border-radius: 5px;
}

.hot-rank.top {
    color: var(--neon);
    border-color: rgba(var(--neon-rgb), .5);
    box-shadow: 0 0 8px rgba(var(--neon-rgb), .3);
}

.side-tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.tag-chip {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .2rem .7rem;
    font-size: .8rem;
    color: var(--text-sub);
    background: rgba(var(--nebula-rgb), .08);
    border: 1px solid rgba(var(--nebula-rgb), .28);
    border-radius: 999px;
    transition: all .22s;
}

.tag-chip:hover {
    color: var(--nebula);
    border-color: rgba(var(--nebula-rgb), .6);
    box-shadow: 0 0 12px rgba(var(--nebula-rgb), .28);
    text-shadow: none;
}

.tag-chip small {
    font-size: .7rem;
    color: var(--text-faint);
}

.side-empty {
    color: var(--text-faint);
    font-size: .88rem;
}

/* ---------- 标签聚合页 ---------- */
.tags-panel {
    padding: 1.6rem 1.4rem;
    background: rgba(var(--bg-panel-rgb), .55);
    border: 1px solid rgba(139, 155, 180, .16);
    border-radius: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.tags-cloud {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: .7rem .8rem;
    overflow-x: auto;
    padding: .4rem .2rem .55rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

/* 标签云 / 文章标签行：隐藏滚动条（拖动与滚轮滑动，触屏原生横滑） */
.tags-cloud::-webkit-scrollbar,
.article-tag-row::-webkit-scrollbar {
    display: none;
}

/* 拖动滑动中：抓手光标 + 禁止文本选择 */
.drag-scrolling {
    cursor: grabbing;
    user-select: none;
    -webkit-user-select: none;
}

/* 聚合页标签：比侧栏略大，按文章数分级强调 */
.tags-cloud .tag-chip {
    padding: .35rem .95rem;
    font-size: .92rem;
}

.tags-cloud .tag-chip small {
    font-size: .78rem;
}

.tags-cloud .tag-chip-md {
    font-size: 1.02rem;
    border-color: rgba(var(--nebula-rgb), .45);
}

.tags-cloud .tag-chip-lg {
    font-size: 1.14rem;
    color: var(--nebula);
    background: rgba(var(--nebula-rgb), .16);
    border-color: rgba(var(--nebula-rgb), .55);
}

@media (max-width: 600px) {
    .tags-panel {
        padding: 1.1rem 1rem;
    }

    .tags-cloud {
        gap: .55rem .65rem;
    }

    .tags-cloud .tag-chip {
        font-size: .84rem;
    }

    .tags-cloud .tag-chip-md {
        font-size: .92rem;
    }

    .tags-cloud .tag-chip-lg {
        font-size: 1rem;
    }
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    margin-top: 2rem;
}

.page-link {
    min-width: 36px;
    height: 36px;
    line-height: 34px;
    text-align: center;
    padding: 0 .7rem;
    font-size: .88rem;
    color: var(--text-sub);
    background: var(--bg-panel);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    transition: all .2s;
}

a.page-link:hover {
    color: var(--neon);
    border-color: rgba(var(--neon-rgb), .5);
    text-shadow: none;
}

.page-link.current {
    color: var(--neon);
    border-color: rgba(var(--neon-rgb), .55);
    background: rgba(var(--neon-rgb), .1);
    box-shadow: 0 0 12px rgba(var(--neon-rgb), .2);
}

.page-link.disabled {
    opacity: .4;
    cursor: default;
}

.page-ellipsis {
    color: var(--text-faint);
    padding: 0 .2rem;
}

/* ---------- 空状态 / 404 ---------- */
.empty-state {
    text-align: center;
    padding: 4.5rem 1.5rem;
    color: var(--text-sub);
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px dashed var(--border-dim);
    border-radius: var(--radius-lg);
}

.empty-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto 1.3rem;
    border-radius: 50%;
    border: 1px dashed rgba(var(--neon-rgb), .35);
    background:
        radial-gradient(circle at 50% 42%, rgba(var(--neon-rgb), .25), transparent 55%),
        radial-gradient(circle at 50% 50%, transparent 58%, rgba(var(--neon-rgb), .5) 59%, transparent 61%),
        radial-gradient(circle at 50% 50%, transparent 42%, rgba(var(--nebula-rgb), .4) 43%, transparent 45%);
    box-shadow: 0 0 34px rgba(var(--neon-rgb), .14);
    animation: planet-pulse 3.6s ease-in-out infinite alternate;
}

@keyframes planet-pulse {
    from { box-shadow: 0 0 22px rgba(var(--neon-rgb), .10); }
    to   { box-shadow: 0 0 48px rgba(var(--neon-rgb), .24); }
}

.notfound-state {
    padding: 6rem 1.5rem;
}

.notfound-code {
    font-size: clamp(4rem, 15vw, 7.5rem);
    font-weight: 800;
    font-family: var(--font-mono);
    letter-spacing: .08em;
    background: linear-gradient(180deg, var(--neon), var(--nebula));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 22px rgba(var(--neon-rgb), .3));
    margin-bottom: .8rem;
}

.notfound-dot {
    animation: notfound-blink 1.2s steps(2) infinite;
}

@keyframes notfound-blink {
    50% { opacity: .15; }
}

/* ---------- 文章详情 ---------- */
.article-page {
    padding: 2rem clamp(1.2rem, 4vw, 2.6rem);
    margin-bottom: 1.6rem;
}

.article-header {
    margin-bottom: 1.6rem;
    padding-bottom: 1.4rem;
    border-bottom: 1px solid rgba(var(--muted-rgb), .16);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .9rem;
    margin-bottom: .8rem;
    font-size: .85rem;
    color: var(--text-sub);
}

.article-title {
    font-size: clamp(1.5rem, 4.5vw, 2.15rem);
    line-height: 1.4;
    margin-bottom: .6rem;
}

.article-summary {
    color: var(--text-sub);
    font-size: .96rem;
    border-left: 3px solid rgba(var(--nebula-rgb), .5);
    padding-left: .9rem;
}

.article-tag-row {
    display: flex;
    flex-wrap: nowrap;
    gap: .5rem;
    margin-top: 1rem;
    overflow-x: auto;
    padding: .35rem .2rem .5rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.article-cover {
    margin: 0 clamp(-.8rem, -2vw, -1.6rem) 1.6rem;
    border-radius: var(--radius);
    overflow: hidden;
}

.article-cover img {
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(var(--muted-rgb), .16);
}

.article-source {
    color: var(--text-faint);
    font-size: .84rem;
}

.article-source span + span::before {
    content: ' · ';
    color: var(--text-faint);
}

/* ---------- 正文排版（覆盖 wangEditor 输出） ---------- */
.article-content {
    font-size: 1.02rem;
    line-height: 1.95;
    color: var(--text-main);
    word-break: break-word;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    color: var(--text-main);
    line-height: 1.4;
    margin: 1.8em 0 .7em;
    font-weight: 700;
}

/* Markdown 可产出一级 / 六级标题，补齐与富文本一致的排版 */
.article-content h1 {
    font-size: 1.75em;
    padding-bottom: .35rem;
    border-bottom: 1px solid rgba(var(--muted-rgb), .22);
}

.article-content h2 {
    font-size: 1.5em;
    padding-left: .8rem;
    border-left: 4px solid;
    border-image: linear-gradient(180deg, var(--neon), var(--nebula)) 1;
}

.article-content h3 { font-size: 1.28em; }
.article-content h4 { font-size: 1.12em; }
.article-content h5 { font-size: 1em; }
.article-content h6 {
    font-size: .92em;
    color: var(--text-sub);
    letter-spacing: .04em;
}

.article-content p {
    margin: .85em 0;
}

.article-content a {
    border-bottom: 1px dashed rgba(var(--neon-rgb), .45);
    padding-bottom: 1px;
}

.article-content img {
    margin: 1.2em auto;
    border-radius: var(--radius);
    border: 1px solid var(--border-dim);
}

.article-content blockquote {
    margin: 1.3em 0;
    padding: .8em 1.2em;
    color: var(--text-sub);
    background: rgba(var(--bg-input-rgb), .6);
    border-left: 4px solid;
    border-image: linear-gradient(180deg, var(--neon), var(--nebula)) 1;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-content blockquote p {
    margin: .3em 0;
}

.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 1.8em;
}

.article-content ul { list-style: disc; }
.article-content ol { list-style: decimal; }

.article-content li {
    margin: .35em 0;
}

.article-content li::marker {
    color: var(--neon);
}

.article-content pre {
    margin: 1.2em 0;
    padding: 1em 1.2em;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: .88em;
    line-height: 1.65;
    color: #bfeaf5;
    background: var(--bg-panel-solid);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
    scrollbar-width: thin;
}

.article-content code {
    font-family: var(--font-mono);
    font-size: .88em;
    padding: .14em .45em;
    color: #9ef2ff;
    background: rgba(var(--neon-rgb), .09);
    border: 1px solid rgba(var(--neon-rgb), .16);
    border-radius: 5px;
}

.article-content pre code {
    padding: 0;
    background: transparent;
    border: none;
    color: inherit;
}

.article-content table {
    width: 100%;
    margin: 1.2em 0;
    border-collapse: collapse;
    font-size: .92em;
    display: block;
    overflow-x: auto;
}

.article-content th,
.article-content td {
    padding: .55em .9em;
    border: 1px solid rgba(var(--muted-rgb), .22);
    text-align: left;
}

.article-content th {
    color: var(--text-main);
    background: rgba(var(--neon-rgb), .07);
    white-space: nowrap;
}

.article-content tr:nth-child(even) td {
    background: rgba(var(--muted-rgb), .05);
}

.article-content hr {
    margin: 2em auto;
    width: 62%;
    height: 1px;
    border: none;
    background: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .45), transparent);
}

.article-content video,
.article-content iframe {
    max-width: 100%;
    margin: 1.2em auto;
    border-radius: var(--radius);
}

/* ---------- 评论区 ---------- */
.comments-section {
    background: var(--bg-panel);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    padding: 1.6rem clamp(1.2rem, 4vw, 2.4rem);
}

.comments-empty {
    color: var(--text-faint);
    padding: 1.2rem 0 2rem;
    text-align: center;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    margin-bottom: 2rem;
}

.comment-item {
    display: flex;
    gap: .9rem;
    padding: 1rem 1.1rem;
    background: rgba(var(--bg-input-rgb), .55);
    border: 1px solid rgba(var(--muted-rgb), .14);
    border-radius: var(--radius);
}

.comment-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    font-weight: 700;
    color: var(--neon);
    font-family: var(--font-mono);
    background: rgba(var(--neon-rgb), .08);
    border: 1px solid rgba(var(--neon-rgb), .3);
    border-radius: 50%;
}

.comment-main {
    flex: 1;
    min-width: 0;
}

.comment-head {
    display: flex;
    align-items: baseline;
    gap: .8rem;
    margin-bottom: .3rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-main);
    font-size: .95rem;
}

.comment-date {
    color: var(--text-faint);
    font-size: .8rem;
}

.comment-content {
    color: var(--text-sub);
    font-size: .94rem;
    word-break: break-word;
}

/* ---------- 评论表单 ---------- */
.comment-form-panel {
    margin-top: 2.2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed rgba(var(--muted-rgb), .2);
    background: transparent;
    border-left: none;
    border-right: none;
    border-bottom: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
}

.comment-form-panel .panel-title {
    margin-bottom: 1.2rem;
}

/* 登录用户评论身份提示（表单不再显示昵称 / 邮箱） */
.comment-identity {
    margin: 0 0 1rem;
    padding: .55rem .85rem;
    font-size: .88rem;
    color: var(--text-sub);
    background: rgba(var(--neon-rgb), .06);
    border: 1px dashed rgba(var(--neon-rgb), .28);
    border-radius: 8px;
}

.comment-identity strong {
    color: var(--neon);
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1.1rem;
}

@media (min-width: 768px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

.form-hint {
    margin-top: .8rem;
    color: var(--text-faint);
    font-size: .8rem;
}

/* ---------- 搜索页 ---------- */
.search-form {
    display: flex;
    gap: .7rem;
    max-width: 560px;
    margin: 1.1rem auto 0;
}

.search-form input {
    flex: 1;
    padding: .65rem 1rem;
    color: var(--text-main);
    background: var(--bg-input);
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    outline: none;
    transition: border-color .25s, box-shadow .25s;
}

.search-form input:focus {
    border-color: rgba(var(--neon-rgb), .55);
    box-shadow: 0 0 0 3px rgba(var(--neon-rgb), .12);
}

/* ---------- 关于页 ---------- */
.about-hero {
    text-align: center;
    padding: 2.6rem 1rem 2.2rem;
    margin-bottom: 1.6rem;
}

.about-planet {
    width: 108px;
    height: 108px;
    margin: 0 auto 1.5rem;
    border-radius: 50%;
    background:
        radial-gradient(circle at 34% 32%, #1b2d5e 0%, var(--bg-panel-solid) 46%, var(--bg-deep) 72%);
    border: 1px solid rgba(var(--neon-rgb), .25);
    box-shadow:
        0 0 0 9px rgba(var(--neon-rgb), .05),
        0 0 0 18px rgba(var(--nebula-rgb), .06),
        0 0 44px rgba(var(--neon-rgb), .22);
    animation: planet-pulse 4.2s ease-in-out infinite alternate;
}

.about-slogan {
    margin-top: .6rem;
    color: var(--text-sub);
    letter-spacing: .12em;
}

.about-panel {
    padding: 1.8rem clamp(1.2rem, 4vw, 2.4rem);
    margin-bottom: 1.4rem;
    color: var(--text-main);
}

.about-panel p {
    margin: .7em 0;
}

.about-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 1.6rem 0;
    text-align: center;
}

.about-stats li {
    display: flex;
    flex-direction: column;
    gap: .25rem;
    padding: 1rem .5rem;
    background: rgba(var(--bg-input-rgb), .55);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius);
}

.about-stats strong {
    font-size: 1.7rem;
    font-family: var(--font-mono);
    color: var(--neon);
    text-shadow: 0 0 16px rgba(var(--neon-rgb), .4);
}

.about-stats span {
    color: var(--text-sub);
    font-size: .85rem;
}

.about-tech li {
    padding: .5rem .2rem .5rem 1.5rem;
    position: relative;
    color: var(--text-sub);
    border-bottom: 1px dashed rgba(var(--muted-rgb), .16);
}

.about-tech li:last-child {
    border-bottom: none;
}

.about-tech li::before {
    content: "✦";
    position: absolute;
    left: .1rem;
    color: var(--neon);
}

/* ---------- 平板：侧栏模块横向堆叠 ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
    .layout-columns {
        grid-template-columns: 1fr;
    }

    .column-side {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
        align-items: start;
    }
}

/* ---------- 移动端微调 ---------- */
@media (max-width: 767px) {
    .site-main {
        padding: 1.2rem 0 2.2rem;
    }

    .article-page {
        padding: 1.4rem 1.1rem;
    }

    .article-card .card-body {
        padding: 1.05rem 1.1rem .95rem;
    }

    .comment-item {
        padding: .85rem .8rem;
    }

    .about-stats {
        gap: .6rem;
    }

    .about-stats strong {
        font-size: 1.35rem;
    }

    /* 触控目标不小于 44px */
    .page-link {
        min-width: 44px;
        height: 44px;
        line-height: 42px;
    }

    .btn-neon {
        padding: .7rem 1.6rem;
    }
}

/* ---------- 全局滚动条（星空主题，替代系统默认白色滚动条） ----------
   窗口与容器内滚动条统一为青辉圆角滑块；
   Firefox 的 scrollbar-color 自 html 继承到全部子元素滚动条。 */
html {
    scrollbar-color: rgba(var(--neon-rgb), .32) rgba(var(--bg-deep-rgb), .6);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(var(--bg-deep-rgb), .6);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb {
    background: rgba(var(--neon-rgb), .28);
    border: 2px solid transparent;
    border-radius: 999px;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--neon-rgb), .5);
    background-clip: padding-box;
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* number 输入：隐藏浏览器原生上下调节块（浅色方块与深空主题冲突） */
input[type='number'] {
    -moz-appearance: textfield;
    appearance: textfield;
}

input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ---------- HUD 全息层（前台轻量版，强度低于后台以免干扰阅读） ---------- */

/* ---------- 1. 全息网格背景层（位于星尘之下，缓慢漂移） ---------- */
.hud-grid-layer {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(var(--neon-rgb), .028) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--neon-rgb), .028) 1px, transparent 1px);
    background-size: 64px 64px;
    animation: hud-home-grid-drift 90s linear infinite;
}

@keyframes hud-home-grid-drift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 0 64px, 64px 0; }
}

/* ---------- 2. 顶栏：底部霓虹渐变描线 ---------- */
.site-header {
    border-bottom: none;
    background-image: linear-gradient(90deg, rgba(var(--neon-rgb), .38), rgba(var(--nebula-rgb), .38));
    background-size: 100% 1px;
    background-position: bottom;
    background-repeat: no-repeat;
}

/* ---------- 3. 面板四角 HUD 角标（hover 增亮） ---------- */
.side-panel,
.comments-section,
.about-panel,
.tags-panel,
.empty-state,
.article-page {
    position: relative;
}

.side-panel::before,
.comments-section::before,
.about-panel::before,
.tags-panel::before,
.empty-state::before,
.article-page::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    height: 15px;
    pointer-events: none;
    background:
        linear-gradient(var(--hud-line), var(--hud-line)) left top / 15px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) left top / 2px 15px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right top / 15px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right top / 2px 15px no-repeat;
    opacity: .5;
    transition: opacity .3s;
}

.side-panel::after,
.comments-section::after,
.about-panel::after,
.tags-panel::after,
.empty-state::after,
.article-page::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: -1px;
    right: -1px;
    height: 15px;
    pointer-events: none;
    background:
        linear-gradient(var(--hud-line), var(--hud-line)) left bottom / 15px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) left bottom / 2px 15px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right bottom / 15px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right bottom / 2px 15px no-repeat;
    opacity: .5;
    transition: opacity .3s;
}

.side-panel:hover::before,
.side-panel:hover::after,
.comments-section:hover::before,
.comments-section:hover::after {
    opacity: 1;
}

/* ---------- 4. 文章卡片：顶部扫描线 + 内嵌双角（overflow 裁剪改用内角） ---------- */
.article-card {
    position: relative;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .55), transparent);
    opacity: 0;
    transition: opacity .3s;
}

.article-card::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(var(--hud-line), var(--hud-line)) left top / 14px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) left top / 2px 14px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right bottom / 14px 2px no-repeat,
        linear-gradient(var(--hud-line), var(--hud-line)) right bottom / 2px 14px no-repeat;
    opacity: .4;
    transition: opacity .3s;
}

.article-card:hover::before,
.article-card:hover::after {
    opacity: 1;
}

/* ---------- 5. 面板标题「//」前缀 ---------- */
.panel-title {
    padding-left: 1.9rem;
}

.panel-title::after {
    content: '//';
    position: absolute;
    left: .78rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--neon);
    font-family: var(--font-mono);
    font-size: .78em;
    letter-spacing: 0;
    opacity: .75;
    text-shadow: 0 0 8px rgba(var(--neon-rgb), .5);
}

/* ---------- 6. 数据位等宽字体（日期 / 计数） ---------- */
.meta-date,
.page-count,
.comment-date,
.article-source,
.card-footer {
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .03em;
}

.read-more {
    font-family: var(--font-mono);
    letter-spacing: .08em;
}

.nav-search button {
    font-family: var(--font-mono);
}

.page-link {
    font-family: var(--font-mono);
}

/* ---------- 7. 页面横幅分隔线 ---------- */
.page-banner::after {
    content: '';
    display: block;
    width: 140px;
    height: 1px;
    margin: 1.2rem auto 0;
    background: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .55), transparent);
}

/* ---------- 8. 页脚：顶部渐变描线 + 副标题「//」前缀 ---------- */
.site-footer {
    border-top: none;
    background-image: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .3), transparent);
    background-size: 100% 1px;
    background-position: top;
    background-repeat: no-repeat;
}

.footer-sub {
    font-family: var(--font-mono);
    letter-spacing: .06em;
}

.footer-sub::before {
    content: '// ';
    color: var(--neon);
}

/* ---------- 9. 入场动效（类名由 main.js 添加，无脚本时保持可见） ---------- */
.hud-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .5s ease-out, transform .5s ease-out;
}

.hud-reveal.in {
    opacity: 1;
    transform: none;
}

/* ---------- 10. 动效降级（无障碍） ---------- */
@media (prefers-reduced-motion: reduce) {
    .hud-grid-layer {
        animation: none;
    }

    .hud-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .logo-mark {
        animation: none;
    }
}

/* ---------- 11. 注册页 ---------- */
.register-panel {
    max-width: 560px;
    margin: 1.8rem auto 0;
}

.register-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.3rem;
}

.register-login-link {
    font-size: .88rem;
    color: var(--text-sub);
    text-decoration: none;
    border-bottom: 1px dashed rgba(var(--neon-rgb), .4);
    transition: color .2s ease;
}

.register-login-link:hover {
    color: var(--neon);
}

/* 注册错误提示（后台样式同款，前台独立声明） */
.flash-error {
    border-left-color: #ff6b9d;
    color: #ffd9e5;
}

/* ---------- 12. 星云层（main.js 注入，装饰层 pointer-events:none） ---------- */

/* ---------- 12.1 星云云团层（blur 云团 + 缓慢漂移；漂移用 background-position，
   transform 留给 JS 滚动/鼠标视差，避免 animation 与内联样式冲突） ---------- */
.nebula-layer {
    position: fixed;
    inset: -12%;
    z-index: -2;
    pointer-events: none;
    background:
        radial-gradient(ellipse 46% 38% at 18% 26%, rgba(var(--neon-rgb), .10), transparent 62%),
        radial-gradient(ellipse 52% 44% at 82% 20%, rgba(var(--nebula-rgb), .12), transparent 60%),
        radial-gradient(ellipse 58% 50% at 76% 78%, rgba(255, 45, 120, .07), transparent 62%),
        radial-gradient(ellipse 44% 36% at 28% 82%, rgba(var(--neon-rgb), .08), transparent 60%),
        radial-gradient(ellipse 30% 26% at 52% 48%, rgba(var(--nebula-rgb), .09), transparent 64%);
    filter: blur(52px);
    will-change: transform;
    animation: hud-home-nebula-drift 110s ease-in-out infinite alternate;
}

@keyframes hud-home-nebula-drift {
    from { background-position: 0% 0%, 100% 0%, 50% 100%, 0% 100%, 60% 40%; }
    to   { background-position: 6% 4%, 94% 5%, 54% 94%, 5% 95%, 66% 46%; }
}

/* ---------- 12.2 流星 / 彗星（错峰斜向划过，头尾辉光） ---------- */
.meteor {
    position: fixed;
    top: -6%;
    right: 24%;
    z-index: -1;
    width: 220px;
    height: 2px;
    pointer-events: none;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(var(--neon-rgb), .85), rgba(var(--neon-rgb), .2) 55%, transparent);
    filter: drop-shadow(0 0 6px rgba(var(--neon-rgb), .8));
    transform: rotate(-28deg);
    animation: hud-home-meteor 11s ease-in infinite;
}

.meteor.meteor-2 {
    top: -8%;
    right: 58%;
    width: 150px;
    background: linear-gradient(90deg, rgba(var(--nebula-rgb), .8), rgba(var(--nebula-rgb), .18) 55%, transparent);
    filter: drop-shadow(0 0 6px rgba(var(--nebula-rgb), .7));
    animation-duration: 15s;
    animation-delay: 5.5s;
}

@keyframes hud-home-meteor {
    0%   { transform: rotate(-28deg) translate3d(0, 0, 0); opacity: 0; }
    4%   { opacity: 1; }
    16%  { transform: rotate(-28deg) translate3d(-74vw, 46vh, 0); opacity: 1; }
    20%  { transform: rotate(-28deg) translate3d(-74vw, 46vh, 0); opacity: 0; }
    100% { transform: rotate(-28deg) translate3d(-74vw, 46vh, 0); opacity: 0; }
}

/* ---------- 12.3 星点闪烁增强（覆盖 base.css 的 twinkle，幅度更大） ---------- */
.stars-1 {
    animation: hud-home-twinkle 4.5s ease-in-out infinite alternate;
}

.stars-2 {
    animation: hud-home-twinkle 7.5s ease-in-out infinite alternate-reverse;
}

@keyframes hud-home-twinkle {
    from { opacity: .28; }
    to   { opacity: 1; }
}

/* ---------- 12.4 顶栏星云辉光与 logo 辉光脉冲 ---------- */
.site-header {
    box-shadow:
        0 1px 0 rgba(var(--neon-rgb), .25),
        0 6px 28px rgba(var(--neon-rgb), .10),
        0 2px 14px rgba(var(--nebula-rgb), .10);
}

.logo-mark {
    animation: logo-spin 14s linear infinite, hud-home-logo-glow 4s ease-in-out infinite alternate;
}

@keyframes hud-home-logo-glow {
    from { filter: drop-shadow(0 0 5px rgba(var(--neon-rgb), .45)); }
    to   { filter: drop-shadow(0 0 14px rgba(var(--neon-rgb), .9)); }
}

.site-nav > a::after {
    box-shadow: 0 0 8px rgba(var(--neon-rgb), .6);
}

/* ---------- 12.5 文章卡片 hover 星云辉光 + 阅读引导 ---------- */
.article-card:hover {
    border-color: rgba(var(--neon-rgb), .5);
    box-shadow:
        0 10px 40px rgba(var(--neon-rgb), .16),
        0 6px 26px rgba(var(--nebula-rgb), .18),
        0 2px 10px rgba(255, 45, 120, .10),
        0 4px 18px rgba(var(--bg-deep-rgb), .5);
}

.read-more {
    transition: color .25s, letter-spacing .25s, text-shadow .25s;
}

.read-more:hover {
    letter-spacing: .14em;
    text-shadow: 0 0 10px rgba(var(--neon-rgb), .55);
}

/* ---------- 12.6 面板标题竖条流光（覆盖 base.css 竖条） ---------- */
.panel-title::before {
    background: linear-gradient(180deg, var(--neon), var(--nebula), var(--neon));
    background-size: 100% 200%;
    animation: hud-home-title-flow 3.2s linear infinite;
}

@keyframes hud-home-title-flow {
    from { background-position: 0% 0%; }
    to   { background-position: 0% -200%; }
}

/* ---------- 12.7 霓虹按钮辉光脉冲 ---------- */
.btn-neon {
    animation: hud-home-btn-pulse 2.8s ease-in-out infinite;
}

@keyframes hud-home-btn-pulse {
    0%, 100% { box-shadow: 0 0 0 rgba(var(--neon-rgb), 0); }
    50%      { box-shadow: 0 0 16px rgba(var(--neon-rgb), .28), 0 0 32px rgba(var(--nebula-rgb), .14); }
}

/* ---------- 12.8 点缀：标签 / 分页 / 页脚 / 空状态 ---------- */
.tag-chip:hover {
    border-color: rgba(var(--neon-rgb), .55);
    box-shadow:
        0 0 14px rgba(var(--nebula-rgb), .32),
        0 0 22px rgba(var(--neon-rgb), .18);
}

.page-link.current {
    color: #fff;
    border-color: rgba(var(--neon-rgb), .6);
    background: linear-gradient(135deg, rgba(var(--neon-rgb), .22), rgba(var(--nebula-rgb), .22));
    box-shadow: 0 0 14px rgba(var(--neon-rgb), .25);
}

.site-footer {
    background-image: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .4) 30%, rgba(var(--nebula-rgb), .4) 70%, transparent);
}

.empty-icon {
    animation: planet-pulse 3.6s ease-in-out infinite alternate, hud-home-spin 28s linear infinite;
}

@keyframes hud-home-spin {
    to { transform: rotate(360deg); }
}

/* ---------- 12.9 太阳系公转装饰（分类 / 标签横幅，offset-path 椭圆轨道，八大行星公转，3D 球体质感） ---------- */
.page-banner {
    position: relative;
    overflow: hidden; /* 防止行星装饰溢出到下方列表 */
}

.page-banner:has(.solar-system) {
    min-height: 330px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.solar-system {
    position: absolute;
    right: 1%;
    top: 50%;
    width: 360px;
    height: 360px;
    margin-top: -180px;
    pointer-events: none;
    opacity: .95;
}

/* 太阳：大发光球体 + 光晕呼吸 */
.solar-sun {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    width: 46px;
    height: 46px;
    margin: -23px 0 0 -23px;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #fffdf2, #ffe490 38%, #ffab4d 68%, #e0682a);
    box-shadow:
        0 0 30px rgba(255, 190, 92, .75),
        0 0 90px rgba(255, 150, 60, .4),
        0 0 150px rgba(255, 130, 50, .2),
        inset -5px -5px 12px rgba(150, 60, 10, .5);
    animation: solar-sun-pulse 4s ease-in-out infinite alternate;
    pointer-events: auto;
    cursor: crosshair;
    transition: transform .25s ease;
}

.solar-sun:hover {
    transform: scale(1.12);
}

@keyframes solar-sun-pulse {
    from {
        box-shadow:
            0 0 26px rgba(255, 190, 92, .65),
            0 0 72px rgba(255, 150, 60, .32),
            0 0 130px rgba(255, 130, 50, .15),
            inset -5px -5px 12px rgba(150, 60, 10, .5);
    }
    to {
        box-shadow:
            0 0 40px rgba(255, 200, 110, .9),
            0 0 120px rgba(255, 160, 70, .45),
            0 0 190px rgba(255, 140, 60, .25),
            inset -5px -5px 12px rgba(150, 60, 10, .5);
    }
}

/* 行星：offset-path 沿椭圆轨道公转，元素自身不变形（无透视压缩） */
.solar-system .planet {
    position: absolute;
    left: 0;
    top: 0;
    display: block;
    border-radius: 50%;
    offset-rotate: 0deg;
    pointer-events: auto;
    cursor: crosshair;
    transition: transform .25s ease, box-shadow .25s ease;
}

.solar-system .planet:hover {
    transform: scale(1.45);
    z-index: 5;
}

/* 球体明暗罩：高光 + 暗缘（叠加在自转纹理之上） */
.solar-system .planet::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 28%, rgba(255, 255, 255, .5), rgba(255, 255, 255, 0) 45%),
        radial-gradient(circle at 72% 76%, rgba(0, 0, 20, .5), rgba(0, 0, 20, 0) 62%);
    box-shadow: inset -3px -4px 6px rgba(0, 0, 15, .4);
}

/* 星球名称标签（hover 显示） */
.planet-name {
    position: absolute;
    left: 50%;
    top: 100%;
    margin-top: 7px;
    transform: translateX(-50%);
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(5, 10, 26, .94);
    border: 1px solid rgba(var(--neon-rgb), .45);
    color: #c9f4ff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-style: normal;
    font-weight: 400;
    letter-spacing: .08em;
    line-height: 1.6;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(var(--neon-rgb), .25);
    z-index: 20;
}

.solar-system .planet:hover .planet-name,
.solar-sun:hover .planet-name {
    opacity: 1;
    visibility: visible;
}

/* 行星 hover 放大时反向补偿，名称标签保持原始字号 */
.solar-system .planet:hover .planet-name {
    transform: translateX(-50%) scale(.69);
}

@keyframes solar-orbit {
    to { offset-distance: 100%; }
}

/* 表面纹理自转（模拟行星自转，仅水平滚动纹理层，底色层不动） */
@keyframes texture-spin {
    from { background-position: 0 0, 0 0, 0 0; }
    to { background-position: -200% 0, -200% 0, 0 0; }
}

/* 八大行星：表面纹理 + 自转 + 椭圆轨道 + 公转周期 + 错峰相位 */
.planet-mercury {
    width: 9px;
    height: 9px;
    background:
        radial-gradient(ellipse 3px 2px at 60% 45%, rgba(80, 75, 68, .7), transparent 70%),
        linear-gradient(135deg, #d8d2c6, #8a857b);
    background-size: 200% 100%, 100% 100%;
    box-shadow: 0 0 7px rgba(190, 185, 175, .55);
    offset-path: ellipse(32px 19px at center);
    animation: texture-spin 46s linear infinite, solar-orbit 5s linear infinite;
    animation-delay: -18s, -1.3s;
}

.planet-venus {
    width: 16px;
    height: 16px;
    background:
        radial-gradient(ellipse 8px 4px at 40% 50%, rgba(255, 240, 200, .35), transparent 70%),
        linear-gradient(135deg, #f7e3b0, #d2a05c);
    background-size: 200% 100%, 100% 100%;
    box-shadow: 0 0 12px rgba(255, 220, 160, .65);
    offset-path: ellipse(52px 31px at center);
    animation: texture-spin 58s linear infinite, solar-orbit 7s linear infinite;
    animation-delay: -30s, -4.2s;
}

.planet-earth {
    width: 18px;
    height: 18px;
    background:
        radial-gradient(ellipse 5px 3px at 35% 40%, #4a8f3f, transparent 70%),
        radial-gradient(ellipse 7px 4px at 65% 35%, rgba(255, 255, 255, .75), transparent 70%),
        linear-gradient(180deg, #3f96f0, #1a54a8);
    background-size: 200% 100%, 200% 100%, 100% 100%;
    box-shadow: 0 0 15px rgba(90, 170, 255, .75);
    offset-path: ellipse(72px 43px at center);
    animation: texture-spin 22s linear infinite, solar-orbit 9s linear infinite;
    animation-delay: -6s, -2.1s;
}

.planet-mars {
    width: 13px;
    height: 13px;
    background:
        radial-gradient(ellipse 4px 3px at 55% 55%, rgba(90, 35, 15, .8), transparent 70%),
        linear-gradient(160deg, #f07a4e, #a33a1e);
    background-size: 200% 100%, 100% 100%;
    box-shadow: 0 0 10px rgba(255, 106, 77, .65);
    offset-path: ellipse(92px 55px at center);
    animation: texture-spin 30s linear infinite, solar-orbit 11s linear infinite;
    animation-delay: -14s, -6.8s;
}

.planet-jupiter {
    width: 30px;
    height: 30px;
    background:
        radial-gradient(ellipse 6px 4px at 62% 58%, #d4573a, transparent 75%),
        repeating-linear-gradient(180deg, #f0dbb2 0 5px, #d9a05f 5px 10px, #b97f46 10px 15px),
        linear-gradient(180deg, #d9a05f, #b97f46);
    background-size: 200% 100%, 100% 100%, 100% 100%;
    box-shadow: 0 0 18px rgba(232, 176, 106, .65);
    offset-path: ellipse(118px 71px at center);
    animation: texture-spin 16s linear infinite, solar-orbit 15s linear infinite;
    animation-delay: -7s, -9.5s;
}

.planet-saturn {
    width: 27px;
    height: 27px;
    background:
        repeating-linear-gradient(180deg, rgba(250, 240, 210, .5) 0 3px, rgba(226, 192, 120, .4) 3px 6px),
        linear-gradient(160deg, #f2dfae, #c9a35e);
    background-size: 100% 100%, 100% 100%;
    box-shadow: 0 0 15px rgba(240, 212, 154, .6);
    offset-path: ellipse(142px 85px at center);
    animation: texture-spin 20s linear infinite, solar-orbit 19s linear infinite;
    animation-delay: -10s, -3.6s;
}

.planet-uranus {
    width: 21px;
    height: 21px;
    background:
        radial-gradient(ellipse 8px 3px at 50% 40%, rgba(220, 255, 255, .4), transparent 70%),
        linear-gradient(170deg, #8fe3ea, #3f9aa5);
    background-size: 200% 100%, 100% 100%;
    box-shadow: 0 0 13px rgba(111, 214, 221, .65);
    offset-path: ellipse(160px 96px at center);
    animation: texture-spin 26s linear infinite, solar-orbit 23s linear infinite;
    animation-delay: -15s, -13.2s;
}

.planet-neptune {
    width: 21px;
    height: 21px;
    background:
        radial-gradient(ellipse 8px 4px at 45% 50%, rgba(60, 80, 180, .5), transparent 70%),
        linear-gradient(170deg, #6a92f0, #2a4694);
    background-size: 200% 100%, 100% 100%;
    box-shadow: 0 0 13px rgba(77, 120, 224, .65);
    offset-path: ellipse(174px 104px at center);
    animation: texture-spin 24s linear infinite, solar-orbit 28s linear infinite;
    animation-delay: -9s, -16.8s;
}

/* 土星光环（倾斜椭圆环，随行星公转自然旋转） */
.planet-saturn::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 44px;
    height: 18px;
    margin: -9px 0 0 -22px;
    border: 1.5px solid rgba(240, 212, 154, .95);
    border-radius: 50%;
    box-shadow: 0 0 6px rgba(240, 212, 154, .4);
    transform: rotate(-16deg);
}

/* 悬停任一星球时全体公转 / 自转暂停，便于查看与阅读名称 */
.solar-system:has(.planet:hover) .planet {
    animation-play-state: paused;
}

/* 不支持 offset-path 的浏览器隐藏行星（避免堆叠在左上角） */
@supports not (offset-path: none) {
    .solar-system .planet {
        display: none;
    }
}

/* 中屏（平板 / 小笔记本）：星盘右缘锚点缩放，避免与数据带重叠 */
@media (min-width: 768px) and (max-width: 1279px) {
    .solar-system {
        transform: scale(.8);
        transform-origin: right center;
        opacity: .82;
    }
}

@media (max-width: 767px) {
    .page-banner:has(.solar-system) {
        min-height: 240px;
    }

    .solar-system {
        right: -55px;
        margin-top: -115px;
        transform: scale(.6);
        opacity: .6;
    }
}

/* ---------- 12.10 关于页行星光环增强 ---------- */
.about-planet {
    animation: hud-home-planet-glow 4.6s ease-in-out infinite alternate;
}

@keyframes hud-home-planet-glow {
    from {
        box-shadow:
            0 0 0 9px rgba(var(--neon-rgb), .04),
            0 0 0 18px rgba(var(--nebula-rgb), .05),
            0 0 34px rgba(var(--neon-rgb), .18);
    }
    to {
        box-shadow:
            0 0 0 11px rgba(var(--neon-rgb), .07),
            0 0 0 24px rgba(var(--nebula-rgb), .09),
            0 0 60px rgba(var(--nebula-rgb), .32);
    }
}

/* ---------- 12.11 动效降级补充（必须位于全部动画定义之后） ---------- */
@media (prefers-reduced-motion: reduce) {
    .nebula-layer,
    .meteor,
    .solar-system .planet,
    .solar-sun,
    .panel-title::before,
    .btn-neon,
    .logo-mark,
    .stars-1,
    .stars-2,
    .empty-icon,
    .about-planet {
        animation: none;
    }
}

/* ---------- 13. 舰桥排版层：指挥条 / 数据台 / 数据卡 / 副面板（装饰沿用 HUD 层） ---------- */

/* ---------- 13.1 舰桥指挥条：导航等宽字体 + 前置指示符 ---------- */
.site-nav > a {
    font-family: var(--font-mono);
    font-size: .86rem;
    letter-spacing: .05em;
}

.site-nav > a::before {
    content: '>';
    margin-right: .3rem;
    color: var(--neon);
    opacity: .55;
    transition: opacity .2s;
}

.site-nav > a:hover::before {
    opacity: 1;
}

/* ---------- 13.2 主视口数据台：HUD 数据带 ---------- */
.page-banner {
    padding: 2.6rem 1rem 3rem;
}

.hero-data {
    display: flex;
    justify-content: center;
    margin-top: 1.4rem;
}

.hero-data-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .1rem;
    min-width: 118px;
    padding: .7rem 1.6rem;
    background: rgba(var(--bg-input-rgb), .5);
    border-top: 1px solid rgba(var(--neon-rgb), .28);
    border-bottom: 1px solid rgba(var(--neon-rgb), .28);
}

.hero-data-item + .hero-data-item {
    border-left: 1px solid rgba(var(--muted-rgb), .22);
}

.hero-data-item strong {
    font-family: var(--font-mono);
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--neon);
    text-shadow: 0 0 16px rgba(var(--neon-rgb), .45);
}

.hero-data-item span {
    font-family: var(--font-mono);
    font-size: .76rem;
    letter-spacing: .1em;
    color: var(--text-sub);
}

/* ---------- 13.3 数据卡：状态行分隔 + 底部操作行 ---------- */
.card-meta .meta-date {
    padding-left: .9rem;
    border-left: 1px solid rgba(var(--muted-rgb), .28);
}

.card-title {
    font-weight: 700;
}

.card-footer {
    border-top: 1px dashed rgba(var(--muted-rgb), .16);
    padding-top: .75rem;
    margin-top: 1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--neon);
}

/* ---------- 13.4 副面板阵列：编号标题 + 数据行光条 ---------- */
.panel-no {
    font-family: var(--font-mono);
    font-size: .82em;
    letter-spacing: .04em;
    color: var(--neon);
    opacity: .85;
    margin-right: .45rem;
    text-shadow: 0 0 8px rgba(var(--neon-rgb), .4);
}

.side-panel {
    padding: 1.5rem 1.4rem;
}

/* 星区导航 · HUD 四角括号 + 悬停扫描线 */
.side-category-list li::before,
.side-category-list li::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .5;
    background-repeat: no-repeat;
    transition: opacity .22s;
    background-image:
        linear-gradient(rgba(var(--neon-rgb), .9), rgba(var(--neon-rgb), .9)),
        linear-gradient(rgba(var(--neon-rgb), .9), rgba(var(--neon-rgb), .9)),
        linear-gradient(rgba(var(--neon-rgb), .9), rgba(var(--neon-rgb), .9)),
        linear-gradient(rgba(var(--neon-rgb), .9), rgba(var(--neon-rgb), .9));
}

.side-category-list li::before {
    background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px;
    background-position: left top, left top, right top, right top;
}

.side-category-list li::after {
    background-size: 9px 1px, 1px 9px, 9px 1px, 1px 9px;
    background-position: left bottom, left bottom, right bottom, right bottom;
}

.side-category-list li:hover::before,
.side-category-list li:hover::after {
    opacity: 1;
}

.side-category-list a::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(var(--neon-rgb), .65), transparent);
    opacity: 0;
    pointer-events: none;
}

.side-category-list li:hover a::before {
    animation: side-category-scan 1.8s linear infinite;
}

@keyframes side-category-scan {
    0%   { top: 0; opacity: 0; }
    15%  { opacity: .85; }
    85%  { opacity: .45; }
    100% { top: 100%; opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .side-category-list li:hover a::before {
        animation: none;
    }
}

.hot-rank.top {
    background: rgba(var(--neon-rgb), .08);
}

/* ---------- 13.5 任务简报屏：标题 / 简报块 / 更新时间 / 通讯光点 ---------- */
.article-title {
    font-weight: 800;
    letter-spacing: .01em;
}

.article-summary {
    font-size: 1.02rem;
    line-height: 1.75;
    padding: .75rem 1.1rem;
    background: rgba(var(--bg-input-rgb), .5);
    border-left: 4px solid;
    border-image: linear-gradient(180deg, var(--neon), var(--nebula)) 1;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-updated-meta {
    margin-left: auto;
    color: var(--text-faint);
    font-family: var(--font-mono);
    font-size: .8rem;
}

.article-updated-meta::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    margin-right: .45rem;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px rgba(56, 232, 160, .8);
    vertical-align: middle;
}

.comment-item {
    position: relative;
}

.comment-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 50%;
    width: 3px;
    height: 3px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: var(--neon);
    box-shadow: 0 0 8px rgba(var(--neon-rgb), .8);
}

/* ---------- 13.6 舰船铭牌页脚 ---------- */
.footer-name {
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .28em;
    color: var(--text-main);
    margin-bottom: .3rem;
}

.footer-copy {
    margin-top: .7rem;
    font-family: var(--font-mono);
    font-size: .8rem;
    letter-spacing: .04em;
}

/* ---------- 13.7 其余页面统一：计数等宽 ---------- */
.page-count {
    font-family: var(--font-mono);
    letter-spacing: .08em;
}

/* ---------- 13.8 响应式：移动端数据带等分压缩 ---------- */
@media (max-width: 767px) {
    .hero-data-item {
        min-width: 0;
        flex: 1;
        padding: .6rem .4rem;
    }

    .hero-data-item strong {
        font-size: 1.4rem;
    }

    .hero-data-item span {
        font-size: .68rem;
    }
}

/* ---------- 14. 舰体层：舰桥尖首 / 甲板双翼 / 双引擎舰尾（纯装饰 pointer-events:none） ---------- */

/* ---------- 14.1 舰桥尖首：顶栏底部中央三角楔形 ---------- */
.site-header {
    position: relative;
}

.site-header::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -18px;
    width: 220px;
    height: 18px;
    transform: translateX(-50%);
    pointer-events: none;
    background: rgba(var(--bg-panel-rgb), .85);
    clip-path: polygon(50% 100%, 0 0, 100% 0);
    filter: drop-shadow(0 0 6px rgba(var(--neon-rgb), .35));
}

/* ---------- 14.2 甲板双翼（≥1024px 对称后掠翼板） ---------- */
.site-main {
    position: relative;
}

@media (min-width: 1024px) {
    .site-main::before,
    .site-main::after {
        content: '';
        position: absolute;
        top: 40px;
        width: 90px;
        height: 200px;
        z-index: -1;
        pointer-events: none;
        background: rgba(var(--bg-panel-rgb), .55);
        clip-path: polygon(0 0, 100% 30%, 55% 100%, 0 78%);
        filter: drop-shadow(0 0 8px rgba(var(--neon-rgb), .18));
    }

    .site-main::before {
        left: -100px;
    }

    .site-main::after {
        right: -100px;
        transform: scaleX(-1);
    }
}

/* ---------- 14.3 双引擎舰尾：引擎口圆环 + 尾焰光锥 ---------- */
.ship-engines {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 1.2rem 0 1.5rem;
    padding: 1.3rem 0 1.6rem;
    background: rgba(var(--bg-input-rgb), .42);
    clip-path: polygon(12% 0, 88% 0, 100% 100%, 0 100%);
}

.engine {
    position: relative;
    display: block;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 50% 50%, #0a1226 0 35%, transparent 36%),
        conic-gradient(from 40deg, rgba(var(--neon-rgb), .55), rgba(var(--nebula-rgb), .55), rgba(var(--neon-rgb), .55));
    box-shadow:
        0 0 22px rgba(var(--neon-rgb), .3),
        inset 0 0 20px rgba(var(--neon-rgb), .18);
    animation: hud-home-engine 3s ease-in-out infinite alternate;
}

@keyframes hud-home-engine {
    from { box-shadow: 0 0 16px rgba(var(--neon-rgb), .22), inset 0 0 14px rgba(var(--neon-rgb), .12); }
    to   { box-shadow: 0 0 30px rgba(var(--neon-rgb), .45), inset 0 0 26px rgba(var(--nebula-rgb), .3); }
}

.engine-flame {
    display: block;
    position: absolute;
    left: 50%;
    top: 76%;
    width: 44px;
    height: 60px;
    transform: translateX(-50%);
    transform-origin: top center;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(var(--neon-rgb), .7), rgba(var(--nebula-rgb), .25) 55%, transparent);
    clip-path: polygon(50% 0, 100% 100%, 0 100%);
    filter: blur(2px);
    animation: hud-home-flame 1.6s ease-in-out infinite alternate;
}

@keyframes hud-home-flame {
    from { opacity: .7; transform: translateX(-50%) scaleY(.9); }
    to   { opacity: 1; transform: translateX(-50%) scaleY(1.1); }
}

/* ---------- 14.4 响应式：移动端缩小舰首与引擎 ---------- */
@media (max-width: 767px) {
    .site-header::after {
        width: 140px;
        height: 12px;
        bottom: -12px;
    }

    .ship-engines {
        gap: 1.8rem;
        padding: 1rem 0 1.2rem;
    }

    .engine {
        width: 56px;
        height: 56px;
    }

    .engine-flame {
        width: 32px;
        height: 40px;
    }
}

/* ---------- 14.5 动效降级补充（位于本层动画定义之后） ---------- */
@media (prefers-reduced-motion: reduce) {
    .engine,
    .engine-flame {
        animation: none;
    }
}

/* ---------- 15. 舰桥之眼：登录 / 注册 / 控制台 / 退出入口（替代「>」指示符与导航下划线） ---------- */

.site-nav .eye-nav {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
}

/* 退出按钮：浏览器按钮默认样式重置，与导航链接视觉一致 */
.site-nav .eye-logout {
    background: none;
    border: 0;
    padding: .3rem 0;
    cursor: pointer;
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: .86rem;
    letter-spacing: .05em;
    line-height: inherit;
}

/* 退出表单：不破坏导航 flex 排列 */
.nav-logout-form {
    display: inline-flex;
    margin: 0;
}

.site-nav .eye-nav::before {
    content: '';
    display: inline-block;
    flex-shrink: 0;
    width: 34px;
    height: 21px;
    border-radius: 50%;
    margin-right: 0;
    border: 1px solid rgba(var(--neon-rgb), .55);
    background:
        radial-gradient(circle at 64% 34%, rgba(255, 255, 255, .95) 0 3px, transparent 4px),
        radial-gradient(circle at 50% 52%, #04060f 0 6.5px, transparent 7.5px),
        radial-gradient(circle at 50% 50%, var(--neon) 0 9px, var(--nebula) 15px, transparent 16px);
    box-shadow:
        0 0 10px rgba(var(--neon-rgb), .3),
        inset 0 0 8px rgba(var(--neon-rgb), .22),
        inset 0 2px 5px rgba(255, 255, 255, .14);
    color: transparent;
    opacity: 1;
    transition: box-shadow .25s;
    vertical-align: middle;
}

.site-nav .eye-nav::after {
    display: none;
}

.site-nav .eye-nav:hover {
    color: var(--text-main);
}

.site-nav .eye-nav:hover::before {
    box-shadow: 0 0 16px rgba(var(--neon-rgb), .55), inset 0 0 12px rgba(var(--neon-rgb), .3);
    animation: hud-home-blink .5s ease;
}

@keyframes hud-home-blink {
    0%, 100% { transform: scaleY(1); }
    40%      { transform: scaleY(.15); }
}

/* ---------- 15.1 动效降级补充 ---------- */
@media (prefers-reduced-motion: reduce) {
    .site-nav .eye-nav:hover::before {
        animation: none;
    }
}

/* ---------- 15.2 移动端：退出按钮与导航项一致 ---------- */
@media (max-width: 767px) {
    .nav-logout-form {
        display: block;
    }

    .site-nav .eye-logout {
        width: 100%;
        padding: .8rem .4rem;
        font-size: 1rem;
        border-bottom: 1px dashed rgba(var(--muted-rgb), .18);
        text-align: left;
    }
}

/* ---------- 16. 弹出式搜索舱（checkbox hack 开合，JS 仅补外部点击 / Esc 关闭与聚焦） ---------- */

.search-toggle-input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.nav-search-toggle {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    color: var(--text-sub);
    font-family: var(--font-mono);
    font-size: .86rem;
    letter-spacing: .05em;
    padding-block: .3rem;
    cursor: pointer;
    user-select: none;
    transition: color .2s;
}

/* 放大镜图标：桌面端单独展示，替代原「> 搜索」文字入口 */
.search-toggle-icon {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    color: inherit;
    opacity: .85;
    transition: opacity .2s, color .2s, filter .2s;
}

/* 文字仅在移动端汉堡菜单中补显（桌面端隐藏） */
.search-toggle-text {
    display: none;
}

.nav-search-toggle:hover {
    color: var(--text-main);
}

.nav-search-toggle:hover .search-toggle-icon {
    color: var(--neon);
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(var(--neon-rgb), .6));
}

/* 搜索舱展开时图标保持霓虹高亮 */
.site-header:has(.search-toggle-input:checked) .search-toggle-icon {
    color: var(--neon);
    opacity: 1;
}

/* ---------- 16.1 搜索舱面板：顶栏下方滑出 ---------- */
.search-bar {
    max-height: 0;
    overflow: hidden;
    background: rgba(var(--bg-deep-rgb), .94);
    border-bottom: 1px solid transparent;
    transition: max-height .32s ease, border-color .32s ease;
}

.search-toggle-input:checked ~ .search-bar {
    max-height: 110px;
    border-bottom-color: rgba(var(--neon-rgb), .35);
}

.search-bar-inner {
    padding: .9rem 0 1rem;
}

.search-bar .nav-search {
    justify-content: center;
}

.search-bar .nav-search input {
    width: 100%;
    max-width: 520px;
    padding: .6rem 1rem;
    font-size: .95rem;
    transition: border-color .3s, box-shadow .3s;
}

.search-bar .nav-search input:focus {
    width: 100%;
    border-color: rgba(var(--neon-rgb), .55);
    box-shadow: 0 0 0 3px rgba(var(--neon-rgb), .12), 0 0 10px rgba(var(--neon-rgb), .18);
}

.search-bar .nav-search button {
    padding: .5rem 1.4rem;
    font-size: .85rem;
}

/* ---------- 16.2 移动端：搜索按钮与汉堡菜单导航项一致 ---------- */
@media (max-width: 767px) {
    .nav-search-toggle {
        padding: .8rem .4rem;
        font-size: 1rem;
        border-bottom: 1px dashed rgba(var(--muted-rgb), .18);
    }

    .search-toggle-text {
        display: inline;
    }

    .search-toggle-icon {
        width: 19px;
        height: 19px;
    }

    .search-bar .nav-search input {
        max-width: none;
    }
}

/* ---------- 16.3 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
    .search-bar {
        transition: none;
    }
}

/* ---------- 17. AI 助手（全站悬浮对话） ---------- */
.ai-assistant {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 990;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

/* ---------- 17.1 悬浮按钮：固定在右下角，显示太空人 + 呼吸光晕 ---------- */
.ai-fab {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 991;
    width: 76px;
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    animation: ai-astro-glow 3s ease-in-out infinite;
    transition: transform .25s ease;
}

.ai-fab:active {
    transform: scale(.92);
}

@keyframes ai-astro-glow {
    0%, 100% { filter: drop-shadow(0 0 5px rgba(var(--nebula-rgb), .35)); }
    50%      { filter: drop-shadow(0 0 14px rgba(var(--neon-rgb), .4)); }
}

.ai-fab:focus-visible {
    outline: 2px solid var(--neon);
    outline-offset: 3px;
}

/* 面板展开时隐藏悬浮按钮，避免遮挡面板内容（统一各端行为） */
.ai-assistant:has(.ai-panel.open) .ai-fab {
    display: none;
}

/* 太空人模型：静态停靠 */
.ai-astronaut {
    display: block;
    width: 64px;
    height: 64px;
}

/* 宇航服：白 + 霓虹青描边 */
.ai-astronaut .ai-helmet,
.ai-astronaut .ai-body,
.ai-astronaut .ai-arm,
.ai-astronaut .ai-leg {
    fill: #eaf6ff;
    stroke: rgba(var(--neon-rgb), .45);
    stroke-width: 1.4;
}

.ai-astronaut .ai-antenna {
    stroke: rgba(var(--neon-rgb), .6);
    stroke-width: 1.6;
    stroke-linecap: round;
}

.ai-astronaut .ai-antenna-dot {
    fill: var(--neon);
    filter: drop-shadow(0 0 4px rgba(var(--neon-rgb), .9));
}

.ai-astronaut .ai-pack {
    fill: #c9d8ea;
    stroke: rgba(var(--nebula-rgb), .4);
    stroke-width: 1.2;
}

.ai-astronaut .ai-boot {
    fill: #b9c6da;
    stroke: rgba(var(--neon-rgb), .3);
    stroke-width: 1.1;
}

/* 身体控制灯：呼吸闪烁 */
.ai-astronaut .ai-body-light {
    fill: var(--neon);
    filter: drop-shadow(0 0 2px rgba(var(--neon-rgb), .9));
    animation: ai-light-blink 2.6s ease-in-out infinite;
}

@keyframes ai-light-blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

/* 面罩：深空渐变 + 高光，hover 提亮 */
.ai-astronaut .ai-visor {
    stroke: rgba(var(--neon-rgb), .75);
    stroke-width: 1.3;
}

.ai-astronaut .ai-visor-shine {
    fill: #ffffff;
    opacity: .92;
}

.ai-astronaut .ai-visor-shine-sm {
    fill: #bfefff;
    opacity: .85;
}

/* 生命感：身体呼吸（以脚为支点轻微起伏） */
.ai-astronaut-body {
    transform-box: fill-box;
    transform-origin: 50% 88%;
    animation: ai-breathe 3.2s ease-in-out infinite;
}

@keyframes ai-breathe {
    0%, 100% { transform: scaleY(1); }
    50%      { transform: scaleY(1.03); }
}

/* 生命感：眨眼（高光瞬间压扁） */
.ai-visor-shine {
    transform-box: fill-box;
    transform-origin: center;
    animation: ai-blink 4.5s ease-in-out infinite;
}

@keyframes ai-blink {
    0%, 46%, 52%, 100% { transform: scaleY(1); }
    49%                { transform: scaleY(.15); }
}

/* 对话等待期：面罩脉冲呼吸 */
.ai-assistant:has(.ai-input.is-sending) .ai-visor {
    animation: ai-visor-pulse 1.1s ease-in-out infinite;
}

@keyframes ai-visor-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: .55; }
}

/* ---------- 17.2 对话面板：深空底 + 霓虹青描边 ---------- */
.ai-panel {
    display: none;
    width: 360px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: 70vh;
    flex-direction: column;
    background: rgba(5, 10, 26, .96);
    border: 1px solid rgba(var(--neon-rgb), .35);
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .55), 0 0 24px rgba(var(--neon-rgb), .12);
    overflow: hidden;
}

.ai-panel.open {
    display: flex;
    animation: ai-panel-in .22s ease;
}

@keyframes ai-panel-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
}

.ai-panel-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(var(--neon-rgb), .18);
    background: linear-gradient(90deg, rgba(var(--nebula-rgb), .14), rgba(var(--neon-rgb), .05));
}

.ai-panel-title {
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .06em;
    color: var(--hud-hi);
}

/* 模式徽标：AI 在线青色 / 基础模式灰色 */
.ai-mode-badge {
    margin-left: auto;
    padding: 3px 9px;
    border: 1px solid;
    border-radius: 999px;
    font-size: .7rem;
    font-family: var(--font-mono);
    white-space: nowrap;
}

.ai-mode-badge.is-ai {
    color: var(--neon);
    border-color: rgba(var(--neon-rgb), .45);
    background: rgba(var(--neon-rgb), .08);
}

.ai-mode-badge.is-local {
    color: var(--text-sub);
    border-color: rgba(var(--muted-rgb), .35);
    background: rgba(var(--muted-rgb), .08);
}

.ai-panel-close {
    margin-left: 2px;
    width: 26px;
    height: 26px;
    border: 1px solid rgba(var(--muted-rgb), .3);
    border-radius: 6px;
    background: transparent;
    color: var(--text-sub);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
    transition: color .2s, border-color .2s;
}

.ai-panel-close:hover {
    color: var(--neon);
    border-color: var(--neon);
}

/* ---------- 17.3 消息区：用户靠右霓虹青 / AI 靠左星云紫 ---------- */
.ai-messages {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.ai-messages::-webkit-scrollbar {
    width: 6px;
}

.ai-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--neon-rgb), .25);
    border-radius: 3px;
}

.ai-msg {
    display: flex;
    flex-direction: column;
    max-width: 86%;
}

.ai-msg-user {
    align-self: flex-end;
    align-items: flex-end;
}

.ai-msg-ai {
    align-self: flex-start;
    align-items: flex-start;
}

.ai-msg-time {
    margin: 0 4px 4px;
    font-size: .66rem;
    font-family: var(--font-mono);
    color: var(--text-faint);
}

.ai-bubble {
    position: relative;
    padding: 10px 12px;
    border: 1px solid;
    border-radius: 12px;
    font-size: .87rem;
    font-family: var(--font-mono);
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}

.ai-msg-user .ai-bubble {
    border-color: rgba(var(--neon-rgb), .4);
    border-top-right-radius: 4px;
    background: rgba(var(--neon-rgb), .1);
    box-shadow: 0 0 12px rgba(var(--neon-rgb), .12);
    color: #d9fbff;
}

.ai-msg-ai .ai-bubble {
    border-color: rgba(var(--nebula-rgb), .38);
    border-top-left-radius: 4px;
    background: rgba(var(--nebula-rgb), .12);
    color: var(--text-main);
}

.ai-bubble-error {
    border-color: var(--danger) !important;
    background: rgba(255, 92, 122, .08) !important;
    color: #ffc4d0 !important;
}

/* 等待 / 打字光标闪烁 */
.ai-bubble.is-typing::after {
    content: '▍';
    margin-left: 2px;
    color: var(--neon);
    animation: hud-home-blink 1s steps(1) infinite;
}

/* ---------- 17.4 输入区 ---------- */
.ai-input {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid rgba(var(--neon-rgb), .18);
    background: rgba(var(--bg-input-rgb), .6);
}

.ai-input input {
    flex: 1;
    min-width: 0;
    padding: 9px 12px;
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--text-main);
    font-size: .88rem;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.ai-input input:focus {
    border-color: var(--neon);
    box-shadow: 0 0 10px rgba(var(--neon-rgb), .2);
}

.ai-input button {
    padding: 0 16px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--neon), var(--nebula));
    color: var(--accent-ink);
    font-weight: 600;
    font-size: .85rem;
    cursor: pointer;
    transition: filter .2s, opacity .2s;
}

.ai-input button:hover {
    filter: brightness(1.15);
}

.ai-input.is-sending button {
    opacity: .55;
    cursor: not-allowed;
}

/* ---------- 17.5 移动端：底部抽屉（92vh 全宽） ---------- */
@media (max-width: 767px) {
    .ai-assistant {
        right: 12px;
        bottom: 12px;
    }

    .ai-fab {
        right: 12px;
        bottom: 12px;
        width: 62px;
        height: 62px;
    }

    .ai-astronaut {
        width: 52px;
        height: 52px;
    }

    .ai-panel {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        height: 92vh;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    }
}

/* ---------- 17.6 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
    .ai-fab {
        animation: none;
    }

    .ai-panel.open {
        animation: none;
    }

    .ai-body-light,
    .ai-astronaut-body,
    .ai-visor-shine,
    .ai-assistant:has(.ai-input.is-sending) .ai-visor {
        animation: none;
    }

    .ai-bubble.is-typing::after {
        animation: none;
    }

    .ai-messages {
        scroll-behavior: auto;
    }
}

/* ---- 密码保护页（文章 / 独立页面 / 分类共用） ---- */
.password-panel {
    max-width: 480px;
    margin: 48px auto;
    padding: 40px 32px;
    text-align: center;
    border: 1px solid rgba(var(--neon-rgb), 0.18);
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(var(--bg-panel-rgb), 0.85), rgba(var(--bg-deep-rgb), 0.9));
    box-shadow: 0 0 32px rgba(var(--neon-rgb), 0.08);
}

.password-lock {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: 50%;
    color: var(--neon);
    border: 1px solid rgba(var(--neon-rgb), 0.35);
    background: rgba(var(--neon-rgb), 0.06);
}

.password-title {
    margin: 18px 0 8px;
    font-size: 1.35rem;
    color: var(--text-main);
}

.password-desc {
    margin: 0 0 22px;
    color: var(--text-sub);
    font-size: 0.92rem;
    line-height: 1.7;
}

.password-form {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.password-form input[type="password"] {
    flex: 1 1 220px;
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid rgba(var(--neon-rgb), 0.3);
    background: rgba(var(--bg-input-rgb), 0.8);
    color: var(--text-main);
    outline: none;
}

.password-form input[type="password"]:focus {
    border-color: var(--neon);
    box-shadow: 0 0 12px rgba(var(--neon-rgb), 0.25);
}

.password-panel .flash-error {
    margin: 18px 0 0;
}

/* 列表卡片：受密码保护摘要占位 */
.card-summary-locked {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-sub);
}

.card-summary-locked::before {
    content: '';
    display: inline-block;
    width: 12px;
    height: 15px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='5' y='10.5' width='14' height='9.5' rx='2'/%3E%3Cpath d='M8 10.5V8a4 4 0 0 1 8 0v2.5'/%3E%3C/svg%3E") no-repeat center / contain;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='5' y='10.5' width='14' height='9.5' rx='2'/%3E%3Cpath d='M8 10.5V8a4 4 0 0 1 8 0v2.5'/%3E%3C/svg%3E") no-repeat center / contain;
    flex-shrink: 0;
}

/* ---------- 前台主题切换菜单（details/summary，无脚本也可用） ---------- */
.theme-menu {
    position: relative;
}

.theme-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .28rem .75rem;
    list-style: none;
    cursor: pointer;
    user-select: none;
    color: var(--text-sub);
    font-size: .9rem;
    border: 1px solid var(--border-dim);
    border-radius: 999px;
    transition: color .22s, border-color .22s, background .22s;
}

.theme-menu-trigger::-webkit-details-marker {
    display: none;
}

.theme-menu-trigger:hover,
.theme-menu[open] .theme-menu-trigger {
    color: var(--text-main);
    border-color: rgba(var(--neon-rgb), .5);
    background: rgba(var(--neon-rgb), .08);
}

.theme-menu-panel {
    position: absolute;
    right: 0;
    top: calc(100% + .75rem);
    z-index: 130;
    width: 258px;
    padding: .55rem;
    background: rgba(var(--bg-panel-rgb), .96);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-lg);
    box-shadow: 0 18px 42px rgba(var(--bg-deep-rgb), .55), 0 0 24px rgba(var(--neon-rgb), .12);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.theme-menu-title {
    margin: 0;
    padding: .15rem .5rem .45rem;
    font-size: .72rem;
    letter-spacing: .12em;
    color: var(--text-faint);
    border-bottom: 1px dashed rgba(var(--muted-rgb), .25);
}

.theme-option {
    display: flex;
    align-items: center;
    gap: .65rem;
    margin-top: .25rem;
    padding: .45rem .5rem;
    color: var(--text-main);
    border: 1px solid transparent;
    border-radius: calc(var(--radius) - 2px);
    transition: background .2s, border-color .2s;
}

.theme-option:hover {
    background: rgba(var(--neon-rgb), .08);
    border-color: rgba(var(--neon-rgb), .24);
}

.theme-option.is-active {
    background: rgba(var(--neon-rgb), .1);
    border-color: rgba(var(--neon-rgb), .42);
}

@media (max-width: 767px) {
    .theme-menu {
        width: 100%;
    }

    .theme-menu-trigger {
        justify-content: center;
    }

    .theme-menu-panel {
        right: auto;
        left: 0;
        width: min(280px, calc(100vw - 2.4rem));
    }
}



