/* ===================================
   未来のニュース - Futuristic Theme
   Purple & Orange Gradient Accents
   =================================== */

/* CSS Variables */
:root {
  --bg-primary: #fcf9f9;
  --bg-secondary: #F8F9FA;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFAFE;
  --bg-surface: #F3F0FF;
  --text-primary: #212529;
  --text-secondary: #6C757D;
  --text-muted: #ADB5BD;
  --border-color: #E9ECEF;
  --border-glow: rgba(139, 92, 246, 0.35);
  --gradient-main: linear-gradient(135deg, #7c3aed, #a855f7, #f97316);
  --gradient-purple: linear-gradient(135deg, #7c3aed, #a855f7);
  --gradient-orange: linear-gradient(135deg, #f97316, #fb923c);
  --gradient-mixed: linear-gradient(135deg, #9333ea, #c084fc, #f97316, #fb923c);
  --accent-purple: #7c3aed;
  --accent-orange: #f97316;
  --glow-purple: rgba(124, 58, 237, 0.25);
  --glow-orange: rgba(249, 115, 22, 0.2);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 1px rgba(139, 92, 246, 0.1);
  --shadow-card-hover: 0 4px 16px rgba(0, 0, 0, 0.08), 0 0 12px rgba(139, 92, 246, 0.1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent-purple);
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #9333ea;
  text-decoration: none;
}

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

/* ===================================
   Layout
   =================================== */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

/* ===================================
   Header
   =================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(252, 249, 249, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}

.header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-main);
  opacity: 0.5;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 700;
  background: var(--gradient-main);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
}

.header-logo-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  /* background-clipの影響を受けないようリセット */
  -webkit-text-fill-color: initial;
}

.header-logo:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

.hamburger-btn {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--text-primary);
  line-height: 1;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.hamburger-btn:hover {
  border-color: var(--accent-purple);
  box-shadow: 0 0 12px var(--glow-purple);
}

/* ===================================
   Hamburger Menu (Slide-in)
   =================================== */
.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 200;
}

.menu-overlay.active {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  right: -300px;
  width: 280px;
  height: 100%;
  background: #fcf9f9;
  z-index: 300;
  transition: right 0.3s ease;
  overflow-y: auto;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
  border-left: 1px solid var(--border-color);
}

.side-menu.active {
  right: 0;
}

.menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
}

.menu-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.menu-close-btn:hover {
  color: var(--accent-orange);
}

.menu-nav {
  padding: 8px 0;
}

.menu-nav a {
  display: block;
  padding: 12px 16px;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: background 0.2s, padding-left 0.2s;
  border-left: 3px solid transparent;
}

.menu-nav a:hover {
  background: var(--bg-surface);
  border-left-color: var(--accent-purple);
  padding-left: 20px;
  text-decoration: none;
}

.menu-section-title {
  padding: 12px 16px 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.menu-nav .sub-item {
  padding-left: 32px;
}

.menu-nav .sub-item:hover {
  padding-left: 36px;
}

.menu-divider {
  height: 1px;
  background: var(--border-color);
  margin: 8px 16px;
}

/* ===================================
   Section Styles
   =================================== */
.section {
  padding: 24px 0;
}

.section-bg {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}

/* ===================================
   Category Labels
   =================================== */
.category-label {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
}

.category-label--ai {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
  box-shadow: 0 0 8px rgba(124, 58, 237, 0.3);
}

.category-label--fusion {
  background: linear-gradient(135deg, #ea580c, #f97316);
  box-shadow: 0 0 8px rgba(249, 115, 22, 0.3);
}

.category-label--quantum {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
  color: #FFFFFF;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.3);
}

.category-label--autonomous {
  background: linear-gradient(135deg, #059669, #34d399);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.3);
}

.category-label--fintech {
  background: linear-gradient(135deg, #dc2626, #f87171);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.3);
}

.category-label--search {
  background: linear-gradient(135deg, #7c3aed, #f97316);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* ===================================
   News Cards
   =================================== */
.news-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: var(--shadow-card);
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: box-shadow 0.3s, transform 0.2s, border-color 0.3s;
  position: relative;
  overflow: hidden;
}

.news-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-main);
  opacity: 0;
  transition: opacity 0.3s;
}

.news-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--border-glow);
}

.news-card:hover::before {
  opacity: 1;
}

.news-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 8px 0 6px;
  line-height: 1.5;
  color: var(--text-primary);
}

.news-card-summary {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Featured News */
.featured-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: padding-left 0.2s;
}

.featured-card:last-child {
  border-bottom: none;
}

.featured-card:hover {
  padding-left: 4px;
}

.featured-card:hover .featured-card-title {
  color: var(--accent-purple);
}

.featured-card-content {
  flex: 1;
}

.featured-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text-primary);
  transition: color 0.2s;
}

.featured-card-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===================================
   Article Detail
   =================================== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  padding: 12px 0;
}

.breadcrumb a {
  color: var(--accent-purple);
}

.breadcrumb span {
  margin: 0 6px;
  color: var(--text-muted);
}

.article-title {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.5;
  margin: 12px 0;
  color: var(--text-primary);
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.article-body {
  font-size: 1rem;
  line-height: 2;
  margin-bottom: 24px;
  white-space: pre-wrap;
  color: var(--text-primary);
}

.source-link-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0 auto;
  background: var(--gradient-main);
  color: #FFFFFF;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
}

.source-link-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  color: #FFFFFF;
  text-decoration: none;
}

/* ===================================
   Share Buttons
   =================================== */
.share-section {
  margin: 24px 0;
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: 12px;
}

.share-section h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
  text-align: center;
}

.share-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.2s, box-shadow 0.2s;
}

