@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

:root {
  --primary: #0D7377;
  --primary-light: #14B8A6;
  --primary-dark: #065F56;
  --primary-bg: #F0FDFA;
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --bg: #F9FAFB;
  --card: #FFFFFF;
  --text: #1F2937;
  --text-light: #6B7280;
  --text-lighter: #9CA3AF;
  --border: #E5E7EB;
  --border-light: #F3F4F6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --max-width: 1120px;
  --header-height: 64px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

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

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

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--header-height);
  display: flex; align-items: center;
}

.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between; width: 100%;
}

.site-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo-icon {
  width: 36px; height: 36px; background: var(--primary); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 900; font-size: 18px;
}
.site-logo-text { font-size: 1.35rem; font-weight: 900; color: var(--text); letter-spacing: -0.02em; }
.site-logo-text span { color: var(--primary); }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a {
  font-size: 0.875rem; font-weight: 500; color: var(--text);
  padding: 4px 0; position: relative; transition: color var(--transition);
}
.nav-links a::after {
  content: ''; position: absolute; bottom: -2px; left: 0; width: 0; height: 2px;
  background: var(--primary); transition: width var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after { width: 100%; }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  width: 32px; height: 32px; position: relative; z-index: 110;
}
.hamburger span {
  display: block; width: 22px; height: 2px; background: var(--text);
  position: absolute; left: 5px; transition: all 0.3s;
}
.hamburger span:nth-child(1) { top: 9px; }
.hamburger span:nth-child(2) { top: 15px; }
.hamburger span:nth-child(3) { top: 21px; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg); top: 15px; }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg); top: 15px; }

.mobile-nav {
  display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5); z-index: 105; opacity: 0; transition: opacity 0.3s;
}
.mobile-nav.open { display: block; opacity: 1; }
.mobile-nav-inner {
  background: #fff; width: 280px; height: 100%; padding: 80px 24px 24px;
  transform: translateX(-100%); transition: transform 0.3s;
}
.mobile-nav.open .mobile-nav-inner { transform: translateX(0); }
.mobile-nav a {
  display: block; padding: 14px 0; font-size: 0.95rem; font-weight: 500;
  color: var(--text); border-bottom: 1px solid var(--border-light);
}
.mobile-nav a:hover { color: var(--primary); }

/* ===== HERO (Top Page) ===== */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  color: #fff; padding: 80px 0 100px; position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; top: -50%; right: -20%; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
}
.hero::after {
  content: ''; position: absolute; bottom: -30%; left: -10%; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(245,158,11,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; text-align: center; }
.hero-badge {
  display: inline-block; background: rgba(255,255,255,0.15); backdrop-filter: blur(4px);
  padding: 6px 18px; border-radius: 50px; font-size: 0.8rem; font-weight: 500;
  margin-bottom: 20px; letter-spacing: 0.05em;
}
.hero h1 { font-size: 2.75rem; font-weight: 900; line-height: 1.3; margin-bottom: 16px; }
.hero p { font-size: 1.05rem; opacity: 0.9; max-width: 600px; margin: 0 auto 32px; line-height: 1.8; }
.hero-cta {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; font-weight: 700;
  padding: 14px 32px; border-radius: 50px; font-size: 0.95rem;
  transition: background var(--transition), transform var(--transition);
}
.hero-cta:hover { background: var(--accent-hover); color: #fff; transform: translateY(-2px); }

/* ===== SECTION HEADINGS ===== */
.section { padding: 60px 0; }
.section-title {
  font-size: 1.65rem; font-weight: 900; color: var(--text); margin-bottom: 8px;
  position: relative; display: inline-block;
}
.section-title::after {
  content: ''; display: block; width: 40px; height: 4px;
  background: var(--accent); border-radius: 2px; margin-top: 8px;
}
.section-subtitle { color: var(--text-light); font-size: 0.9rem; margin-bottom: 32px; }

/* ===== CATEGORY CARDS (Top Page) ===== */
.category-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-bottom: 24px; }
.category-card {
  background: var(--card); border-radius: var(--radius); padding: 32px 24px;
  border: 1px solid var(--border-light); transition: all 0.3s;
  position: relative; overflow: hidden;
}
.category-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: var(--primary); transform: scaleX(0); transition: transform 0.3s; transform-origin: left;
}
.category-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.category-card:hover::before { transform: scaleX(1); }
.category-card-icon {
  width: 48px; height: 48px; border-radius: 12px; background: var(--primary-bg);
  display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
  font-size: 1.3rem;
}
.category-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 8px; }
.category-card p { font-size: 0.85rem; color: var(--text-light); line-height: 1.6; }
.category-card-count {
  display: inline-block; background: var(--primary-bg); color: var(--primary);
  font-size: 0.75rem; font-weight: 600; padding: 4px 12px; border-radius: 50px; margin-top: 12px;
}

