/* ========================================
   粗放主义 - 两栏布局 + 时间天气壁纸
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
    --bg: #FFFEF7;
    --bg-card: #FFFFFF;
    --fg: #0A0A0A;
    --muted: #666666;
    --border-color: #0A0A0A;
    
    --accent-yellow: #FFE600;
    --accent-red: #FF3E3E;
    --accent-blue: #3E59FF;
    
    --border-width: 4px;
    --border-heavy: 6px;
    --shadow-offset: 10px;
    --shadow-offset-sm: 6px;
    
    --font-mono: 'IBM Plex Mono', 'Noto Sans SC', monospace;
    --font-display: 'Space Grotesk', 'Noto Sans SC', sans-serif;
    --font-sans: 'Noto Sans SC', sans-serif;
    
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* 过渡动画参数 */
    --transition-fast: 0.2s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
    
    /* 过渡属性分组 */
    --transition-layout: width var(--transition-normal),
                         height var(--transition-normal),
                         padding var(--transition-normal),
                         margin var(--transition-normal),
                         max-width var(--transition-normal),
                         min-height var(--transition-normal);
    
    --transition-all: all var(--transition-normal);
    
    --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ===== 深色主题 ===== */
[data-theme="dark"] {
    --bg: #0A0A0A;
    --bg-card: #151515;
    --fg: #FFFEF7;
    --muted: #999999;
    
    --border-color: #FFFEF7;
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    height: 100vh;
    overflow: hidden;
}

/* 隐藏整个页面的滚动条 */
html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--fg);
    background-color: var(--bg);
    height: 100vh;
    overflow: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* 隐藏滚动条但保持滚动功能 */
body::-webkit-scrollbar {
    display: none;
}

html {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* 隐藏所有元素的滚动条 */
*::-webkit-scrollbar {
    display: none;
}

* {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* ===== 全局过渡类 ===== */
.transition-layout {
    transition: var(--transition-layout);
}

.transition-transform {
    transition: transform var(--transition-normal);
}

.transition-all {
    transition: var(--transition-all);
}

/* ===== 批量过渡应用（解耦） ===== */
/* 头像和按钮 */
.avatar-box,
.social-link,
.theme-toggle {
    transition: var(--transition-all);
}

/* 文字区域 */
.bio-container,
.time-widget,
.wallpaper-container {
    transition: var(--transition-all);
}

/* 字体大小过渡 */
.name,
.weekday,
.clock,
.date-display {
    transition: font-size var(--transition-normal);
}

/* 噪点叠加层 */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== 加载遮罩层 ===== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

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

.loading-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    padding: 3rem;
    border: var(--border-heavy) solid var(--fg);
    background: var(--bg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--fg);
    animation: loading-bounce 1.5s ease-in-out infinite;
}

/* 旋转方块 - 粗野主义风格 */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: var(--border-width) solid var(--fg);
    background: var(--bg);
    animation: loading-rotate 1s linear infinite, loading-pulse 0.8s ease-in-out infinite;
}

@keyframes loading-rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes loading-pulse {
    0%, 100% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.1) rotate(180deg); }
}

@keyframes loading-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* 加载文字 */
.loading-text {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--fg);
    min-height: 1.5em;
}

/* 像素进度条 */
.loading-progress {
    width: 200px;
    height: 12px;
    border: 3px solid var(--fg);
    background: var(--bg);
    position: relative;
    overflow: hidden;
}

.loading-bar {
    height: 100%;
    background: var(--fg);
    width: 0%;
    transition: width 0.3s ease-out;
}

.loading-percent {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--muted);
}

/* ===== 主容器：两栏布局 ===== */
.container {
    display: flex;
    flex-wrap: nowrap;
    height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
    overflow: hidden;
    transition: grid-template-columns var(--transition-normal),
                filter 0.5s ease-out;
    opacity: 1;
    visibility: visible;
    filter: blur(30px);
    pointer-events: none;
}

.container.visible {
    opacity: 1;
    visibility: visible;
    filter: blur(0);
    pointer-events: auto;
}

