/* ==================== 基础重置 ==================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f5f5f5;
    color: #000;
    min-height: 100vh;
    position: relative;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ==================== 页面section ==================== */
.page-section {
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* 页面section不再使用opacity过渡，避免白屏问题 */

.page-section.section-enter {
    animation: sectionFadeIn 0.8s ease-out forwards;
}

@keyframes sectionFadeIn {
    0% {
        opacity: 0.5;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

#home {
    background-color: #f5f5f5;
}

#about {
    background-color: #f0f0f0;
}

/* ==================== 滚动指示器 ==================== */
.scroll-indicator {
    position: fixed;
    right: 2vw;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1000;
}

.scroll-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.scroll-dot:hover {
    background-color: rgba(0, 0, 0, 0.5);
    transform: scale(1.2);
}

.scroll-dot.active {
    background-color: #000;
    transform: scale(1.3);
}

/* ==================== 樱花树画布 ==================== */
#tree-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* ==================== 问候弹窗 ==================== */
.greeting-toast {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: rgba(40, 40, 40, 0.9);
    color: #fff;
    padding: 0.8rem 2rem;
    border-radius: 50px;
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.greeting-toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(100px);
}

.greeting-toast.hide {
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50%) translateY(80px);
}

/* ==================== 顶部导航栏 ==================== */
.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2vw;
    z-index: 100;
    background: transparent;
}

.topbar-left {
    display: flex;
    align-items: center;
}

.logo img {
    display: block;
    height: 120px;
    width: auto;
}

.topbar-center {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #000;
    transition: opacity 0.3s ease;
}

.nav-link:hover {
    opacity: 0.6;
}

.nav-slash {
    color: #999;
    font-weight: 300;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    color: #000;
    transition: opacity 0.3s ease;
}

.icon-link:hover {
    opacity: 0.6;
}

/* 导航栏日期 */
.nav-date {
    font-family: 'Noto Serif SC', 'Georgia', serif;
    font-size: 14px;
    font-weight: 400;
    color: #333;
    letter-spacing: 0.1em;
}

.topbar-line {
    position: absolute;
    bottom: 0;
    left: 2vw;
    right: 2vw;
    height: 1px;
    background-color: #000;
}

/* ==================== 首页标题整体区域 ==================== */
.home-title-block {
    position: absolute;
    top: 10vh;
    left: 2vw;
    z-index: 10;
}

/* ==================== 页面标题 ==================== */
.page-title {
    position: relative;
    display: flex;
    flex-direction: column;
    z-index: 10;
    max-width: 50vw;
}

.page-title .title-small {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 0.05em;
}

.page-title .title-large {
    font-family: 'Inter', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    color: #000;
    letter-spacing: -0.02em;
    line-height: 0.9;
}

/* ==================== 标题下方横线和一言 ==================== */
.title-line-section {
    position: relative;
    margin-top: 1.5rem;
    z-index: 10;
}

.title-line {
    width: 36vw;
    height: 1px;
    background-color: #000;
    margin-bottom: 1.5vh;
}

/* 一言样式 */
.hitokoto-container {
    max-width: 36vw;
}

#hitokoto-text {
    font-family: 'Noto Serif SC', 'SimSun', 'STSong', serif;
    font-size: 1.6vh;
    font-weight: 400;
    color: #333;
    line-height: 1.8;
    margin: 0;
    letter-spacing: 0.05em;
}

#hitokoto-from {
    font-family: 'Noto Serif SC', 'SimSun', 'STSong', serif;
    font-size: 1.3vh;
    font-weight: 300;
    color: #666;
    margin: 0.8vh 0 0 0;
    text-align: right;
}

/* ==================== 代码面板 ==================== */
#code-panel {
    position: absolute;
    top: 20vh;
    right: 2vw;
    width: 35vw;
    max-width: 500px;
    padding: 2rem;
    font-family: 'JetBrains Mono', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #000;
    z-index: 10;
    background: transparent;
}

#leftCodeContent {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* 代码高亮样式 */
#code-panel .keyword {
    color: #0066cc;
}

#code-panel .function {
    color: #cc6600;
}

#code-panel .property {
    color: #000;
}

