@charset "UTF-8";

/* ==============================================================
   1. 共通基本スタイル & 変数定義
   ============================================================== */
:root {
    --primary-color: #003366;
    --secondary-color: #0066cc;
    --text-color: #333;
    --bg-light: #f4f6f9;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* スムーズスクロールをサイト全体に適用 */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Helvetica Neue', Arial, 'Hiragino Kaku Gothic ProN', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--white);
    overflow-x: hidden; /* スマホでの横揺れを防止 */
}

/* 固有ページで背景をグレーにするための指定 */
body.sub-page {
    background-color: var(--bg-light);
}

section {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 40px;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
}

/* ==============================================================
   2. 共通ヘッダー（追従型）
   ============================================================== */
header {
    position: sticky;
    top: 0;
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
}

/* --- ロゴ周りのスタイル調整 --- */
.logo {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-decoration: none;
    line-height: 1.3;
    display: flex;             /* 画像とテキストを横並びにする */
    align-items: center;        /* 垂直方向の中央に揃える */
    gap: 10px;                  /* ロゴ画像とテキストの間の余白 */
}

/* ロゴ画像のサイズ制御 */
.logo-img {
    height: 35px;               /* ヘッダーの高さに合わせた画像の高さ */
    width: auto;                /* 横幅は自動計算 */
    display: block;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 15px;      
    flex-shrink: 0;         
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s;
    white-space: nowrap;    
}

nav ul li a:hover {
    color: var(--secondary-color);
}

.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    transition: 0.3s;
}

/* ==============================================================
   3. 共通レイアウトコンテナ（下層ページ用）
   ============================================================== */
.container {
    max-width: 950px; 
    margin: 15px auto 40px; 
    background: #ffffff; 
    padding: 25px 40px 40px; 
    border-radius: 4px; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* メンバーページなど、幅を広く取りたいページ用 */
.container.wide {
    max-width: 1100px;
}

.page-title {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    text-align: center;
}

.page-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background-color: var(--secondary-color);
    margin: 10px auto 0;
}

.intro-text {
    text-align: center;
    color: #555;
    max-width: 850px;
    margin: 0 auto 40px;
    font-size: 0.95rem;
}

/* ==============================================================
   4. index.html (トップページ) 固有スタイル
   ============================================================== */
/* メインスライダー */
.hero {
    height: 60vh;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slide.active {
    opacity: 0.5;
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: var(--white);
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 2.3rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.6);
    margin-bottom: 15px;
}

/* お知らせ */
.news-list {
    max-width: 850px;
    margin: 0 auto;
}

.news-item {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    padding: 15px 10px;
    font-size: 0.95rem;
    align-items: flex-start;
}

.news-date {
    width: 120px;
    color: #64748b;
    font-weight: bold;
    flex-shrink: 0;
}

.news-item-tags {
    display: flex;
}