/* ===== 左侧面板 ===== */
.left-panel {
    width: 30%;
    min-width: 280px;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border-right: var(--border-width) solid var(--fg);
    background-color: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    transition: width var(--transition-normal), 
                padding var(--transition-normal),
                border-right-width var(--transition-normal);
}

.left-panel .hero {
    width: 100%;
    text-align: left;
    animation: slideIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== 右侧面板 ===== */
.right-panel {
    width: 70%;
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background-color: transparent;
    color: var(--bg);
    transition: width var(--transition-normal);
    position: relative;
}

/* ===== 右侧：信息面板 ===== */
.info-panel {
    padding: var(--space-md);
    padding-bottom: 0;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 254, 247, 0.15);
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.35),
        0 16px 64px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 254, 247, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 254, 247, 0.05);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 254, 247, 0.2), transparent);
    pointer-events: none;
    z-index: 2;
}

.info-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(180deg, rgba(255,150,80,0.12) 0%, transparent 12%),
        linear-gradient(90deg, rgba(255,100,100,0.1) 0%, transparent 15%),
        linear-gradient(270deg, rgba(100,180,255,0.1) 0%, transparent 15%),
        linear-gradient(0deg, rgba(150,100,255,0.12) 0%, transparent 12%);
    pointer-events: none;
    z-index: 1;
}
.avatar-box {
    width: clamp(100px, 12vw, 150px);
    height: clamp(100px, 12vw, 150px);
    margin: 0 0 var(--space-lg) 0;
    border: var(--border-heavy) solid var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 var(--fg);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
}

.avatar-box:hover {
    transform: translate(-5px, -5px);
    box-shadow: 15px 15px 0 var(--fg);
}

.avatar-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== 名称 ===== */
.name {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--fg);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
}

/* ===== 状态栏 ===== */
.status-bar {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    border: 3px solid var(--fg);
    background-color: var(--bg);
    margin-bottom: var(--space-lg);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.status-dot {
    width: 10px;
    height: 10px;
    background-color: var(--accent-yellow);
    border: 2px solid var(--fg);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-weight: 500;
    color: var(--fg);
}

/* ===== 简介区域 ===== */
.bio-container {
    margin-bottom: var(--space-xl);
    padding: var(--space-md);
    border: var(--border-width) solid var(--fg);
    background-color: #FFFFFF;
    text-align: left;
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 rgba(0, 0, 0, 0.1);
    min-height: 100px;
}

.bio {
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1.8;
    color: var(--fg);
}

.typewriter-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.typewriter-cursor {
    display: inline-block;
    color: var(--accent-blue);
    font-weight: 700;
    animation: blink 0.8s step-end infinite;
    margin-left: 2px;
}

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

/* ===== 社交链接 ===== */
.social-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: var(--space-sm);
}

.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    border: var(--border-width) solid var(--fg);
    background-color: var(--bg);
    color: var(--fg);
    text-decoration: none;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-link--yellow {
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--accent-yellow);
}

.social-link--yellow:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--accent-yellow);
    background-color: var(--accent-yellow);
}

.social-link--red {
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--accent-red);
}

.social-link--red:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--accent-red);
    background-color: var(--accent-red);
}

.social-link--blue {
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--accent-blue);
}

.social-link--blue:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--accent-blue);
    background-color: var(--accent-blue);
}

/* 自定义颜色链接（HEX 颜色） */
.social-link--custom {
    --custom-color: #FF6B6B;
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--custom-color);
}

.social-link--custom:hover {
    transform: translate(-4px, -4px);
    box-shadow: 10px 10px 0 var(--custom-color);
    background-color: var(--custom-color);
}

.link-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ===== 左侧底部 ===== */
.footer-left {
    margin-top: auto;
    padding-top: var(--space-lg);
}

.footer-line {
    height: var(--border-width);
    background-color: var(--fg);
    margin-bottom: var(--space-sm);
}

.footer-text {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    text-align: center;
}

