/*
 * QuAILib サイト（Top・成果ページ）用スタイル
 * パルス・ステーション作成のテストサイト（quailib-design）の <style> を元にしています。
 *   - Top 用: index.html（2026-08-13 版）の <style> をそのまま使用
 *   - 成果ページ用: results.html（2026-08-09 版）にだけある規則を末尾に追加
 * 画像パスはサイトのルートからの絶対パス（/images/...）に変更しています。
 */
:root{
  --bg:#ffffff;
  --bg-soft:#f3f7fc;
  --bg-soft-2:#eaf1fb;
  --brand-blue:#0071bb;
  --brand-blue-dark:#025a96;
  --accent-indigo:#5d73e6;
  --accent-cyan:#2aace2;
  --text-primary:#16233f;
  --text-muted:#5c6b87;
  --border:#e1e8f3;
  --border-strong:#cddaee;
  --max:1180px;
}
*{box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  margin:0;
  background:var(--bg);
  color:var(--text-primary);
  font-family:"Noto Sans JP", sans-serif;
  line-height:1.8;
  -webkit-font-smoothing:antialiased;
}
h1,h2,h3,.wordmark,.eyebrow,.card-index{
  font-family:"Zen Kaku Gothic Antique","Noto Sans JP",sans-serif;
}
.mono{
  font-family:"JetBrains Mono",monospace;
  letter-spacing:0.02em;
}
a{color:inherit;}
img{max-width:100%;display:block;}
.wrap{max-width:var(--max);margin:0 auto;padding:0 32px;}

a:focus-visible, button:focus-visible{
  outline:2px solid var(--brand-blue);
  outline-offset:3px;
  border-radius:2px;
}

/* ===== Header ===== */
header{
  position:sticky;top:0;z-index:50;
  backdrop-filter:blur(10px);
  background:rgba(255,255,255,0.82);
  border-bottom:1px solid var(--border);
}
.nav{
  display:flex;align-items:center;justify-content:space-between;
  padding:8px 32px;max-width:var(--max);margin:0 auto;
}
.wordmark{
  font-weight:900;font-size:1.05rem;letter-spacing:0.01em;
  display:flex;align-items:center;gap:10px;text-decoration:none;
  color:var(--text-primary);
}
.wordmark img{height:90px;width:auto;}
nav ul{
  list-style:none;display:flex;gap:32px;margin:0;padding:0;
  font-size:0.9rem;font-weight:500;
}
nav ul a{text-decoration:none;color:var(--text-muted);transition:color .2s;}
nav ul a:hover{color:var(--brand-blue);}
nav ul a.highlight{
  color:var(--brand-blue);font-weight:700;
}
.lang-toggle{
  display:flex;gap:6px;font-family:"JetBrains Mono",monospace;font-size:0.78rem;
}
.lang-toggle .lang-pill{
  padding:5px 10px;border:1px solid var(--border-strong);border-radius:20px;
  color:var(--text-muted);cursor:pointer;text-decoration:none;display:inline-block;
}
.lang-toggle .lang-pill.active{
  color:#fff;background:var(--brand-blue);border-color:var(--brand-blue);cursor:default;
}
.nav-right{display:flex;align-items:center;gap:26px;}
.nav-right nav{margin-right:30px;}
.nav-toggle{display:none;background:none;border:0;color:var(--text-primary);font-size:1.4rem;cursor:pointer;}

/* ===== Hero ===== */
.hero{
  position:relative;
  overflow:hidden;
  border-bottom:1px solid var(--border);
  background-image:url('/images/hero-bg.jpg');
  background-size:cover;
  background-position:center;
  height:clamp(340px, calc(36vw + 40px), 640px);
}
/* ===== NEDO事業バッジバー ===== */
.project-badge-bar{
  background:var(--bg-soft);
  border-bottom:1px solid var(--border);
  padding:14px 0;
}
.eyebrow{
  display:inline-flex;align-items:center;gap:8px;flex-wrap:wrap;
  font-family:"JetBrains Mono",monospace;
  font-size:0.75rem;letter-spacing:0.02em;
  color:var(--text-muted);
}
.eyebrow b{color:var(--brand-blue-dark);font-weight:700;}

