@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600&family=Inter:wght@300;400;500&display=swap');

:root {
    --bg-main: #ffffff;
    --bg-secondary: #f2f5f9;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --accent: #2563eb; /* ZJU Blue (更亮) */
    --accent-light: #dbeafe;
    --border-soft: #cbd5e1;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.12), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --transition-smooth: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础重置 */
.body-element {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-primary);
    margin: 0;
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

h1, h2, h3, h4, .nav-name, .section-header {
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    letter-spacing: -0.02em;
}

/* 顶部锚点 */
.top-anchor { display: block; }

/* 导航栏 - 极简白 */
.nav-bar {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-soft);
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    transition: var(--transition-smooth);
}

.nav-container {
    width: 85%;
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.nav-name {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-links { display: flex; gap: 32px; }

.nav-link {
    color: var(--text-secondary) !important;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover { color: var(--text-primary) !important; }

.nav-link.nav-github {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
}

.nav-link.nav-github i {
    font-size: 1.05rem;
}

/* 容器布局 */
.app-container {
    width: 85%;
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Header Section - 左右两栏布局 */
.header-section {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    padding: 60px 0 80px;
    gap: 48px;
}

.avatar-wrap { 
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.avatar-img { 
    width: 160px; 
    height: 160px; 
    border-radius: 50%; 
    object-fit: cover; 
    object-position: center center;
    border: 2px solid var(--border-soft);
    padding: 5px;
    background: #fff;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth), object-position 0.3s ease;
    display: block;
}

/* 证件照：竖版长方形相框 + 整体缩放显示（contain），保证人像完整不裁切 */
.avatar-img[data-type="id"] {
    width: 120px;
    height: 160px;
    border-radius: 10px;
    object-fit: contain;
    object-position: center center;
    background: #ffffff;
}

.avatar-img:hover {
    transform: scale(1.02);
    box-shadow: var(--card-shadow-hover);
}

.avatar-img.switching {
    opacity: 0;
    transform: scale(0.92);
}

.avatar-container {
    position: relative;
    cursor: pointer;
    border-radius: 50%;
    display: inline-block;
}

.avatar-badge {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(37, 99, 235, 0.92);
    backdrop-filter: blur(4px);
    color: #ffffff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.avatar-container:hover .avatar-badge {
    background: var(--accent);
    transform: translateY(-1px);
}

.photo-toggle-bar {
    display: inline-flex;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 20px;
    margin: 12px 0 14px 0;
    border: 1px solid var(--border-soft);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.photo-tab-btn {
    border: none;
    background: transparent;
    padding: 4px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    font-family: inherit;
}

.photo-tab-btn:hover {
    color: var(--text-primary);
}

.photo-tab-btn.active {
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.08);
    font-weight: 600;
}

.avatar-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.avatar-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.avatar-modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    max-width: 90vw;
    max-height: 90vh;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.avatar-modal.active .avatar-modal-content {
    transform: scale(1);
}

.avatar-modal-img {
    max-width: 320px;
    max-height: 440px;
    object-fit: contain;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
}

.avatar-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4b5563;
    transition: 0.2s;
}

.avatar-modal-close:hover {
    background: #e2e8f0;
    color: #111827;
}

.avatar-modal-title {
    margin-top: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

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

.intro-p { 
    font-size: 1.05rem; 
    color: var(--text-primary); 
    margin-bottom: 20px; 
    line-height: 1.8; 
    font-weight: 400;
    text-align: left;
}

.font-bold { color: var(--accent); font-weight: 600; }

.som-link { 
    color: var(--text-primary); 
    text-decoration: none; 
    border-bottom: 1.5px solid var(--accent);
    padding-bottom: 2px;
    transition: 0.2s;
}

.som-link:hover { background: var(--accent-light); }

/* 联系信息 - 条目式设计 */
.contact-info { 
    display: flex; 
    flex-direction: column;
    align-items: stretch;
    gap: 8px; 
    margin-top: 16px;
    width: 100%;
}

.contact-item, .contact-item-last { 
    font-size: 0.82rem; 
    color: var(--text-primary); 
    background: var(--bg-secondary);
    padding: 7px 14px;
    border-radius: 10px;
    border: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
}

.contact-icon { margin-right: 8px; color: var(--accent); opacity: 0.85; }

a.contact-item-link {
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

a.contact-item-link:hover {
    background: #eef2ff;
    border-color: #93c5fd;
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.12);
}

a.contact-item-link:hover .contact-icon {
    opacity: 1;
    transform: scale(1.15);
}

.contact-link-icon {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.6;
    transition: all 0.2s ease;
}

a.contact-item-link:hover .contact-link-icon {
    color: var(--accent);
    opacity: 1;
    transform: translate(2px, -2px);
}

/* 生活志 - 精致小卡片 */
.lifestyle-section { margin-top: 40px; }

.lifestyle-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 18px;
    text-align: left;
}

.lifestyle-grid { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 14px; 
}

.lifestyle-card {
    background: var(--bg-main);
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    padding: 24px;
    text-align: left;
    transition: var(--transition-smooth);
    box-shadow: var(--card-shadow);
}

.lifestyle-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--accent);
}

.lifestyle-card .icon { font-size: 1.4rem; margin-bottom: 12px; display: block; }
.lifestyle-card .label { font-weight: 600; font-size: 0.95rem; color: var(--text-primary); margin-bottom: 6px; display: block;}
.lifestyle-card .desc { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* 游戏入口区域 */
.game-entry-section {
    margin: 0 0 30px;
    text-align: center;
}

.game-entry-btn {
    background: linear-gradient(135deg, #3a1c71, #d76d77, #ffaf7b);
    border: none;
    border-radius: 20px;
    padding: 15px 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(255, 175, 123, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.game-entry-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 175, 123, 0.5);
}

.game-entry-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.game-entry-btn:hover::before {
    left: 100%;
}

.game-entry-icon {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 8px;
}

.game-entry-text {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.game-entry-subtext {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
}

/* 板块通用头部 */
.section-header {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 100px 0 40px;
    text-align: center;
    position: relative;
}

.section-header::after {
    content: "";
    display: block;
    width: 40px;
    height: 3px;
    background: var(--accent);
    margin: 15px auto 0;
    border-radius: 2px;
}

.card-body { 
    padding: 0;
}

/* 列表与项目 */
.custom-list { list-style: none; padding: 0; }

.list-item { 
    margin-bottom: 16px; 
    color: var(--text-primary);
    padding: 18px 20px;
    background: var(--bg-secondary);
    border-radius: 12px;
    border: 1px solid var(--border-soft);
    transition: 0.3s;
    line-height: 1.7;
}

.list-item:hover { transform: scale(1.01); border-color: var(--accent); background: var(--accent-light); }

.project-item { margin-bottom: 40px; padding-bottom: 30px; border-bottom: 1px solid var(--border-soft); }
.project-title { font-size: 1.25rem; font-weight: 600; color: var(--text-primary); margin-bottom: 15px; }

/* 阅读列表 */
.accordion-wrap { margin-bottom: 32px; }

.year-header {
    display: flex;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    padding: 16px 24px;
    border-radius: 12px;
    cursor: pointer;
    border: 1px solid var(--border-soft);
}

.book-entry {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 32px;
    margin-top: 16px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--border-soft);
}

.book-cover { 
    width: 100px; 
    border-radius: 4px; 
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); 
}

.book-title { font-size: 1.3rem; margin-bottom: 8px; color: var(--text-primary); }

.buy-link {
    font-size: 0.85rem;
    color: var(--accent) !important;
    text-decoration: none;
    font-weight: 600;
    border: 1px solid var(--accent);
    padding: 6px 20px;
    border-radius: 50px;
    transition: 0.3s;
}

.buy-link:hover { background: var(--accent); color: white !important; }

/* 底部 */
.footer-action { margin: 80px 0; text-align: center; }

.back-to-top {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 24px;
    border: 1px solid var(--border-soft);
    border-radius: 50px;
    transition: 0.3s;
}

.back-to-top:hover { background: var(--bg-secondary); color: var(--text-primary); border-color: var(--text-primary); }

/* 禅意空间 (小游戏) 样式 */
.zen-entry {
    margin-top: 120px;
    text-align: center;
    padding: 60px 0;
    border-top: 1px solid var(--border-soft);
}

.zen-btn {
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition-smooth);
    letter-spacing: 1px;
}

.zen-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-primary);
    padding: 12px 40px;
    background: var(--bg-secondary);
}

