:root {
    --kira-pink: #ff1b6b;
    --kira-blue: #00d2ff;
    --kira-purple: #9d50bb;
    --bg-light: #ffffff;
    --glass-white: rgba(255, 255, 255, 0.65); /* 大幅提升亮度与不透明度 */
    --text-dark: #1a1a1a; /* 极深色保证清晰度 */
    --text-grey: #4a4a4a; /* 加深辅助文字 */
    --card-shadow: 0 20px 60px rgba(255, 107, 157, 0.15);
    --glass-border: 1px solid rgba(255, 255, 255, 0.4); /* 增加微弱白边勾勒轮廓 */
}

html, body {
    width: 100%;
    margin: 0; padding: 0;
    -webkit-text-size-adjust: 100%; /* 防止 iOS 旋转时字体缩放 */
}

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: 'ZCOOL KuaiLe', 'Quicksand', 'Noto Sans SC', sans-serif !important;
}

img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
}

body {
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* 防复制保护 */
    user-select: none;
    -webkit-user-drag: none;
}

/* 终极背景修复方案：解决 iOS/iPad 固定背景失效及白屏 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/backgrounds/kirashell_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: -10;
    /* 在 iOS 上强制使用 scroll 模式的伪类固定，这是最稳健的方案 */
    transform: translateZ(0);
}

/* 统一蒙版层：变亮变白 */
body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(255,255,255,0.4) 0%, rgba(255,255,255,0.1) 100%);
    z-index: -9;
    pointer-events: none;
}

/* 顶部导航 */
header {
    border: none !important;
}

.logo {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-weight: 400;
    background: linear-gradient(to right, #ff1b6b, #45caff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: 1px;
}

/* 樱花容器 - 强化溢出保护 */
#sakura-container {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    pointer-events: none; z-index: 100;
    perspective: 1200px;
    transform-style: preserve-3d;
    overflow: hidden; /* 防止花瓣 3D 转换撑开宽度 */
}

.sakura {
    pointer-events: none;
    position: absolute;
    will-change: transform; /* 开启硬件加速，解决 iPad 不流畅问题 */
}

.nav-item {
    text-decoration: none;
    color: var(--text-dark);
    font-size: 1rem;
    font-weight: 600;
    transition: 0.3s;
    position: relative;
    opacity: 0.8;
    cursor: pointer !important;
    z-index: 9999; /* 强制最高层级 */
    pointer-events: auto !important;
}

.nav-item:hover, .nav-item.active {
    opacity: 1;
    color: var(--kira-pink);
}

.nav-item.active {
    color: var(--kira-pink) !important;
    font-weight: 800;
}

/* 隐藏滚动条 */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@media (min-width: 1024px) {
    .nav-item.active::after {
        content: '';
        position: absolute;
        bottom: -4px;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--kira-pink);
        border-radius: 2px;
        box-shadow: 0 2px 8px rgba(255, 27, 107, 0.3);
    }
}

/* 移动端特殊处理：去掉边线，改用左侧圆点或纯色 */
@media (max-width: 1023px) {
    .nav-item.active {
        color: var(--kira-pink) !important;
        background: rgba(255, 27, 107, 0.05);
        padding-left: 1rem;
        border-radius: 12px;
    }
}

.nav-links a:hover { color: var(--kira-pink); opacity: 1; }

/* 主容器 */
.container {
    max-width: 1400px;
    position: relative;
}

/* 视图切换核心样式 */
.view-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.view-section.active {
    display: flex !important;
    flex-direction: column;
    gap: 24px; /* 移动端间距 */
}

@media (min-width: 1024px) {
    .view-section.active {
        gap: 40px; /* 桌面端间距，与 main-content 保持一致 */
    }
}

/* 可点击卡片通用样式 - 彻底去边框 */
.clickable-card {
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275),
                box-shadow 0.3s ease,
                background 0.3s ease;
    border: none !important;
    outline: none !important;
}

