/* =====================================================================
 * liquid-glass.css - 液态玻璃设计系统
 * 基于 Cinematic Space-Travel 设计规范，适配导航站 + 日夜切换
 * ===================================================================== */

/* ---- 去除所有元素 outline ---- */
*, *::before, *::after {
    outline: none !important;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* ---- CSS 变量：日间 / 夜间 ---- */
:root {
    --lg-bg: #ffffff;
    --lg-text: #1d1d1f;
    --lg-text-secondary: rgba(29, 29, 31, 0.65);
    --lg-text-muted: rgba(29, 29, 31, 0.4);
    --lg-glass-bg: rgba(255, 255, 255, 0.7);
    --lg-glass-border: rgba(0, 0, 0, 0.08);
    --lg-glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 2px 12px rgba(0, 0, 0, 0.06);
    --lg-card-bg: rgba(245, 245, 247, 0.6);
    --lg-accent: #0071e3;
    --lg-accent-hover: #0077ed;
    --lg-video-opacity: 0;
    --lg-overlay: transparent;
}

body.dark {
    --lg-bg: #000000;
    --lg-text: #ffffff;
    --lg-text-secondary: rgba(255, 255, 255, 0.7);
    --lg-text-muted: rgba(255, 255, 255, 0.4);
    --lg-glass-bg: rgba(255, 255, 255, 0.01);
    --lg-glass-border: rgba(255, 255, 255, 0.15);
    --lg-glass-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
    --lg-card-bg: rgba(255, 255, 255, 0.03);
    --lg-accent: #0a84ff;
    --lg-accent-hover: #409cff;
    --lg-video-opacity: 1;
    --lg-overlay: transparent;
}

/* ---- 基础重置 ---- */
html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

html, body {
    overflow-x: hidden;
    width: 100%;
}

body {
    min-height: 100vh;
    background: var(--lg-bg);
    color: var(--lg-text);
    font-family: 'Barlow', -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    font-weight: 400;
    line-height: 1.6;
    transition: background-color 0.5s ease, color 0.5s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; border-style: none; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---- 字体类 ---- */
.font-heading { font-family: 'Instrument Serif', serif; font-style: italic; }
.font-body { font-family: 'Barlow', sans-serif; }

/* =====================================================================
 * 液态玻璃核心样式（严格按 prompt.txt 规范）
 * ===================================================================== */
.liquid-glass {
    background: var(--lg-glass-bg);
    background-blend-mode: luminosity;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: none;
    box-shadow: var(--lg-glass-shadow);
    position: relative;
    overflow: hidden;
}

.liquid-glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.45) 0%,
        rgba(255, 255, 255, 0.15) 20%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0.15) 80%,
        rgba(255, 255, 255, 0.45) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.liquid-glass-strong {
    background: var(--lg-glass-bg);
    background-blend-mode: luminosity;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
    border: none;
    box-shadow: 4px 4px 4px rgba(0, 0, 0, 0.05), inset 0 1px 1px rgba(255, 255, 255, 0.15);
    position: relative;
    overflow: hidden;
}

.liquid-glass-strong::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1.4px;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.5) 0%,
        rgba(255, 255, 255, 0.2) 20%,
        rgba(255, 255, 255, 0) 40%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0.2) 80%,
        rgba(255, 255, 255, 0.5) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

/* =====================================================================
 * 视频背景层
 * ===================================================================== */
.video-bg-wrapper {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.video-bg-wrapper video {
    position: absolute;
    object-fit: cover;
    z-index: 0;
}

/* 日间模式：隐藏视频，使用纯白背景 */
body:not(.dark) .video-bg-wrapper {
    display: none;
}

body:not(.dark) .hero-section,
body:not(.dark) .nav-section {
    background: #ffffff;
}

/* 夜间模式视频遮罩 */
body.dark .video-bg-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

/* =====================================================================
 * 导航栏
 * ===================================================================== */
.lg-navbar {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 1rem;
    width: calc(100% - 2rem);
    max-width: 1200px;
}

.lg-navbar-center {
    display: none;
}

@media (min-width: 768px) {
    .lg-navbar-center {
        display: flex;
        align-items: center;
        gap: 0.25rem;
    }
}

/* 居中站点标题 */
.lg-site-title {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-family: '"Instrument Serif"', serif;
    font-style: italic;
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--lg-text);
    white-space: nowrap;
    pointer-events: auto;
    transition: opacity 0.25s ease;
}

.lg-site-title:hover { opacity: 0.7; }