.game-section {
    padding: 60px 20px;
    background: linear-gradient(180deg, #0a0a1e 0%, #10103a 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 80px;
}

.game-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2rem;
    margin: 0 0 30px;
    color: #ffffff;
    text-align: center;
    letter-spacing: 2px;
    text-shadow: 0 2px 10px rgba(255, 255, 255, 0.2);
}

.game-container {
    display: flex;
    gap: 20px;
    max-width: 1100px;
    width: 95%;
    margin: 0 auto;
    justify-content: center;
    align-items: flex-start;
}

.game-sidebar {
    width: 220px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar-section {
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    padding: 12px;
}

.sidebar-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    color: #ffffff;
    font-weight: 600;
}

.tower-panel {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.panel-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 6px;
    text-align: center;
}

.tower-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.07);
}

.tower-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.tower-btn.selected {
    border-color: #ffcc00;
    background: rgba(255, 204, 0, 0.15);
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.2);
}

.tower-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tower-btn-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    flex-shrink: 0;
}

.tower-btn-info {
    flex: 1;
}

.tower-btn-name {
    font-size: 0.75rem;
    color: #ffffff;
    font-weight: 600;
}

.tower-btn-cost {
    font-size: 0.65rem;
    color: #ffcc00;
}

.tower-btn-desc {
    display: none;
}

