:root{
  --bg:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#2563eb;
  --max:1100px;
  --radius:16px;

  /* ETH-like dropdown background */
  --dropdown-bg:#f3f4f6;

  --menu-top: 165px;
}

*{box-sizing:border-box;}

body{
  margin:0;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Hiragino Sans",
    "Noto Sans JP",
    "Yu Gothic",
    "Meiryo",
    sans-serif;

  color:var(--text);
  background:var(--bg);
  line-height:1.55;
  overflow-y:scroll;
}

a{
  color:var(--accent);
  text-decoration:none;
}

a:hover{
  text-decoration:underline;
}

.wrap{
  max-width:var(--max);
  margin:0 auto;
  padding:0 48px;
}

/* accessibility */
.skip{
  position:absolute;
  left:-9999px;
  top:auto;
  width:1px;
  height:1px;
  overflow:hidden;
}

.skip:focus{
  position:static;
  width:auto;
  height:auto;
  display:inline-block;
  margin:12px;
  padding:10px 12px;
  background:#fff;
  border:1px solid var(--line);
  border-radius:10px;
}

/* top bar */
.topbar{
  border-bottom:1px solid var(--line);
  background:#8A1E2D;
  position:relative;
  z-index:2000;
  padding:0 48px;
}

.topbar a{
  color:rgba(255,255,255,0.85);
  text-decoration:none;
}

.topbar a:hover{
  color:#ffffff;
  text-decoration:underline;
}

.topbar-inner{
  display:flex;
  gap:14px; 
  align-items:center;
  justify-content:space-between;
  height: 40px;
  padding: 0;
  font-size:14px;
  color:var(--muted);
  color:rgba(255,255,255,0.85);
}

.top-links{
  display:flex;
  gap:12px;
  flex-wrap:wrap;
  align-items:center;
}

.lang{
  font-weight:600;
}


/* header */
header{
  padding:18px 0 12px;
  position:relative;
  z-index:2000;
}

.header-row{
  display:flex;
  flex-direction:column;
  gap:10px;
  position: relative; /* これを追加：パネルはこの要素の左端(0)に合わせるようになります */
}

.site-title{
  margin:0;
  font-size:30px;
  padding: 20px 0; 
  letter-spacing:0.3px;
}

/* menu */
.menu{
  display:flex;
  justify-content:flex-start;
  gap:14px;
  flex-wrap:wrap;
  align-items:center;
  font-size:15px;
}

.menu-disabled{
  display:block;
  color:#9ca3af;          /* 薄いグレー */
  cursor:default;
  padding:4px 0;
}

/* ETH-like: button background does not change */
.mega{
  position:static;
}

.menu-link,
.mega-btn{
  color:var(--text);
  font: inherit;

  border:none;
  background:transparent;
  cursor:pointer;

  padding:0 0 6px 0;
  border-bottom:2px solid transparent;

  text-decoration:none !important;
}

.menu-link:hover,
.mega-btn:hover{
  color: var(--accent); /* 文字を青に変更 */
  border-bottom: 2px solid var(--accent); /* 下線も青に変更 */
  text-decoration:none !important;
}



/* mega dropdown panel */
.mega-panel {
  position: absolute;   /* fixed から absolute に変更 */
  left: 0;
  right: 0;             /* left:0 と right:0 で親要素の幅いっぱいに広がる */
  top: 100%;            /* メニューのすぐ下に出す */
  width: 100%;          /* 親（.wrap）と同じ幅になる */
  background: var(--dropdown-bg);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  display: none;
  z-index: 2500;
  padding: 12px 48px 18px; /* 左右の余白を .wrap の 48px に合わせる */
}

.mega.open .mega-panel{
  display:block;
}

/* top row inside dropdown */
.mega-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:10px 20px;
  border-bottom:1px solid var(--line);
  margin-bottom:14px;
}

.mega-title{
  font-weight:700;
  font-size:15px;
}

.mega-close{
  border:none;
  background:transparent;
  font-size:28px;
  line-height:1;
  cursor:pointer;
  color:var(--muted);
  padding:0 6px;
}

.mega-close:hover{
  color:var(--text);
}

