/* Web3 / Deep Tech Modern Theme */
:root {
  /* Core Palette - Dark & Deep */
  --bg-primary: #0B0E14; /* Deep Void */
  --bg-secondary: #151923; /* Dark Slate */
  --bg-accent: #1E2330; /* Lighter Slate */
  
  /* Neon Accents */
  --primary-color: #3b82f6; /* Electric Blue */
  --primary-glow: rgba(59, 130, 246, 0.5);
  --secondary-color: #8b5cf6; /* Violet */
  --accent-color: #06b6d4; /* Cyan */
  
  /* Text Colors */
  --text-primary: #F1F5F9; /* Off-white for readability */
  --text-secondary: #94A3B8; /* Slate Grey */
  --text-dim: #64748B;
  
  /* Borders & Glass */
  --border-color: rgba(255, 255, 255, 0.2);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.05);
  
  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-text: linear-gradient(90deg, #60a5fa, #a78bfa);
  --gradient-dark: linear-gradient(180deg, rgba(11, 14, 20, 0) 0%, rgba(11, 14, 20, 1) 100%);

  /* Shadows (Glows instead of dark shadows) */
  --shadow-sm: 0 0 10px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 15px rgba(59, 130, 246, 0.1); /* Blue glow hint */
  --shadow-lg: 0 10px 40px -10px rgba(0, 0, 0, 0.5), 0 0 30px rgba(139, 92, 246, 0.15); /* Purple glow hint */
  
  --border-radius: 12px;
  --border-radius-lg: 24px;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Base Settings */
html {
  scroll-behavior: smooth;
  background-color: var(--bg-primary);
}

body {
  font-family: 'Inter', 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text-primary);
  line-height: 1.7;
  font-size: 16px;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
    radial-gradient(circle at 85% 30%, rgba(139, 92, 246, 0.08), transparent 25%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Typography Overrides for Web3 Vibe */
h1, h2, h3, h4, .title, .publication-title {
  color: var(--text-primary) !important;
  letter-spacing: -0.02em;
}

.title.is-3 {
  border-bottom: none !important;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 2rem !important;
}

.title.is-3::after {
  display: none; /* Remove old underline */
}

.title.is-4 {
  border-bottom: none !important;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
  margin-bottom: 2rem !important;
}

/* Modern Button - Glowing & Gradient */
.button {
  background: var(--glass-bg) !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-primary) !important;
  border-radius: var(--border-radius) !important;
  backdrop-filter: blur(10px);
  transition: var(--transition) !important;
  box-shadow: 0 0 0 transparent;
}

.button:hover {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 15px var(--primary-glow);
  transform: translateY(-2px);
  text-shadow: 0 0 8px rgba(255,255,255,0.5);
}

.button.is-dark {
  background: var(--gradient-primary) !important;
  border: none !important;
  color: #fff !important;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.button.is-dark:hover {
  box-shadow: 0 0 25px rgba(59, 130, 246, 0.6);
  transform: translateY(-2px) scale(1.02);
}

/* Links */
a {
  color: var(--primary-color);
  transition: var(--transition);
}
a:hover {
  color: var(--accent-color);
  text-shadow: 0 0 10px var(--primary-glow);
}

/* Hero Section */
.hero.is-light {
  background: transparent;
  border: none;
  position: relative;
}

/* Publication Content - Glassmorphism Cards */
.publication-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  position: relative;
}

/* Add a grid overlay effect to images/video if desired */
.publication-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(11,14,20,0.8) 100%);
  pointer-events: none;
}

.publication-venue, .publication-awards {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  color: #60a5fa;
  backdrop-filter: blur(5px);
}

.publication-awards {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-left: none; /* Reset old style */
}

/* Authors */
.publication-authors a {
   color: var(--text-primary) !important;
}

.publication-authors a::after {
    background: var(--gradient-primary);
    height: 1px;
}

/* Carousel & Items - The "Card" Look */
.results-carousel .item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.results-carousel .item:hover {
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.15);
}

.results-carousel .subtitle {
  color: var(--text-secondary);
}

/* BibTeX - Terminal Style */
pre {
  background: #0d1117 !important; /* GitHub Dark dim */
  border: 1px solid var(--border-color) !important;
  color: #c9d1d9 !important;
  position: relative;
  padding-top: 2.5rem !important; /* Space for fake window dots */
}

.bibtex-code {
  width: 70% !important;
  overflow-x: auto; /* スマホでの横スクロール対応 */
}