.tower-info {
    color: #ffffff;
    font-size: 0.8rem;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.info-icon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
}

.info-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.info-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 8px;
}

.info-stat {
    font-size: 0.7rem;
    color: #ccccee;
}

.info-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.upgrade-btn, .sell-btn {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.upgrade-btn {
    background: #1e7e1e;
    color: #ffffff;
    border: 1px solid #2ecc2e;
}

.upgrade-btn:hover {
    background: #3a8e3a;
}

.upgrade-btn.disabled {
    background: #444444;
    cursor: not-allowed;
}

.sell-btn {
    background: #7e2020;
    color: #ffffff;
    border: 1px solid #cc3333;
}

.sell-btn:hover {
    background: #8e3a3a;
}

.max-level {
    text-align: center;
    color: #ffcc00;
    font-size: 0.75rem;
    padding: 4px;
}

.sidebar-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

/* controls-row: 4个控制按钮2x2排列 */
.controls-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.ctrl-btn {
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-radius: 8px;
    padding: 8px 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 600;
    transition: all 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.ctrl-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.help-text {
    color: #b8b8d8;
    font-size: 0.65rem;
    line-height: 1.6;
}

.help-title {
    color: #ffffff;
    font-weight: 600;
    font-size: 0.75rem;
    margin-bottom: 4px;
}

.help-item {
    padding: 1px 0;
}

.game-canvas-wrap {
    flex: 1;
    max-width: 800px;
}

.game-canvas-wrap canvas {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: block;
}

.site-footer {
    padding: 60px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    border-top: 1px solid var(--border-soft);
}

.footer-github-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-github-link:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* 适配响应式 */
@media (max-width: 768px) {
    .nav-container, .app-container { width: 92%; }
    .lifestyle-grid { grid-template-columns: 1fr; }
    .book-entry { flex-direction: column; align-items: center; text-align: center; }
    .header-section { 
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 40px 0; 
    }
    .avatar-wrap { width: auto; }
    .contact-info { align-items: center; }
    .lifestyle-title { text-align: center; }
    .intro-p { text-align: center; }
    .game-container { flex-direction: column; align-items: center; }
    .game-sidebar { width: 100%; max-width: 500px; flex-direction: row; flex-wrap: wrap; }
    .sidebar-section { flex: 1; min-width: 150px; }
    .sidebar-controls { grid-template-columns: repeat(4, 1fr); }
    .game-canvas-wrap { width: 100%; }
    .game-entry-btn {
        padding: 15px 30px;
    }
    .game-entry-text {
        font-size: 1.2rem;
    }
    .game-entry-icon {
        font-size: 1.5rem;
    }
}

/* 手风琴折叠项目经历样式 */
.project-item.collapsible {
    border-bottom: 1px solid var(--border-soft);
    padding-bottom: 24px;
    margin-bottom: 24px;
}

.project-item.collapsible:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.project-title.toggle-trigger {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
    padding: 8px 12px;
    border-radius: 8px;
    margin: 0;
}

.project-title.toggle-trigger:hover {
    background-color: var(--bg-secondary);
    color: var(--accent);
}

.title-text-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 600;
}

.toggle-icon {
    display: inline-block;
    font-size: 0.78rem;
    color: #2563eb;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-left: 10px;
    vertical-align: middle;
    line-height: 1;
    flex-shrink: 0;
}

.project-item.active .toggle-icon,
.section-header.collapsible.active .toggle-icon {
    transform: rotate(-90deg);
}

/* 折叠容器过渡动画 */
.project-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.4s ease;
    margin-top: 0;
}

.project-item.active .project-details {
    opacity: 1;
    margin-top: 16px;
}

/* 技能与校园经历大板块折叠额外样式 */
.section-header.collapsible {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 100px 0 40px;
}

.section-header.collapsible .section-title-wrap.toggle-trigger {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.section-header.collapsible .section-title-wrap.toggle-trigger:hover {
    color: var(--accent);
}

.section-header.collapsible.active .toggle-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

/* 技能与校园大折叠容器动画 */
.skill-details, .campus-details {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1), margin 0.4s ease;
    margin-top: 0;
}





