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

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f0f0f0;
    cursor: default;
    user-select: none;
}

/* ===== 全屏背景 ===== */
.background-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../images/background/hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
}

.background-layer video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.background-layer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.05);
    pointer-events: none;
    z-index: 1;
}

/* ===== 项目散布层 ===== */
.projects-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}

.project-item {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    will-change: transform;
}

.project-item:hover {
    transform: scale(1.08);
    z-index: 10;
}

.project-item:hover .project-thumb {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.project-thumb {
    width: 72px;
    height: 72px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease;
    background: #ddd;
}

.project-title {
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
    text-align: center;
    max-width: 100px;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 遮罩层 ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    z-index: 50;
    pointer-events: none;
    transition: background 0.4s ease;
}

.overlay.active {
    background: rgba(0, 0, 0, 0.35);
    pointer-events: auto;
}

/* ===== macOS 窗口 ===== */
.mac-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    width: 640px;
    max-width: 92vw;
    max-height: 85vh;
    background: rgba(245, 245, 247, 0.92);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border-radius: 14px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.08),
        0 20px 60px rgba(0, 0, 0, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}

.mac-window.active {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

/* 窗口标题栏 */
.window-header {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    cursor: grab;
    flex-shrink: 0;
}

.window-header:active {
    cursor: grabbing;
}

.window-controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.window-control {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    cursor: pointer;
    transition: filter 0.15s ease;
}

.window-control:hover {
    filter: brightness(0.85);
}

.window-control.close { background: #ff5f57; border: 1px solid #e0443e; }
.window-control.minimize { background: #febc2e; border: 1px solid #d89e24; }
.window-control.maximize { background: #28c840; border: 1px solid #1aab29; }

.window-title {
    flex: 1;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-right: 52px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 窗口内容 */
.window-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

.window-content::-webkit-scrollbar {
    width: 8px;
}

.window-content::-webkit-scrollbar-track {
    background: transparent;
}

.window-content::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}

/* 项目详情样式 */
.project-detail {
    padding: 20px 24px;
}

.project-detail-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 20px;
}

.project-detail-icon {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.project-detail-meta {
    flex: 1;
}

.project-detail-title {
    font-size: 18px;
    font-weight: 700;
    color: #1d1d1f;
    margin-bottom: 2px;
}

.project-detail-subtitle {
    font-size: 13px;
    color: #86868b;
    margin-bottom: 8px;
}

.project-detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tag {
    font-size: 11px;
    font-weight: 500;
    color: #0071e3;
    background: rgba(0, 113, 227, 0.08);
    padding: 3px 10px;
    border-radius: 100px;
}

.project-detail-description {
    font-size: 13px;
    line-height: 1.7;
    color: #333;
    margin-bottom: 20px;
}

.project-detail-section {
    margin-bottom: 16px;
}

.project-detail-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #1d1d1f;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.project-detail-section-title::after {
    content: '▼';
    font-size: 8px;
    color: #86868b;
    transition: transform 0.2s ease;
}

.project-detail-section-title.collapsed::after {
    transform: rotate(-90deg);
}

.project-detail-section-content {
    font-size: 12px;
    line-height: 1.6;
    color: #555;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.project-detail-section-content.collapsed {
    max-height: 0;
}

.project-detail-media {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 16px;
    background: #e8e8e8;
}

.project-detail-media img,
.project-detail-media video {
    width: 100%;
    height: auto;
    display: block;
}

.project-detail-media-item {
    margin-bottom: 24px;
}

.project-detail-media-item:last-child {
    margin-bottom: 0;
}

.detail-label {
    font-size: 11px;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    padding-left: 2px;
}

/* 联系信息样式 */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 20px 24px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    transition: background 0.2s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.contact-item-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
}

.contact-item-label {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
}

.contact-item-value {
    font-size: 12px;
    color: #86868b;
    text-align: center;
    word-break: break-all;
}

.contact-item-qr {
    width: 120px;
    height: 120px;
    border-radius: 8px;
    object-fit: cover;
    margin-top: 4px;
}

/* 照片墙 */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 4px;
}

.photo-grid-item {
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.photo-grid-item:hover {
    transform: scale(1.02);
}

.photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Dock 栏 ===== */
.dock-container {
    position: fixed;
    bottom: 12px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 200;
    pointer-events: none;
}

.dock {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 10px 16px 8px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    pointer-events: auto;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.dock-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform-origin: bottom center;
}

.dock-item:hover {
    transform: scale(1.25) translateY(-6px);
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(-4px);
}

.dock-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: #fff;
}

.dock-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 5px 12px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s ease;
    z-index: 10;
}

.dock-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.75);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .project-thumb {
        width: 56px;
        height: 56px;
    }

    .project-title {
        font-size: 9px;
        max-width: 80px;
    }

    .mac-window {
        width: 94vw;
        max-height: 80vh;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .dock {
        padding: 8px 12px 6px;
        gap: 8px;
    }

    .dock-icon {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .project-thumb {
        width: 48px;
        height: 48px;
    }

    .dock-icon {
        width: 36px;
        height: 36px;
    }
}

/* ===== 加载动画 ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.project-item {
    animation: fadeIn 0.6s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    opacity: 0;
}

/* ===== 哔哩哔哩视频播放器 ===== */
.bilibili-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bilibili-item {
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
}

.bilibili-label {
    font-size: 11px;
    font-weight: 700;
    color: #86868b;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
}

.bilibili-player {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
}

.bilibili-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ===== 音频列表 ===== */
.audio-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.audio-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.audio-item:hover {
    background: rgba(255, 255, 255, 0.9);
}

.audio-number {
    font-size: 12px;
    font-weight: 700;
    color: #86868b;
    width: 28px;
    text-align: center;
    flex-shrink: 0;
}

.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-name {
    font-size: 13px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 6px;
}

.audio-info audio {
    width: 100%;
    height: 32px;
    border-radius: 4px;
}

/* ===== 文章列表 ===== */
.article-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    transition: background 0.2s ease;
}

.article-card:hover {
    background: rgba(255, 255, 255, 0.9);
}

.article-link {
    cursor: pointer;
    text-decoration: none;
}

.article-card-icon {
    font-size: 20px;
    color: #0071e3;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 113, 227, 0.08);
    border-radius: 8px;
    flex-shrink: 0;
}

.article-card-body {
    flex: 1;
    min-width: 0;
}

.article-card-title {
    font-size: 14px;
    font-weight: 600;
    color: #1d1d1f;
    margin-bottom: 4px;
}

.article-card-meta {
    font-size: 12px;
    color: #86868b;
}

.article-card-content {
    font-size: 13px;
    line-height: 1.7;
    color: #333;
    margin-top: 8px;
}

.article-pdf embed {
    border-radius: 8px;
    margin-top: 8px;
}

/* ===== 响应式补充 ===== */
@media (max-width: 768px) {
    .audio-item {
        padding: 12px;
    }
    .article-card {
        padding: 14px;
    }
}