/* ===== 右侧：信息面板 ===== */
.info-panel {
    padding: var(--space-md);
    padding-bottom: 0;
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 254, 247, 0.15);
    box-shadow: 
        0 8px 40px rgba(0, 0, 0, 0.35),
        0 16px 64px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 254, 247, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 254, 247, 0.05);
    position: relative;
    z-index: 2;
}

.info-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 254, 247, 0.2), transparent);
    pointer-events: none;
    z-index: 2;
}

.info-panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(180deg, rgba(255,150,80,0.12) 0%, transparent 12%),
        linear-gradient(90deg, rgba(255,100,100,0.1) 0%, transparent 15%),
        linear-gradient(270deg, rgba(100,180,255,0.1) 0%, transparent 15%),
        linear-gradient(0deg, rgba(150,100,255,0.12) 0%, transparent 12%);
    pointer-events: none;
    z-index: 1;
}

/* 深色主题信息面板 */
[data-theme="dark"] .info-panel {
    background: rgba(15, 15, 15, 0.85);
    border-color: rgba(255, 254, 247, 0.1);
}

/* ===== 时间组件 ===== */
.time-widget {
    text-align: left;
}

.weekday {
    font-family: var(--font-display);
    font-size: clamp(3rem, 8vw, 5rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.02em;
    color: var(--bg);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.date-display {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 3vw, 1.5rem);
    color: rgba(255, 254, 247, 0.7);
    margin-bottom: 2px;
}

.clock {
    font-family: var(--font-mono);
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 600;
    color: var(--accent-yellow);
    letter-spacing: 0.05em;
}

/* ===== 壁纸容器 ===== */
.wallpaper-scroll-area {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 0;
    background-color: #0A0A0A;
    scrollbar-width: none;
    
    /* 禁用用户交互 */
    pointer-events: none;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

[data-theme="dark"] .wallpaper-scroll-area {
    background-color: #151515;
}

.wallpaper-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.wallpaper-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.wallpaper-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(255, 254, 247, 0.3);
    border-radius: 3px;
}

.wallpaper-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 254, 247, 0.5);
}

.wallpaper-image {
    width: 100%;
    min-height: 300px;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    position: relative;
}

.wallpaper-image img {
    width: 100%;
    height: auto;
    min-height: 300px;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.wallpaper-image.loaded img {
    opacity: 1;
}

/* ===== 壁纸信息 ===== */
.wallpaper-info {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 254, 247, 0.15);
    background: rgba(10, 10, 10, 0.75);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow: 
        0 -8px 40px rgba(0, 0, 0, 0.35),
        0 -16px 64px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 254, 247, 0.12),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        inset 0 0 0 1px rgba(255, 254, 247, 0.05);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
}

.wallpaper-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 254, 247, 0.2), transparent);
    pointer-events: none;
    z-index: 2;
}

.wallpaper-info::after {
    content: '';
    position: absolute;
    inset: 0;
    background: 
        linear-gradient(180deg, rgba(255,150,80,0.12) 0%, transparent 12%),
        linear-gradient(90deg, rgba(255,100,100,0.1) 0%, transparent 15%),
        linear-gradient(270deg, rgba(100,180,255,0.1) 0%, transparent 15%),
        linear-gradient(0deg, rgba(150,100,255,0.12) 0%, transparent 12%);
    pointer-events: none;
    z-index: 1;
}

/* 深色主题壁纸信息 */
[data-theme="dark"] .wallpaper-info {
    background: rgba(15, 15, 15, 0.85);
    border-color: rgba(255, 254, 247, 0.1);
}

.wallpaper-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 254, 247, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wallpaper-author {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: rgba(255, 254, 247, 0.7);
}

/* ===== 响应式设计 ===== */
@media (max-width: 1200px) {
    .left-panel {
        width: 35%;
    }
    
    .right-panel {
        width: 65%;
    }
}