#code-panel .string {
    color: #cc0000;
}

#code-panel .number {
    color: #cc0000;
}

#code-panel .operator {
    color: #666;
}

#code-panel .bracket {
    color: #000;
}

/* ==================== 响应式 ==================== */
@media screen and (max-width: 768px) {
    .page-title {
        font-size: 3rem;
        top: 15vh;
    }

    .title-line-section {
        top: 22vh;
    }

    .title-line {
        width: 80vw;
    }

    #code-panel {
        display: none;
    }

    .topbar-center {
        display: none;
    }

    .nav-date {
        font-size: 12px;
    }
}

/* ==================== 关于我Section样式 ==================== */
.ghost-text-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    pointer-events: none;
}

.ghost-text-scroll {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 6rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.05);
    white-space: nowrap;
    animation: scrollText 30s linear infinite;
}

.ghost-text-scroll.reverse {
    animation: scrollTextReverse 35s linear infinite;
}

@keyframes scrollText {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(-50%);
    }
}

@keyframes scrollTextReverse {
    0% {
        transform: translateX(-50%);
    }

    100% {
        transform: translateX(0);
    }
}

.about-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    z-index: 10;
}

.identity-labels {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    z-index: 20;
}

.identity-label {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: clamp(4rem, 9vw, 7rem);
    font-weight: 900;
    color: #000;
    line-height: 1;
    letter-spacing: -0.03em;
}

.about-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-end;
    padding: 15vh 4vw 0 2vw;
    position: relative;
}

/* 英文标语 - 右上角大字 */
.about-slogan-en {
    font-family: 'Inter', sans-serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-weight: 700;
    color: rgba(0, 0, 0, 0.85);
    text-align: right;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.about-title-area {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    z-index: 30;
}

.about-title-small {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 0.05em;
}

.about-title-large {
    font-family: 'Inter', sans-serif;
    font-size: clamp(4rem, 10vw, 8rem);
    font-weight: 900;
    color: #000;
    letter-spacing: -0.02em;
    line-height: 0.9;
}

/* 3D网格容器 - JS实时控制样式，跟手滚动 */
#three-container {
    position: fixed;
    pointer-events: none;
    /* 初始状态 - 左中位置 */
    top: 50%;
    right: 25vw;
    transform: translateY(-50%);
    width: 45vw;
    height: 65vh;
    opacity: 0;
    visibility: hidden;
    z-index: 100;
}

#three-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    pointer-events: auto;
}

/* 网格代码装饰 - about section内独立显示 */
.grid-code-display {
    position: absolute;
    bottom: 12%;
    right: 4%;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 13px;
    line-height: 1.6;
    color: rgba(60, 60, 60, 0.9);
    z-index: 50;
    pointer-events: none;
    max-width: 380px;
}

.grid-code-display .code-block {
    margin: 0;
    padding: 0;
    background: none;
    white-space: pre;
}

.grid-code-display code {
    font-family: inherit;
}

/* 代码语法高亮 */
.code-keyword {
    color: #0066cc;
    font-weight: 600;
}

.code-function {
    color: #6f42c1;
}

.code-number {
    color: #d73a49;
}

.code-string {
    color: #22863a;
}

.code-boolean {
    color: #d73a49;
}

.code-property {
    color: #005cc5;
}

.code-comment {
    color: #6a737d;
    font-style: italic;
}

#about-textOverlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 50;
    overflow: hidden;
}

.about-outline-text {
    position: absolute;
    color: rgba(0, 0, 0, 0.7);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
    transform-origin: center;
    letter-spacing: 0.05em;
}

/* ==================== 瑞士设计风格线条 ==================== */
.swiss-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
}

.swiss-line {
    position: absolute;
    background-color: rgba(0, 0, 0, 0.08);
}

.swiss-line.horizontal {
    width: 100%;
    height: 1px;
    left: 0;
}

.swiss-line.vertical {
    width: 1px;
    height: 100%;
    top: 0;
}

/* ==================== 左侧身份区域 ==================== */
.identity-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4vw;
    gap: 1.5rem;
    z-index: 20;
    align-items: flex-start;
}