/* menu grid */
.mega-inner{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:18px;
}

.mega-col{
  padding:8px 0;
}

.mega-col h3{
  margin:0 0 10px;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:0.08em;
  color:var(--muted);
}

.mega-col a{
  display:block;
  padding:6px 0;
  color:var(--text);
  font-weight:500;
}

.mega-col a:hover{
  color: var(--accent);          /* 文字を青にする */
  text-decoration: none !important;    /* 下線は消したほうがモダンです */
}

.mega-desc{
  margin:0 0 10px;
  color:var(--muted);
  font-size:14px;
  line-height:1.5;
}

.mega-highlight{
  display:inline-block;
  margin-top:6px;
  font-weight:700;
  color:var(--accent);
}

/* welcome */
.welcome{
  padding:18px 0 22px;
}

.welcome-grid{
  display:grid;
  grid-template-columns: 1.0fr 1.0fr;
  gap:18px;
  align-items:center;
}
.welcome-text{
  max-width: 520px;
  padding: 40px 55px 0px 55px;
  text-align: justify;
  text-justify: inter-ideograph;
}

.welcome-text h2{
  margin:0 0 10px;
  font-size:26px;
}

.welcome-text p{
  margin:0 0 12px;
  color:var(--muted);
  font-size:15px;
}

.welcome-image{
	display: flex;
	align-items: center;
	justify-content: center;
}

.welcome-image img {
	max-width: 400px;
	width: 100%;
	height: auto;
	border-radius: 10px;
}

.welcome-image figcaption {
	margin-top: 8px;
	font-size: 13px;
	color: var(--muted);
	text-align: center;
}

.welcome-image figure {
  margin: 0;
  display: inline-block;
  text-align: center;
}

/* sections */
.section-title{
  font-size:28px;
  margin:0 0 10px;
}

.rule{
  height:1px;
  background:var(--line);
  margin:8px 0 16px;
}

.card{
  border:1px solid var(--line);
  border-radius:var(--radius);
  background:#fff;
  padding:16px;
}

.links{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
}

ul.clean{
  margin:0;
  padding-left:18px;
}

ul.clean li{
  margin:6px 0;
}

.muted{
  color:var(--muted);
}

/* footer */
footer{
  margin-top:26px; 
  background:#8A1E2D;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0;
  color:rgba(255,255,255,0.85);
  font-size:12px;
}

footer a{
  color:rgba(255,255,255,0.85);
  text-decoration:none;
}

footer a:hover{
  color:#ffffff;
  text-decoration:underline;
}

.footer-bottom{
}

/* responsive */
@media (max-width: 900px){
  .welcome-grid{
    grid-template-columns: 1fr;
  }
  .links{
    grid-template-columns: 1fr;
  }
  .mega-inner{
    grid-template-columns: 1fr;
  }
  .mega-panel{
    top:140px;
  }
}


.whatsnew{
  margin-top:14px;
  padding-top:10px;
  border-top:1px solid var(--line);
  font-size:14px;
  color:var(--muted);
}

.whatsnew-label{
  font-weight:700;
  color:var(--text);
  margin-right:6px;
}

.whatsnew-text{
  color:var(--muted);
}

/* members section */

.member-category{
  margin:26px 0 12px;
  font-size:16px;
  font-weight:700;
  color:var(--text);
}

.member-grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap:14px;
  margin-bottom:10px;
}

.member-card{
  background:#fff;
  border:1px solid var(--line);
  border-radius:14px;
  padding:14px 16px;
}

.member-grade{
  font-size:13px;
  font-weight:700;
  color:var(--muted);
  margin-bottom:6px;
}

.member-name{
  font-size:16px;
  font-weight:700;
  color:var(--text);
}

.member-name-en{
  font-size:14px;
  color:#6b7280;
/*  color:var(--muted); */
  margin-top:2px;
}

.member-web{
  margin-top:8px;
  font-size:13px;
}

.member-web a{
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  background:#f3f4f6;
  color:var(--text);
  font-size:12px;
  font-weight:600;
  text-decoration:none;
  border:1px solid var(--line);
}

