/* --- 全局样式 --- */
:root {
    --primary-color: #007BFF;
    --secondary-color: #0056b3;
    --text-color: #333333;
    --text-light-color: #555555;
    --bg-color: #FFFFFF;
    --bg-light-color: #f8f9fa;
    --border-color: #eeeeee;
    --font-family-en: 'Inter', sans-serif;
    --font-family-ja: 'Noto Sans JP', sans-serif;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --transition-speed: 0.3s;
}

/* --- 基础和动画 --- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-en);
    margin: 0;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.8;
    overflow-x: hidden; /* 防止水平滚动 */
}

html[lang="ja"] body {
    font-family: var(--font-family-ja);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 淡入动画 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.content-section, .hero {
    animation: fadeIn 0.8s ease-out forwards;
}

/* --- 导航栏 --- */
header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}
.logo:hover {
    color: var(--primary-color);
}

.nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
}

.nav-links li {
    margin-left: 30px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 400;
    transition: color var(--transition-speed);
    position: relative;
    padding-bottom: 5px;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--primary-color);
    transition: all var(--transition-speed) ease-out;
    transform: translateX(-50%);
}

.nav-links a:hover::after,
.nav-links a.active-nav-link::after {
    width: 100%;
}

/* --- 语言切换器 --- */
.lang-switcher {
    margin-left: 30px;
    font-size: 0.9rem;
}

.lang-switcher a {
    color: var(--text-light-color);
    text-decoration: none;
    transition: color var(--transition-speed);
    padding: 2px 5px;
}

.lang-switcher a:hover {
    color: var(--primary-color);
}

.lang-switcher a.active {
    font-weight: bold;
    color: var(--primary-color);
}

.lang-switcher a.active::after {
    width: 100%;
}


/* --- 欢迎区 --- */
.hero {
    text-align: center;
    padding: 100px 20px;
    background-color: var(--bg-light-color);
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin: 0;
}

.hero .subtitle {
    font-size: 1.3rem;
    font-weight: 300;
    color: var(--text-light-color);
    margin: 15px 0 40px 0;
}

.cta-button {
    background-color: var(--primary-color);
    color: white;
    padding: 15px 35px;
    text-decoration: none;
    border-radius: 5px;
    transition: all var(--transition-speed);
    box-shadow: var(--shadow);
    font-weight: bold;
    display: inline-block; /* 确保按钮样式正确应用 */
}

.cta-button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

/* --- 内容版块 --- */
.content-section {
    padding-top: 80px;
    padding-bottom: 80px;
}

.content-section h2 {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
}

/* [新增] 用于在合并页面中分隔不同内容区域的样式 */
.section-separator {
    height: 1px;
    width: 100px;
    background-color: var(--border-color);
    margin: 80px auto;
}

/* --- 关于页面卡片 (新样式) --- */
.about-card {
    background-color: var(--bg-light-color);
    border-radius: 10px;
    padding: 40px;
    box-shadow: var(--shadow);
}

.about-card h2 {
    margin-top: 0;
    text-align: center;
}

.about-card p {
    font-size: 1.1rem;
    line-height: 1.9;
    max-width: 70ch;
    margin: 0 auto;
    /* [修复] 添加此行以确保段落内的文本也居中对齐 */
    text-align: center;
}


/* --- 作品集网格和卡片 --- */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.portfolio-card {
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

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

.portfolio-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.portfolio-card-content {
    padding: 25px;
}

.portfolio-card-content h3 {
    margin-top: 0;
    font-size: 1.4rem;
    color: var(--primary-color);
}

.portfolio-card-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-light-color);
}

/* --- 联系方式 --- */
#contact {
    text-align: center;
}

.contact-wrapper {
    max-width: 70ch;
    margin-left: auto;
    margin-right: auto;
}

#contact .cta-button {
    margin-top: 20px;
}


/* --- 页脚 --- */
footer {
    text-align: center;
    padding: 40px 0;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: #777777;
    background-color: var(--bg-light-color);
}

/* --- 汉堡菜单 --- */
.nav-toggle {
    display: none;
    cursor: pointer;
    border: none;
    background: transparent;
    z-index: 1001; /* 确保在导航之上 */
}

.hamburger {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--text-color);
    position: relative;
    transition: background 0.2s ease-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: var(--text-color);
    left: 0;
    transition: transform 0.2s ease-out, top 0.2s ease-out, bottom 0.2s ease-out;
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.nav-open .hamburger { background: transparent; }
.nav-open .hamburger::before { transform: rotate(45deg); top: 0; }
.nav-open .hamburger::after { transform: rotate(-45deg); bottom: 0; }

/* --- Portfolio Category Section --- */
.portfolio-category {
    background: var(--bg-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 50px; /* Space between categories */
    text-align: center;
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.portfolio-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.portfolio-category-banner {
    width: 100%;
    height: auto; /* Maintain aspect ratio */
    max-height: 350px; /* Limit banner height */
    object-fit: cover;
    display: block;
}

.portfolio-category-content {
    padding: 40px 30px;
}

.portfolio-category-content h2 {
    margin-top: 0;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.portfolio-category-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-light-color);
    max-width: 70ch;
    margin: 0 auto 30px auto; /* Center the paragraph */
}

/* Adjust grid to be a single column for this layout */
.portfolio-grid {
    display: block; /* Override grid to stack categories */
}


/* --- 响应式设计 (Mobile) --- */
@media (max-width: 768px) {
    /* --- Navigation --- */
    .nav-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%; /* 从右侧滑入 */
        width: 80%;
        max-width: 300px;
        height: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(5px);
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(0);
        transition: right 0.4s ease-in-out;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        margin: 0 0 40px 0;
    }

    .nav-links a {
        font-size: 1.5rem;
        font-weight: bold;
    }

    .lang-switcher {
        margin: 20px 0 0 0;
        font-size: 1.2rem;
    }

    body.nav-open {
        overflow: hidden;
    }

    /* --- Typography & Layout --- */
    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .content-section {
        padding-top: 60px;
        padding-bottom: 60px;
    }

    .content-section h2 {
        font-size: 2rem;
    }

    .about-card {
        padding: 25px;
    }
}