/* 简介文案 */
.about-bio {
    margin-top: 1.5rem;
}

.bio-text {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #444;
    line-height: 1.9;
    margin: 0;
}

/* ==================== 技术栈标签 ==================== */
.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    z-index: 30;
}

.tech-tag {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 2px;
    letter-spacing: 0.05em;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

/* ==================== 底部装饰编号 ==================== */
.about-footer {
    position: absolute;
    bottom: 3vh;
    left: 4vw;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    z-index: 20;
}

.section-number {
    font-family: 'Inter', sans-serif;
    font-size: 4rem;
    font-weight: 900;
    color: rgba(0, 0, 0, 0.1);
    line-height: 1;
}

.section-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    letter-spacing: 0.15em;
}

/* ==================== 作品页样式 ==================== */
#works {
    background-color: #f8f8f8;
}

#works-grid-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#works-grid-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.works-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4vw;
    z-index: 10;
}

.works-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 3rem;
}

.works-title-small {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 0.1em;
}

.works-title-large {
    font-family: 'Inter', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    font-weight: 900;
    color: #000;
    letter-spacing: -0.03em;
    line-height: 0.9;
}

.works-subtitle {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #666;
    margin-top: 1rem;
    letter-spacing: 0.2em;
}

.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
}

.work-card {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 2rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.work-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}

.work-card-inner {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.work-title {
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: #000;
    margin: 0;
}

.work-desc {
    font-family: 'Noto Sans SC', 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #555;
    margin: 0;
    line-height: 1.6;
}

.work-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.work-tag {
    font-family: 'Inter', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    color: #333;
    background: rgba(0, 0, 0, 0.05);
    padding: 0.3rem 0.6rem;
    border-radius: 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.works-footer {
    position: absolute;
    bottom: 3vh;
    left: 4vw;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    z-index: 20;
}

/* 作品卡片链接 */
.work-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ==================== 联系页样式 ==================== */
#contact {
    background-color: #f5f5f5;
}

.contact-container {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0 4vw;
    z-index: 10;
}

.contact-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 4rem;
}

.contact-title-small {
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #333;
    letter-spacing: 0.1em;
}

.contact-title-large {
    font-family: 'Inter', sans-serif;
    font-size: clamp(4rem, 12vw, 9rem);
    font-weight: 900;
    color: #000;
    letter-spacing: -0.02em;
    line-height: 0.95;
}

.contact-subtitle {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1.2rem;
    color: #666;
    margin-top: 1rem;
    letter-spacing: 0.2em;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    max-width: 600px;
}

.contact-item {
    display: flex;
    align-items: baseline;
    gap: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.contact-label {
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #666;
    min-width: 80px;
    letter-spacing: 0.1em;
}

.contact-value {
    font-family: 'Inter', sans-serif;
    font-size: 1.2rem;
    font-weight: 400;
    color: #000;
    text-decoration: none;
    transition: opacity 0.3s;
}

.contact-value:hover {
    opacity: 0.6;
}

.contact-footer {
    position: absolute;
    bottom: 10vh;
    left: 4vw;
}

.contact-footer p {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: #888;
    margin: 0.3rem 0;
}

.contact-quote {
    font-family: 'Noto Sans SC', sans-serif;
    font-size: 1rem;
    color: #555;
    margin-top: 1rem;
    letter-spacing: 0.1em;
}

.contact-section-footer {
    position: absolute;
    bottom: 3vh;
    left: 4vw;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    z-index: 20;
}

.contact-section-footer .section-number {
    color: rgba(0, 0, 0, 0.1);
}

.contact-section-footer .section-label {
    color: rgba(0, 0, 0, 0.3);
}

/* ==================== ICP备案信息样式 ==================== */
.icp-info {
    margin-top: 1.5rem;
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
}

.icp-info p {
    margin: 0.5rem 0;
    font-size: 0.75rem;
    color: #999;
}

.icp-link,
.police-link {
    color: #999;
    text-decoration: none;
    transition: color 0.3s;
}

.icp-link:hover,
.police-link:hover {
    color: #666;
    text-decoration: underline;
}

.police-filing {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.police-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 4px;
}