/* 外科ネット - 新デザインスタイル */
:root {
  --primary: #0d6efd;
  --primary-dark: #0a4fae;
  --accent: #ff6b35;
  --bg: #f5f7fa;
  --surface: #ffffff;
  --text: #212529;
  --muted: #6c757d;
  --border: #dee2e6;
  --radius: 8px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
}

.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* ヘッダー */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 14px 0;
  box-shadow: 0 2px 4px rgba(0,0,0,.1);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.logo { color: #fff; font-size: 1.4rem; font-weight: 700; text-decoration: none; }
.main-nav { display: flex; gap: 18px; }
.main-nav a { color: rgba(255,255,255,.9); text-decoration: none; font-size: .95rem; }
.main-nav a:hover { color: #fff; text-decoration: underline; }

/* メイン */
main.container { padding: 28px 16px 48px; }

h1 { font-size: 1.7rem; margin-bottom: 16px; line-height: 1.3; }
h2 { font-size: 1.25rem; margin: 36px 0 16px; padding-bottom: 8px; border-bottom: 3px solid var(--primary); }

/* ヒーロー */
.hero { background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); color: #fff; border-radius: var(--radius); padding: 40px 32px; margin-bottom: 32px; }
.hero h1 { font-size: 2rem; margin-bottom: 8px; }
.hero p { opacity: .9; margin-bottom: 20px; font-size: .98rem; }

.search-box { display: flex; gap: 8px; max-width: 560px; }
.search-box input {
  flex: 1; padding: 12px 16px; border: none; border-radius: 6px; font-size: 1rem;
}
.search-box button {
  padding: 12px 24px; background: var(--accent); color: #fff; border: none;
  border-radius: 6px; font-size: 1rem; cursor: pointer;
}
.search-box button:hover { opacity: .9; }

/* 都道府県一覧 */
.pref-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px; list-style: none;
}
.pref-list a {
  display: block; padding: 10px 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--text); font-size: .95rem;
  transition: all .15s;
}
.pref-list a:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }

/* サイト一覧 */
.site-list { list-style: none; }
.site-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
.site-list a { color: var(--primary); text-decoration: none; }
.site-list a:hover { text-decoration: underline; }
.site-list small { color: var(--muted); }

/* ランダム紹介 */
.random-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.random-list li { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.random-list a { color: var(--primary); text-decoration: none; }
.random-list a:hover { text-decoration: underline; }

/* パンくず */
.breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 16px; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--primary); }