@media (max-width: 900px) {
    /* 移动端：单栏布局 */
    /* 允许移动端页面滚动 */
    html, body {
        overflow-y: auto;
        height: auto;
    }
    
    .container {
        flex-direction: column;
        overflow-y: auto;
        overflow-x: hidden;
        height: auto;
        min-height: 100vh;
    }
    
    .left-panel {
        width: 100%;
        min-width: 100%;
        height: auto;
        flex-shrink: 0;
        border-right-width: 0;
        border-bottom: var(--border-width) solid var(--fg);
        padding: var(--space-lg);
        overflow-y: visible;
    }
    
    /* 粘性头部 */
    .hero {
        position: sticky;
        top: 0;
        background: var(--bg);
        z-index: 10;
        padding: var(--space-sm) 0;
        margin: calc(var(--space-sm) * -1) 0;
    }
    
    /* 头像缩小效果 */
    .avatar-box {
        transition: width 0.3s ease, height 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
        cursor: pointer;
    }
    
    .avatar-box.scrolled {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px;
        margin-bottom: var(--space-sm);
        box-shadow: 6px 6px 0 var(--fg);
    }
    
    .avatar-box.scrolled:hover {
        transform: translate(-2px, -2px);
        box-shadow: 8px 8px 0 var(--fg);
    }
    
    /* 右侧面板：默认隐藏，全屏覆盖 */
    .right-panel {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
        display: flex;
        background-color: transparent;
        flex-direction: column;
        opacity: 0;
        visibility: hidden;
        transform: translateX(100%);
        transition: opacity 0.3s ease-out,
                    visibility 0.3s ease-out,
                    transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .right-panel.active {
        opacity: 1;
        visibility: visible;
        transform: translateX(0);
    }
    
    /* 移除固定尺寸，使用 clamp */
    .avatar-letter {
        font-size: clamp(3rem, 10vw, 4rem);
    }
    
    .social-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .left-panel {
        padding: var(--space-md);
    }
    
    .bio-container {
        padding: var(--space-sm);
    }
    
    .info-panel {
        padding: var(--space-md);
    }
    
    .weekday {
        font-size: 2.5rem;
    }
    
    .clock {
        font-size: 1.5rem;
    }
}

/* ===== 减少动画偏好 ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===== 性能优化 ===== */
/* 启用 GPU 加速，提升过渡性能 */
.avatar-box,
.social-link,
.theme-toggle {
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.container,
.left-panel,
.right-panel {
    will-change: width, padding;
    backface-visibility: hidden;
}

/* 确保过渡不影响文本渲染 */
.name,
.weekday,
.clock,
.bio {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border: var(--border-width) solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--fg);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background-color var(--theme-transition);
    z-index: 1000;
    padding: 0;
}

.theme-toggle:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--fg);
}

.theme-toggle:active {
    transform: translate(-1px, -1px);
    box-shadow: 7px 7px 0 var(--fg);
}

.theme-toggle:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* 图标切换 */
.theme-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-icon--sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon--moon {
    opacity: 0;
    transform: rotate(-90deg);
}

[data-theme="dark"] .theme-icon--sun {
    opacity: 0;
    transform: rotate(90deg);
}

[data-theme="dark"] .theme-icon--moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* 屏幕阅读器隐藏 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 深色模式下的主题按钮 */
[data-theme="dark"] .theme-toggle {
    border-color: var(--fg);
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 rgba(255, 254, 247, 0.3);
}

[data-theme="dark"] .theme-toggle:hover {
    box-shadow: 9px 9px 0 rgba(255, 254, 247, 0.5);
}

/* 响应式调整 */
@media (max-width: 600px) {
    .theme-toggle {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }
}

/* ===== 深色主题特殊样式 ===== */
[data-theme="dark"] .avatar-box {
    background-color: var(--bg);
    border-color: var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 254, 247, 0.3);
}

[data-theme="dark"] .avatar-box:hover {
    box-shadow: 15px 15px 0 rgba(255, 254, 247, 0.5);
}

[data-theme="dark"] .name {
    color: var(--fg);
}

[data-theme="dark"] .status-bar {
    background-color: var(--bg);
    border-color: var(--fg);
}

[data-theme="dark"] .status-text {
    color: var(--fg);
}