.member-web a:hover{
  background:#e5e7eb;
  text-decoration:none;
}

.member-links{
  margin-top:10px;
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}

.pill{
  display:inline-block;
  padding:4px 12px;
  border-radius:999px;
  background:#f3f4f6;
  border:1px solid var(--line);
  font-size:12px;
  font-weight:600;
  color:var(--text);
  text-decoration:none;
  line-height:1.2;
}

.pill:hover{
  background:#e5e7eb;
  text-decoration:none;
}


/* smartphone */
@media (max-width: 900px){
  .member-grid{
    grid-template-columns: repeat(2, 1fr) !important; /* 2列にする */
    /*      grid-template-columns: 1fr;*/
  }
}


/* research topics */

.topic{
  display:grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap:20px;
  align-items:start;
  margin-bottom:30px;
  padding-bottom:20px;
  border-bottom:1px solid var(--line);
  align-items:center;
}

.topic:last-child{
  border-bottom:none;
  margin-bottom:0;
  padding-bottom:0;
}

.topic-text h3{
  margin:0 0 10px;
  font-size:22px;
  font-weight:700;
}

.topic-text p{
  text-align: justify;
  text-justify: inter-ideograph;
  line-height: 1.6;
}


.topic-link{
  font-weight:700;
  color:var(--accent);
  text-decoration:none;
}

.topic-link:hover{
  text-decoration:underline;
}

.topic-image img{
  width:90%;
  margin: 0 auto;   /* ← これを追加 */
  display:block;
}

/* smartphone */
@media (max-width: 900px){
  .topic{
    grid-template-columns: 1fr;
  }
}

.pub-year-heading{
  margin:28px 0 12px;
  font-size:18px;
  font-weight:700;
}

.pub-list{
  list-style:none;
  padding:0;
  margin:0 0 20px 0;
}

.pub-item{
  margin-bottom:20px;
}

.pub-title{
  font-size:16px;
  margin-bottom:4px;
}

.pub-meta{
  font-size:15px;
}

.pub-journal{
/*  font-style:italic; */
}

.pub-vol{
  font-weight:700;
}

.pub-journal-link{
  color:#1a56db;
  text-decoration:none;
}

.pub-journal-link:hover{
  text-decoration:underline;
}


.contact-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:40px;
  margin-top:20px;
}

.contact-info h3{
  margin-top:20px;
  margin-bottom:10px;
  font-size:18px;
  font-weight:600;
}

.contact-info p{
  margin-bottom:12px;
  line-height:1.5;
}

.contact-note{
  font-size:14px;
  color:var(--muted);
}

.contact-map iframe{
  border-radius:8px;
  height: 300px;
}

/* スマホ対応 */
@media (max-width: 768px){
  .contact-grid{
    grid-template-columns:1fr;
  }
}


.station-title{
  font-weight:600;
  margin-bottom:6px;
}

.station-list{
  margin:0 0 12px 16px;
  padding:0;
}

.station-list li{
  margin-bottom:4px;
}


.orcid-inline{
  position: relative;
  top: 1px;
  display:inline-flex;
  width:16px;   /* 14–18pxで調整可 */
  height:16px;
  line-height:0;
  transition:transform .15s ease;
}

.orcid-inline:hover{
  transform:scale(1.08);
}

.orcid-icon{
  position: relative;
  top: 1px;
  width:100%;
  height:100%;
}

/* PCでボタンとアイコンを隠す */
.menu-toggle, .mobile-icon { display: none; }

/* PC版メガパネルの配置修正（位置がずれないように absolute に） */
.mega-panel {
  position: absolute; 
  top: 100%; 
  left: 0; 
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  z-index: 2500;
}

/* ==========================================
   スマホ・タブレット向け設定 (900px以下)
   ========================================== */