@media (max-width: 767px) {
    .lg-site-title {
        font-size: 1rem;
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.lg-nav-link {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lg-text);
    opacity: 0.9;
    transition: opacity 0.25s ease;
    white-space: nowrap;
}

.lg-nav-link:hover {
    opacity: 1;
}

/* lg-logo 已移除，替换为居中标题 lg-site-title */

/* =====================================================================
 * Hero 区域
 * ===================================================================== */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.hero-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1rem 2rem;
}

.hero-avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    border: 2px solid var(--lg-glass-border);
}

.hero-headline {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    color: var(--lg-text);
    font-size: 2.5rem;
    line-height: 0.9;
    letter-spacing: -2px;
    max-width: 36rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .hero-headline { font-size: 3.5rem; }
}

@media (min-width: 1024px) {
    .hero-headline { font-size: 4.5rem; }
}

.hero-subheading {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: var(--lg-text-secondary);
    max-width: 32rem;
    font-weight: 300;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .hero-subheading { font-size: 1rem; }
}

/* ---- 打字机 ---- */
.typewriter-wrap {
    margin-top: 1.5rem;
    min-height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.typewriter-text {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 1.125rem;
    color: var(--lg-text);
    opacity: 0.85;
}

@media (min-width: 768px) {
    .typewriter-text { font-size: 1.25rem; }
}

.typewriter-cursor {
    display: inline-block;
    width: 2px;
    height: 1.2em;
    background: var(--lg-text);
    margin-left: 2px;
    animation: blink 0.8s infinite;
    vertical-align: middle;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ---- 联系方式图标 ---- */
.contact-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.contact-chip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    color: var(--lg-text);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.contact-chip:hover {
    transform: translateY(-2px);
}

.contact-chip svg,
.contact-chip img {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ---- CTA 按钮 ---- */
.cta-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.cta-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lg-text);
    transition: transform 0.25s ease;
}

.cta-primary:hover { transform: translateY(-1px); }

.cta-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--lg-text);
    opacity: 0.8;
    transition: opacity 0.25s ease;
}

.cta-secondary:hover { opacity: 1; }