[data-theme="dark"] .bio-container {
    background-color: var(--bg-card);
    border-color: var(--fg);
}

[data-theme="dark"] .bio {
    color: var(--fg);
}

[data-theme="dark"] .social-link {
    background-color: var(--bg);
    border-color: var(--fg);
    color: var(--fg);
}

[data-theme="dark"] .social-link--yellow:hover {
    background-color: var(--accent-yellow);
}

[data-theme="dark"] .social-link--red:hover {
    background-color: var(--accent-red);
}

[data-theme="dark"] .social-link--blue:hover {
    background-color: var(--accent-blue);
}

[data-theme="dark"] .social-link--custom {
    border-color: var(--fg);
    color: var(--fg);
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--custom-color);
}

[data-theme="dark"] .social-link--custom:hover {
    background-color: var(--custom-color);
    box-shadow: 10px 10px 0 var(--custom-color);
}

[data-theme="dark"] .footer-line {
    background-color: var(--fg);
}

/* 加载遮罩层深色主题 */
[data-theme="dark"] .loading-panel {
    background: var(--bg);
    border-color: var(--fg);
    box-shadow: var(--shadow-offset) var(--shadow-offset) 0 rgba(255, 254, 247, 0.3);
}

[data-theme="dark"] .loading-spinner {
    border-color: var(--fg);
    background: var(--bg);
}

[data-theme="dark"] .loading-progress {
    border-color: var(--fg);
    background: var(--bg);
}

[data-theme="dark"] .loading-bar {
    background: var(--fg);
}

[data-theme="dark"] .footer-text {
    color: var(--muted);
}

/* 右侧面板深色主题 */
[data-theme="dark"] .right-panel {
    background-color: transparent;
    color: var(--fg);
}

[data-theme="dark"] .weekday {
    color: var(--fg) !important;
}

[data-theme="dark"] .clock {
    color: var(--accent-yellow) !important;
}

[data-theme="dark"] .date-display {
    color: rgba(255, 254, 247, 0.7);
}

[data-theme="dark"] .wallpaper-scroll-area {
    scrollbar-color: rgba(255, 254, 247, 0.3) transparent;
}

[data-theme="dark"] .wallpaper-title {
    color: rgba(255, 254, 247, 0.5);
}

[data-theme="dark"] .wallpaper-author {
    color: rgba(255, 254, 247, 0.7);
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .theme-icon {
        transition-duration: 0.01ms !important;
    }
}

/* ===== 手机端壁纸切换按钮 ===== */
.wallpaper-toggle {
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 56px;
    height: 56px;
    border: var(--border-width) solid var(--fg);
    background: var(--bg);
    color: var(--fg);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 var(--fg);
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                background-color var(--theme-transition);
    z-index: 1001;
    padding: 0;
}

.wallpaper-toggle:hover {
    transform: translate(-3px, -3px);
    box-shadow: 9px 9px 0 var(--fg);
}

.wallpaper-toggle:active {
    transform: translate(-1px, -1px);
    box-shadow: 7px 7px 0 var(--fg);
}

.wallpaper-toggle:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

.wallpaper-toggle.active {
    background: var(--accent-yellow);
}

/* 手机端显示按钮 */
@media (max-width: 900px) {
    .wallpaper-toggle {
        display: flex;
    }
}

@media (max-width: 600px) {
    .wallpaper-toggle {
        width: 48px;
        height: 48px;
        bottom: 75px;
        right: 15px;
    }
}

/* 深色主题 */
[data-theme="dark"] .wallpaper-toggle {
    border-color: var(--fg);
    box-shadow: var(--shadow-offset-sm) var(--shadow-offset-sm) 0 rgba(255, 254, 247, 0.3);
}

[data-theme="dark"] .wallpaper-toggle:hover {
    box-shadow: 9px 9px 0 rgba(255, 254, 247, 0.5);
}

/* ===== 手机端关闭按钮 ===== */
.close-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border: var(--border-width) solid var(--fg);
    background: rgba(255, 254, 247, 0.95);
    color: #0A0A0A;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.3);
    z-index: 1002;
    padding: 0;
    transition: transform 0.15s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.close-panel.active {
    display: flex;
}

