<!DOCTYPE html>

<html lang="ja" data-theme="light">

  <head>

    <meta charset="UTF-8" />

    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <meta name="format-detection" content="telephone=no,email=no,address=no" />

    <meta name="theme-color" content="#10233a" />

    <title>診療科別 業界平均指標一覧 | Dr.節税相談室</title>

    <meta

      name="description"

      content="公的統計データをもとに整理した、医療機関向けの平均指標リファレンスです。診療科別の業界平均指標を一覧で確認できます。"

    />

    <link rel="canonical" href="https://trivy.jp/shinryoka-average/" />

    <meta property="og:locale" content="ja_JP" />

    <meta property="og:type" content="website" />

    <meta property="og:title" content="診療科別 業界平均指標一覧 | Dr.節税相談室" />

    <meta

      property="og:description"

      content="公的統計データをもとに整理した、医療機関向けの平均指標リファレンスです。"

    />

    <meta property="og:url" content="https://trivy.jp/shinryoka-average/" />

    <meta property="og:site_name" content="Dr.節税相談室" />

    <meta name="twitter:card" content="summary" />

    <meta name="twitter:title" content="診療科別 業界平均指標一覧 | Dr.節税相談室" />

    <meta

      name="twitter:description"

      content="公的統計データをもとに整理した、医療機関向けの平均指標リファレンスです。"

    />

    <style>

      :root {

        --brand-navy: #10233a;

        --brand-gold: #c9a227;

        --brand-gold-hover: #b38f22;

        --bg-light: #f4f5f7;

        --card-bg: #ffffff;

        --text-main: #333333;

        --text-muted: #666666;

        --bar-bg: #e5e7eb;

        --radius-card: 18px;

        --accent-finance: #2f5d8a;

        --accent-finance-soft: #edf4fb;

        --accent-volume: #b8871b;

        --accent-volume-soft: #fbf5e8;

        --accent-cost: #7b4d7d;

        --accent-cost-soft: #f6eef8;

        --accent-surface-navy: #f3f7fc;

        --accent-surface-gold: #fcf7ec;

        --accent-surface-plum: #f7f1fa;

        --card-outline: #e6e8ee;

        --font-mincho:

          'Yu Mincho', 'Hiragino Mincho ProN', 'Hiragino Mincho Pro', 'Noto Serif JP', 'Times New Roman', serif;

      }


      * {

        box-sizing: border-box;

      }


      body {

        margin: 0;

        padding: 0;

        background-color: var(--bg-light);

        color: var(--text-main);

        font-family: var(--font-mincho);

        line-height: 1.8;

        -webkit-font-smoothing: antialiased;

        padding-bottom: 100px;

      }


      h1,

      h2,

      h3,

      h4,

      p,

      ul,

      li,

      a,

      button,

      span,

      div,

      strong {

        font-family: var(--font-mincho);

      }


      img {

        max-width: 100%;

        height: auto;

      }


      main {

        max-width: 1040px;

        margin: 0 auto;

        padding: 32px 16px;

      }


      .hero {

        background: linear-gradient(135deg, #10233a 0%, #17304d 65%, #1d3b5d 100%);

        text-align: center;

        padding: 56px 20px;

        border-bottom: 4px solid var(--brand-gold);

        box-shadow: inset 0 -18px 40px rgba(0, 0, 0, 0.12);

      }


      .hero h1 {

        color: var(--brand-gold);

        font-size: clamp(1.4rem, 4vw, 2.2rem);

        margin: 0 0 16px 0;

        font-weight: bold;

      }


      .hero p {

        color: rgba(255, 255, 255, 0.95);

        font-size: clamp(0.95rem, 2vw, 1.1rem);

        margin: 0;

      }


      .description-section {

        background:

          linear-gradient(135deg, rgba(201, 162, 39, 0.08) 0%, rgba(201, 162, 39, 0) 34%),

          linear-gradient(180deg, #ffffff 0%, #fcfcfd 100%);

        border-radius: var(--radius-card);

        padding: 32px 24px;

        margin-bottom: 40px;

        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);

        border: 1px solid var(--card-outline);

        border-left: 6px solid var(--brand-gold);

      }


      .description-section h2 {

        color: var(--brand-navy);

        font-size: 1.3rem;

        margin-top: 0;

        margin-bottom: 16px;

        border-bottom: 1px solid #eee;

        padding-bottom: 12px;

      }


      .description-section p {

        margin-bottom: 12px;

        font-size: 1rem;

      }


      .description-section p:last-child {

        margin-bottom: 0;

      }


      .cards-grid {

        display: grid;

        grid-template-columns: 1fr;

        gap: 24px;

        margin-bottom: 48px;

      }


      @media (min-width: 768px) {

        .cards-grid {

          grid-template-columns: repeat(2, 1fr);

        }

      }


      .card {

        background: linear-gradient(180deg, #ffffff 0%, #fdfdfd 100%);

        border-radius: var(--radius-card);

        padding: 28px 24px;

        box-shadow: 0 10px 28px rgba(16, 35, 58, 0.07);

        display: flex;

        flex-direction: column;

        border: 1px solid var(--card-outline);

        position: relative;

        overflow: hidden;

        transition:

          transform 0.2s ease,

          box-shadow 0.2s ease;

      }


      .card::before {

        content: '';

        position: absolute;

        top: 0;

        left: 0;

        width: 100%;

        height: 6px;

        background: linear-gradient(90deg, var(--brand-navy) 0%, var(--brand-gold) 100%);

      }


      .card.accent-0 {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-surface-navy) 100%);

      }


      .card.accent-1 {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-surface-gold) 100%);

      }


      .card.accent-2 {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-surface-plum) 100%);

      }


      .card.accent-0::before {

        background: linear-gradient(90deg, #2f5d8a 0%, #5d89b3 100%);

      }


      .card.accent-1::before {

        background: linear-gradient(90deg, #b8871b 0%, #d4a542 100%);

      }


      .card.accent-2::before {

        background: linear-gradient(90deg, #7b4d7d 0%, #9a6a9d 100%);

      }


      @media (hover: hover) {

        .card:hover {

          transform: translateY(-3px);

          box-shadow: 0 14px 34px rgba(16, 35, 58, 0.1);

        }

      }


      .card-title {

        font-size: 1.4rem;

        color: var(--brand-navy);

        margin: 0 0 12px 0;

        font-weight: bold;

      }


      .card-subtitle {

        font-size: 1rem;

        color: var(--brand-navy);

        margin: 0 0 16px 0;

        font-weight: bold;

        display: inline-flex;

        align-items: center;

        gap: 8px;

      }


      .card-subtitle::before {

        content: '';

        display: inline-block;

        width: 10px;

        height: 10px;

        border-radius: 999px;

        background: var(--brand-gold);

        box-shadow: 0 0 0 5px rgba(201, 162, 39, 0.14);

      }


      .card-desc {

        font-size: 0.95rem;

        color: var(--text-muted);

        margin-top: 0;

        margin-bottom: 24px;

        padding-bottom: 20px;

        border-bottom: 1px dashed #eee;

      }


      .metrics {

        display: flex;

        flex-direction: column;

        gap: 20px;

        flex-grow: 1;

      }


      .metric {

        display: flex;

        flex-direction: column;

        padding: 12px 12px 10px;

        border-radius: 14px;

        border: 1px solid rgba(16, 35, 58, 0.06);

      }


      .metric.theme-finance {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-finance-soft) 100%);

      }


      .metric.theme-volume {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-volume-soft) 100%);

      }


      .metric.theme-cost {

        background: linear-gradient(180deg, #ffffff 0%, var(--accent-cost-soft) 100%);

      }


      .metric-top {

        display: flex;

        justify-content: space-between;

        align-items: baseline;

        margin-bottom: 6px;

      }


      .metric-label {

        font-size: 0.88rem;

        color: var(--text-main);

        font-weight: bold;

        display: inline-flex;

        align-items: center;

        padding: 4px 10px;

        border-radius: 999px;

        letter-spacing: 0.02em;

      }


      .metric.theme-finance .metric-label {

        background: var(--accent-finance-soft);

        color: var(--accent-finance);

      }


      .metric.theme-volume .metric-label {

        background: var(--accent-volume-soft);

        color: var(--accent-volume);

      }


      .metric.theme-cost .metric-label {

        background: var(--accent-cost-soft);

        color: var(--accent-cost);

      }


      .metric-value-wrap {

        display: flex;

        align-items: baseline;

        gap: 4px;

      }


      .metric-value {

        font-size: 1.3rem;

        font-weight: bold;

        color: var(--brand-navy);

      }


      .metric-unit {

        font-size: 0.9rem;

        color: var(--text-muted);

      }


      .metric-bar-bg {

        background-color: var(--bar-bg);

        height: 6px;

        border-radius: 3px;

        width: 100%;

        overflow: hidden;

      }


      .metric-bar-fill {

        background-color: var(--brand-navy);

        height: 100%;

        border-radius: 3px;

      }


      .metric.theme-finance .metric-bar-fill {

        background: linear-gradient(90deg, #2f5d8a 0%, #5d89b3 100%);

      }


      .metric.theme-volume .metric-bar-fill {

        background: linear-gradient(90deg, #b8871b 0%, #d4a542 100%);

      }


      .metric.theme-cost .metric-bar-fill {

        background: linear-gradient(90deg, #7b4d7d 0%, #9a6a9d 100%);

      }


      .card-note {

        margin-top: 24px;

        font-size: 0.85rem;

        color: var(--text-muted);

        text-align: right;

      }


      .cta-section {

        background: linear-gradient(135deg, #10233a 0%, #183652 100%);

        color: #ffffff;

        text-align: center;

        padding: 48px 24px;

        border-radius: var(--radius-card);

        margin-bottom: 48px;

        box-shadow: 0 12px 28px rgba(16, 35, 58, 0.14);

      }


      .cta-section h2 {

        color: var(--brand-gold);

        font-size: clamp(1.3rem, 3vw, 1.8rem);

        margin-top: 0;

        margin-bottom: 20px;

      }


      .cta-section p {

        margin-bottom: 32px;

        font-size: 1.05rem;

      }


      .btn {

        display: inline-block;

        background-color: var(--brand-gold);

        color: #ffffff;

        text-decoration: none;

        padding: 18px 40px;

        border-radius: 40px;

        font-weight: bold;

        font-size: 1.1rem;

        box-shadow: 0 4px 12px rgba(201, 162, 39, 0.3);

        transition:

          background-color 0.2s,

          transform 0.2s;

      }


      .btn:hover,

      .btn:focus {

        background-color: var(--brand-gold-hover);

        transform: translateY(-2px);

        outline: none;

      }


      .btn:active {

        transform: translateY(0);

      }


      .disclaimer {

        background: linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);

        padding: 36px 28px;

        border-radius: var(--radius-card);

        margin-bottom: 48px;

        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);

        border: 1px solid var(--card-outline);

      }


      .disclaimer h2 {

        font-size: 1.25rem;

        color: var(--brand-navy);

        margin-top: 0;

        margin-bottom: 24px;

      }


      .disclaimer h3 {

        font-size: 1.05rem;

        color: var(--brand-navy);

        margin: 28px 0 12px 0;

        border-left: 4px solid var(--brand-gold);

        padding-left: 12px;

      }


      .disclaimer p,

      .disclaimer li {

        font-size: 0.95rem;

        color: var(--text-muted);

        margin-bottom: 8px;

      }


      .disclaimer ul {

        margin-top: 0;

        margin-bottom: 16px;

        padding-left: 20px;

      }


      footer {

        text-align: center;

        padding: 32px 16px 48px 16px;

        color: var(--text-muted);

        font-size: 0.95rem;

        border-top: 1px solid #ddd;

      }


      footer p {

        margin: 8px 0;

      }


      footer a {

        color: var(--brand-navy);

        text-decoration: underline;

      }


      .fixed-cta {

        position: fixed;

        bottom: 24px;

        right: 24px;

        background-color: var(--brand-gold);

        color: #ffffff;

        padding: 16px 32px;

        border-radius: 40px;

        font-weight: bold;

        font-size: 1.1rem;

        text-decoration: none;

        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);

        z-index: 1000;

        transition:

          transform 0.2s,

          background-color 0.2s;

      }


      .fixed-cta:hover,

      .fixed-cta:focus {

        background-color: var(--brand-gold-hover);

        transform: scale(1.05);

        outline: none;

      }


      @media (max-width: 767px) {

        .fixed-cta {

          bottom: 16px;

          right: 16px;

          padding: 14px 24px;

          font-size: 1rem;

        }

      }

    </style>

  </head>

  <body>

    <header class="hero">

      <h1>診療科別 業界平均指標一覧</h1>

      <p>公的統計データをもとに整理した、医療機関向けの平均指標リファレンス</p>

    </header>


    <main>

      <section class="description-section">

        <h2>このページについて</h2>

        <p>

          本ページは診療科別の平均指標を確認するための参考資料です。個別の医院の評価を目的とするものではありません。

        </p>

        <p>

          掲載している指標は、公的資料等において確実な横並び比較が可能であったデータのみを厳選しています。

        </p>

        <p>

          なお、患者単価は厚生労働省公表の「1日当たり医療費」、1日あたり患者数は同資料の「1施設当たり日数」を365日で換算した延べ患者数ベースの参考値、委託費比率は厚生労働省の診療科分類別収支構造比較に基づく対医業収益比を掲載しています。

        </p>

        <p>

          美容皮膚科・美容外科など自由診療中心の分野は、本ページと同一基準で横並び比較できる公的平均値の蓄積が十分でないため、現時点では追加掲載を見送っています。

        </p>

      </section>


      <section class="cards-grid" id="clinics-container"></section>


      <section class="cta-section">

        <h2>平均指標を踏まえて、貴院の状況をLINEで相談しませんか?</h2>

        <p>

          業界平均との違いや、今後どこを見直すべきかは、実際の決算内容や運営状況を確認してはじめて整理できます。<br />下のボタンから公式LINEを開くと、流入元に応じた相談文が自動入力された状態でご相談を始められます。

        </p>

        <a href="#" class="btn line-consult-link">LINEでオンライン相談する</a>

      </section>


      <section class="disclaimer">

        <h2>【重要な注意事項】</h2>


        <h3>■ データの性質について</h3>

        <p>

          本ページに掲載の指標は、厚生労働省「医療経済実態調査(令和6年度)」、日本医師会「診療所の緊急経営調査(令和7年)」等の公的統計データに基づく業界平均値です。個々の医療機関の実績を示すものではありません。

        </p>


        <h3>■ 参考値としての位置づけ</h3>

        <ul>

          <li>

            本データは<strong>概算・参考値</strong>であり、実際の経営状況は医療機関の規模、立地、経営方針、地域特性等により大きく異なります

          </li>

          <li>診療報酬改定、税制改正、医療政策の変更等により数値は変動します</li>

          <li>2024年度(令和6年度)時点のデータであり、今後の状況変化を反映していません</li>

        </ul>


        <h3>■ 免責</h3>

        <ul>

          <li>Dr.節税相談室は、本データの正確性・完全性・有用性について保証しません</li>

          <li>本データの利用により生じた直接的・間接的損害について、当事務所は一切責任を負いません</li>

          <li>経営判断や税務対策の実施にあたっては、必ず税理士による個別相談をお受けください</li>

        </ul>


        <h3>■ データ出典</h3>

        <ul>

          <li>厚生労働省「第25回医療経済実態調査」(令和7年実施)</li>

          <li>日本医師会「令和7年 診療所の緊急経営調査 結果」</li>

          <li>健康保険組合連合会「第25回医療経済実態調査の結果に対する見解」</li>

          <li>最終更新日: 2025年1月</li>

        </ul>


        <h3>【個別相談のご案内】</h3>

        <p>貴院の実際の経営状況に基づくご相談は、下記ボタンから公式LINEへ進み、自動入力された相談文をご利用ください。</p>

      </section>

    </main>


    <footer>

      <p><strong>Dr.節税相談室</strong></p>

      <p>医療法人・開業医向け 節税・経営相談サポート</p>

      <p>LINEからお気軽にご相談ください</p>

    </footer>


    <a href="#" class="fixed-cta line-consult-link">LINEで相談</a>


    <script>

      const clinics = [

        {

          name: '1. 内科',

          desc: '幅広い患者層を抱える基幹診療科で、安定性はある一方、人件費と固定費の管理が利益確保の鍵になります。',

          metrics: [

            { label: '医業利益率', value: 4.2, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 52, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 69, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 5.0, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 14.5, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 31.9, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 9723, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '2. 小児科',

          desc: '季節変動の影響を受けやすく、繁閑差への対応と継続受診につながる運営設計が重要です。',

          metrics: [

            { label: '医業利益率', value: 4.8, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 54, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 68, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 1.4, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 18.5, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 37.4, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 7053, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '3. 外科',

          desc: '専門性が高い一方で利益率は低く、稼働効率や原価管理の見直し余地が大きい診療科です。',

          metrics: [

            { label: '医業利益率', value: 0.5, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 56, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 65, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 5.0, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 16.6, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 36.7, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 8311, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '4. 整形外科',

          desc: '患者数を確保しやすい反面、リハビリやスタッフ配置の負担が収益性に影響しやすい傾向があります。',

          metrics: [

            { label: '医業利益率', value: 2.6, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 53, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 67, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 2.9, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 14.4, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 79.3, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 4768, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '5. 産婦人科',

          desc: '専門人材確保と設備維持の負担が重く、診療体制全体の効率化が重要になる分野です。',

          metrics: [

            { label: '医業利益率', value: 1.7, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 55, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 64, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 5.8, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 15.7, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 27.9, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 9865, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '6. 眼科',

          desc: '自己資本比率が高く財務は比較的安定していますが、設備投資の更新タイミングが経営に直結します。',

          metrics: [

            { label: '医業利益率', value: 5.3, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 48, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 72, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 1.8, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 17.8, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 38.3, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 9026, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '7. 耳鼻咽喉科',

          desc: '外来回転率の高さを活かしやすく、比較的堅実な収支構造を作りやすい診療科です。',

          metrics: [

            { label: '医業利益率', value: 9.9, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 47, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 74, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 2.2, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 7.9, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 51.3, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 5373, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '8. 皮膚科',

          desc: '比較的高い利益率を確保しやすく、自由診療の有無やサービス設計によって差が出やすい分野です。',

          metrics: [

            { label: '医業利益率', value: 8.1, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 49, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 73, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 3.3, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 13.9, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 50.9, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 4070, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '9. 精神科',

          desc: '継続診療が中心となる一方で人件費負担が重く、稼働率改善や体制最適化が課題になりやすい診療科です。',

          metrics: [

            { label: '医業利益率', value: 1.6, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 58, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 66, unit: '%', type: 'percent' },

            { label: '委託費比率', value: 2.7, unit: '%', type: 'percent' },

            { label: '材料費比率', value: 9.5, unit: '%', type: 'percent' },

            { label: '1日あたり患者数', value: 30.4, unit: '人', type: 'patients_day' },

            { label: '患者単価', value: 6386, unit: '円', type: 'patient_unit' }

          ]

        },

        {

          name: '10. 歯科',

          desc: '単価設計の自由度はあるものの、競争環境や設備投資の影響を強く受けやすい領域です。',

          metrics: [

            { label: '医業利益率', value: 5.5, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 51, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 50, unit: '%', type: 'percent' }

          ],

          note: '委託費比率・材料費比率・1日あたり患者数・患者単価は、今回確認できる横並び公表値が不足するため未掲載です。'

        },

        {

          name: '11. リハビリテーション科',

          desc: '労働集約型になりやすく、人員配置と稼働率のバランスが利益を大きく左右します。',

          metrics: [

            { label: '医業利益率', value: 3.2, unit: '%', type: 'percent' },

            { label: '人件費比率', value: 55, unit: '%', type: 'percent' },

            { label: '自己資本比率', value: 68, unit: '%', type: 'percent' }

          ],

          note: '委託費比率・材料費比率・1日あたり患者数・患者単価は、今回確認できる横並び公表値が不足するため未掲載です。'

        }

      ];


      const formatNumber = (num) => {

        const parts = num.toString().split('.');

        parts[0] = parts[0].replace(/\B(?=(\d{3})+(?!\d))/g, ',');

        return parts.join('.');

      };


      const calculateBarWidth = (val, type) => {

        let ratio = 0;

        switch (type) {

          case 'patient_unit':

            ratio = (val / 12000) * 100;

            break;

          case 'patients_day':

            ratio = val;

            break;

          default:

            ratio = val;

        }

        return Math.min(Math.max(ratio, 0), 100);

      };


      const getMetricTheme = (type) => {

        if (type === 'patient_unit') return 'theme-cost';

        if (type === 'patients_day') return 'theme-volume';

        return 'theme-finance';

      };


      const lineOaId = '@958kffrw';

      const params = new URLSearchParams(window.location.search);

      const consultMessage =

        params.get('from') === 'richmenu_avg'

          ? 'オンライン相談希望(平均指標ページ・リッチメニュー経由)'

          : 'オンライン相談希望(平均指標ページ)';

      const lineConsultUrl = `https://line.me/R/oaMessage/${encodeURIComponent(lineOaId)}/?${encodeURIComponent(consultMessage)}`;


      document.querySelectorAll('.line-consult-link').forEach((link) => {

        link.setAttribute('href', lineConsultUrl);

      });


      const container = document.getElementById('clinics-container');

      let htmlContent = '';


      clinics.forEach((clinic, index) => {

        let metricsHtml = '';

        clinic.metrics.forEach((m) => {

          const width = calculateBarWidth(m.value, m.type);

          const themeClass = getMetricTheme(m.type);

          metricsHtml += `

          <div class="metric ${themeClass}">

            <div class="metric-top">

              <span class="metric-label">${m.label}</span>

              <div class="metric-value-wrap">

                <span class="metric-value">${formatNumber(m.value)}</span>

                <span class="metric-unit">${m.unit}</span>

              </div>

            </div>

            <div class="metric-bar-bg">

              <div class="metric-bar-fill" style="width: ${width}%;"></div>

            </div>

          </div>

        `;

        });


        const noteHtml = clinic.note ? `<p class="card-note">※ ${clinic.note}</p>` : '';


        htmlContent += `

        <article class="card accent-${index % 3}">

          <h3 class="card-title">${clinic.name}</h3>

          <p class="card-desc">${clinic.desc}</p>

          <h4 class="card-subtitle">今回掲載している平均指標</h4>

          <div class="metrics">

            ${metricsHtml}

          </div>

          ${noteHtml}

        </article>

      `;

      });


      container.innerHTML = htmlContent;

    </script>

  </body>

</html>