/* ===== Section shell ===== */
section{padding:56px 32px;}
.section-head{max-width:640px;margin:0 0 36px;}
#pillars .section-head{max-width:none;}
.nowrap-line{white-space:normal;}
.section-head .kicker{
  font-family:"JetBrains Mono",monospace;font-size:0.75rem;
  letter-spacing:0.08em;color:var(--accent-indigo);text-transform:uppercase;
  display:block;margin-bottom:14px;
}
.section-head h2{
  font-size:clamp(1.6rem,2.8vw,2.2rem);font-weight:700;margin:0 0 16px;line-height:1.4;
}
.section-head p{color:var(--text-muted);margin:0;font-size:1.02rem;}

/* ===== News ===== */
.news-section{
  background:var(--bg);
  border-bottom:1px solid var(--border);
  padding-top:44px;padding-bottom:44px;
}
.news-divider{
  display:flex;align-items:center;gap:14px;
  margin-bottom:32px;
}
.news-divider .line-start{width:36px;height:1px;background:var(--brand-blue);flex:none;}
.news-divider .line-end{width:36px;height:1px;background:var(--brand-blue);flex:none;}
.news-divider span{
  font-family:"JetBrains Mono",monospace;font-size:1.6rem;font-weight:700;
  letter-spacing:0.06em;color:var(--brand-blue);white-space:nowrap;
  text-transform:uppercase;
}
.news-list{display:flex;flex-direction:column;gap:2px;border-top:2px solid var(--brand-blue);max-width:880px;}
.news-row{
  display:flex;align-items:baseline;gap:16px;flex-wrap:wrap;
  padding:11px 4px;border-bottom:1px solid var(--border-strong);
}
.news-date{
  flex:none;font-size:0.82rem;color:var(--brand-blue-dark);
  display:flex;align-items:center;gap:8px;
}
.news-date::before{
  content:"";width:7px;height:7px;border-radius:50%;
  background:var(--brand-blue);flex:none;
}
.news-title{
  flex:1 1 320px;font-size:0.85rem;font-weight:600;color:var(--text-primary);
  text-decoration:none;line-height:1.6;
}
.news-title:hover{color:var(--brand-blue);text-decoration:underline;}
@media (max-width:600px){
  .hero{height:clamp(220px, calc(50vw + 40px), 340px);}
  .news-section{padding-top:20px;padding-bottom:20px;}
  .news-divider{gap:10px;margin-bottom:16px;}
  .news-divider .line-start,.news-divider .line-end{width:20px;}
  .news-divider span{font-size:1.1rem;}
  .news-list{gap:0;}
  .news-row{flex-direction:column;align-items:flex-start;gap:4px;padding:9px 4px;}
  .news-title{flex:1 1 auto;}
}

/* ===== Mission ===== */
.mission{
  background:var(--bg-soft) url('/images/mission-bg.png') center/cover no-repeat;
  border-bottom:1px solid var(--border);
}
.mission-grid{max-width:820px;}
.mission-grid p{color:var(--text-muted);font-size:1.02rem;}
.mission-grid p + p{margin-top:20px;}

