/* ===== STカコモン 共通スタイル ===== */
:root {
  --primary: #1a3a5c;
  --accent:  #2980b9;
  --accent2: #1a6fa8;
  --bg:      #f0f4f8;
  --card:    #fff;
  --border:  #dde3ea;
  --text:    #2d3748;
  --sub:     #5a7184;
  --radius:  8px;
  --shadow:  0 2px 12px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Noto Sans JP', sans-serif; background: var(--bg); color: var(--text); line-height: 1.8; }
a { text-decoration: none; color: inherit; }

/* ---- Header ---- */
.header {
  background: var(--primary);
  color: #fff;
  padding: 0;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.header-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 54px; gap: 12px;
}
.header-logo { font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.header-logo img { height: 26px; }
.header-nav { display: flex; align-items: center; gap: 2px; }
.header-nav a {
  color: rgba(255,255,255,.82); font-size: 0.82rem; font-weight: 500;
  padding: 6px 10px; border-radius: 5px; transition: all .15s;
  display: flex; align-items: center; gap: 5px;
}
.header-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.header-app-btn {
  background: var(--accent); color: #fff !important;
  padding: 6px 14px !important; border-radius: 5px;
  font-weight: 700 !important; font-size: 0.82rem !important;
  margin-left: 6px;
}
.header-app-btn:hover { background: var(--accent2) !important; }
@media (max-width: 700px) {
  .header-nav .hide-sp { display: none; }
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  max-width: 1160px; margin: 0 auto; padding: 10px 20px;
  font-size: 0.78rem; color: var(--sub);
  display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: #aab; }

/* ---- Layout ---- */
.page-wrapper {
  max-width: 1160px; margin: 0 auto; padding: 0 20px 60px;
  display: grid; grid-template-columns: 1fr 240px; gap: 28px;
  align-items: start;
}
.container { max-width: 1160px; margin: 0 auto; padding: 0 20px 60px; }
.container-with-sidebar { min-width: 0; }

/* ---- Sidebar ---- */
.content-sidebar { position: sticky; top: 74px; }
.sidebar-section {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sidebar-section h3 {
  font-size: 0.7rem; font-weight: 700; color: var(--sub);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.sidebar-nav { list-style: none; padding: 0; margin: 0; }
.sidebar-nav li { margin-bottom: 1px; }
.sidebar-nav a {
  display: block; font-size: 0.81rem; color: var(--text);
  padding: 5px 8px; border-radius: 4px; transition: background .12s;
  line-height: 1.5;
}
.sidebar-nav a:hover { background: var(--bg); color: var(--accent); }
.sidebar-nav a.active { background: #e8f4fd; color: var(--accent); font-weight: 700; }
.sidebar-cta {
  background: linear-gradient(135deg, var(--primary), #2d5a8e);
  color: #fff; border-radius: var(--radius); padding: 16px;
  text-align: center; margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.sidebar-cta p { font-size: 0.8rem; color: rgba(255,255,255,.88); margin-bottom: 10px; line-height: 1.6; }
.sidebar-cta a {
  display: inline-block; background: #fff; color: var(--primary);
  font-weight: 700; font-size: 0.82rem; padding: 7px 16px; border-radius: 5px;
  transition: opacity .15s;
}
.sidebar-cta a:hover { opacity: .88; }

/* ---- TOC (table of contents) ---- */
.toc-box {
  background: #f8fbff; border: 1px solid #c9dff0;
  border-radius: var(--radius); padding: 16px 20px; margin: 0 0 28px;
}
.toc-box h3 { font-size: 0.82rem; font-weight: 700; color: var(--sub); margin-bottom: 10px; }
.toc-list { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.toc-list li { counter-increment: toc; margin-bottom: 4px; }
.toc-list li::before {
  content: counter(toc) ". ";
  font-size: 0.78rem; color: var(--accent); font-weight: 700; margin-right: 2px;
}
.toc-list a { font-size: 0.83rem; color: var(--accent); }
.toc-list a:hover { text-decoration: underline; }

/* ---- Hero (index pages) ---- */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #2d5a8e 60%, #1a4f7a 100%);
  color: #fff; padding: 44px 20px 36px; text-align: center;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 80% 50%, rgba(99,162,241,.18) 0%, transparent 60%);
}
.hero-inner { position: relative; z-index: 1; max-width: 700px; margin: 0 auto; }
.hero h1 { font-size: 1.6rem; color: #fff; margin-bottom: 10px; font-weight: 700; }
.hero p { font-size: 0.95rem; color: rgba(255,255,255,.85); margin-bottom: 20px; }
.hero-stats {
  display: flex; justify-content: center; gap: 28px; flex-wrap: wrap;
  margin-top: 20px;
}
.hero-stat { text-align: center; }
.hero-stat .num { font-size: 1.6rem; font-weight: 900; color: #fff; line-height: 1.1; }
.hero-stat .label { font-size: 0.72rem; color: rgba(255,255,255,.75); margin-top: 2px; }

/* ---- Article meta ---- */
.article-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 0.8rem; color: var(--sub); margin: 0 0 20px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.article-meta i { margin-right: 4px; }
.article-meta .tag {
  background: #e8f4fd; color: var(--accent); padding: 2px 8px;
  border-radius: 4px; font-size: 0.75rem; font-weight: 700;
}

/* ---- Typography ---- */
h1 { font-size: 1.65rem; color: var(--primary); margin: 20px 0 8px; line-height: 1.4; }
.lead { font-size: 0.97rem; color: var(--sub); margin-bottom: 24px; line-height: 1.85; }
h2 {
  font-size: 1.12rem; color: var(--primary); margin: 36px 0 12px;
  padding: 10px 14px; background: #f0f5fb;
  border-left: 4px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
}
h3 { font-size: 1rem; color: var(--primary); margin: 24px 0 8px; }
p { font-size: 0.93rem; margin-bottom: 12px; line-height: 1.85; }

/* ---- Table ---- */
table { width: 100%; border-collapse: collapse; margin: 14px 0; font-size: 0.87rem; box-shadow: var(--shadow); border-radius: var(--radius); overflow: hidden; }
th, td { border: 1px solid var(--border); padding: 10px 13px; text-align: left; line-height: 1.6; }
th { background: #e8f0fa; font-weight: 700; color: var(--primary); }
tr:nth-child(even) td { background: #fafbfc; }
tr:hover td { background: #f5f8ff; }

/* ---- Lists ---- */
ul { padding-left: 1.4em; margin: 8px 0 14px; }
ul li { font-size: 0.92rem; margin-bottom: 6px; line-height: 1.75; }

/* ---- Point Box ---- */
.point-box {
  background: #e8f4fd; border: 1px solid #b3d7f5;
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
  font-size: 0.88rem; position: relative; padding-left: 44px;
}
.point-box::before {
  content: '\f05a'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; left: 14px; top: 14px; color: var(--accent); font-size: 1rem;
}
.point-box strong { color: var(--primary); display: block; margin-bottom: 4px; }

/* ---- Warn Box ---- */
.warn-box {
  background: #fff8e1; border: 1px solid #ffe082;
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
  font-size: 0.88rem; position: relative; padding-left: 44px;
}
.warn-box::before {
  content: '\f071'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  position: absolute; left: 14px; top: 14px; color: #d97706; font-size: 1rem;
}
.warn-box strong { color: #b45309; display: block; margin-bottom: 4px; }

/* ---- Clinical Note ---- */
.clinical-note {
  background: #fffbeb; border: 1px solid #fcd34d;
  border-radius: var(--radius); padding: 14px 18px; margin: 16px 0;
  font-size: 0.88rem;
}

/* ---- Author Box ---- */
.author-box {
  background: #f0f5fb; border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 18px; margin: 0 0 20px; font-size: 0.86rem;
  display: flex; align-items: center; gap: 10px;
}
.author-box::before {
  content: '\f4fe'; font-family: 'Font Awesome 6 Free'; font-weight: 900;
  color: var(--accent); font-size: 1.2rem; flex-shrink: 0;
}

/* ---- Formula ---- */
.formula {
  background: #f0f4f8; border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; margin: 16px 0;
  font-size: 0.9rem; line-height: 2;
}

/* ---- CTA ---- */
.cta-box {
  background: linear-gradient(135deg, var(--primary), #2d5a8e);
  color: #fff; border-radius: 10px; padding: 32px 28px;
  text-align: center; margin-top: 44px;
  box-shadow: 0 4px 20px rgba(26,58,92,.25);
}
.cta-box h2 { border: none; padding: 0; color: #fff; margin-bottom: 10px; background: none; font-size: 1.2rem; }
.cta-box p { color: rgba(255,255,255,.88); margin-bottom: 20px; font-size: 0.93rem; }
.cta-btn {
  background: #fff; color: var(--primary); font-weight: 700;
  padding: 12px 32px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 8px; font-size: 0.95rem;
  transition: opacity .15s;
}
.cta-btn:hover { opacity: .88; }

/* ---- Related articles ---- */
.related-articles { margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--border); }
.related-articles h3 { font-size: 0.9rem; color: var(--sub); margin-bottom: 14px; }
.related-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.related-item {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  font-size: 0.83rem; color: var(--accent); transition: border-color .15s;
  display: flex; align-items: center; gap: 8px;
}
.related-item:hover { border-color: var(--accent); }
.related-item i { color: var(--sub); font-size: 0.75rem; flex-shrink: 0; }
@media (max-width: 600px) { .related-list { grid-template-columns: 1fr; } }

/* ---- Footer ---- */
.footer {
  background: var(--primary); color: rgba(255,255,255,.65);
  text-align: center; padding: 24px 20px; font-size: 0.78rem;
  margin-top: 0;
}
.footer a { color: rgba(255,255,255,.65); }
.footer a:hover { color: #fff; }

/* ---- Badges ---- */
.badge { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 0.72rem; font-weight: 700; margin-left: 6px; }
.badge-new { background: #d4edda; color: #155724; }
.badge-hard { background: #f8d7da; color: #721c24; }
.badge-hot { background: #fff3cd; color: #856404; }

/* ---- OK / NG ---- */
.ok { color: #27ae60; font-weight: 700; }
.ng { color: #e74c3c; font-weight: 700; }

/* ---- Audiogram ---- */
.audiogram-box { background: #fff; border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 16px 0; font-size: 0.85rem; }
.audiogram-symbols { display: flex; gap: 24px; flex-wrap: wrap; margin: 12px 0; }
.audiogram-symbols .sym { display: flex; align-items: center; gap: 8px; }

/* ---- Stage grid ---- */
.stage-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 10px; margin: 16px 0; }
.stage-card { background: #fff; border: 2px solid var(--accent); border-radius: var(--radius); padding: 12px 8px; text-align: center; }
.stage-card .num { font-size: 1.4rem; font-weight: 700; color: var(--accent); }
.stage-card .name { font-size: 0.8rem; font-weight: 700; color: var(--primary); margin: 4px 0; }
.stage-card .desc { font-size: 0.72rem; color: var(--sub); line-height: 1.5; }

/* ---- Rank cards ---- */
.rank-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; margin: 16px 0; box-shadow: var(--shadow); }
.rank-card .rank-num { font-size: 2rem; font-weight: 700; color: var(--accent); float: left; margin-right: 14px; line-height: 1; }
.rank-card h3 { font-size: 1.05rem; color: var(--primary); margin-bottom: 6px; }
.rank-card p { font-size: 0.88rem; color: var(--text); margin-bottom: 8px; }
.rank-card .tips { background: #f0f4f8; border-radius: 4px; padding: 8px 12px; font-size: 0.84rem; color: var(--sub); }
.rank-card::after { content: ''; display: table; clear: both; }

/* ---- Week cards ---- */
.week-card { background: var(--card); border-left: 4px solid var(--accent); padding: 16px 20px; margin: 12px 0; border-radius: 0 var(--radius) var(--radius) 0; box-shadow: var(--shadow); }
.week-card h3 { font-size: 0.97rem; color: var(--primary); margin-bottom: 8px; }

/* ---- Area grid ---- */
.area-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 16px 0; }
.area-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center; box-shadow: var(--shadow); }
.area-card i { font-size: 1.5rem; color: var(--accent); margin-bottom: 8px; display: block; }
.area-card h3 { font-size: 0.9rem; color: var(--primary); margin-bottom: 4px; }
.area-card p { font-size: 0.8rem; color: var(--sub); margin: 0; }

/* ---- Guide grid ---- */
.guide-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; padding: 28px 0; }
.guide-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: all 0.2s; box-shadow: var(--shadow); }
.guide-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); border-color: var(--accent); }
.guide-card i { font-size: 1.8rem; color: var(--accent); margin-bottom: 12px; display: block; }
.guide-card h2 { font-size: 1rem; color: var(--primary); margin-bottom: 6px; border: none; padding: 0; margin-top: 0; background: none; }
.guide-card p { font-size: 0.83rem; color: var(--sub); line-height: 1.7; margin-bottom: 14px; }
.guide-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; padding: 7px 16px; border-radius: 4px; font-size: 0.83rem; font-weight: 700; transition: background .15s; }
.guide-btn:hover { background: var(--accent2); }

/* ---- Theme grid ---- */
.theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin: 20px 0; }
.theme-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: all 0.2s; box-shadow: var(--shadow); }
.theme-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); border-color: var(--accent); }
.theme-card .badge { display: inline-block; background: #fff3cd; color: #856404; border-radius: 3px; font-size: 0.72rem; padding: 2px 7px; font-weight: 700; margin-bottom: 8px; margin-left: 0; }
.theme-card h2 { font-size: 0.95rem; color: var(--primary); margin-bottom: 6px; border: none; padding: 0; margin-top: 0; background: none; }
.theme-card p { font-size: 0.82rem; color: var(--sub); line-height: 1.7; margin-bottom: 10px; }
.theme-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; padding: 6px 14px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; transition: background .15s; }
.theme-btn:hover { background: var(--accent2); }

/* ---- Year grid ---- */
.year-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin: 20px 0; }
.year-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; transition: all 0.2s; box-shadow: var(--shadow); }
.year-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); transform: translateY(-2px); border-color: var(--accent); }
.year-card .year-num { font-size: 2rem; font-weight: 700; color: var(--accent); display: block; }
.year-card h2 { font-size: 1rem; color: var(--primary); margin: 6px 0 10px; border: none; padding: 0; background: none; }
.year-card p { font-size: 0.83rem; color: var(--sub); line-height: 1.7; margin-bottom: 12px; }
.year-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; padding: 7px 16px; border-radius: 4px; font-size: 0.83rem; font-weight: 700; transition: background .15s; }
.year-btn:hover { background: var(--accent2); }

/* ---- Article list ---- */
.article-list { display: flex; flex-direction: column; gap: 12px; margin: 20px 0; }
.article-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 22px; display: flex; align-items: flex-start; gap: 16px; transition: all 0.2s; box-shadow: var(--shadow); }
.article-card:hover { box-shadow: 0 6px 20px rgba(0,0,0,.1); border-color: var(--accent); }
.article-card i { font-size: 1.5rem; color: var(--accent); min-width: 30px; margin-top: 2px; }
.article-card h2 { font-size: 0.97rem; color: var(--primary); margin-bottom: 5px; border: none; padding: 0; margin-top: 0; background: none; }
.article-card p { font-size: 0.84rem; color: var(--sub); line-height: 1.7; margin-bottom: 8px; }
.article-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: #fff; padding: 5px 13px; border-radius: 4px; font-size: 0.8rem; font-weight: 700; transition: background .15s; }
.article-btn:hover { background: var(--accent2); }

/* ---- Content index section ---- */
.content-section { margin-bottom: 40px; }
.content-section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 2px solid var(--border);
}
.content-section-header h2 {
  font-size: 1.05rem; color: var(--primary); font-weight: 700;
  border: none; padding: 0; margin: 0; background: none;
  display: flex; align-items: center; gap: 8px;
}
.content-section-header h2 i { color: var(--accent); }
.content-section-header a { font-size: 0.78rem; color: var(--accent); }

/* ---- Glossary ---- */
.search-bar { margin: 20px 0 14px; display: flex; gap: 8px; }
.search-bar input { flex: 1; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.95rem; font-family: inherit; }
.alpha-nav { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 20px; }
.alpha-btn { background: #fff; border: 1px solid var(--border); color: var(--sub); padding: 4px 11px; border-radius: 4px; font-size: 0.83rem; cursor: pointer; font-family: inherit; transition: all .12s; }
.alpha-btn:hover, .alpha-btn.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.section-header { font-size: 1rem; font-weight: 700; color: var(--primary); background: #e8f0fa; border-left: 4px solid var(--accent); padding: 8px 14px; margin: 24px 0 10px; border-radius: 0 4px 4px 0; }
.term-list { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px; margin-bottom: 8px; }
.term-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.term-card dt { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.term-card dd { font-size: 0.84rem; color: var(--text); line-height: 1.7; }
.term-card .tag { display: inline-block; font-size: 0.72rem; background: #e8f4fd; color: var(--accent); padding: 1px 7px; border-radius: 10px; margin-bottom: 4px; }
.hidden { display: none; }

/* ---- Card grid (legacy) ---- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 20px; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; transition: border-color .15s; box-shadow: var(--shadow); }
.card:hover { border-color: var(--accent); }
.card-icon { font-size: 1.4rem; margin-bottom: 10px; color: var(--accent); }
.card h3 { font-size: 0.95rem; margin-bottom: 6px; color: var(--primary); }
.card p { font-size: 0.82rem; color: var(--sub); margin: 0; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
  .page-wrapper { grid-template-columns: 1fr; padding: 0 16px 60px; }
  .content-sidebar { display: none; }
  .container { padding: 0 16px 60px; }
}
@media (max-width: 600px) {
  h1 { font-size: 1.3rem; }
  h2 { font-size: 1rem; }
  table { font-size: 0.8rem; }
  .guide-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .theme-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .year-grid { grid-template-columns: 1fr; }
  .article-card { flex-direction: column; gap: 8px; }
  .term-list { grid-template-columns: 1fr; }
  .area-grid { grid-template-columns: 1fr 1fr; }
  .stage-grid { grid-template-columns: repeat(3,1fr); }
  .related-list { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .guide-grid { grid-template-columns: 1fr; }
  .theme-grid { grid-template-columns: 1fr; }
}

/* ---- Print ---- */
@media print {
  .header-app-btn, .cta-box, .content-sidebar, .footer { display: none; }
}