@media screen and (max-width: 900px) {

  /* 1. ヘッダー：三本線を左、タイトルをその横に */
  .header-row {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 15px !important;
    padding: 10px 0 !important;
    position: relative;
  }

  /* ハンバーガーボタン：サイズを固定してガタつきを防止 */
  .menu-toggle {
    display: flex !important;   /* 中央寄せのためflexに */
    align-items: center;
    justify-content: center;
    width: 44px !important;    /* ★幅を固定（指で押しやすいサイズ） */
    height: 44px !important;   /* ★高さも固定 */
    background: none !important;
    border: none !important;
    font-size: 28px !important; /* アイコンの大きさ */
    cursor: pointer;
    order: -1;                 /* 左側に配置 */
    padding: 0 !important;
    margin: 0 !important;
    line-height: 1;
    color: var(--text);
    flex-shrink: 0;            /* ★ボタンが潰れないように固定 */
  }

  .site-title {
    font-size: 18px !important;
    margin: 0 !important;
    padding: 0 !important;
    flex: 1;
    text-align: left !important;
  }

  /* 2. メニュー本体：縦並びリスト */
  .menu {
    display: none;
    flex-direction: column !important;
    align-items: flex-start !important;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #ffffff !important; /* 背景を白に統一 */
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
    border-top: 1px solid var(--line);
    z-index: 9999;
    padding: 0 !important;
    padding-bottom: 16px !important;
    gap: 0 !important;
  }

  .menu.is-active {
    display: flex !important;
  }


  .menu .menu-disabled {
    font-weight: 400;        /* 標準の太さに戻す */
    color: var(--muted);     /* 既に設定されている --muted（#6b7280）などで薄く */
    opacity: 0.6;            /* さらに透明度を下げて「押せない感」を強調 */
    cursor: default;
    padding: 10px 0;
  }

  /* 3. 各親項目（ホーム、メンバー、研究等） */
  .mega {
    width: 100% !important;
    text-align: left !important;
    position: static; /* relative から static に変更 */
  }

  .menu-link, .mega-btn {
    display: flex !important;
    justify-content: flex-start !important;
    align-items: center !important;
    width: 100% !important;
    padding: 18px 20px !important;
    margin: 0 !important;
    border: none !important;
    border-bottom: 1px solid var(--line) !important;
    background: #ffffff !important; /* 背景を白に統一 */
    font-size: 16px !important;
    font-weight: 600 !important; /* 親項目を少し強調 */
    text-align: left !important;
    color: var(--text) !important;
  }

  /* + アイコンを右端へ */
  .mobile-icon {
    display: inline-block !important;
    margin-left: auto !important;
    font-size: 20px;
    color: var(--muted);
  }

  /* 4. メガパネル：アコーディオン形式 */
  .mega-panel {
    position: static !important;
    display: none;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important; /* ★背景を白に統一 */
    border: none !important;
    box-shadow: none !important;
  }

  .mega.open .mega-panel {
    display: block !important;
  }

  /* 5. パネル内の整理（見出しを隠し、リンクを右へずらす） */
  .mega-top, .mega-col h3 { 
    display: none !important; 
  }

  .mega-inner {
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important; /* ここでは親の余白をリセット */
    gap: 0 !important;
  }

  .mega-col {
    padding: 0 !important;
  }

  .mega-col a, .menu-disabled {
    display: block !important;
    padding: 15px 20px 15px 45px !important; /* ★左側のパディング(45px)で右へずらす */
    border-bottom: 1px solid #f0f0f0 !important;
    text-align: left !important;
    width: 100% !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    color: var(--text) !important;
    text-decoration: none !important;
  }
  
  /* 親項目のホバー（タップ）時 */
  .menu-link:hover, 
  .mega-btn:hover {
    color: var(--accent) !important;
    border-bottom: 1px solid var(--line) !important; /* PC版の下線を打ち消し、枠線を維持 */
  }

  /* 子項目のホバー（タップ）時 */
  .mega-col a:hover {
    color: var(--accent) !important;
    text-decoration: none !important;
  }
  
  /* アイコンの色も連動させる場合 */
  .mega-btn:hover .mobile-icon {
    color: var(--accent) !important;
  }

  /* その他レスポンシブ微調整 */
  .wrap { padding: 0 20px !important; }
  .welcome-grid, .topic { grid-template-columns: 1fr !important; }
}

/* ==========================================
   PC向け設定 (901px以上)
   ========================================== */