.clickable-card:hover {
    transform: translateY(-5px) scale(1.01);
    background: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 15px 35px rgba(255, 100, 150, 0.2);
    border: none !important;
    outline: none !important;
}

.clickable-card:active {
    transform: translateY(-2px) scale(0.99);
}

.portfolio-cat-btn {
    padding: 8px 24px;
    border-radius: 10px;
    color: white;
    opacity: 0.6;
    font-size: 0.85rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: transparent;
}

.portfolio-cat-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.05);
}

.portfolio-cat-btn.active {
    opacity: 1;
    background: var(--kira-pink) !important;
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

/* App Showcase */
.app-card {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.4s ease;
    cursor: pointer;
}

.app-card:hover {
    transform: translateY(-10px) rotate(2deg);
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}

.app-screen {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    position: relative;
    background: #000;
}

.app-screen img {
    width: 100%;
    height: 100%;
    object-cover: cover;
}

/* Art Timeline */
.art-timeline {
    position: relative;
    padding: 40px 0;
}

.timeline-line {
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, 
        transparent, 
        var(--kira-pink) 10%, 
        var(--kira-pink) 90%, 
        transparent
    );
    box-shadow: 0 0 15px var(--kira-pink);
    transform: translateX(-50%);
}

@media (min-width: 1024px) {
    .timeline-line {
        left: 50%;
    }
}

.art-timeline-item {
    display: flex;
    flex-direction: column; /* 移动端：垂直排列 */
    align-items: flex-start;
    margin-bottom: 60px;
    position: relative;
    z-index: 10;
    padding-left: 50px; /* 为左侧时间线留出空间 */
}

/* 大屏下恢复交错布局与对齐 */
@media (min-width: 1024px) {
    .art-timeline-item {
        flex-direction: row;
        align-items: center;
        margin-bottom: 80px;
        padding-left: 0;
    }
    .art-timeline-item:nth-child(even) {
        flex-direction: row-reverse;
    }
}

.timeline-dot {
    position: absolute;
    left: 20px;
    top: 12px; /* 移动端：对齐日期标签的第一行 */
    width: 16px;
    height: 16px;
    background: var(--kira-pink);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 40;
    box-shadow: 0 0 10px var(--kira-pink);
}

@media (min-width: 1024px) {
    .timeline-dot {
        left: 50%;
        top: 50%; /* 桌面端：垂直居中 */
        transform: translate(-50%, -50%);
    }
}

/* 呼吸灯动效 */
.timeline-dot::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--kira-pink);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.8); opacity: 0; }
}

.art-card {
    width: 100%; /* 移动端：全宽 */
    margin-left: 0;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 24px;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@media (min-width: 1024px) {
    .art-card {
        width: 35%;
        margin-left: 0;
    }
    .art-timeline-item:nth-child(odd) .art-card {
        margin-right: 15%;
    }
    .art-timeline-item:nth-child(even) .art-card {
        margin-left: 15%;
    }
}

.art-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--kira-pink);
    box-shadow: 0 20px 40px rgba(255, 107, 157, 0.2);
}

.art-date {
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    color: var(--kira-pink);
    background: rgba(255, 107, 157, 0.1);
    padding: 4px 12px;
    border-radius: 10px;
    margin-top: 10px;
}

/* 时间轴日期标签 */
.timeline-date-label {
    position: relative; /* 移动端：非绝对定位，参与文档流 */
    left: 0;
    top: 0;
    margin-bottom: 12px;
    display: inline-block;
    font-family: 'Fira Code', monospace;
    font-weight: bold;
    color: var(--kira-pink);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    padding: 4px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 107, 157, 0.2);
    white-space: nowrap;
    z-index: 30;
}

@media (min-width: 1024px) {
    .timeline-date-label {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        margin-top: -45px; /* 放在圆点上方或侧边 */
    }
    
    /* 更加精致的侧边定位 */
    .art-timeline-item:nth-child(odd) .timeline-date-label {
        transform: translateX(-180%);
        margin-top: 0;
    }
    
    .art-timeline-item:nth-child(even) .timeline-date-label {
        transform: translateX(80%);
        margin-top: 0;
    }
}

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

