:root {
    --primary-color: #007aff;
    --background-color: #0a0a0c;
    --card-bg: rgba(255, 255, 255, 0.05);
    --text-color: #e0e0e6;
    --text-muted: #a0a0ab;
    --accent-gradient: linear-gradient(135deg, #007aff, #00c6ff);
    --container-width: 1000px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    overflow-x: hidden;
}

body {
    font-family: 'Inter', 'Noto Sans JP', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

header {
    background-color: var(--secondary-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease; /* スムーズな出し入れ用 */
}

header.header-hidden {
    transform: translateY(-100%); /* ヘッダーを上に隠す */
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    margin: 0;
    white-space: nowrap;
}

header h1 a {
    color: inherit;
    text-decoration: none;
    background: linear-gradient(45deg, #fff, #bbb);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Hamburger Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 26px;
    height: 18px;
    cursor: pointer;
    z-index: 1100;
    margin-left: 1rem;
}

.menu-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background-color: #fff;
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 1.5rem;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    transition: all 0.3s;
    font-size: 0.9rem;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Mobile Responsiveness for Header */
@media (max-width: 850px) {
    header h1 {
        font-size: 1.1rem;
    }

    .menu-toggle {
        display: flex;
    }

    nav {
        position: absolute;
        top: 100%; /* ヘッダーの直下 */
        left: 0;
        width: 100%;
        background: rgba(15, 15, 15, 0.98);
        backdrop-filter: blur(20px);
        padding: 1rem 2rem 2rem;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1050;
        box-shadow: 0 10px 30px rgba(0,0,0,0.5);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
    }

    nav.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    nav ul {
        flex-direction: column;
        align-items: center; /* 中央揃えに変更 */
        text-align: center;
    }

    nav ul li {
        margin: 0.8rem 0;
        width: 100%;
        margin-left: 0;
    }

    nav ul li a {
        font-size: 1.1rem;
        display: block;
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    /* Toggle Animation */
    .menu-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
        transform: translateX(10px);
    }
    .menu-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero Responsiveness */
    .hero-banner {
        height: 300px;
        margin-bottom: 2rem;
    }

    .hero-text h2 {
        font-size: 2rem;
    }

    .hero-text p {
        font-size: 1rem;
    }
}

/* Hero Banner */
.hero-banner {
    position: relative;
    width: 100%;
    height: 480px;
    margin-bottom: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: var(--background-color);
}

.hero-banner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    opacity: 0.6;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 50%, rgba(0,0,0,0) 100%);
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, var(--background-color) 0%, transparent 60%);
    z-index: 2;
}

.hero-text {
    position: relative;
    z-index: 3;
    text-align: center;
    padding: 0 2rem;
    max-width: var(--container-width);
}

.hero-text h2 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 4px 15px rgba(0, 0, 0, 0.8);
    background: none;
    -webkit-text-fill-color: inherit;
}

.hero-text h2::after {
    display: none;
}

.hero-text p {
    font-size: 1.3rem;
    color: var(--text-color);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    letter-spacing: 1px;
}

main {
    padding: 4rem 0;
}

section {
    margin-bottom: 4rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.list-container {
    display: grid;
    gap: 1.5rem;
}

.card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(0, 122, 255, 0.3);
}