@media screen and (min-width: 901px) {
  .menu-toggle, .mobile-icon {
    display: none !important;
  }
  .header-row {
    flex-direction: column !important;
  }
  .mega-panel {
    position: absolute !important;
  }
}

@media (max-width: 900px) {
  .welcome-text {
    padding: 20px 0 !important; /* 上下の余白だけ残し、左右を0に */
    max-width: 100%;            /* 横幅を画面いっぱいに広げる */
    text-align: left;           /* スマホでは左寄せが見やすい場合が多いです */
  }

  /* 親要素の wrap の余白（48px）もスマホでは広すぎるので調整 */
  .wrap {
    padding: 0 20px; 
  }
    /* 全てのメニュー関連要素の下線を強制的に削除 */
  .menu-link, 
  .mega-btn, 
  .menu-disabled,
  .menu a,
  .menu button {
    border-bottom: none !important; /* 下線を消去 */
    text-decoration: none !important; /* 念のためアンダーラインも消去 */
    box-shadow: none !important; /* 影で線に見えている場合も消去 */
    padding-bottom: 8px !important; /* 線の代わりに余白を調整 */
  }

  /* ホバー時（指で触れた瞬間）の下線も無効化 */
  .menu-link:hover, 
  .mega-btn:hover {
    border-bottom: none !important;
  }

  /* メニュー項目を縦に並べ、リンクありを太字、なしを薄く */
  .menu {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .menu .menu-link, 
  .menu .mega-btn {
    font-weight: 700;
  }

  .menu .menu-disabled {
    font-weight: 400;
    color: var(--muted);
    opacity: 0.5;
  }
}

@media screen and (max-width: 900px) {
  /* 1. 赤いトップバーの余白をなくす */
  .topbar {
    padding: 0 !important;
  }

  /* 2. トップバー内部の横幅を100%にして、文字を端に寄せる */
  .topbar-inner {
    max-width: 100% !important;
    padding: 0 15px !important; /* 完全に0だと文字が画面に張り付くので、最小限(15px)残すのが一般的です */
  }

  /* 3. ヘッダーエリア（ロゴと三本線）の余白をなくす */
  header {
    padding: 0 !important;
  }

  /* 4. ヘッダー内部（.wrap）のパディングをリセット */
  header .wrap {
    padding: 0 10px !important; /* 三本線と画面端の間に最小限の隙間を作ります */
    max-width: 100% !important;
  }

  /* 5. サイトタイトルが画面端に寄るように調整 */
  .header-row {
    padding: 10px 0 !important;
    gap: 10px !important;
  }
}

@media screen and (max-width: 900px) {
  /* ウェルカムテキストをスマホでも両端揃えにする */
  .welcome-text {
    padding: 20px 0 !important; /* 左右の大きな余白(55px)をリセットして読みやすく */
    max-width: 100% !important;
    text-align: justify !important;
    text-justify: inter-ideograph !important; /* 日本語の隙間を綺麗に埋める */
  }

  .welcome-text p {
    text-align: justify !important;
    text-justify: inter-ideograph !important;
  }
  
  .topbar-inner {
    height: 24px;      /* 40 → 32 に縮小 */
    font-size: 12px;   /* 少し小さく */
  }

  .header-row {
    left: -15px;
  }

  footer {
    height: 24px;
    font-size: 10.5px;
    letter-spacing: 0.3px;
  }
}


/* ========================================
   Alumni Section – Clean Single Column
   ======================================== */

.alumni-section {
  padding: 0 0;
}

/* 年 */
.alumni-year {
  margin: 36px 0 10px;
  font-size: 16px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.03em;
}

/* 各人 */
.alumni-item {
  margin-bottom: 6px;
  font-size: 14px;
  line-height: 1.6;
}

/* 名前 */
.alumni-name {
  font-weight: 600;
}

/* 在籍時情報 */
.alumni-former {
  color: var(--muted);
  margin-left: 4px;
  font-size: 13px;
}

/* 矢印 */
.alumni-arrow {
  margin: 0 6px;
  color: var(--muted);
}

/* 現在所属 */
.alumni-current {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

.alumni-current:hover {
  color: var(--accent);
}