/* ---- 平台统计 ---- */
.stats-row {
    display: flex;
    align-items: stretch;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-card {
    padding: 1.25rem;
    width: 220px;
    border-radius: 1.25rem;
    max-width: calc(50vw - 0.5rem);
}

.stat-number {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 2.25rem;
    letter-spacing: -1px;
    line-height: 1;
    color: var(--lg-text);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--lg-text-secondary);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* =====================================================================
 * 导航分组区域
 * ===================================================================== */
.nav-section {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
}

.nav-section-content {
    position: relative;
    z-index: 10;
    padding: 6rem 1rem 2.5rem;
}

@media (min-width: 768px) {
    .nav-section-content { padding: 6rem 2rem 2.5rem; }
}

@media (min-width: 1024px) {
    .nav-section-content { padding: 6rem 3rem 2.5rem; }
}

.nav-kicker {
    font-size: 0.875rem;
    color: var(--lg-text-secondary);
    margin-bottom: 1.5rem;
}

.nav-heading {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    color: var(--lg-text);
    font-size: 2.5rem;
    line-height: 0.9;
    letter-spacing: -2px;
}

@media (min-width: 768px) {
    .nav-heading { font-size: 3.5rem; }
}

@media (min-width: 1024px) {
    .nav-heading { font-size: 4.5rem; }
}

/* ---- 导航分组卡片 ---- */
.nav-group-card {
    border-radius: 1.25rem;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.nav-group-title {
    font-family: 'Instrument Serif', serif;
    font-style: italic;
    font-size: 1.5rem;
    color: var(--lg-text);
    margin-bottom: 1rem;
}

@media (min-width: 768px) {
    .nav-group-title { font-size: 1.75rem; }
}

/* ---- 导航链接卡片网格 ---- */
.nav-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .nav-links-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .nav-links-grid { grid-template-columns: repeat(4, 1fr); }
}

/* 手机端可配置列数（由 JS 设置 --mobile-cols） */
@media (max-width: 639px) {
    .nav-links-grid {
        grid-template-columns: repeat(var(--mobile-cols, 2), 1fr);
    }
}

.nav-link-card {
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.nav-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

body.dark .nav-link-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.nav-link-icon {
    width: 36px;
    height: 36px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.nav-link-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.nav-link-icon svg {
    width: 20px;
    height: 20px;
}

.nav-link-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--lg-text);
    line-height: 1.3;
}

.nav-link-url {
    font-size: 0.6875rem;
    color: var(--lg-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

.nav-link-remark {
    font-size: 0.6875rem;
    color: var(--lg-text-secondary);
    margin-top: 0.125rem;
}

/* =====================================================================
 * 友链区域
 * ===================================================================== */
.friend-section {
    position: relative;
    z-index: 10;
    padding: 3rem 1rem;
}

@media (min-width: 768px) {
    .friend-section { padding: 3rem 2rem; }
}

.friend-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

@media (min-width: 640px) {
    .friend-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
    .friend-grid { grid-template-columns: repeat(3, 1fr); }
}

.friend-card {
    border-radius: 1rem;
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: transform 0.3s ease;
}

.friend-card:hover {
    transform: translateY(-2px);
}

.friend-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.friend-card-icon img { width: 100%; height: 100%; object-fit: contain; }
.friend-card-icon svg { width: 22px; height: 22px; }

.friend-card-info { flex: 1; min-width: 0; }
.friend-card-name { font-size: 0.875rem; font-weight: 500; color: var(--lg-text); }
.friend-card-desc { font-size: 0.6875rem; color: var(--lg-text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* =====================================================================
 * 页脚
 * ===================================================================== */
.lg-footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem 1rem 5rem;
    font-size: 0.75rem;
    color: var(--lg-text-muted);
}

/* =====================================================================
 * 日夜切换按钮
 * ===================================================================== */
.dark-toggle-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lg-text);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.dark-toggle-btn:hover { transform: rotate(-15deg); }
.dark-toggle-btn svg { width: 18px; height: 18px; }

/* =====================================================================
 * 滚动进度按钮（左侧，避开底部歌词区域）
 * ===================================================================== */
.scroll-progress-btn {
    position: fixed;
    left: 1.25rem;
    bottom: 5rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lg-text);
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    /* 覆盖 liquid-glass 的 overflow:hidden，确保进度环不被裁剪 */
    overflow: visible !important;
    background: var(--lg-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.scroll-progress-btn::before { display: none !important; }

.scroll-progress-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 进度环 SVG：包围整个按钮（48x48） */
.scroll-progress-ring {
    position: absolute;
    top: -3px;
    left: -3px;
    width: 54px !important;
    height: 54px !important;
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 2;
    overflow: visible;
}

/* 背景轨道圆圈 */
.ring-track {
    fill: none;
    stroke: var(--lg-text-muted);
    stroke-width: 3;
    opacity: 0.5;
}

/* 进度弧线 */
.ring-progress {
    fill: none;
    stroke: var(--lg-accent);
    stroke-width: 3;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.1s linear;
}

/* 中心箭头图标 */
.scroll-progress-icon {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.scroll-progress-icon svg { width: 20px; height: 20px; }

/* =====================================================================
 * 看板娘（Live2D）
 * ===================================================================== */
#waifu {
    z-index: 998 !important;
    bottom: 0;
    left: 0;
}

@media (max-width: 768px) {
    #waifu {
        transform: scale(0.7);
        transform-origin: bottom left;
    }
}

/* =====================================================================
 * 音乐播放器
 * ===================================================================== */
#music-player {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 999;
}

/* =====================================================================
 * 加载动画
 * ===================================================================== */
.loading-screen {
    position: fixed;
    inset: 0;
    background: var(--lg-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid var(--lg-glass-border);
    border-top-color: var(--lg-accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* =====================================================================
 * 响应式微调
 * ===================================================================== */
@media (max-width: 639px) {
    .lg-navbar {
        top: 0.5rem;
        padding: 0.375rem 0.625rem;
        width: calc(100% - 1rem);
    }

    /* lg-logo 已移除 */

    .hero-content { padding: 5rem 1rem 1.5rem; }
    .hero-avatar { width: 72px; height: 72px; }

    .stat-card { width: calc(50vw - 0.75rem); padding: 1rem; }
    .stat-number { font-size: 1.5rem; }

    .cta-row { gap: 1rem; }
    .contact-chip { padding: 0.375rem 0.75rem; font-size: 0.75rem; }

    .scroll-progress-btn { left: 0.75rem; bottom: 4.5rem; width: 40px; height: 40px; }
    .scroll-progress-ring { width: 48px !important; height: 48px !important; top: -4px; left: -4px; }
    #music-player { right: 0.75rem; bottom: 0.75rem; }
}

/* =====================================================================
 * 过渡动画
 * ===================================================================== */
.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

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

/* 滚动条美化 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--lg-glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--lg-text-muted); }