/* Fake Terminal Window Dots */
pre::before {
  content: '•••';
  position: absolute;
  top: 0.5rem;
  left: 1rem;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 2px;
  color: var(--border-color);
}

code {
  background: transparent !important;
  color: #ff7b72 !important; /* Terminal Red/Pink */
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
}

/* Copy Button Styling */
.copy-bibtex-btn {
  background: var(--bg-accent);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.copy-bibtex-btn:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
  box-shadow: 0 0 15px var(--primary-glow);
}

/* Footer */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  color: var(--text-dim);
}

.footer a {
  color: var(--text-secondary);
}
.footer a:hover {
  color: var(--primary-color);
}

/* More Works Dropdown - Glass Menu */
.more-works-btn {
  background: rgba(11, 14, 20, 0.8);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.more-works-dropdown {
  background: rgba(21, 25, 35, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
}

.dropdown-header {
  border-bottom: 1px solid var(--border-color);
}

.work-item:hover {
  background: var(--glass-bg);
  border-left: 2px solid var(--primary-color);
}

.work-info h5 {
  color: var(--text-primary);
}

/* Scrollbar Styling (Webkit) */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--bg-accent);
  border-radius: 5px;
  border: 2px solid var(--bg-primary);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* Utility: Grid Background Pattern (Optional but very Web3) */
.grid-background {
  background-size: 40px 40px;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  mask-image: radial-gradient(circle at center, black 40%, transparent 100%);
}

/* =========================================
   Fix: Force Light Text for Readability
   ========================================= */

/* 本文、リスト、段落の色を強制的に明るくする */
p, .content, .content p, .content ul, .content ol, .content li, li {
  color: var(--text-primary) !important;
}

/* もし「薄すぎる」と感じる場合は、以下の色指定を有効にしてください */
/*
p, .content, .content p {
  color: #ffffff !important;
}
*/

/* 見出しも確実に明るくする */
h1, h2, h3, h4, h5, h6,
.title, .subtitle,
.content h1, .content h2, .content h3 {
  color: var(--text-primary) !important;
}

/* リンクがある箇所のテキスト調整（青色になりすぎないように調整） */
.content a {
  color: var(--primary-color) !important;
}

.content a:hover {
  color: var(--secondary-color) !important;
}

strong, b,
.content strong, .content b,
.title strong, .title b {
  color: var(--primary-color) !important;
  font-weight: 700 !important;
}

/* =========================================
   People Section - Modern Grid Cards
   ========================================= */

.people-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* PCでは2列 */
  gap: 1.5rem;
  margin-top: 2rem;
}

.person-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-secondary); /* または rgba(255,255,255,0.03) */
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  padding: 1.25rem 1.5rem;
  text-decoration: none !important;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

/* ホバー時のエフェクト（Web3 Glow） */
.person-card:hover {
  background: var(--bg-accent);
  border-color: var(--primary-color);
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.2); /* 青白い光 */
  transform: translateY(-2px);
}

.person-info {
  display: flex;
  flex-direction: column;
}