/* ===== Pillars (実施項目) ===== */
.pillars{border-bottom:1px solid var(--border);}
.pillar-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:24px;align-items:stretch;
}
.pillar-grid-4{grid-template-columns:repeat(2,1fr);}
.pillar{
  background-image:linear-gradient(160deg, #eff3fb 0%, #ffffff 100%);background-repeat:no-repeat;background-size:100% 100%;
  border:1px solid var(--border);
  border-radius:14px;
  padding:32px 28px;
  position:relative;
  box-shadow:0 2px 10px rgba(20,40,80,0.04);
  transition:border-color .2s, transform .2s, box-shadow .2s;
}
div.pillar:hover{border-color:var(--border-strong);transform:translateY(-4px);box-shadow:0 14px 28px rgba(20,40,80,0.08);}
.pillar::before{
  content:"";position:absolute;top:0;left:28px;right:28px;height:3px;
  background:var(--pillar-color,var(--brand-blue));
  border-radius:0 0 4px 4px;
}
.pillar:nth-child(1){--pillar-color:#0071bb;}
.pillar:nth-child(2){--pillar-color:#5d73e6;}
.pillar:nth-child(3){--pillar-color:#f2994a;}
.pillar:nth-child(4){--pillar-color:#12b886;}
.card-index{
  font-size:0.8rem;color:var(--text-muted);font-weight:700;
  margin-bottom:18px;display:block;
}
.pillar h3{font-size:1.05rem;margin:0 0 8px;line-height:1.5;font-weight:700;}
.pillar h3 a{color:inherit;text-decoration:none;}
.pillar h3 a:hover{color:var(--brand-blue);text-decoration:underline;}
.pillar .owner{
  font-family:"JetBrains Mono",monospace;font-size:0.75rem;color:var(--pillar-color,var(--brand-blue));
  display:block;
}
.pillar .fy{
  font-size:0.72rem;color:#7c3aed;
  display:block;margin-top:4px;margin-bottom:16px;
}
.pillar p{font-size:0.88rem;color:var(--text-muted);margin:0;}
.pillar-note{
  margin-top:28px;padding:16px 20px;border:1px dashed var(--border-strong);
  border-radius:10px;font-size:0.85rem;color:var(--text-muted);background:var(--bg-soft);
}

/* ===== Links out ===== */
.linkout{background:var(--bg-soft-2);border-bottom:1px solid var(--border);}
.linkout-grid{
  display:grid;grid-template-columns:repeat(3,1fr);gap:20px;
}
.linkcard{
  display:block;padding:26px 24px;border:1px solid var(--brand-blue-dark);border-radius:12px;
  text-decoration:none;transition:box-shadow .2s, transform .2s;
  box-shadow:0 2px 10px rgba(20,40,80,0.12);
  background-size:cover;background-position:center;position:relative;
  isolation:isolate;overflow:hidden;
}
.linkcard::before{
  content:"";position:absolute;inset:0;z-index:1;
  background:linear-gradient(180deg, rgba(2,60,110,0.32) 0%, rgba(2,40,80,0.5) 100%);
  transition:background .3s ease;
}
.linkcard:hover::before{
  background:linear-gradient(180deg, rgba(0,113,187,0.5) 0%, rgba(2,40,80,0.62) 100%);
}
a.linkcard:hover{box-shadow:0 14px 26px rgba(20,40,80,0.22);transform:translateY(-5px);}
.linkcard.linkcard-nedo{background-image:url('/images/linkcard-nedo.jpg');}
.linkcard.linkcard-gquat{background-image:url('/images/linkcard-gquat.jpg');}
.linkcard.linkcard-abciq{background-image:url('/images/linkcard-abciq.jpg');}
.linkcard .tag{position:relative;z-index:3;font-family:"JetBrains Mono",monospace;font-size:0.72rem;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,0.5);}
.linkcard h4{position:relative;z-index:3;margin:10px 0 8px;font-size:1rem;font-weight:700;color:#fff;text-shadow:0 1px 4px rgba(0,0,0,0.5);}
.linkcard span.arrow{position:relative;z-index:3;color:#fff;font-family:"JetBrains Mono",monospace;font-size:0.85rem;text-shadow:0 1px 4px rgba(0,0,0,0.5);}

/* ===== Footer ===== */
footer{padding:64px 32px 40px;background:#fff;border-top:3px solid var(--brand-blue);}
.footer-grid{
  display:flex;justify-content:space-between;align-items:flex-start;gap:40px;flex-wrap:wrap;
  padding-bottom:32px;
}
.footer-brand-logos{display:flex;align-items:center;gap:120px;flex-wrap:wrap;}
.footer-brand .wordmark{margin-bottom:0;}
.aist-logo-slot{display:flex;align-items:center;text-decoration:none;}
.aist-logo-slot img{height:20px;width:auto;}
.footer-links{display:flex;flex-direction:column;align-items:flex-end;gap:18px;flex:1 1 auto;}
.footer-nav-row{
  display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:flex-start;
  gap:28px;
}
.footer-nav-row a{text-decoration:none;color:var(--text-primary);font-size:0.9rem;}
.footer-nav-row a:hover{color:var(--brand-blue);}
.footer-privacy-row{width:100%;display:flex;justify-content:flex-end;margin-top:32px;}
.footer-privacy-row a{text-decoration:none;color:var(--text-muted);font-size:0.82rem;}
.footer-privacy-row a:hover{color:var(--brand-blue);}
.footer-notice{
  font-size:0.78rem;color:var(--text-muted);
  padding-bottom:24px;border-bottom:1px solid var(--border);margin-bottom:24px;
}
.footer-bottom{
  display:flex;justify-content:space-between;color:var(--text-muted);
  font-size:0.8rem;flex-wrap:wrap;gap:10px;
}

/* ===== Responsive ===== */
@media (max-width:1040px){
  .pillar{padding:26px 22px;}
  .pillar h3{font-size:1.02rem;}
  .pillar p{font-size:0.86rem;}
}
@media (max-width:900px){
  .linkout-grid{grid-template-columns:1fr;}
  nav ul{display:none;}
  .nav-toggle{display:block;}
}
@media (max-width:680px){
  .pillar-grid{grid-template-columns:1fr;}
  .pillar-grid-4{grid-template-columns:1fr;}
}
@media (max-width:600px){
  .wrap,.nav,section,footer{padding-left:20px;padding-right:20px;}
  .footer-grid{flex-direction:column;}
}
/* ===== Back to top button ===== */
.back-to-top{
  position:fixed;right:24px;bottom:24px;z-index:60;
  width:48px;height:48px;border-radius:50%;
  display:flex;align-items:center;justify-content:center;
  background:var(--brand-blue);color:#fff;border:none;cursor:pointer;
  box-shadow:0 8px 20px rgba(0,113,187,0.35);
  opacity:0;visibility:hidden;transform:translateY(10px);
  transition:opacity .25s ease, transform .25s ease, visibility .25s ease;
}
.back-to-top.visible{opacity:1;visibility:visible;transform:translateY(0);}
.back-to-top:hover{transform:translateY(-3px);}
.back-to-top svg{width:20px;height:20px;}
@media (max-width:600px){
  .back-to-top{right:16px;bottom:16px;width:44px;height:44px;}
}
/* ===== Scroll fade-in ===== */
.fade-in{
  opacity:0;
  transform:translateY(18px);
  transition:opacity .6s ease, transform .6s ease;
}
.fade-in.is-visible{
  opacity:1;
  transform:translateY(0);
}
@media (prefers-reduced-motion: reduce){
  .fade-in{opacity:1;transform:none;transition:none;}
}

/* ===== モバイル表示崩れ対策 ===== */
html{overflow-x:hidden;}
@media (max-width:700px){
  .footer-brand-logos{gap:32px;}
}
/* 英語版Topのメイン画像（テストサイトでは index-en.html 側で .hero の画像を差し替えている） */
.hero.hero-en{background-image:url('/images/hero-bg-en.jpg');}

/* 1行に収まる幅でのみ折り返しを止める（狭い画面でのはみ出し防止） */
@media (min-width:1025px){
  .nowrap-line{white-space:nowrap;}
}

/* ===== 成果ページ ===== */
.breadcrumb{background:var(--bg);border-bottom:1px solid var(--border);}
.breadcrumb .wrap{
  padding:14px 32px;font-size:0.8rem;color:var(--text-muted);
  display:flex;align-items:center;gap:8px;
}
.breadcrumb a{color:var(--text-muted);text-decoration:none;}
.breadcrumb a:hover{color:var(--brand-blue);text-decoration:underline;}
.breadcrumb .sep{color:var(--border-strong);}
.breadcrumb .current{color:var(--text-primary);font-weight:600;}
.results-page{padding-top:32px;padding-bottom:56px;background:#eef2f8;border-bottom:3px solid var(--brand-blue);}
.results-search{max-width:960px;margin-bottom:28px;}
.results-search input{
  width:100%;padding:14px 18px;border:1px solid var(--border-strong);border-radius:10px;
  font-size:0.95rem;font-family:"Noto Sans JP",sans-serif;color:var(--text-primary);
  background:#fff;outline:none;transition:border-color .2s, box-shadow .2s;
}
.results-search input:focus{border-color:var(--brand-blue);box-shadow:0 0 0 3px rgba(0,113,187,0.12);}
.results-search input::placeholder{color:var(--text-muted);}
.results-list{display:flex;flex-direction:column;gap:14px;max-width:960px;}
.result-row{
  display:grid;grid-template-columns:auto 1fr;column-gap:16px;row-gap:8px;
  background:#fff;border-radius:14px;padding:18px 24px;
  border:1px solid var(--border-strong);
  border-left:5px solid #f2994a;
  box-shadow:0 2px 10px rgba(20,40,80,0.05);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.result-row:hover{transform:translateY(-4px);box-shadow:0 16px 28px rgba(20,40,80,0.12);}
.result-date{
  grid-column:1;grid-row:1;align-self:start;
  font-family:"Noto Sans JP",sans-serif;font-size:0.75rem;font-weight:700;
  color:#fff;background:var(--brand-blue);
  padding:6px 14px;border-radius:999px;white-space:nowrap;margin-top:2px;
}
.result-title{
  grid-column:2;grid-row:1;
  font-size:0.96rem;font-weight:700;color:var(--text-primary);
  text-decoration:none;line-height:1.6;
}
a.result-title:hover{color:#f2994a;text-decoration:underline;}
/* 発表先（雑誌名・学会名・イベント名等）。タイトルの下、発表者の上に置く */
.result-venue{
  grid-column:2;grid-row:2;
  font-size:0.82rem;color:var(--text-primary);
  padding-top:8px;border-top:1px solid var(--border-strong);
  line-height:1.8;
}
.result-author{
  grid-column:2;grid-row:3;
  font-size:0.82rem;color:var(--text-muted);
  line-height:1.8;
}
.result-row.is-hidden{display:none;}
.results-pagination{
  display:flex;align-items:center;gap:14px;margin-top:32px;
  font-family:"JetBrains Mono",monospace;font-size:0.85rem;
}
.results-pagination a{
  color:var(--text-muted);text-decoration:none;
  padding:6px 12px;border:1px solid var(--border-strong);border-radius:6px;
  transition:border-color .2s, color .2s;
}
.results-pagination a:hover{color:var(--brand-blue);border-color:var(--brand-blue);}
.results-pagination .page-current{
  color:#fff;background:var(--brand-blue);
  padding:6px 12px;border-radius:6px;font-weight:700;
}
.results-pagination .page-next{margin-left:auto;}
.results-pagination-top{margin-top:0;margin-bottom:28px;}
.results-count{
  margin:8px 0 0;font-size:0.85rem;color:var(--text-muted);
  font-family:"Noto Sans JP",sans-serif;
}
@media (max-width:680px){
  .result-row{grid-template-columns:1fr;}
  .result-date{grid-column:1;grid-row:1;}
  .result-title{grid-column:1;grid-row:2;}
  .result-venue{grid-column:1;grid-row:3;}
  .result-author{grid-column:1;grid-row:4;}
}

/* 成果ページはセクション下端に青線があるため、フッター上の青線は出さない（テストサイト results.html と同じ見た目にする） */
.results-page + footer{border-top:none;}

/* カードの下に並べる文字のみのリンク一覧（2026-09-22 産総研様ご指示で追加） */
.linkout-list{
  list-style:none;margin:28px 0 0;padding:0;
  display:flex;flex-wrap:wrap;gap:12px 28px;
}
.linkout-list a{
  font-size:0.9rem;color:var(--text-primary);text-decoration:none;
  display:inline-flex;align-items:center;gap:8px;
  transition:color .2s;
}
.linkout-list a::before{
  content:"";width:6px;height:6px;border-radius:50%;
  background:var(--brand-blue);flex:none;
}
.linkout-list a:hover{color:var(--brand-blue);text-decoration:underline;}
@media (max-width:600px){
  .linkout-list{gap:10px 18px;}
}