.news-tag {
    color: white;
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 15px;
    flex-shrink: 0;
    font-weight: bold;
    background-color: #64748b;
}
.news-tag.award { background-color: #ea580c; }
.news-tag.paper { background-color: #dc2626; }
.news-tag.academic { background-color: var(--secondary-color); }
.news-tag.international { background-color: #10b981; }

.news-text {
    color: var(--text-color);
    flex-grow: 1;
}

.news-archive {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}

.news-toggle-btn {
    display: none;
    width: 220px;
    margin: 30px auto 0;
    padding: 10px;
    text-align: center;
    background: transparent;
    border: 1px solid var(--secondary-color);
    color: var(--secondary-color);
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}
.news-toggle-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

/* 研究室で目指すもの */
.vision-box {
    background-color: var(--white);
    border-left: 5px solid var(--primary-color);
    padding: 25px;
    margin-bottom: 40px;
    border-radius: 0 5px 5px 0;
}

.vision-box h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

/* 主な研究テーマ */
.research-theme-list {
    list-style: none;
    max-width: 850px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.research-theme-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}

.research-theme-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
    border-color: var(--secondary-color);
}

.research-theme-link {
    display: block;
    padding: 22px 25px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.15rem;
    position: relative;
}

.research-theme-link::after {
    content: '➔';
    position: absolute;
    right: 25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    font-size: 1rem;
    transition: transform 0.3s;
}

.research-theme-link:hover::after {
    transform: translateY(-50%) translateX(4px);
}

/* 産学連携カード */
.academic-container {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.academic-card {
    background: #ffffff;
    border-top: 3px solid var(--primary-color);
    border-left: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 30px;
    width: 48%;
    min-width: 340px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.academic-card h4 {
    color: var(--primary-color);
    font-size: 1.15rem;
    margin-bottom: 15px;
    padding-bottom: 8px;
}

.academic-card ul {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 25px;
}

.academic-card li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 12px;
    font-size: 0.95rem;
    color: #334155;
}

.academic-card li::before {
    content: "■";
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-size: 0.75rem;
    top: 2px;
}

.academic-link {
    display: inline-block;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-top: auto;
}

.academic-link:hover {
    text-decoration: underline;
}

.academic-btn {
    display: block;
    text-align: center;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    background-color: transparent;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    transition: all 0.3s;
    margin-top: auto;
}

.academic-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.official-link {
    display: inline-block;
    margin-top: 15px;
    font-size: 0.85rem;
    color: var(--secondary-color);
    text-decoration: none;
    font-weight: bold;
}
.official-link:hover {
    text-decoration: underline;
}

/* 進路情報のタブ */
.tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #ddd;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    color: #666;
    position: relative;
    bottom: -2px;
}

.tab-btn.active {
    color: var(--secondary-color);
    border-bottom: 2px solid var(--secondary-color);
    font-weight: bold;
}

.tab-content {
    display: none;
    background-color: var(--white);
    padding: 20px;
    border-radius: 5px;
}

.tab-content.active {
    display: block;
}

/* ==============================================================
   5. research.html (研究内容詳細) 固有スタイル
   ============================================================== */
.theme-block {
    margin-top: 50px;
}
.theme-block:first-of-type {
    margin-top: 20px;
}

.theme-title {
    color: var(--primary-color);
    background-color: #f0f4f8;
    padding: 12px 18px;
    margin-bottom: 15px;
    font-size: 1.3rem;
    border-left: 5px solid var(--primary-color);
    border-radius: 0 4px 4px 0;
    scroll-margin-top: 90px;
}

/* キーワード丸タグ */
.tech-tags {
    margin-bottom: 25px;
    padding-left: 5px;
}
.tag {
    display: inline-block;
    background-color: #e2e8f0;
    color: #4a5568;
    padding: 3px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    margin-right: 8px;
    margin-bottom: 5px;
    font-weight: 500;
}

/* 動的マークダウン描画エリアの装飾 */
.markdown-body h4 {
    color: #475569; font-size: 1.1rem; margin-top: 30px; margin-bottom: 12px;
    padding-left: 10px; border-left: 3px solid var(--secondary-color); display: block;
}
.markdown-body p { font-size: 0.95rem; color: var(--text-color); margin-bottom: 15px; text-align: justify; }
.markdown-body ul { padding-left: 25px; margin-bottom: 25px; }
.markdown-body li { font-size: 0.9rem; color: #475569; margin-bottom: 6px; }
.markdown-body strong { color: var(--primary-color); }
.markdown-body a { color: var(--secondary-color); text-decoration: none; font-weight: bold; }
.markdown-body hr { border: none; border-top: 1px dashed #cbd5e1; margin: 40px 0; }

/* ==============================================================
   6. publications.html (研究業績) 固有スタイル
   ============================================================== */
.pub-container {
    max-width: 1000px;
    margin: 20px auto 40px;
    background: #ffffff;
    padding: 40px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#publications-content h3 {
    color: var(--primary-color); border-bottom: 2px solid var(--primary-color);
    padding-bottom: 5px; margin-top: 35px; margin-bottom: 20px; 
    font-size: 1.3rem; clear: both;
    scroll-margin-top: 90px;
}

.pub-category-block { margin-bottom: 25px; display: block; clear: both; }
.pub-category-block h4 {
    color: #555; font-size: 1.1rem; margin-top: 25px; margin-bottom: 12px;
    font-weight: bold; display: block;
}
.pub-category-block:first-of-type h4 { margin-top: 10px; }

#publications-content ul,
#publications-content ol {
    list-style-type: decimal; 
    list-style-position: outside;
    margin: 0;
    padding: 0 0 0 3em;
}

#publications-content li {
    margin-bottom: 15px; 
    font-size: 0.95rem; 
    line-height: 1.6;
    text-align: left;
    word-break: break-word;
}

#publications-content li::marker {
    color: var(--secondary-color);
    font-weight: bold;
}

/* 自動生成目次（TOC）の装飾 */
.pub-toc {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 12px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.pub-toc a {
    display: inline-block;
    padding: 6px 12px;
    margin: 4px;
    background-color: var(--white);
    border: 1px solid #ccc;
    border-radius: 20px;
    color: var(--secondary-color);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pub-toc a:hover {
    background-color: var(--secondary-color);
    color: var(--white);
    border-color: var(--secondary-color);
}

/* ページトップへ戻るボタンの装飾 */
#to-top-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: #333;
    color: var(--white);
    border: none;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 999;
}

#to-top-btn.show {
    opacity: 1;
    visibility: visible;
}

#to-top-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
}