.person-name {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.person-role {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.2rem;
  font-family: 'Inter', sans-serif;
}

.arrow-icon {
  color: var(--text-dim);
  font-size: 1.2rem;
  transition: var(--transition);
  opacity: 0.5;
}

.person-card:hover .arrow-icon {
  color: var(--primary-color);
  transform: translate(2px, -2px); /* 右上に少し動く */
  opacity: 1;
}

/* モバイル対応（スマホでは1列にする） */
@media screen and (max-width: 768px) {
  .people-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* =========================================
   Message / Article Styling
   ========================================= */
.message {
  background-color: transparent;
}

.message.is-dark .message-body {
  background-color: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
  border-left: 4px solid var(--primary-color); /* Adds the Electric Blue accent */
  box-shadow: var(--shadow-sm);
}

/* Ensure strong text inside the message pops */
.message.is-dark .message-body strong {
  color: var(--primary-color);
}

/* =========================================
   Table Styling (Dark Mode)
   ========================================= */
.table {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: var(--border-radius);
  overflow: hidden; /* Keeps corners rounded */
}

/* Header and Cell Borders */
.table th, 
.table td {
  border-color: var(--border-color);
  color: var(--text-primary);
}

.table th {
  color: var(--text-primary) !important; /* 暗い色から明るいオフホワイトに変更 */
  border-bottom: 2px solid var(--border-color) !important;
  font-weight: 600; /* 少し太字にして視認性を向上 */
}


/* Striped Rows - alternating dark colors */
.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
  background-color: var(--bg-accent);
}

/* Fix for status tags inside the table */
.table .tag.is-light {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.table .tag.is-danger.is-light {
  background-color: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

/* 偶数行の背景色（縞模様）も見やすく調整 */
.table.is-striped tbody tr:not(.is-selected):nth-child(even) {
  background-color: rgba(255, 255, 255, 0.02) !important;
}

/* 行全体のホバー設定 */
.table.is-hoverable tbody tr:not(.is-selected):hover {
  /* 背景：うっすらと青いガラスのような色に */
  background-color: rgba(59, 130, 246, 0.15) !important;

  /* 発光表現：
     1. 外側に広がる青い光 (0 0 20px ...)
     2. 内側に鋭い光のライン (inset 0 0 1px ...) ボーダーのように見せるテクニック
  */
  box-shadow: 
    0 0 20px rgba(59, 130, 246, 0.4), 
    inset 0 0 2px rgba(59, 130, 246, 0.8) !important;

  /* 影（光）を隣の行に隠されないように前面に出す */
  position: relative;
  z-index: 5;

  /* アニメーションを滑らかに */
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ホバー時のセル・文字の設定 */
.table.is-hoverable tbody tr:not(.is-selected):hover td {
  color: #ffffff !important; /* 真っ白な文字 */
  
  /* 文字自体も少しボヤッと光らせる */
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.8);
  
  /* セルの境界線も光の色に合わせる */
  border-color: rgba(59, 130, 246, 0.4) !important;
}

/* =========================================
   Tags Visibility Fix (Under/Over-constrained)
   ========================================= */

/* Under-constrained (Danger/Red) */
.tag.is-danger.is-light {
  background-color: rgba(239, 68, 68, 0.25) !important; /* 背景を少し濃く */
  color: #ffaaaa !important; /* 文字を明るいパステルレッドに */
  border: 1px solid rgba(239, 68, 68, 0.6); /* 枠線をつけて輪郭をはっきりさせる */
  font-weight: 800 !important; /* 極太字にする */
  letter-spacing: 0.02em;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2); /* 全体をほんのり赤く光らせる */
}

/* Over-constrained (Warning/Yellow) */
.tag.is-warning.is-light {
  background-color: rgba(234, 179, 8, 0.25) !important; /* 背景を少し濃く */
  color: #fef08a !important; /* 文字を明るい黄色に */
  border: 1px solid rgba(234, 179, 8, 0.6); /* 枠線を追加 */
  font-weight: 800 !important; /* 極太字にする */
  letter-spacing: 0.02em;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2); /* 全体をほんのり黄色く光らせる */
}

/* =========================================
   ZKP Workflow Diagram Styling
   ========================================= */

/* 図全体のコンテナ（ターミナル風ウィンドウ） */
.zk-workflow {
  background: var(--bg-secondary) !important; /* 暗い背景 */
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius-lg) !important;
  padding: 3rem 2rem 2rem !important; /* 上部にタイトルバー用の余白 */
  font-family: 'JetBrains Mono', 'Fira Code', monospace !important;
  font-size: 0.9rem;
  line-height: 1.4;
  white-space: pre; /* アスキーアートの崩れを防止 */
  overflow-x: auto; /* スマホでの横スクロール対応 */
  box-shadow: var(--shadow-md), inset 0 0 30px rgba(0, 0, 0, 0.3) !important; /* 奥行きのある影 */
  position: relative;
  text-align: left; /* 図自体は左寄せ */
  display: inline-block; /* 中央揃えのためにインラインブロック化 */
}

/* ターミナルウィンドウの偽装トップバー */
.zk-workflow::before {
  content: '● ○ ○  zk_protocol_flow.asc'; /* Mac風のボタンとファイル名 */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.03);
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  letter-spacing: 0.05em;
}

/* 図の中の強調キーワード設定 */
.zk-highlight {
  color: var(--accent-color); /* シアン（水色） */
  font-weight: 800;
  text-shadow: 0 0 8px var(--accent-color); /* 発光エフェクト */
}