.weather-fade-in {
    animation: weatherFade 0.5s ease forwards;
}

@keyframes weatherFade {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- 左侧边栏 --- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .sidebar {
        gap: 40px;
    }
}

.profile-card {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: var(--card-shadow);
    border: none !important;
}

/* 移动端性能优化：减小模糊半径 */
@media (max-width: 1024px) {
    .profile-card, .sidebar-widget, .logs-column, .gallery-column, .portfolio-preview, .guestbook-section, header {
        backdrop-filter: blur(6px) !important;
        -webkit-backdrop-filter: blur(6px) !important;
    }
}

.avatar-wrap {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.avatar {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    object-fit: cover;
}

.status-badge {
    position: absolute; top: 0; right: 0;
    background: var(--kira-pink);
    color: white; font-size: 0.7rem;
    padding: 2px 8px; border-radius: 10px;
    font-weight: 800;
}

.profile-card h2 {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.8rem;
    margin-bottom: 5px;
}
.profile-card p {
    font-size: 0.9rem;
    color: var(--text-grey);
    margin-bottom: 20px;
    font-weight: 500;
}


.follow-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #ff9a9e, #fad0c4);
    border: none;
    border-radius: 20px;
    color: white; font-weight: 800;
    cursor: pointer; transition: 0.3s;
}

.follow-btn:hover { transform: scale(1.02); filter: brightness(1.1); }

.sidebar-widget {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    border-radius: 25px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    border: none !important;
}

.widget-title {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--text-dark); /* 修正：不再使用透明度，直接用深色 */
    margin-bottom: 15px;
    letter-spacing: 1px;
    opacity: 0.6; /* 使用 opacity 整体控制，比 rgba 更可控 */
}

.stats-item { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
    font-size: 0.85rem; 
}

/* 针对天气这类多行内容的特殊处理 */
.stats-item:has(#weather-info) {
    align-items: flex-start;
}

#weather-info {
    text-align: right;
    max-width: 70%;
    line-height: 1.4;
}

#weather-info > div:first-child {
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.stats-val { font-weight: 800; color: var(--kira-pink); }

.mana-bar { width: 100%; height: 6px; background: rgba(0,0,0,0.05); border-radius: 3px; overflow: hidden; margin-top: 10px; position: relative; }
.mana-progress {
    width: 99%; height: 100%;
    background: linear-gradient(to right, var(--kira-pink), var(--kira-blue));
    box-shadow: 0 0 10px var(--kira-pink);
    animation: manaPulse 3s infinite ease-in-out;
}

@keyframes manaPulse {
    0%, 100% { opacity: 0.8; filter: brightness(1); }
    50% { opacity: 1; filter: brightness(1.3); transform: scaleX(1.02); }
}

/* --- 右侧主内容 --- */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

@media (min-width: 1024px) {
    .main-content {
        gap: 40px;
    }
}

.top-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

/* 首页核心模块强效去边框 */
.logs-column, .gallery-column, .portfolio-preview {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: none !important; /* 彻底根除首页边框 */
    outline: none !important;
}

.card-header {
    font-family: 'ZCOOL KuaiLe', cursive;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px; /* 统一内部间距 */
}

.header-icon { font-size: 1.6rem; }

/* 日志列表样式 */
.log-item {
    background: rgba(255, 255, 255, 0.4);
    padding: 20px;
    border-radius: 20px;
    margin-bottom: 15px;
    transition: 0.3s;
    border: none !important;
}

.log-tag {
    font-size: 0.7rem;
    padding: 3px 10px;
    border-radius: 8px;
    font-weight: 800;
    color: white;
}
.tag-dev { background: var(--kira-blue); }
.tag-life { background: var(--kira-purple); }

.log-date { float: right; font-size: 0.8rem; color: var(--text-grey); }

/* 画廊预览 */
.gallery-grid {
    display: block;
    width: 100%;
}