/* ===== ARTICLE CARDS ===== */
.article-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.article-card {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border-light); transition: all 0.3s;
}
.article-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.article-card-thumb {
  width: 100%; height: 180px; background: linear-gradient(135deg, var(--primary-bg) 0%, #e0f2fe 100%);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.article-card-thumb-icon { font-size: 2.5rem; opacity: 0.4; }
.article-card-body { padding: 20px; }
.article-card-category {
  display: inline-block; font-size: 0.72rem; font-weight: 600;
  color: var(--primary); background: var(--primary-bg);
  padding: 3px 10px; border-radius: 50px; margin-bottom: 10px;
}
.article-card h3 {
  font-size: 0.95rem; font-weight: 700; line-height: 1.6;
  margin-bottom: 10px; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card:hover h3 { color: var(--primary); }
.article-card-date { font-size: 0.78rem; color: var(--text-lighter); }

/* ===== ARTICLE PAGE ===== */
.article-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff; padding: 48px 0 60px; position: relative;
}
.article-header-inner { position: relative; z-index: 1; }
.article-breadcrumb {
  font-size: 0.8rem; opacity: 0.8; margin-bottom: 16px;
}
.article-breadcrumb a { color: rgba(255,255,255,0.85); }
.article-breadcrumb a:hover { color: #fff; }
.article-breadcrumb span { margin: 0 6px; opacity: 0.5; }
.article-category-badge {
  display: inline-block; background: rgba(255,255,255,0.2); backdrop-filter: blur(4px);
  padding: 4px 14px; border-radius: 50px; font-size: 0.78rem; font-weight: 500; margin-bottom: 14px;
}
.article-header h1 { font-size: 1.75rem; font-weight: 900; line-height: 1.5; max-width: 800px; }
.article-meta {
  display: flex; gap: 20px; margin-top: 16px; font-size: 0.82rem; opacity: 0.8;
}

.article-layout {
  display: grid; grid-template-columns: 1fr 280px; gap: 40px;
  max-width: var(--max-width); margin: 0 auto; padding: 40px 20px;
}

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

/* Article Body Styles */
.article-body { max-width: 100%; }
.article-body h1 { font-size: 1.8rem; font-weight: 900; color: var(--text); margin: 48px 0 20px; line-height: 1.4; }
.article-body h2 {
  font-size: 1.4rem; font-weight: 700; color: var(--text); margin: 40px 0 16px;
  padding-bottom: 10px; border-bottom: 3px solid var(--primary);
  line-height: 1.5;
}
.article-body h3 { font-size: 1.15rem; font-weight: 700; color: var(--text); margin: 28px 0 12px; }
.article-body h4 { font-size: 1rem; font-weight: 700; color: var(--text); margin: 20px 0 8px; }
.article-body p { margin: 16px 0; line-height: 1.9; }
.article-body ul, .article-body ol { margin: 16px 0; padding-left: 1.5em; }
.article-body li { margin: 6px 0; line-height: 1.8; }
.article-body strong { font-weight: 700; }
.article-body blockquote {
  border-left: 4px solid var(--primary); background: var(--primary-bg);
  padding: 16px 20px; margin: 20px 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
}
.article-body blockquote p { margin: 4px 0; }
.article-body table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  font-size: 0.88rem; overflow-x: auto; display: block;
}
.article-body th {
  background: var(--primary); color: #fff; padding: 10px 14px;
  text-align: left; font-weight: 600; white-space: nowrap;
}
.article-body td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.article-body tr:nth-child(even) td { background: var(--primary-bg); }
.article-body hr { border: none; height: 1px; background: var(--border); margin: 32px 0; }
.article-body img { border-radius: var(--radius-sm); margin: 20px 0; }
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--primary-dark); }
.article-body .headerlink { display: none; }

