/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Color Palette - Unique to Cashless Payment */
  --primary-color: #0066ff;
  --secondary-color: #1a1f36;
  --accent-color: #00d4ff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-light: #718096;
  --bg-light: #f7fafc;
  --bg-white: #ffffff;
  --bg-dark: #0f172a;
  --gradient-primary: linear-gradient(135deg, #0066ff 0%, #00d4ff 100%);
  --gradient-dark: linear-gradient(135deg, #1a1f36 0%, #0f172a 100%);
  --gradient-accent: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-white);
  overflow-x: hidden;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-color);
}

/* Navigation */
.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  transition: var(--transition);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.nav-logo {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 800;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.logo-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  letter-spacing: 0.05em;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 1.5rem;
  align-items: center;
  flex-wrap: wrap;
  max-width: 900px;
  justify-content: center;
}

.nav-menu a {
  color: var(--text-primary);
  font-weight: 500;
  position: relative;
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  transition: var(--transition);
  font-size: 0.9rem;
  white-space: nowrap;
}

.nav-menu a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: width 0.3s ease;
}

.nav-menu a:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 10;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-top: 80px;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.6);
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.85) 0%, rgba(26, 31, 54, 0.9) 100%);
  mix-blend-mode: multiply;
  z-index: 1;
}

.hero-content {
  text-align: center;
  color: white;
  z-index: 2;
  max-width: 900px;
  padding: 0 2rem;
  position: relative;
}

.hero-title {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.title-main {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.title-sub {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 400;
  opacity: 0.9;
}

.hero-description {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 2.5rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  opacity: 0.95;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 3rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  min-width: 150px;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--accent-color);
  margin-bottom: 0.5rem;
}

.stat-label {
  font-size: 0.9rem;
  opacity: 0.9;
  text-align: center;
}

.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: white;
  opacity: 0.7;
  cursor: pointer;
  z-index: 2;
}

.scroll-arrow {
  width: 2px;
  height: 30px;
  background: white;
  position: relative;
  animation: scrollBounce 2s infinite;
}

@keyframes scrollBounce {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(10px); opacity: 1; }
}

/* Section Styles */
.section-overview, .section-news, .section-categories, .content-section {
  padding: 5rem 0;
}

.section-overview {
  background: var(--bg-light);
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.title-en {
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: var(--primary-color);
}

.title-ja {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  color: var(--text-primary);
}

/* Overview Section */
.overview-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
}

.overview-text {
  font-size: 1.1rem;
  line-height: 1.8;
}

.lead-text {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
}

.overview-features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.feature-card {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--text-light);
}

/* News Section */
.section-news {
  background: white;
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.news-item {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
  transition: var(--transition);
}

.news-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.news-date {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.news-item h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.news-item p {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

.news-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  font-weight: 600;
  transition: var(--transition);
}

.news-link:hover {
  gap: 1rem;
  color: var(--accent-color);
}

/* Categories Section */
.section-categories {
  background: var(--bg-dark);
  color: white;
}

.section-categories .title-en {
  color: var(--accent-color);
}

.section-categories .title-ja {
  color: white;
}

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

.category-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  transition: var(--transition);
  cursor: pointer;
}

.category-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-5px);
}

.category-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  color: white;
}

.category-card p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-color);
  font-weight: 600;
  margin-top: 1rem;
}

/* Content Pages - Two Column Layout */
.page-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  max-width: 1200px;
  margin: 6rem auto 3rem;
  padding: 0 2rem;
}

.main-content {
  min-width: 0;
}

.page-hero {
  position: relative;
  height: 400px;
  margin-bottom: 3rem;
  border-radius: 16px;
  overflow: hidden;
}

.page-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(0, 102, 255, 0.8) 0%, rgba(26, 31, 54, 0.7) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.page-hero h1 {
  color: white;
  text-align: center;
  font-size: clamp(2rem, 5vw, 3rem);
}

