{"id":77,"date":"2026-06-03T12:14:18","date_gmt":"2026-06-03T03:14:18","guid":{"rendered":"https:\/\/toirolifecare.com\/app\/?page_id=77"},"modified":"2026-06-03T16:12:16","modified_gmt":"2026-06-03T07:12:16","slug":"77-2","status":"publish","type":"page","link":"https:\/\/toirolifecare.com\/app\/77-2\/","title":{"rendered":"\u30bf\u30af\u30b7\u30fc\u6599\u91d1\u8a08\u7b97"},"content":{"rendered":"\n<meta charset=\"utf-8\">\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n  <meta name=\"theme-color\" content=\"#5d95e8\">\n  <title>\u4ecb\u8b77\u30bf\u30af\u30b7\u30fc\u6599\u91d1\u8a08\u7b97\u6a5f<\/title>\n  <style>\n    :root{\n      --bg1:#f4f8ff;\n      --bg2:#eaf2ff;\n      --card:#ffffff;\n      --line:#d8e5f7;\n      --line-strong:#c5d8f3;\n      --text:#1d2736;\n      --muted:#5f6f85;\n      --accent:#5d95e8;\n      --accent2:#7eb0f7;\n      --accent-soft:#eef5ff;\n      --danger:#d92d20;\n      --ok:#0f9d58;\n      --shadow:0 12px 30px rgba(42,91,163,.10);\n      --shadow-soft:0 6px 18px rgba(42,91,163,.08);\n      --radius:24px;\n      --fs-min:16px;\n    }\n\n    *{\n      box-sizing:border-box;\n      -webkit-tap-highlight-color:transparent;\n    }\n\n    html,body{\n      margin:0;\n      padding:0;\n    }\n\n    body{\n      font-family:-apple-system,BlinkMacSystemFont,\"Hiragino Sans\",\"Yu Gothic\",\"Noto Sans JP\",sans-serif;\n      background:linear-gradient(180deg,var(--bg1) 0%, var(--bg2) 100%);\n      color:var(--text);\n      font-size:var(--fs-min);\n      line-height:1.8;\n    }\n\n    .wrap{\n      max-width:780px;\n      margin:0 auto;\n      padding:16px 14px 34px;\n    }\n\n    .hero{\n      background:linear-gradient(135deg,var(--accent) 0%, var(--accent2) 100%);\n      color:#fff;\n      border-radius:30px;\n      padding:22px 20px 20px;\n      box-shadow:var(--shadow);\n      margin-bottom:16px;\n    }\n\n    .hero h1{\n      margin:0;\n      font-size:32px;\n      line-height:1.25;\n      letter-spacing:.02em;\n      font-weight:900;\n    }\n\n    .hero p{\n      margin:8px 0 0;\n      font-size:16px;\n      line-height:1.8;\n      opacity:.95;\n    }\n\n    .card{\n      background:var(--card);\n      border:1px solid var(--line);\n      border-radius:var(--radius);\n      padding:16px;\n      margin-bottom:16px;\n      box-shadow:var(--shadow);\n    }\n\n    .section-title{\n      margin:0 0 12px;\n      font-size:22px;\n      line-height:1.4;\n      color:#2f67b7;\n      font-weight:900;\n      letter-spacing:.01em;\n    }\n\n    .grid{\n      display:grid;\n      grid-template-columns:1fr 1fr;\n      gap:12px;\n    }\n\n    .grid > *{\n      min-width:0;\n    }\n\n    .row{\n      display:flex;\n      flex-direction:column;\n      gap:8px;\n      min-width:0;\n    }\n\n    label{\n      font-size:16px;\n      font-weight:800;\n      color:#35507a;\n      line-height:1.6;\n    }\n.checks{\n  display:flex;\n  flex-direction:column;\n  align-items:center;\n  gap:12px;\n  width:100%;\n}\n    select,input,button{\n      width:100%;\n      max-width:100%;\n      min-width:0;\n      font-size:16px;\n      line-height:1.4;\n      padding:15px 14px;\n      border:1px solid var(--line);\n      border-radius:16px;\n      background:#fff;\n      color:var(--text);\n      outline:none;\n      transition:border-color .18s ease, box-shadow .18s ease, transform .05s ease;\n    }\n\n    select,input{\n      box-shadow:inset 0 1px 0 rgba(255,255,255,.65);\n    }\n\n    input[type=\"time\"]{\n      min-width:0;\n      appearance:none;\n      -webkit-appearance:none;\n    }\n\n    select:focus,input:focus,button:focus{\n      border-color:#8ab3ef;\n      box-shadow:0 0 0 4px rgba(93,149,232,.14);\n    }\n\n.checks{\n  display:flex;\n  flex-direction:column;\n  align-items:center;\n  gap:12px;\n  width:100%;\n  margin-bottom:24px;\n}\n\n.check{\n  display:flex;\n  align-items:center;\n  justify-content:center;\n\n  gap:10px;\n  padding:14px 14px;\n\n  width:100%;\n  max-width:320px;\n\n  border:1px solid var(--line);\n  border-radius:16px;\n  background:#fff;\n  color:#304865;\n  font-size:16px;\n  font-weight:700;\n  line-height:1.5;\n  box-shadow:var(--shadow-soft);\n}\n\n    .check input{\n      width:auto;\n      margin:0;\n      transform:scale(1.15);\n      accent-color:var(--accent);\n      box-shadow:none;\n    }\n\n    .mini{\n      background:var(--accent-soft);\n      border:1px solid #d5e4fb;\n      border-radius:18px;\n      padding:14px 15px;\n      font-size:16px;\n      line-height:1.9;\n      color:#476487;\n    }\n\n    .result{\n      background:linear-gradient(180deg,#ffffff 0%, #f8fbff 100%);\n      border:1px solid #cfe0fb;\n    }\n\n    .summary{\n      font-size:16px;\n      line-height:1.9;\n      color:#35507a;\n      margin-bottom:10px;\n      padding:2px 2px 0;\n    }\n\n    .total-label{\n      font-size:16px;\n      font-weight:900;\n      color:#5f7391;\n      letter-spacing:.06em;\n      line-height:1.6;\n    }\n\n    .total{\n      font-size:44px;\n      font-weight:900;\n      margin:4px 0 12px;\n      line-height:1.1;\n      letter-spacing:.01em;\n      color:#163760;\n    }\n\n    .badges{\n      margin-bottom:12px;\n    }\n\n    .pill{\n      display:inline-flex;\n      align-items:center;\n      gap:6px;\n      margin:0 8px 8px 0;\n      padding:8px 12px;\n      background:#fff;\n      border:1px solid var(--line);\n      border-radius:999px;\n      font-size:16px;\n      font-weight:800;\n      line-height:1.4;\n      color:#4a6383;\n      box-shadow:var(--shadow-soft);\n    }\n\n    .formula{\n      background:#fff;\n      border:1px dashed #b8cceb;\n      border-radius:20px;\n      padding:16px;\n      white-space:pre-wrap;\n      line-height:2;\n      font-size:16px;\n      color:#24405f;\n    }\n\n    .actions{\n      display:grid;\n      grid-template-columns:1fr 1fr;\n      gap:10px;\n      margin-top:14px;\n    }\n\n    button{\n      border:none;\n      color:#fff;\n      font-weight:900;\n      box-shadow:0 10px 20px rgba(93,149,232,.20);\n      cursor:pointer;\n    }\n\n    button:active{\n      transform:translateY(1px);\n    }\n\n    .primary{\n      background:linear-gradient(135deg,#5d95e8 0%, #6da2ef 100%);\n    }\n\n    .secondary{\n      background:linear-gradient(135deg,#6f7e95 0%, #8796ad 100%);\n    }\n\n    .status{\n      margin-top:10px;\n      font-size:16px;\n      font-weight:800;\n      color:var(--ok);\n      min-height:1.5em;\n      line-height:1.6;\n    }\n\n    .error{\n      margin-top:10px;\n      font-size:16px;\n      font-weight:800;\n      color:var(--danger);\n      min-height:1.5em;\n      line-height:1.6;\n    }\n\n   @media (max-width:768px){\n\n  .grid,\n  .actions{\n    grid-template-columns:1fr;\n  }\n\n  .check{\n    max-width:none;\n  }\n\n  .wrap{\n    padding-left:12px;\n    padding-right:12px;\n  }\n\n  .hero{\n    border-radius:26px;\n    padding:20px 16px 18px;\n  }\n\n  .hero h1{\n    font-size:28px;\n  }\n\n  .section-title{\n    font-size:20px;\n  }\n\n  .total{\n    font-size:38px;\n  }\n}\n\n\n\n      .wrap{\n        padding-left:12px;\n        padding-right:12px;\n      }\n\n      .hero{\n        border-radius:26px;\n        padding:20px 16px 18px;\n      }\n\n      .hero h1{\n        font-size:28px;\n      }\n\n      .section-title{\n        font-size:20px;\n      }\n\n      .total{\n        font-size:38px;\n      }\n    }\n  <\/style>\n\n\n  <div class=\"wrap\">\n    <div class=\"hero\">\n      <h1>\u4ecb\u8b77\u30bf\u30af\u30b7\u30fc\u6599\u91d1\u8a08\u7b97\u6a5f<\/h1>\n      \n    <\/div>\n\n    <div class=\"card\">\n      <h2 class=\"section-title\">\u5165\u529b<\/h2>\n\n      <div class=\"grid\">\n        <div class=\"row\">\n          <label for=\"service\">\u30b5\u30fc\u30d3\u30b9<\/label>\n          <select id=\"service\">\n            <option value=\"nurse\">\u770b\u8b77\u5e2b\u4ed8\u304d\u6dfb\u3044<\/option>\n            <option value=\"helper\">\u30d8\u30eb\u30d1\u30fc\u540c\u4e57<\/option>\n            <option value=\"transfer\">\u79fb\u4e57\u30b5\u30dd\u30fc\u30c8<\/option>\n            <option value=\"life\">\u751f\u6d3b\u30b5\u30dd\u30fc\u30c8<\/option>\n          <\/select>\n        <\/div>\n\n        <div class=\"row\">\n          <label for=\"distance\">\u9577\u8ddd\u96e2\u52a0\u7b97<\/label>\n          <select id=\"distance\"><\/select>\n        <\/div>\n\n        <div class=\"row\">\n  <label>\u958b\u59cb\u6642\u523b<\/label>\n  <div style=\"display:flex; gap:8px;\">\n    <select id=\"startHour\"><\/select>\n    <select id=\"startMin\"><\/select>\n  <\/div>\n<\/div>\n\n<div class=\"row\">\n  <label>\u7d42\u4e86\u6642\u523b<\/label>\n  <div style=\"display:flex; gap:8px;\">\n    <select id=\"endHour\"><\/select>\n    <select id=\"endMin\"><\/select>\n  <\/div>\n<\/div>\n\n      <div class=\"row\" style=\"margin-top:12px;\">\n        <label>\u30aa\u30d7\u30b7\u30e7\u30f3<\/label>\n        <div class=\"checks\">\n          <label class=\"check\"><input id=\"holiday\" type=\"checkbox\"> \u65e5\u795d\u65e5<\/label>\n          <label class=\"check\"><input id=\"yearEnd\" type=\"checkbox\"> \u5e74\u672b\u5e74\u59cb<\/label>\n          <label class=\"check\"><input id=\"cancel\" type=\"checkbox\"> \u5f53\u65e5\u30ad\u30e3\u30f3\u30bb\u30eb<\/label>\n        <\/div>\n      <\/div>\n\n      \n    <\/div>\n\n    <div class=\"card result\">\n      <div class=\"summary\" id=\"summary\">\u3053\u3053\u306b\u8a08\u7b97\u6761\u4ef6\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/div>\n      <div class=\"total-label\">\u5408\u8a08\u91d1\u984d<\/div>\n      <div class=\"total\" id=\"total\">&#8211;<\/div>\n      <div class=\"badges\" id=\"badges\"><\/div>\n      <div class=\"formula\" id=\"formula\">\u3053\u3053\u306b\u8a08\u7b97\u5f0f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002<\/div>\n\n      <div class=\"actions\">\n        <button id=\"calcBtn\" class=\"primary\" type=\"button\">\u518d\u8a08\u7b97\u3059\u308b<\/button>\n        <button id=\"copyBtn\" class=\"secondary\" type=\"button\">\u8a08\u7b97\u5f0f\u3092\u30b3\u30d4\u30fc<\/button>\n      <\/div>\n\n<div class=\"mini\" style=\"margin-top:12px;\">\n        \u30fb\u7d42\u4e86\u304c\u958b\u59cb\u3088\u308a\u65e9\u3044\u5834\u5408\u306f\u7fcc\u65e5\u6271\u3044\u3067\u3059\u3002<br>\n        \u30fb\u8acb\u6c42\u6642\u9593\u306e\u7aef\u6570\u306f15\u5206\u5358\u4f4d\u3067\u56db\u6368\u4e94\u5165\u3057\u307e\u3059\u3002<br>\n        \u30fb\u591c\u9593\u306f18:00\u301c\u7fcc8:00\u306e\u8a72\u5f53\u5206\u306e\u307f20%\u5897\u3057\u3067\u3059\u3002<br>\n        \u30fb\u65e5\u795d\u65e5\u30fb\u5e74\u672b\u5e74\u59cb\u306e\u5272\u5897\u306f\u57fa\u672c\u6599\u91d1\u306b\u5bfe\u3057\u3066\u9069\u7528\u3057\u3001\u9577\u8ddd\u96e2\u52a0\u7b97\u306b\u306f\u9069\u7528\u3057\u307e\u305b\u3093\u3002<br>\n        \u30fb\u9577\u8ddd\u96e2\u52a0\u7b97\u306f31\u301c500km\u307e\u3067\u9078\u629e\u3067\u304d\u307e\u3059\u3002\n      <\/div>\n\n      <div class=\"status\" id=\"status\"><\/div>\n      <div class=\"error\" id=\"error\"><\/div>\n    <\/div>\n  <\/div>\n\n  <script>\n\n    function buildTimeParts() {\n  const startHour = document.getElementById('startHour');\n  const startMin = document.getElementById('startMin');\n  const endHour = document.getElementById('endHour');\n  const endMin = document.getElementById('endMin');\n\n  \/\/ \u6642\n  let hourOptions = '';\n  for (let h = 0; h < 24; h++) {\n    const hh = String(h).padStart(2, '0');\n    hourOptions += `<option value=\"${hh}\">${hh}\u6642<\/option>`;\n  }\n\n  \/\/ \u5206\uff085\u5206\u523b\u307f\uff09\n  let minOptions = '';\n  for (let m = 0; m < 60; m += 5) {\n    const mm = String(m).padStart(2, '0');\n    minOptions += `<option value=\"${mm}\">${mm}\u5206<\/option>`;\n  }\n\n  startHour.innerHTML = hourOptions;\n  endHour.innerHTML = hourOptions;\n  startMin.innerHTML = minOptions;\n  endMin.innerHTML = minOptions;\n\n  \/\/ \u521d\u671f\u5024\n  startHour.value = \"09\";\n  startMin.value = \"00\";\n  endHour.value = \"11\";\n  endMin.value = \"00\";\n}\n\nfunction getTime(hourId, minId) {\n  const h = document.getElementById(hourId).value;\n  const m = document.getElementById(minId).value;\n  return `${h}:${m}`;\n}\n    function yen(n) {\n      return Number(Math.round(n)).toLocaleString('ja-JP') + '\u5186';\n    }\n\n    function roundToNearest15(minutes) {\n      return Math.round(minutes \/ 15) * 15;\n    }\n\n    function ceilHalfHourUnits(minutes) {\n      return Math.ceil(minutes \/ 30);\n    }\n\n    function toMinutes(timeStr) {\n      const parts = timeStr.split(':').map(Number);\n      return parts[0] * 60 + parts[1];\n    }\n\n    function roundTo5Minutes(timeStr) {\n  const [h, m] = timeStr.split(':').map(Number);\n  const total = h * 60 + m;\n  const rounded = Math.round(total \/ 5) * 5;\n  const hh = String(Math.floor(rounded \/ 60)).padStart(2, '0');\n  const mm = String(rounded % 60).padStart(2, '0');\n  return `${hh}:${mm}`;\n}\n\n    function diffMinutes(startStr, endStr) {\n      const start = toMinutes(startStr);\n      let end = toMinutes(endStr);\n      if (end < start) end += 24 * 60;\n      return end - start;\n    }\n\n    function getNightMinutes(startStr, endStr) {\n      let start = toMinutes(startStr);\n      let end = toMinutes(endStr);\n\n      if (end < start) end += 24 * 60;\n\n      const nightRanges = [\n        [0, 480],\n        [1080, 1440],\n        [1440, 1920]\n      ];\n\n      let total = 0;\n\n      for (let i = 0; i < nightRanges.length; i++) {\n        const a = nightRanges[i][0];\n        const b = nightRanges[i][1];\n        total += Math.max(0, Math.min(end, b) - Math.max(start, a));\n      }\n\n      return total;\n    }\n\n    function serviceLabel(v) {\n      return {\n        nurse: '\u770b\u8b77\u5e2b\u4ed8\u304d\u6dfb\u3044',\n        helper: '\u30d8\u30eb\u30d1\u30fc\u540c\u4e57',\n        transfer: '\u79fb\u4e57\u30b5\u30dd\u30fc\u30c8',\n        life: '\u751f\u6d3b\u30b5\u30dd\u30fc\u30c8'\n      }[v] || v;\n    }\n\n    function getServiceRuleText(service) {\n      if (service === 'nurse') {\n        return '\u770b\u8b77\u5e2b\u4ed8\u304d\u6dfb\u3044\uff1a2\u6642\u9593\u307e\u306712,000\u5186\u3001\u4ee5\u964d30\u5206\u3054\u30683,000\u5186';\n      }\n      if (service === 'helper') {\n        return '\u30d8\u30eb\u30d1\u30fc\u540c\u4e57\uff1a2\u6642\u9593\u307e\u306710,000\u5186\u3001\u4ee5\u964d30\u5206\u3054\u30682,000\u5186';\n      }\n      if (service === 'transfer') {\n        return '\u79fb\u4e57\u30b5\u30dd\u30fc\u30c8\uff1a1\u56de5,000\u5186';\n      }\n      if (service === 'life') {\n        return '\u751f\u6d3b\u30b5\u30dd\u30fc\u30c8\uff1a\u6700\u521d\u306e1\u6642\u95936,000\u5186\u3001\u4ee5\u964d30\u5206\u3054\u30682,000\u5186';\n      }\n      return '';\n    }\n\n    function buildDistanceOptions() {\n      const select = document.getElementById('distance');\n      const options = [];\n\n      options.push({ label: '\u306a\u3057\uff0830km\u4ee5\u4e0b\uff09', fee: 0 });\n      options.push({ label: '31\u301c50km\uff082,000\u5186\uff09', fee: 2000 });\n      options.push({ label: '51\u301c100km\uff085,000\u5186\uff09', fee: 5000 });\n\n      for (let start = 101; start <= 500; start += 50) {\n        const end = Math.min(start + 49, 500);\n        const extraBlocks = Math.ceil((start - 100) \/ 50);\n        const fee = 5000 + extraBlocks * 2500;\n        options.push({\n          label: start + '\u301c' + end + 'km\uff08' + fee.toLocaleString('ja-JP') + '\u5186\uff09',\n          fee: fee\n        });\n      }\n\n      select.innerHTML = options.map(function(opt) {\n        return '<option value=\"' + opt.fee + '\">' + opt.label + '<\/option>';\n      }).join('');\n    }\n\n    function copyTextFallback(text) {\n      const ta = document.createElement('textarea');\n      ta.value = text;\n      ta.setAttribute('readonly', '');\n      ta.style.position = 'fixed';\n      ta.style.top = '-9999px';\n      document.body.appendChild(ta);\n      ta.focus();\n      ta.select();\n      document.execCommand('copy');\n      document.body.removeChild(ta);\n    }\n\n    function calcCancel(service) {\n      const cancelFees = {\n        nurse: 6000,\n        helper: 5000,\n        transfer: 5000,\n        life: 4000\n      };\n      const total = cancelFees[service] || 0;\n      const lines = [\n        '\u30101. \u5f53\u65e5\u30ad\u30e3\u30f3\u30bb\u30eb\u6599\u3011',\n        serviceLabel(service) + '\uff1a' + yen(total),\n        '',\n        '\u30102. \u5408\u8a08\u3011',\n        yen(total)\n      ];\n\n      return {\n        total: total,\n        baseFee: total,\n        surcharge: 0,\n        calcHours: 0,\n        formula: lines.join('\\n')\n      };\n    }\n\n    function calcNurse(dayMinutes, nightMinutes) {\n      const dayFee = dayMinutes <= 0 ? 0 : (dayMinutes <= 120 ? 12000 : 12000 + ceilHalfHourUnits(dayMinutes - 120) * 3000);\n      const nightFee = nightMinutes <= 0 ? 0 : (nightMinutes <= 120 ? 12000 : 12000 + ceilHalfHourUnits(nightMinutes - 120) * 3000);\n      const nightPremium = Math.round(nightFee * 0.2);\n\n      const lines = [\n        '\u30103. \u57fa\u672c\u6599\u91d1\u3011',\n        '\u901a\u5e38\u6642\u9593\u6599\u91d1\uff1a' + dayMinutes + '\u5206 = ' + yen(dayFee),\n        '\u591c\u9593\u6642\u9593\u6599\u91d1\uff1a' + nightMinutes + '\u5206 = ' + yen(nightFee),\n        '\u591c\u9593\u5272\u5897\uff1a' + yen(nightFee) + ' \u00d7 20% = ' + yen(nightPremium)\n      ];\n\n      return {\n        baseFee: dayFee + nightFee,\n        nightPremium: nightPremium,\n        lines: lines\n      };\n    }\n\n    function calcHelper(dayMinutes, nightMinutes) {\n      const dayFee = dayMinutes <= 0 ? 0 : (dayMinutes <= 120 ? 10000 : 10000 + ceilHalfHourUnits(dayMinutes - 120) * 2000);\n      const nightFee = nightMinutes <= 0 ? 0 : (nightMinutes <= 120 ? 10000 : 10000 + ceilHalfHourUnits(nightMinutes - 120) * 2000);\n      const nightPremium = Math.round(nightFee * 0.2);\n\n      const lines = [\n        '\u30103. \u57fa\u672c\u6599\u91d1\u3011',\n        '\u901a\u5e38\u6642\u9593\u6599\u91d1\uff1a' + dayMinutes + '\u5206 = ' + yen(dayFee),\n        '\u591c\u9593\u6642\u9593\u6599\u91d1\uff1a' + nightMinutes + '\u5206 = ' + yen(nightFee),\n        '\u591c\u9593\u5272\u5897\uff1a' + yen(nightFee) + ' \u00d7 20% = ' + yen(nightPremium)\n      ];\n\n      return {\n        baseFee: dayFee + nightFee,\n        nightPremium: nightPremium,\n        lines: lines\n      };\n    }\n\n    function calcTransfer(dayMinutes, nightMinutes) {\n      const totalMinutes = dayMinutes + nightMinutes;\n      const baseFee = totalMinutes > 0 ? 5000 : 0;\n      const nightRatio = totalMinutes > 0 ? nightMinutes \/ totalMinutes : 0;\n      const nightPremium = Math.round(baseFee * nightRatio * 0.2);\n\n      const lines = [\n        '\u30103. \u57fa\u672c\u6599\u91d1\u3011',\n        '\u79fb\u4e57\u30b5\u30dd\u30fc\u30c8\u57fa\u672c\u6599\u91d1\uff1a' + yen(baseFee),\n        '\u591c\u9593\u5272\u5408\uff1a' + nightMinutes + '\u5206 \/ ' + totalMinutes + '\u5206 = ' + nightRatio.toFixed(4),\n        '\u591c\u9593\u5272\u5897\uff1a' + yen(baseFee) + ' \u00d7 ' + nightRatio.toFixed(4) + ' \u00d7 20% = ' + yen(nightPremium)\n      ];\n\n      return {\n        baseFee: baseFee,\n        nightPremium: nightPremium,\n        lines: lines\n      };\n    }\n\n    function calcLife(dayMinutes, nightMinutes) {\n      const totalMinutes = dayMinutes + nightMinutes;\n      let baseFee = 0;\n\n      if (totalMinutes > 0) {\n        if (totalMinutes <= 60) {\n          baseFee = 6000;\n        } else {\n          baseFee = 6000 + ceilHalfHourUnits(totalMinutes - 60) * 2000;\n        }\n      }\n\n      const nightRatio = totalMinutes > 0 ? nightMinutes \/ totalMinutes : 0;\n      const nightPremium = Math.round(baseFee * nightRatio * 0.2);\n\n      const lines = [\n        '\u30103. \u57fa\u672c\u6599\u91d1\u3011',\n        '\u751f\u6d3b\u30b5\u30dd\u30fc\u30c8\u57fa\u672c\u6599\u91d1\uff1a' + totalMinutes + '\u5206 = ' + yen(baseFee),\n        '\u591c\u9593\u5272\u5408\uff1a' + nightMinutes + '\u5206 \/ ' + totalMinutes + '\u5206 = ' + nightRatio.toFixed(4),\n        '\u591c\u9593\u5272\u5897\uff1a' + yen(baseFee) + ' \u00d7 ' + nightRatio.toFixed(4) + ' \u00d7 20% = ' + yen(nightPremium)\n      ];\n\n      return {\n        baseFee: baseFee,\n        nightPremium: nightPremium,\n        lines: lines\n      };\n    }\n\n    function calcByService(service, dayMinutes, nightMinutes) {\n      if (service === 'nurse') return calcNurse(dayMinutes, nightMinutes);\n      if (service === 'helper') return calcHelper(dayMinutes, nightMinutes);\n      if (service === 'transfer') return calcTransfer(dayMinutes, nightMinutes);\n      if (service === 'life') return calcLife(dayMinutes, nightMinutes);\n      throw new Error('\u30b5\u30fc\u30d3\u30b9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\n    }\n\n\n\n    function calculate(params) {\n      const service = params.service;\n      const start = params.start;\n      const end = params.end;\n      const holiday = params.holiday;\n      const yearEnd = params.yearEnd;\n      const cancel = params.cancel;\n      const distanceFee = params.distanceFee;\n\n      const rawMinutes = diffMinutes(start, end);\n      if (rawMinutes <= 0) {\n        throw new Error('\u958b\u59cb\u6642\u523b\u3068\u7d42\u4e86\u6642\u523b\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\n      }\n\n      const billedMinutes = roundToNearest15(rawMinutes);\n      const nightMinutesRaw = getNightMinutes(start, end);\n      const nightMinutes = Math.min(nightMinutesRaw, billedMinutes);\n      const dayMinutes = Math.max(0, billedMinutes - nightMinutes);\n      const calcHours = billedMinutes \/ 60;\n\n      if (cancel) {\n        return {\n          total: calcCancel(service).total,\n          calcHours: 0,\n          night: false,\n          nightMinutes: 0,\n          dayMinutes: 0,\n          billedMinutes: 0,\n          surcharge: 0,\n          formula: calcCancel(service).formula\n        };\n      }\n\n      const lines = [];\n      const detail = calcByService(service, dayMinutes, nightMinutes);\n\n      let holidayPremium = 0;\n      let yearEndPremium = 0;\n\n      if (holiday) {\n        holidayPremium = Math.round(detail.baseFee * 0.2);\n      }\n\n      if (yearEnd) {\n        yearEndPremium = Math.round(detail.baseFee * 0.2);\n      }\n\n      const total = detail.baseFee + detail.nightPremium + holidayPremium + yearEndPremium + distanceFee;\n\n      lines.push('\u30101. \u6642\u9593\u5185\u8a33\u3011');\n      lines.push('\u8acb\u6c42\u6642\u9593\uff1a' + billedMinutes + '\u5206\uff08' + calcHours + '\u6642\u9593\uff09');\n      lines.push('\u901a\u5e38\u6642\u9593\uff1a' + dayMinutes + '\u5206\uff08' + (dayMinutes \/ 60) + '\u6642\u9593\uff09');\n      lines.push('\u591c\u9593\u6642\u9593\uff1a' + nightMinutes + '\u5206\uff08' + (nightMinutes \/ 60) + '\u6642\u9593\uff09');\n\n      lines.push('');\n      lines.push('\u30102. \u6599\u91d1\u30eb\u30fc\u30eb\u3011');\n      lines.push(getServiceRuleText(service));\n\n      lines.push('');\n      detail.lines.forEach(function(line) {\n        lines.push(line);\n      });\n\n      if (holiday) {\n        lines.push('\u65e5\u795d\u65e5\u5272\u5897\uff1a' + yen(detail.baseFee) + ' \u00d7 20% = ' + yen(holidayPremium));\n      }\n\n      if (yearEnd) {\n        lines.push('\u5e74\u672b\u5e74\u59cb\u5272\u5897\uff1a' + yen(detail.baseFee) + ' \u00d7 20% = ' + yen(yearEndPremium));\n      }\n\n      lines.push('');\n      lines.push('\u30104. \u305d\u306e\u4ed6\u3011');\n      lines.push(distanceFee > 0 ? '\u9577\u8ddd\u96e2\u52a0\u7b97\uff1a' + yen(distanceFee) : '\u9577\u8ddd\u96e2\u52a0\u7b97\uff1a\u306a\u3057');\n\n      lines.push('');\n      lines.push('\u30105. \u5408\u8a08\u3011');\n      const parts = [yen(detail.baseFee)];\n      if (detail.nightPremium > 0) parts.push(yen(detail.nightPremium));\n      if (holidayPremium > 0) parts.push(yen(holidayPremium));\n      if (yearEndPremium > 0) parts.push(yen(yearEndPremium));\n      if (distanceFee > 0) parts.push(yen(distanceFee));\n      lines.push(parts.join(' + ') + ' = ' + yen(total));\n\n      return {\n        total: total,\n        calcHours: calcHours,\n        night: nightMinutes > 0,\n        nightMinutes: nightMinutes,\n        dayMinutes: dayMinutes,\n        billedMinutes: billedMinutes,\n        surcharge: detail.nightPremium + holidayPremium + yearEndPremium,\n        formula: lines.join('\\n')\n      };\n    }\n\nfunction buildTimeOptions() {\n  const start = document.getElementById('start');\n  const end = document.getElementById('end');\n\n  const options = [];\n\n  for (let h = 0; h < 24; h++) {\n    for (let m = 0; m < 60; m += 5) {\n      const hh = String(h).padStart(2, '0');\n      const mm = String(m).padStart(2, '0');\n      const time = `${hh}:${mm}`;\n      options.push(`<option value=\"${time}\">${time}<\/option>`);\n    }\n  }\n\n  start.innerHTML = options.join('');\n  end.innerHTML = options.join('');\n\n  \/\/ \u521d\u671f\u5024\n  start.value = \"09:00\";\n  end.value = \"11:00\";\n}\n    function update() {\n      const statusEl = document.getElementById('status');\n      const errorEl = document.getElementById('error');\n      statusEl.textContent = '';\n      errorEl.textContent = '';\n\n      try {\n        const service = document.getElementById('service').value;\n\nconst start = getTime('startHour', 'startMin');\nconst end = getTime('endHour', 'endMin');\n\nconst holiday = document.getElementById('holiday').checked;\n        const yearEnd = document.getElementById('yearEnd').checked;\n        const cancel = document.getElementById('cancel').checked;\n        const distanceFee = Number(document.getElementById('distance').value || 0);\n\n        if (!start || !end) {\n          throw new Error('\u958b\u59cb\u6642\u523b\u3068\u7d42\u4e86\u6642\u523b\u3092\u5165\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002');\n        }\n\n        const r = calculate({\n          service: service,\n          start: start,\n          end: end,\n          holiday: holiday,\n          yearEnd: yearEnd,\n          cancel: cancel,\n          distanceFee: distanceFee\n        });\n\n        let summaryText =\n          '<strong>' + serviceLabel(service) + '<\/strong><br>' +\n          '\u958b\u59cb ' + start + ' \uff0f \u7d42\u4e86 ' + end;\n\n        if (!cancel) {\n          summaryText += ' \uff0f \u8acb\u6c42\u6642\u9593 ' + r.calcHours + '\u6642\u9593';\n        }\n\n        if (!cancel && r.night) {\n          summaryText += ' \uff0f \u591c\u9593 ' + (r.nightMinutes \/ 60) + '\u6642\u9593';\n        }\n\n        document.getElementById('summary').innerHTML = summaryText;\n        document.getElementById('total').textContent = yen(r.total);\n\n        const badges = [];\n        if (r.night) badges.push('<span class=\"pill\">\u591c\u9593\u6642\u9593\u306e\u307f20%\u5897<\/span>');\n        if (holiday) badges.push('<span class=\"pill\">\u65e5\u795d\u65e5<\/span>');\n        if (yearEnd) badges.push('<span class=\"pill\">\u5e74\u672b\u5e74\u59cb<\/span>');\n        if (cancel) badges.push('<span class=\"pill\">\u5f53\u65e5\u30ad\u30e3\u30f3\u30bb\u30eb<\/span>');\n        if (distanceFee > 0) badges.push('<span class=\"pill\">\u9577\u8ddd\u96e2\u52a0\u7b97\u3042\u308a<\/span>');\n        document.getElementById('badges').innerHTML = badges.join('');\n\n        document.getElementById('formula').textContent = r.formula;\n        window.latestFormula = r.formula;\n        statusEl.textContent = '\u8a08\u7b97\u3057\u307e\u3057\u305f';\n      } catch (e) {\n        document.getElementById('summary').textContent = '\u5165\u529b\u5185\u5bb9\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002';\n        document.getElementById('total').textContent = '-';\n        document.getElementById('badges').innerHTML = '';\n        document.getElementById('formula').textContent = '\u3053\u3053\u306b\u8a08\u7b97\u5f0f\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002';\n        errorEl.textContent = e.message || '\u8a08\u7b97\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002';\n      }\n    }\n\n    async function copyFormula() {\n      const text = window.latestFormula || document.getElementById('formula').textContent || '';\n      const statusEl = document.getElementById('status');\n      const errorEl = document.getElementById('error');\n      statusEl.textContent = '';\n      errorEl.textContent = '';\n\n      try {\n        if (navigator.clipboard && window.isSecureContext) {\n          await navigator.clipboard.writeText(text);\n        } else {\n          copyTextFallback(text);\n        }\n        statusEl.textContent = '\u8a08\u7b97\u5f0f\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f';\n      } catch (e) {\n        try {\n          copyTextFallback(text);\n          statusEl.textContent = '\u8a08\u7b97\u5f0f\u3092\u30b3\u30d4\u30fc\u3057\u307e\u3057\u305f';\n        } catch (err) {\n          errorEl.textContent = '\u30b3\u30d4\u30fc\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002';\n        }\n      }\n    }\n\n    function bindEvents() {\n     ['service','distance','startHour','startMin','endHour','endMin','holiday','yearEnd','cancel'].forEach(function(id) {\n        const el = document.getElementById(id);\n        el.addEventListener('change', update);\n        el.addEventListener('input', update);\n      });\n\n      document.getElementById('calcBtn').addEventListener('click', update);\n      document.getElementById('copyBtn').addEventListener('click', copyFormula);\n    }\n\n    document.addEventListener('DOMContentLoaded', function() {\n  buildDistanceOptions();\n  buildTimeParts(); \/\/ \u2190\u5909\u66f4\n  bindEvents();\n  update();\n});\n  <\/script>\n\n<\/div>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ecb\u8b77\u30bf\u30af\u30b7\u30fc\u6599\u91d1\u8a08\u7b97\u6a5f \u4ecb\u8b77\u30bf\u30af\u30b7\u30fc\u6599\u91d1\u8a08\u7b97\u6a5f \u5165\u529b \u30b5\u30fc\u30d3\u30b9 \u770b\u8b77\u5e2b\u4ed8\u304d\u6dfb\u3044\u30d8\u30eb\u30d1\u30fc\u540c\u4e57\u79fb\u4e57\u30b5\u30dd\u30fc\u30c8\u751f\u6d3b\u30b5\u30dd\u30fc\u30c8 \u9577\u8ddd\u96e2\u52a0\u7b97 \u958b\u59cb\u6642\u523b \u7d42\u4e86\u6642\u523b \u30aa\u30d7\u30b7\u30e7\u30f3 \u65e5\u795d\u65e5 \u5e74\u672b\u5e74\u59cb \u5f53\u65e5\u30ad\u30e3\u30f3\u30bb\u30eb \u3053\u3053\u306b\u8a08\u7b97\u6761\u4ef6\u304c\u8868\u793a\u3055\u308c\u307e&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_kad_post_transparent":"default","_kad_post_title":"hide","_kad_post_layout":"fullwidth","_kad_post_sidebar_id":"","_kad_post_content_style":"unboxed","_kad_post_vertical_padding":"hide","_kad_post_feature":"hide","_kad_post_feature_position":"","_kad_post_header":true,"_kad_post_footer":true,"_kad_post_classname":"","footnotes":""},"class_list":["post-77","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/77","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/comments?post=77"}],"version-history":[{"count":8,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/77\/revisions"}],"predecessor-version":[{"id":99,"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/pages\/77\/revisions\/99"}],"wp:attachment":[{"href":"https:\/\/toirolifecare.com\/app\/wp-json\/wp\/v2\/media?parent=77"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}