/* ===== TOC SIDEBAR ===== */
.toc-sidebar {
  position: sticky; top: calc(var(--header-height) + 20px);
  align-self: start; max-height: calc(100vh - 100px); overflow-y: auto;
}
.toc-card {
  background: var(--card); border: 1px solid var(--border-light); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.toc-card h4 {
  font-size: 0.85rem; font-weight: 700; color: var(--text); margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}
.toc-card ul { list-style: none; padding: 0; }
.toc-card li { margin: 0; }
.toc-card a {
  display: block; padding: 5px 10px; font-size: 0.78rem; color: var(--text-light);
  border-radius: var(--radius-xs); transition: all var(--transition); line-height: 1.5;
}
.toc-card a:hover { background: var(--primary-bg); color: var(--primary); }
.toc-card .toc-h2 > a { font-weight: 600; color: var(--text); }
.toc-card .toc-h3 { padding-left: 18px; }
.toc-card .toc-h4 { padding-left: 32px; }

/* ===== MOBILE TOC ===== */
.mobile-toc { display: none; margin: 24px 0; }
.mobile-toc summary {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 12px 16px; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-toc[open] summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.mobile-toc .toc-content {
  background: var(--card); border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 16px;
  max-height: 300px; overflow-y: auto;
}
.mobile-toc .toc-content ul { list-style: none; padding: 0; }
.mobile-toc .toc-content li { margin: 0; }
.mobile-toc .toc-content a {
  display: block; padding: 6px 10px; font-size: 0.82rem; color: var(--text-light); line-height: 1.5;
}
.mobile-toc .toc-content a:hover { color: var(--primary); }
.mobile-toc .toc-content .toc-h2 > a { font-weight: 600; color: var(--text); }
.mobile-toc .toc-content .toc-h3 { padding-left: 16px; }

/* ===== RELATED ARTICLES ===== */
.related-section { padding: 40px 0; background: var(--bg); }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.related-card {
  background: var(--card); border-radius: var(--radius-sm); padding: 16px;
  border: 1px solid var(--border-light); transition: all var(--transition);
}
.related-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.related-card h4 { font-size: 0.85rem; font-weight: 600; line-height: 1.5; margin-bottom: 6px; }
.related-card:hover h4 { color: var(--primary); }
.related-card-keyword { font-size: 0.72rem; color: var(--text-lighter); }

/* ===== CATEGORY PAGE ===== */
.category-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: #fff; padding: 48px 0 56px;
}
.category-hero h1 { font-size: 1.8rem; font-weight: 900; margin-bottom: 8px; }
.category-hero p { font-size: 0.95rem; opacity: 0.85; }
.category-list-section { padding: 40px 0; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text); color: rgba(255,255,255,0.7); padding: 48px 0 24px;
}
.footer-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 40px; margin-bottom: 40px;
}
.footer-col h4 { color: #fff; font-size: 0.9rem; font-weight: 700; margin-bottom: 16px; }
.footer-col a {
  display: block; color: rgba(255,255,255,0.65); font-size: 0.82rem;
  padding: 4px 0; transition: color var(--transition);
}
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid rgba(255,255255,0.1); padding-top: 20px;
  text-align: center; font-size: 0.78rem; color: rgba(255,255,255,0.4);
}

/* ===== PAGINATION ===== */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 32px; }
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 40px; height: 40px; border-radius: var(--radius-sm);
  font-size: 0.85rem; font-weight: 500; border: 1px solid var(--border);
  transition: all var(--transition);
}
.pagination a:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc-sidebar { display: none; }
  .mobile-toc { display: block; }
  .category-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .hamburger { display: block; }
  .hero h1 { font-size: 1.8rem; }
  .hero p { font-size: 0.9rem; }
  .hero { padding: 56px 0 72px; }
  .section { padding: 40px 0; }
  .section-title { font-size: 1.3rem; }
  .category-grid { grid-template-columns: 1fr; }
  .article-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 1.3rem; }
  .article-header { padding: 32px 0 40px; }
  .article-layout { padding: 24px 20px; gap: 0; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .related-grid { grid-template-columns: 1fr; }
  .article-body h2 { font-size: 1.2rem; }
  .article-body h3 { font-size: 1.05rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .container { padding: 0 16px; }
}

/* ===== SCROLL TOP BUTTON ===== */
.scroll-top {
  position: fixed; bottom: 24px; right: 24px; width: 44px; height: 44px;
  background: var(--primary); color: #fff; border: none; border-radius: 50%;
  cursor: pointer; font-size: 1.2rem; display: none; align-items: center;
  justify-content: center; box-shadow: var(--shadow-md); transition: all var(--transition);
  z-index: 90;
}
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }
.scroll-top.visible { display: flex; }

/* ===== CATEGORY ICONS ===== */
.cat-icon-zheng-she-yuan::before { content: "📋"; }
.cat-icon-bing-yuan-tiao-ji::before { content: "🏥"; }
.cat-icon-pai-qian::before { content: "💼"; }