.gallery-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 15px;
    transition: 0.3s;
}

.gallery-img:hover { transform: scale(1.05); }

/* 画廊分类过滤器 */
.filter-btn {
    padding: 10px 22px;
    background: var(--glass-white);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    opacity: 0.8;
}

.filter-btn:hover {
    transform: translateY(-3px);
    opacity: 1;
    background: rgba(255, 255, 255, 0.8);
}

.filter-btn.active {
    background: var(--kira-pink);
    color: white;
    opacity: 1;
    box-shadow: 0 8px 20px rgba(255, 27, 107, 0.3);
}

/* 音乐播放器容器 */
.music-player-container {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 12px 20px;
    box-shadow: var(--card-shadow);
    border: none !important;
    width: 100%; /* 恢复全宽显示 */
}

/* --- APlayer 样式微调 --- */
.aplayer {
    background: transparent !important;
    box-shadow: none !important;
    margin: 0 !important;
    border: none !important;
}
.aplayer .aplayer-list { background: rgba(255,255,255,0.2) !important; }

/* 底部留言板预览 */
.guestbook-section {
    background: var(--glass-white);
    backdrop-filter: blur(12px);
    border-radius: 30px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    border: none !important;
}

.chat-bubble {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.bubble-content {
    background: rgba(255, 255, 255, 0.5);
    padding: 15px 20px;
    border-radius: 15px 15px 15px 0;
    font-size: 0.9rem;
    position: relative;
    border: none !important;
}

.bubble-me { flex-direction: row-reverse; }
.bubble-me .bubble-content {
    background: var(--kira-pink);
    color: white;
    border-radius: 15px 15px 0 15px;
}

.input-area {
    display: flex;
    gap: 10px;
}

.input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.4);
    border: none !important;
    padding: 12px 20px;
    border-radius: 20px;
    outline: none;
    font-size: 0.9rem;
}

.input-area button {
    background: linear-gradient(135deg, var(--kira-pink), #ff9a9e);
    border: none !important;
    padding: 0 25px; /* 增加左右内边距，变成长方形 */
    height: 48px;
    border-radius: 12px;
    color: white;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
    font-size: 0.9rem;
}

.input-area button:hover {
    transform: translateY(-3px) scale(1.1) rotate(5deg);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.6),
                inset 0 0 15px rgba(255, 255, 255, 0.5);
    filter: brightness(1.1);
}

.input-area button:active {
    transform: scale(0.95);
}

/* 作品集网格 */
.creations-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.creation-card {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    overflow: hidden;
    transition: 0.3s;
    border: none !important;
}

.creation-card:hover { transform: translateY(-5px); box-shadow: 0 10px 20px rgba(0,0,0,0.1); }

.creation-img { width: 100%; height: 180px; object-fit: cover; }
.creation-info { padding: 15px; }

/* 响应式适配 */




/* 防复制提示 */
body::after {
    display: none;
    content: '次元壁保护中...';
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--kira-pink);
    color: white;
    padding: 5px 15px;
    border-radius: 10px;
    font-size: 0.8rem;
    z-index: 1000;
}

/* 页脚 */
footer {
    width: 100%;
    text-align: center;
    padding: 40px 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8); /* 改为白色 */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.full-gallery-grid img {
    max-height: 450px;
    object-fit: cover;
    width: 100%;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 20px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}

.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px 15px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.75), transparent);
    color: white;
    font-size: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: none;
    opacity: 1; /* 恢复常驻显示 */
    border-radius: 0 0 20px 20px;
}

.gallery-date { font-weight: 500; }
.gallery-tag { 
    background: rgba(255,255,255,0.2); 
    padding: 2px 8px; 
    border-radius: 6px; 
    backdrop-filter: blur(4px);
}

/* 幻灯片动效 */
@keyframes slowZoom {
    from { transform: scale(1); }
    to { transform: scale(1.18); }
}

.slideshow-container {
    perspective: 1000px;
}

.slideshow-container img {
    will-change: transform;
    backface-visibility: hidden;
}