.date {
    display: inline-block;
    font-size: 0.8rem;
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.authors, .presenters {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-bottom: 0.4rem;
}

.venue {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.doi-link {
    display: inline-block;
    margin-top: 1rem;
    font-size: 0.8rem;
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
}

footer {
    padding: 4rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-social {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.footer-social a {
    color: var(--text-muted);
    font-size: 1.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.footer-social a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.interest-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 0.5rem;
    margin-top: 1rem;
    color: var(--text-muted);
}

.research-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.news-item {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.member-profile {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 850px) {
    .member-profile {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.member-profile .role {
    color: var(--primary-color);
    font-weight: 700;
}

.experience h4 {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.experience ul {
    list-style: none;
}

.experience li {
    font-size: 0.9rem;
    margin-bottom: 0.8rem;
    padding-left: 1rem;
    border-left: 2px solid rgba(0, 122, 255, 0.3);
}

.award-title {
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.member-group {
    margin-bottom: 3rem;
}

.member-group h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
}

.student-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.student-card h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.research-theme {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.student-names {
    padding: 1.5rem;
}

.student-names p {
    color: var(--text-muted);
}

.email-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 1rem;
    margin-bottom: 0.2rem;
}

.email-obfuscated {
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    color: var(--text-color);
    letter-spacing: 0.05rem;
}

.email-obfuscated .u::after {
    content: '[at]';
    margin: 0 0.2rem;
    color: var(--primary-color);
    font-weight: 700;
}

.view-all {
    text-align: right;
    margin-top: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    transition: transform 0.2s;
}

.btn:hover {
    transform: translateY(-2px);
}

/* News Archive Styles */
.news-archive-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.news-full-item {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
}

.news-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
}

.news-image img {
    max-width: 100%;
    max-height: 500px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.news-description {
    line-height: 1.8;
    color: var(--text-muted);
}

.student-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.student-card .name {
    font-size: 1.1rem;
    font-weight: 700;
}

.student-card .theme {
    font-size: 0.9rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.5rem;
}

.professor-full-card {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.member-experience h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.experience-list {
    list-style: none;
    padding: 0;
}

.experience-list li {
    display: flex;
    gap: 1.5rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.experience-list li:last-child {
    border-bottom: none;
}

.exp-date {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 150px;
    flex-shrink: 0;
}

.exp-detail {
    font-size: 0.95rem;
}

/* Member Section - Undergraduate Students */
.student-names {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 0.5rem 0;
}

.student_item_tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    color: var(--text-color);
}

/* News Section Fixes */
.news-link-wrapper {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
    transition: transform 0.2s, background-color 0.2s;
    border-radius: 12px;
}

.news-link-wrapper:hover {
    transform: translateY(-2px);
    background-color: rgba(255, 255, 255, 0.05);
}

.news-link-wrapper:visited {
    color: inherit !important;
}

/* Recruitment Banner */
.recruitment-banner {
    margin-top: 3rem;
    text-align: center;
}

.student-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    background: var(--accent-gradient);
    color: white !important;
    text-decoration: none !important;
    padding: 1.2rem 2.5rem;
    border-radius: 50px;
    box-shadow: 0 10px 30px rgba(0, 122, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    min-width: 400px;
    margin: 1.5rem auto;
}

.student-cta-btn:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.4);
}

.student-cta-btn .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 1rem;
}

.student-cta-btn .main-text {
    font-size: 1.1rem;
    font-weight: 700;
    flex-grow: 1;
}

.student-cta-btn .arrow {
    margin-left: 1rem;
    font-size: 1.2rem;
}

/* Research Cards Spacing & Layout Fixes */
#research .research-grid .card {
    padding: 2.5rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Students Page Specific Fixes */
.research-grid .card {
    overflow: hidden; /* 画像のはみ出し防止 */
    display: flex;
    flex-direction: column;
    padding: 0;
}

.research-grid .card-img {
    width: 100%;
    height: 200px;
    object-fit: cover; /* はみ出さずに枠に合わせる */
    display: block;
}

.research-grid .card-content {
    padding: 1.5rem;
}

/* Chart Container Fixes */
.students-page .chart-container {
    position: relative;
    min-height: 450px; /* 凡例が収まるよう最小高さを拡大 */
    width: 100%;
    margin-bottom: 2rem;
    padding: 1.5rem;
    overflow: visible; /* 凡例のはみ出しを許容 */
    display: flex;
    flex-direction: column;
}

.students-page .chart-container canvas {
    max-height: 350px; /* キャンバス自体の高さに制限を設けて無限伸長を防止 */
}

/* Speech Bubble Styles */
.speech-bubble-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.speech-bubble {
    position: relative;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 15px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.6;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 30px;
    border-width: 15px 15px 0 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.08) transparent transparent transparent;
}

/* Collaborative Research Section */
.collaboration-section {
    background: linear-gradient(to right, rgba(0, 122, 255, 0.1), transparent);
    border-left: 4px solid var(--primary-color);
    padding: 2rem;
    margin: 3rem 0;
}

@media (max-width: 768px) {
    .survey-grid {
        grid-template-columns: 1fr;
    }
    
    .student-cta-btn {
        min-width: auto;
        width: 100%;
        padding: 1rem 1.5rem;
    }
    
    .chart-container {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .experience-list li {
        flex-direction: column;
        gap: 0.3rem;
    }
    
    .exp-date {
        min-width: auto;
    }
}