.share-btn:hover {
  filter: brightness(1.15);
  text-decoration: none;
}

.share-btn--native {
  background: var(--gradient-purple);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.share-btn--x {
  background: #000000;
  color: #FFFFFF;
}

.share-btn--line {
  background: #06C755;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(6, 199, 85, 0.2);
}

.share-btn--copy {
  background: #6C757D;
  color: #FFFFFF;
}

.copy-feedback {
  font-size: 0.8rem;
  color: #198754;
  margin-left: 8px;
  font-weight: 500;
}

/* ===================================
   Search Section
   =================================== */
.search-section {
  padding: 24px 0;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.search-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  background: #FFFFFF;
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2), 0 0 16px rgba(139, 92, 246, 0.1);
}

.search-btn {
  padding: 10px 20px;
  background: var(--gradient-main);
  color: #FFFFFF;
  border: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: filter 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.search-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
}

.search-btn:disabled {
  background: #ADB5BD;
  color: #FFFFFF;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.search-limit-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===================================
   Update Button
   =================================== */
.update-section {
  text-align: center;
  padding: 24px 0;
}

.update-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--gradient-main);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: filter 0.2s, box-shadow 0.2s, transform 0.2s;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.3), 0 0 24px rgba(249, 115, 22, 0.1);
}

.update-btn:hover {
  filter: brightness(1.15);
  box-shadow: 0 6px 24px rgba(124, 58, 237, 0.4), 0 0 32px rgba(249, 115, 22, 0.15);
  transform: translateY(-1px);
}

.update-btn:disabled {
  background: #ADB5BD;
  color: #FFFFFF;
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
  transform: none;
}

.update-info {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ===================================
   Ad Container
   =================================== */
.ad-container {
  margin: 16px 0;
  text-align: center;
}

.ad-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.ad-content {
  padding: 12px;
}

.ad-content a {
  color: var(--text-primary);
  text-decoration: none;
}

.ad-content a:hover {
  text-decoration: underline;
}

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

/* ===================================
   Footer
   =================================== */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 24px 16px;
  text-align: center;
  background: var(--bg-secondary);
  position: relative;
}

.footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--gradient-main);
  opacity: 0.4;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.footer-links a {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

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

.footer-copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================================
   Loading & Error States
   =================================== */
.loading {
  text-align: center;
  padding: 40px 0;
  color: var(--text-secondary);
}

.loading-spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #E9ECEF;
  border-top-color: var(--accent-purple);
  border-right-color: var(--accent-orange);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error-message {
  text-align: center;
  padding: 24px;
  color: #DC3545;
  font-size: 0.95rem;
}

.empty-message {
  text-align: center;
  padding: 24px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.no-data-banner {
  text-align: center;
  padding: 40px 20px;
  background: var(--bg-surface);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.no-data-message {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.no-data-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* ===================================
   Back to Top
   =================================== */
.back-to-top {
  display: inline-block;
  margin: 16px 0;
  font-size: 0.95rem;
  color: var(--accent-purple);
  transition: color 0.2s;
}

.back-to-top:hover {
  color: var(--accent-orange);
}

/* ===================================
   Static Pages (non-React)
   =================================== */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px 16px;
}

@media (min-width: 768px) {
  .static-page {
    padding: 32px 24px;
  }
}

.static-page h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid transparent;
  border-image: var(--gradient-main) 1;
}

.static-page h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 32px 0 12px;
  padding-left: 12px;
  border-left: 3px solid var(--accent-purple);
}

.static-page h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 24px 0 8px;
  color: var(--text-primary);
}

.static-page p {
  margin-bottom: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

.static-page ul, .static-page ol {
  margin: 12px 0 16px 24px;
}

.static-page li {
  margin-bottom: 8px;
  line-height: 1.7;
  color: var(--text-primary);
}

.static-page table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
}

.static-page th, .static-page td {
  padding: 10px 14px;
  border: 1px solid var(--border-color);
  text-align: left;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.static-page th {
  background: var(--bg-card);
  font-weight: 600;
  white-space: nowrap;
  width: 30%;
}

.static-page .cta-link {
  display: inline-block;
  margin: 16px 0;
  padding: 10px 20px;
  background: var(--gradient-main);
  color: #FFFFFF;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  box-shadow: 0 2px 12px rgba(124, 58, 237, 0.3);
  transition: filter 0.2s, box-shadow 0.2s;
}

.static-page .cta-link a {
  color: #FFFFFF;
}

.static-page .cta-link:hover {
  filter: brightness(1.15);
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.4);
  text-decoration: none;
}

/* ===================================
   Category Page
   =================================== */
.category-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  color: var(--text-primary);
}

.category-about-link {
  margin: 24px 0 16px;
  padding: 14px 20px;
  background: var(--bg-surface);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.category-about-link:hover {
  border-color: var(--border-glow);
  box-shadow: 0 2px 12px var(--glow-purple);
}

.category-about-link a {
  color: var(--accent-purple);
  font-weight: 500;
  font-size: 0.95rem;
}

.section-title--link {
  cursor: pointer;
  transition: color 0.2s;
}

.section-title--link:hover {
  color: var(--accent-purple);
}

.section-title-arrow {
  font-size: 0.9rem;
  color: var(--text-muted);
  transition: color 0.2s, transform 0.2s;
}

.section-title--link:hover .section-title-arrow {
  color: var(--accent-purple);
  transform: translateX(4px);
}

/* ===================================
   Responsive
   =================================== */
@media (max-width: 480px) {
  .article-title {
    font-size: 1.25rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    justify-content: center;
  }

  .search-form {
    flex-direction: column;
  }

  .search-btn {
    width: 100%;
  }
}