.close-panel:hover {
    transform: scale(1.1);
    box-shadow: 12px 12px 0 rgba(0, 0, 0, 0.4);
}

.close-panel:focus {
    outline: 2px solid var(--accent-yellow);
    outline-offset: 2px;
}

@media (max-width: 600px) {
    .close-panel {
        width: 48px;
        height: 48px;
        top: 15px;
        right: 15px;
    }
}

/* ===== 交互特效 ===== */

/* 点击彩纸特效 */
.confetti-particle {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    animation: confetti-fall var(--duration, 1500ms) ease-out forwards;
}

.confetti--square {
    border-radius: 2px;
}

.confetti--circle {
    border-radius: 50%;
}

@keyframes confetti-fall {
    0% {
        transform: translate(0, 0) rotate(0deg) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(
            var(--x-offset, 50px),
            var(--y-offset, 300px)
        ) rotate(var(--rotation, 360deg)) scale(0.3);
        opacity: 0;
    }
}

/* 滚动触发动画 */
.scroll-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* 像素小宠物 */
.pixel-pet {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 50px;
    pointer-events: none;
    z-index: 100;
}

.pixel-pet__sprite {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.1s linear;
    background: transparent;
}

/* 像素猫咪 - 使用 box-shadow 绘制 */
.pixel-pet__sprite--cat {
    width: 4px;
    height: 4px;
    background: var(--fg);
    box-shadow:
        /* 耳朵 */
        4px 0 0 var(--fg),
        0 4px 0 var(--fg),
        4px 4px 0 var(--fg),
        24px 0 0 var(--fg),
        28px 0 0 var(--fg),
        24px 4px 0 var(--fg),
        28px 4px 0 var(--fg),
        /* 头部 */
        4px 8px 0 var(--fg),
        8px 8px 0 var(--fg),
        12px 8px 0 var(--fg),
        16px 8px 0 var(--fg),
        20px 8px 0 var(--fg),
        24px 8px 0 var(--fg),
        4px 12px 0 var(--fg),
        8px 12px 0 var(--fg),
        12px 12px 0 var(--fg),
        16px 12px 0 var(--fg),
        20px 12px 0 var(--fg),
        24px 12px 0 var(--fg),
        /* 眼睛 */
        8px 16px 0 var(--fg),
        12px 16px 0 var(--bg),
        16px 16px 0 var(--bg),
        20px 16px 0 var(--fg),
        /* 鼻子和嘴巴 */
        12px 20px 0 var(--fg),
        16px 20px 0 var(--fg),
        12px 24px 0 var(--fg),
        16px 24px 0 var(--fg),
        /* 身体 */
        4px 28px 0 var(--fg),
        8px 28px 0 var(--fg),
        12px 28px 0 var(--fg),
        16px 28px 0 var(--fg),
        20px 28px 0 var(--fg),
        24px 28px 0 var(--fg),
        /* 腿 */
        4px 32px 0 var(--fg),
        8px 32px 0 var(--fg),
        20px 32px 0 var(--fg),
        24px 32px 0 var(--fg);
    transform-origin: bottom left;
}

.pixel-pet__sprite--jump {
    animation: pixel-pet-jump 0.3s ease-out;
}

@keyframes pixel-pet-jump {
    0%, 100% {
        transform: translateY(0) translateX(var(--x, 0px)) scaleX(var(--dir, 1));
    }
    50% {
        transform: translateY(-20px) translateX(var(--x, 0px)) scaleX(var(--dir, 1));
    }
}

.pixel-pet__hearts {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pixel-pet__heart {
    position: absolute;
    font-size: 20px;
    animation: pixel-pet-heart-float 1s ease-out forwards;
}

@keyframes pixel-pet-heart-float {
    0% {
        transform: translateY(0) scale(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-30px) scale(1.2);
        opacity: 1;
    }
    100% {
        transform: translateY(-60px) scale(1);
        opacity: 0;
    }
}