.zk-highlight-secret {
  color: #f87171; /* 赤色 */
  font-weight: 700;
  text-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

.zk-highlight-proof {
  color: var(--primary-color); /* エレクトリックブルー */
  font-weight: 700;
  text-shadow: 0 0 8px rgba(59, 130, 246, 0.5);
}

/* スマホ表示時の調整 */
@media screen and (max-width: 768px) {
  .zk-workflow {
    width: 100% !important;
    font-size: 0.7rem; /* フォントを小さくして画面に収まりやすく */
    padding: 2.5rem 1rem 1rem !important;
  }
}

/* =========================================
   Feature Cards (What is zkFuzz)
   ========================================= */
.feature-card {
  background: var(--bg-secondary) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: var(--border-radius-lg) !important;
  padding: 2rem !important;
  height: 100%; /* 高さを揃える */
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.feature-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color) !important;
  box-shadow: 0 10px 30px -10px rgba(59, 130, 246, 0.3);
}

/* アイコンの背景 */
.icon-box {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  background: linear-gradient(135deg, rgba(59,130,246,0.1) 0%, rgba(139,92,246,0.1) 100%);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--primary-color);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.1);
}

.feature-card:hover .icon-box {
  background: var(--gradient-primary);
  color: #fff;
  box-shadow: 0 0 20px var(--primary-glow);
}

/* =========================================
   Terminal / Mockup Window
   ========================================= */
.mockup-window {
  background: #1e1e1e; /* ターミナルの背景色（VSCode風） */
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  text-align: left;
  position: relative;
}

.mockup-header {
  background: #2d2d2d;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  border-bottom: 1px solid #333;
}