/* ==============================================================
   7. equipment.html (主要研究設備) 固有スタイル
   ============================================================== */
.equipment-section {
    margin-bottom: 50px;
}
.category-title {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 6px;
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 24px;
}
.eq-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
}
.eq-card h4 {
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
    font-weight: bold;
}
.eq-card h4::before {
    content: "■";
    color: var(--secondary-color);
    font-size: 0.8rem;
    margin-right: 8px;
    margin-top: 2px;
}

.eq-img-wrapper {
    width: 100%;
    height: 160px;
    background-color: #f8fafc;
    border: 1px solid #f1f5f9;
    border-radius: 4px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.eq-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain; 
}

.eq-card p {
    font-size: 0.88rem;
    color: #475569;
    margin-bottom: 12px;
    line-height: 1.5;
}

.models-list {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
}
.model-tag {
    font-size: 0.8rem;
    color: #4b5563;
    background-color: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    display: block;
    margin-bottom: 4px;
    font-family: monospace;
}
.model-tag:last-child {
    margin-bottom: 0;
}

/* ==============================================================
   8. members.html (メンバー紹介) 固有スタイル
   ============================================================== */
.year-tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 40px; border-bottom: 2px solid #e2e8f0; padding-bottom: 15px; }
.year-btn { background: none; border: 1px solid #cbd5e1; padding: 8px 20px; font-size: 1rem; cursor: pointer; color: #64748b; border-radius: 20px; transition: all 0.3s; }
.year-btn.active { background-color: var(--primary-color); color: white; border-color: var(--primary-color); font-weight: bold; }

.year-content { display: none; }
.year-content.active { display: block; }
.member-section { margin-bottom: 40px; }
.grade-title { color: var(--primary-color); border-bottom: 2px solid var(--primary-color); padding-bottom: 6px; margin-bottom: 15px; font-size: 1.2rem; font-weight: bold; }
.member-list { list-style: none; padding-left: 0; }

.member-item { 
    background-color: #f8fafc; 
    border-left: 4px solid var(--secondary-color); 
    padding: 5px 16px;    
    margin-bottom: 4px;  
    border-radius: 0 4px 4px 0; 
}

.member-main { 
    display: flex;
    align-items: baseline;
    gap: 12px; 
}

.member-name { 
    font-weight: bold; 
    font-size: 1.1rem; 
    color: var(--text-color);
}

.member-role { 
    font-size: 0.85rem; 
    color: var(--secondary-color); 
    font-weight: bold;
}

.member-detail { 
    font-size: 0.85rem; 
    color: #475569; 
    margin-top: 3px; 
    margin-bottom: 3px;
}

/* ==============================================================
   9. inquiry.html (お問い合わせフォーム) 固有スタイル
   ============================================================== */
.form-container {
    max-width: 760px;
    margin: 30px auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.iframe-wrapper {
    position: relative;
    width: 100%;
    height: 850px; 
    overflow: hidden;
}
.iframe-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ==============================================================
   10. for-students.html (配属希望生向けページ) 固有スタイル
   ============================================================== */
.policy-box {
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 25px;
    margin-bottom: 30px;
}

.policy-box h3 {
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 6px;
}

.student-list {
    padding-left: 20px;
    font-size: 0.95rem;
    color: #334155;
}

.student-list.mb-15 {
    margin-bottom: 15px;
}

.schedule-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 30px;
}

.schedule-item {
    display: flex;
    border-bottom: 1px dashed #cbd5e1;
    padding: 12px 5px;
    align-items: baseline;
}

.schedule-month {
    width: 90px;
    font-weight: bold;
    color: var(--primary-color);
    flex-shrink: 0;
}

.schedule-desc {
    color: var(--text-color);
    font-size: 0.95rem;
}

.tab-content.mb-30 {
    margin-bottom: 30px;
}

.tab-list {
    padding-left: 20px;
    font-size: 0.95rem;
    line-height: 1.8;
}

.tab-text {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #334155;
}

/* --- FAQ（よくある質問）カード枠装飾の強化 --- */
.faq-item {
    margin-bottom: 20px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px 24px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.faq-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}

.faq-q {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.05rem;
    margin-bottom: 10px;
    display: flex;
    align-items: baseline;
    gap: 8px;
    line-height: 1.5;
}

.faq-q::before {
    content: "Q.";
    color: var(--secondary-color);
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1;
}

.faq-a {
    color: #475569;
    font-size: 0.95rem;
    padding-left: 28px;
    line-height: 1.7;
}

.contact-box {
    text-align: center;
    margin-top: 40px;
    background: #f0f4f8;
    padding: 30px;
    border-radius: 6px;
}

.contact-title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.contact-text {
    font-size: 0.95rem;
    color: #475569;
    margin-bottom: 20px;
}

.contact-btn {
    display: inline-block;
    width: auto;
    padding: 12px 30px;
}

/* ==============================================================
   11. レスポンシブ対応（スマホ表示全般・メディアクエリ）
   ============================================================= */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    
    nav ul {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%; left: 0; width: 100%;
        background-color: var(--white);
        box-shadow: 0 4px 5px rgba(0,0,0,0.1);
        padding: 20px;
    }
    nav ul.show { display: flex; }
    nav ul li { margin: 10px 0; margin-left: 0; }

    /* 各下層ページのレイアウトコンテナ調整 */
    .container, .pub-container { 
        padding: 25px 20px; 
        margin: 15px;
    }
    
    /* トップページスライダー・カード */
    .hero h1 { font-size: 1.6rem; }
    .hero::before {
        content: ""; position: absolute; inset: 0;
        background: rgba(0, 0, 0, 0.30); z-index: 5;
    }
    .hero-content { position: relative; z-index: 10; }
    .academic-card { width: 100%; }
    .news-item { flex-direction: column; }
    .news-date { margin-bottom: 5px; }
    .research-theme-link { padding: 18px 40px 18px 20px; font-size: 1rem; }
    .research-theme-link::after { right: 15px; }

    /* FAQのスマホ時の余白調整 */
    .faq-item {
        padding: 16px;
    }
    .faq-a {
        padding-left: 22px;
    }

    /* 論文リスト */
    #publications-content ul,
    #publications-content ol {
        padding: 0 0 0 2.5em;
    }

    /* お問い合わせ */
    .iframe-wrapper { height: 1000px; }

    /* スマホ表示の時は「ページトップへ戻る」ボタンを少し小さく、配置を調整 */
    #to-top-btn {
        bottom: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
}