/* ページング */
.pager { display: flex; gap: 6px; margin-top: 24px; flex-wrap: wrap; }
.pager a, .pager span {
  display: inline-block; min-width: 36px; padding: 6px 10px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 4px; text-decoration: none; color: var(--primary);
}
.pager .current { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ランキング */
.rank-list { list-style: none; counter-reset: rank; }
.rank-list li { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 8px; }
.rank-num { font-weight: 700; font-size: 1.1rem; color: var(--accent); min-width: 28px; }

/* 詳細ページ */
.comment { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.keywd { color: var(--muted); font-size: .9rem; }
.cats { color: var(--primary); font-weight: 600; }
.site-url a { color: var(--accent); }

/* スポンサーリンク（エリア広告） */
.sp-list { list-style: none; }
.sp-list li {
  background: #fffbeb;
  border: 1px solid #f0df9f;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 8px;
  font-size: .92rem;
}
.sp-list a { color: var(--primary); text-decoration: none; }
.sp-list a:hover { text-decoration: underline; }

/* コンテンツ */
.content-list { list-style: none; }
.content-list li {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 10px;
}
.content-list a { color: var(--primary); text-decoration: none; }
.content-list a:hover { text-decoration: underline; }
.content-list small { color: var(--muted); }
.content-more { margin-top: 12px; text-align: right; }
.content-more a { color: var(--primary); }
.content-article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.content-date { color: var(--muted); font-size: .85rem; margin-bottom: 16px; }
.content-body { line-height: 1.9; }
.content-body h2 { font-size: 1.2rem; margin-top: 28px; }
.content-body h3 { font-size: 1.05rem; margin-top: 22px; }
.content-body p { margin: 12px 0; }
.content-body img { max-width: 100%; height: auto; }
.empty { color: var(--muted); padding: 20px 0; }

/* 医院詳細テーブル */
.detail-table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.detail-table th { text-align: left; width: 130px; padding: 10px 14px; background: #f1f5fb; border-bottom: 1px solid var(--border); font-size: .9rem; }
.detail-table td { padding: 10px 14px; border-bottom: 1px solid var(--border); }
.detail-table tr:last-child th, .detail-table tr:last-child td { border-bottom: none; }

/* トップSEOコンテンツ */
.seo-top-content { margin-top: 40px; }
.seo-top-content h2 {
  font-size: 1.3rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.seo-top-content h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.seo-top-content p { margin: 10px 0; line-height: 1.9; }
.seo-top-content ul { margin: 10px 0 10px 24px; }
.seo-top-content li { margin: 4px 0; }
.seo-top-content a { color: var(--primary); text-decoration: none; }
.seo-top-content a:hover { text-decoration: underline; }
.pref-hot { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.pref-all { columns: 3; column-gap: 24px; }
@media (max-width: 640px) { .pref-all { columns: 2; } }

/* 都道府県ページSEOコンテンツ */
.pref-seo-content { margin-top: 40px; }
.pref-seo-content h2 {
  font-size: 1.25rem; margin: 36px 0 14px; padding-bottom: 8px;
  border-bottom: 3px solid var(--primary);
}
.pref-seo-content h3 { font-size: 1.05rem; margin: 22px 0 10px; }
.pref-seo-content p { margin: 10px 0; line-height: 1.9; }
.pref-seo-content ul { margin: 10px 0 10px 24px; }
.pref-seo-content li { margin: 6px 0; }
.pref-top-list a { color: var(--primary); text-decoration: none; }
.pref-top-list a:hover { text-decoration: underline; }
.pref-areas li, .pref-tips li { list-style: disc; }

/* フッター */
.site-footer { background: #212529; color: rgba(255,255,255,.8); padding: 28px 0; margin-top: 48px; font-size: .85rem; }
.site-footer a { color: rgba(255,255,255,.8); text-decoration: none; }
.site-footer nav { margin-top: 8px; }

/* モバイル */
@media (max-width: 640px) {
  .hero { padding: 28px 20px; }
  .hero h1 { font-size: 1.5rem; }
  .pref-list { grid-template-columns: repeat(2, 1fr); }
  .site-header .container { flex-direction: column; align-items: flex-start; }
}

/* ---------- テーマ別レイアウト ---------- */

/* テーマB: モダンポータル（2カラム・ヘッダー中央） */
.header-center .container { flex-direction: column; align-items: center; text-align: center; }
.header-center .tagline { color: rgba(255,255,255,.85); font-size: .9rem; margin: 4px 0 8px; }
.main-with-sidebar { display: grid; grid-template-columns: 1fr; gap: 24px; }
.footer-columns .footer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.footer-columns .footer-2col { grid-template-columns: 1fr 1fr; }
.footer-note { color: rgba(255,255,255,.7); font-size: .85rem; }

/* テーマC: ミニマル（角丸0・背景白） */
body.theme-c { background: #fff; }
body.theme-c .pref-list a { border-radius: 0; box-shadow: none; }
body.theme-c .site-list li { border-radius: 0; }
body.theme-c .hero { background: #fff; color: var(--text); border-bottom: 3px solid var(--primary); }
body.theme-c .hero p { color: var(--muted); }

/* テーマD: タイル型（カテゴリタイルを大きく） */
body.theme-d .pref-list { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
body.theme-d .pref-list a { padding: 20px 14px; text-align: center; font-weight: 600; }
body.theme-d .hero { background: var(--surface); color: var(--text); border: 1px solid var(--border); }
body.theme-d .hero p { color: var(--muted); }

/* テーマB 2カラム（大きい画面） */
@media (min-width: 768px) {
  .main-with-sidebar { grid-template-columns: 1fr 280px; }
}