.mockup-title {
  margin-left: 1rem;
  color: #999;
  font-size: 0.8rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.dot.red { background-color: #ff5f56; }
.dot.yellow { background-color: #ffbd2e; }
.dot.green { background-color: #27c93f; }

.mockup-content {
  padding: 1.5rem;
  color: #d4d4d4;
  font-size: 0.9rem;
  line-height: 1.6;
  position: relative;
}

.mockup-content pre {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  color: inherit !important;
  box-shadow: none !important;
}

.mockup-content pre::before {
  display: none; /* 既存のCSSの偽装ドットを消す */
}

/* Command Styles */
.cmd-prompt {
  color: #5af;
  margin-right: 0.5rem;
  user-select: none;
}

.cmd-output {
  color: #a0a0a0;
  display: block;
  margin-bottom: 0.5rem;
}

.cmd-output.is-success {
  color: #4ade80;
  font-weight: bold;
}

/* Copy Button inside Terminal */
.copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.copy-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* 個別の色調整（もしarXivだけ色を変えたい場合など） */
/* arXivボタンだけ少し赤みを帯びさせる例 */
.publication-links .button[href*="arxiv"]:hover {
  background: rgba(220, 38, 38, 0.15) !important;
  border-color: #f87171 !important;
  box-shadow: 0 0 20px rgba(220, 38, 38, 0.5), inset 0 0 10px rgba(220, 38, 38, 0.2) !important;
}

/* =========================================
   Theoretical Foundation (Math Block)
   ========================================= */

.theory-block {
  background: rgba(15, 23, 42, 0.6); /* 深い紺色 */
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary-color); /* 紫色のアクセント */
  border-radius: var(--border-radius);
  overflow: hidden;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(5px);
}

.theory-header {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.02em;
}

.theory-header i {
  margin-right: 0.5rem;
  color: var(--secondary-color);
}

.theory-body {
  padding: 1.5rem 2rem;
  color: var(--text-secondary);
  text-align: left;
}

/* Math Styles */
.math {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  color: var(--text-primary);
}

.math-display {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.math-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px solid transparent;
  transition: all 0.3s ease;
}

.math-row:hover {
  background: rgba(255, 255, 255, 0.03);
  border-color: var(--border-color);
}

/* ラベル (Over/Under) */
.bug-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: block;
}

.bug-label.over { color: #facc15; text-shadow: 0 0 10px rgba(250, 204, 21, 0.3); }
.bug-label.under { color: #f87171; text-shadow: 0 0 10px rgba(248, 113, 113, 0.3); }

/* 数式部分のデザイン */
.formula {
  font-family: 'JetBrains Mono', 'Fira Code', monospace; /* コードフォントでモダンに */
  font-size: 1.1rem;
  color: #e2e8f0;
}

.formula .func { color: var(--primary-color); font-weight: bold; }
.formula .var { color: #fff; font-style: italic; font-family: 'Times New Roman', serif; }
.formula .op { color: var(--secondary-color); margin: 0 0.3rem; }
.formula .val { color: #4ade80; }
.formula .text { font-family: sans-serif; font-size: 0.85rem; color: var(--text-dim); margin: 0 0.5rem; }

/* 数式の下の説明文 */
.desc {
  grid-column: 1 / -1; /* 横幅いっぱいに */
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
  padding-left: 200px; /* 数式の開始位置に合わせる */
}

/* モバイル対応 */
@media screen and (max-width: 768px) {
  .math-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: center;
  }
  .desc {
    padding-left: 0;
    text-align: center;
  }
}

/* =========================================
   Definitions Grid in Theory Block
   ========================================= */

.theory-subtitle {
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
  border-left: 2px solid var(--primary-color);
  padding-left: 0.5rem;
}

.def-grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* 2列レイアウト */
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.def-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.math-symbol {
  font-family: 'Times New Roman', serif;
  font-style: italic;
  font-size: 1.5rem;
  color: var(--primary-color);
  background: rgba(255, 255, 255, 0.05);
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.def-desc strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-bottom: 0.2rem;
}

.def-desc p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0 !important;
}

.divider-line {
  height: 1px;
  background: var(--border-color);
  margin: 2rem 0;
  position: relative;
}

/* スマホ対応: 定義を1列にする */
@media screen and (max-width: 768px) {
  .def-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* =========================================
   System Architecture Section
   ========================================= */

/* Diagram Container */
.system-diagram-box {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease;
  /* 画像がSVGの場合、背景が透明だと見にくいことがあるため、わずかに明るくする */
  background: radial-gradient(circle at center, rgba(255,255,255,0.02) 0%, rgba(0,0,0,0) 70%);
}

.system-diagram-box:hover {
  border-color: var(--accent-color);
  box-shadow: 0 0 30px rgba(6, 182, 212, 0.1); /* シアン色の淡い発光 */
}

/* Process List (Right Column) */
.process-list {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.process-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.process-icon {
  background: rgba(255, 255, 255, 0.05);
  color: var(--primary-color);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.process-text strong {
  color: var(--text-primary);
  display: block;
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.process-text p {
  color: var(--text-secondary);
  font-size: 0.9rem !important;
  margin: 0;
  line-height: 1.4;
}

.gradient-text {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-block; /* グラデーションを綺麗に見せるために必要 */
}

/* =========================================
   Main Title (Aurora Glow Effect)
   ========================================= */

.publication-title {
  /* 4色のネオンカラーを複雑にブレンドしたグラデーション */
  background: linear-gradient(
    135deg, 
    #3b82f6 0%,   /* Electric Blue */
    #8b5cf6 25%,  /* Violet */
    #ec4899 50%,  /* Neon Pink */
    #06b6d4 75%,  /* Cyan */
    #3b82f6 100%  /* Loop back */
  );
  
  /* テキストで切り抜く */
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  -webkit-text-fill-color: transparent;
  
  /* グラデーションを大きく引き伸ばす */
  background-size: 300% 300%;
  
  /* アニメーション: 
     ease-in-out = ゆっくり動き出し、ゆっくり止まる（有機的な動き）
     alternate = 行ったり来たりさせることで色の混ざり方を変える
  */
  animation: aurora-flow 8s ease-in-out infinite alternate;
  
  /* 初期の発光（控えめ） */
  filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3));
  
  display: inline-block;
  font-weight: 800 !important;
  letter-spacing: -0.03em !important;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  cursor: default;
}

/* ホバー時のインタラクション: ふわりと浮き上がり、強い光を放つ */
.publication-title:hover {
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 0 30px rgba(139, 92, 246, 0.6)); /* 紫色の強い光 */
}

/* アニメーション定義: 色の位置を動かしつつ、影（光）の色も同期させる */
@keyframes aurora-flow {
  0% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 12px rgba(59, 130, 246, 0.3)); /* 青い光 */
  }
  50% {
    background-position: 100% 50%;
    filter: drop-shadow(0 0 20px rgba(236, 72, 153, 0.4)); /* ピンクの光 */
  }
  100% {
    background-position: 0% 50%;
    filter: drop-shadow(0 0 12px rgba(6, 182, 212, 0.3)); /* シアンの光 */
  }
}

.link-block a {
    margin: 8px 4px;
}

/* Mobile Responsive Improvements */
@media screen and (max-width: 768px) {
  .hero-body {
    padding: 2rem 1rem;
  }
  
  .publication-header .hero-body {
    padding: 3rem 1rem 2rem;
  }
  
  .publication-title {
    font-size: 2.5rem !important;
    line-height: 1.2 !important;
    margin-bottom: 1.5rem !important;
  }
  
  .publication-authors {
    font-size: 1rem !important;
  }
  
  .button {
    margin: 0.25rem !important;
    font-size: 0.875rem !important;
    padding: 0.75rem 1rem !important;
  }
  
  .more-works-container {
    bottom: 2rem;
    right: 1rem;
    top: auto;
  }
  
  .more-works-btn {
    padding: 0.6rem 1rem;
    font-size: 0.8rem;
  }
  
  .more-works-dropdown {
    width: calc(100vw - 2rem);
    right: -1rem;
    bottom: calc(100% + 0.5rem);
    top: auto;
  }
  
  .results-carousel .item {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .teaser .hero-body {
    padding: 1rem;
  }
  
  .content.has-text-justified {
    font-size: 1rem;
  }
}

@media screen and (max-width: 480px) {
  .publication-title {
    font-size: 2rem !important;
  }
  
  .hero-body {
    padding: 1.5rem 0.75rem;
  }
  
  .more-works-container {
    position: fixed;
    bottom: 2rem;
    right: 1rem;
    z-index: 1000;
  }
  
  .more-works-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .more-works-dropdown {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    right: 0;
    width: calc(100vw - 2rem);
    max-width: 90vw;
  }
  
  .link-block {
    display: block;
    margin-bottom: 0.5rem;
  }
  
  .button {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================
   Subtitle Styling (Sophisticated Look)
   ========================================= */

.publication-subtitle {
  /* 真っ白(#fff)ではなく、少し青みのあるグレーにして深みを出す */
  color: #94a3b8 !important; /* Slate 400 */
  
  /* もしくは、背景になじむ半透明の白 */
  /* color: rgba(255, 255, 255, 0.8) !important; */

  font-size: 1.5rem !important; /* 少し控えめなサイズ感に */
  font-weight: 400 !important;  /* 細くしてエレガントに */
  line-height: 1.5 !important;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  margin-top: 1rem !important;
  margin-bottom: 1.5rem !important;
  
  /* ほんの少しだけ発光させて、背景に埋没しないようにする */
  text-shadow: 0 0 20px rgba(59, 130, 246, 0.2);
}

/* スマホではさらに少し小さくして読みやすく */
@media screen and (max-width: 768px) {
  .publication-subtitle {
    font-size: 1.1rem !important;
  }
}

/* =========================================
   Responsive Table Improvements
   ========================================= */

/* 1. テーブルコンテナのスクロールバーをスタイリッシュにする */
.table-container {
  display: block;
  overflow-x: scroll;
  /*overflow-x: auto; /* 横スクロールを有効化 */
  -webkit-overflow-scrolling: touch; /* iOSでのスクロールを滑らかに */
  width: 95vw !important;
  
  /* スクロールバーのカスタマイズ (Webkit系: Chrome, Safari) */
  scrollbar-width: thin; /* Firefox用: 細くする */
  scrollbar-color: var(--primary-color) var(--bg-secondary); /* Firefox用 */
}

.table-container::-webkit-scrollbar {
  height: 8px; /* 横スクロールバーの高さ */
}

.table-container::-webkit-scrollbar-track {
  background: var(--bg-secondary); /* 背景色 */
  border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
  background: var(--bg-accent); /* つまみの色 */
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.table-container::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color); /* ホバー時に青く光る */
}


/* 2. スマホ表示時の列幅と改行の制御 */
@media screen and (max-width: 768px) {
  
  /* 基本的にセル内の文字は勝手に改行させない（横スクロール前提） */
  .table th, 
  .table td {
    white-space: nowrap;
    vertical-align: middle;
  }

  /* ただし、「Description（4列目）」だけは長文なので改行を許可する */
  /* ※ thの並び順に合わせて nth-child の数字を調整してください */
  .table td:nth-child(4) {
    white-space: normal; /* 改行あり */
    min-width: 250px;    /* 最低でもこれくらいの幅は確保して読みやすくする */
    font-size: 0.9rem;   /* 少し文字を小さくして情報を詰め込む */
  }
  
  /* IDなどの短い列は中央寄せにする */
  .table td:nth-child(2), /* ID */
  .table td:nth-child(3)  /* DSL */
  {
    text-align: center;
  }
}