.content-body {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.content-body h2 {
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

.content-body h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.content-body h4 {
  font-size: 1.25rem;
  margin-top: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--primary-color);
}

.content-body p {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 1.25rem;
}

.content-body ul, .content-body ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.content-body li {
  margin-bottom: 0.75rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.content-body strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-section {
  background: var(--bg-light);
  padding: 1.5rem;
  border-radius: 12px;
  margin-bottom: 2rem;
}

.sidebar-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.sidebar-toc {
  list-style: none;
  padding: 0;
}

.sidebar-toc li {
  margin-bottom: 0.5rem;
}

.sidebar-toc a {
  display: block;
  padding: 0.5rem 0.75rem;
  color: var(--text-secondary);
  border-left: 2px solid transparent;
  transition: var(--transition);
}

.sidebar-toc a:hover {
  color: var(--primary-color);
  border-left-color: var(--primary-color);
  padding-left: 1rem;
}

.related-links {
  list-style: none;
  padding: 0;
}

.related-links li {
  margin-bottom: 0.75rem;
}

.related-links a {
  display: block;
  padding: 0.75rem;
  background: white;
  border-radius: 8px;
  color: var(--text-primary);
  transition: var(--transition);
}

.related-links a:hover {
  background: var(--primary-color);
  color: white;
  transform: translateX(5px);
}

.ad-space {
  background: #f5f5f5;
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Footer */
footer {
  background: var(--bg-dark);
  color: white;
  padding: 3rem 0 1.5rem;
  margin-top: 5rem;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: rgba(255, 255, 255, 0.7);
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--accent-color);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  padding: 1.5rem 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }

  .nav-container {
    padding: 1rem;
  }

  .nav-toggle {
    display: flex;
  }

  .nav-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    flex-direction: column;
    padding: 1rem;
    box-shadow: var(--shadow-md);
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: var(--transition);
  }

  .nav-menu.active {
    max-height: 500px;
    opacity: 1;
    padding: 1rem;
  }

  .hero {
    height: 80vh;
    min-height: 500px;
    margin-top: 60px;
  }

  .hero-content {
    padding: 0 1rem;
  }

  .hero-stats {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .stat-item {
    min-width: 120px;
    width: 100%;
    max-width: 300px;
  }

  .page-layout {
    grid-template-columns: 1fr;
    margin-top: 4rem;
    padding: 0 1rem;
    gap: 2rem;
  }

  .sidebar {
    position: static;
  }

  .content-body {
    padding: 1.5rem;
  }

  .content-body h2 {
    font-size: 1.5rem;
  }

  .content-body h3 {
    font-size: 1.25rem;
  }

  .page-hero {
    height: 300px;
    margin-left: -1.5rem;
    margin-right: -1.5rem;
    margin-bottom: 2rem;
    border-radius: 0;
  }

  .news-grid {
    grid-template-columns: 1fr;
  }

  .categories-grid {
    grid-template-columns: 1fr;
  }

  .overview-features {
    grid-template-columns: 1fr;
  }

  .ad-space img {
    max-width: 100%;
    height: auto;
  }

  /* 広告画像がはみ出さないように */
  .sidebar-section img {
    max-width: 100% !important;
    height: auto !important;
    width: auto !important;
  }

  /* フッター */
  .footer-content {
    grid-template-columns: 1fr;
  }

  .footer-links {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Dify-injected News Section */
.latest-news-section {
  padding: 3rem 0;
  background: var(--bg-light);
}

.section-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.latest-news-section h2 {
  font-size: 1.8rem;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--text-primary);
}

.news-list-simple {
  list-style: none;
  padding: 0;
}

.news-list-simple .news-item {
  padding: 1rem;
  margin-bottom: 0.75rem;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  display: flex;
  gap: 1rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.news-list-simple .news-date {
  font-size: 0.85rem;
  white-space: nowrap;
}

.news-more {
  text-align: center;
  margin-top: 1.5rem;
}

.btn-more {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--gradient-primary);
  color: white;
  border-radius: 25px;
  font-weight: 600;
  transition: var(--transition);
}

.btn-more:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  color: white;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.6s ease-in;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border-width: 0;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  top: 0;
}

/* Print Styles */
@media print {
  .main-nav, .sidebar, footer, .ad-space {
    display: none !important;
  }
  
  .page-layout {
    grid-template-columns: 1fr;
  }
  
  body {
    font-size: 12pt;
  }
}


/* Glossary Specific Styles */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 2rem;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary-color);
}

.glossary-term {
  background: white;
  padding: 3rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.term-title {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  position: relative;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.term-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100px;
  height: 3px;
  background: var(--gradient-primary);
}

.term-category {
  display: inline-block;
  background: var(--bg-light);
  color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 2rem;
}

.term-body {
    margin-bottom: 3rem;
}

.term-body p {
  font-size: 1.1rem;
  line-height: 1.9;
  margin-bottom: 1.5rem;
}

.external-links {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.external-links h3 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.external-links ul {
  list-style: none;
  padding: 0;
}

.external-links li {
  margin-bottom: 0.75rem;
}

.external-links a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
  transition: var(--transition);
}

.external-links a:hover {
  color: var(--primary-color);
  transform: translateX(5px);
}

.external-links a::before {
  content: '';
  color: var(--accent-color);
}

/* Glossary Index Styles */
.glossary-category {
    margin-bottom: 4rem;
}

.glossary-category h2 {
    font-size: 1.75rem;
    padding-left: 1rem;
    border-left: 5px solid var(--primary-color);
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.term-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.term-list li a {
    display: block;
    padding: 1rem 1.5rem;
    background: white;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 600;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.term-list li a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}



/* === Mobile fix v3 (auto-injected) === */
html, body { overflow-x: hidden; }
img, video, iframe, table { max-width: 100%; }

@media (max-width: 768px) {
  /* ヒーローテキストがviewportからはみ出さないようにする */
  h1, h2, h3 {
    font-size: clamp(1.3rem, 5vw, 2.5rem) !important;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  p, li, td, th, span, a {
    overflow-wrap: break-word;
    word-break: break-word;
  }
  /* 全要素の幅を100vw以内に */
  .container, main, section, article, header, footer, nav,
  [class*="container"], [class*="wrapper"], [class*="content"] {
    max-width: 100vw;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
}
/* === End Mobile fix v3 === */
