/* 對象頁通用渲染器（2026-12-03 UX 第二階段）：只用設計系統的 CSS 變數（athena.css :root），平台內頁與公開藥品頁共用 */
.rxo{--rxo-gap:14px;color:var(--ink,#16233a);font-size:15px;line-height:1.6;min-width:0}
.rxo *{box-sizing:border-box}
.rxo .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* 標題區 */
.rxo-head{margin:0 0 16px}
.rxo-title{font-size:var(--fs-2xl,28px);line-height:1.25;margin:0 0 6px;color:var(--navy-deep,#0f2942)}
.rxo-subt{margin:0;color:var(--mut,#566378);font-size:var(--fs-sm,13px)}
.rxo-pub{margin:6px 0 0;font-size:var(--fs-sm,13px)}
.rxo-a{color:var(--navy,#1e3a5f);text-decoration:underline;text-underline-offset:2px;display:inline-block;min-height:24px;padding:2px 0}
.rxo-a:hover{color:var(--gold-deep,#7a5c26)}
.rxo-phead{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:0 0 10px}
.rxo-ptitle{font-size:var(--fs-lg,19px);margin:0;color:var(--navy-deep,#0f2942)}
.rxo-public{margin:22px 0 26px;padding:16px;border:1px solid var(--line,#dfe5ed);border-radius:var(--r-lg,16px);background:var(--navy-soft,#eef2f8)}

/* 重點卡：桌機換行、手機橫捲 */
.rxo-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:10px;margin:0 0 14px;padding:0;list-style:none}
.rxo-cardw{min-width:0;display:flex}
.rxo-card{all:unset;box-sizing:border-box;flex:1;display:flex;flex-direction:column;gap:2px;min-height:86px;padding:12px 14px;border-radius:var(--r-md,12px);
  background:var(--card,#fff);border:1px solid var(--line,#dfe5ed);border-left:4px solid var(--line,#dfe5ed);box-shadow:var(--sh-xs);cursor:pointer;text-align:left;font:inherit;color:inherit}
.rxo-card.is-static{cursor:default}
.rxo-card:not(.is-static):hover{box-shadow:var(--sh-sm);border-color:var(--navy,#1e3a5f)}
.rxo-card:focus-visible{outline:none;box-shadow:var(--ring)}
.rxo-cl{font-size:12.5px;color:var(--mut,#566378);font-weight:600}
.rxo-cv{font-size:19px;font-weight:800;color:var(--navy-deep,#0f2942);line-height:1.25;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.rxo-cn{font-size:12.5px;color:var(--ink-2,#3b4a61)}
.rxo-card.t-ok{border-left-color:var(--ok,#17693f)}
.rxo-card.t-warn{border-left-color:#d08a2c}
.rxo-card.t-bad{border-left-color:var(--bad,#a51b1b)}
.rxo-card.t-info{border-left-color:var(--navy,#1e3a5f)}
.rxo-card.t-lock{border-left-color:var(--gold,#c8a35b);background:var(--gold-soft,#f7f1e3)}
.rxo-card.t-warn .rxo-cn{color:var(--warn,#9a4a07)}
.rxo-card.t-bad .rxo-cn{color:var(--bad,#a51b1b)}
@media (max-width:640px){
  .rxo-cards{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;padding-bottom:6px}
  .rxo-cardw{flex:0 0 46%;scroll-snap-align:start}
}

/* 動作列 */
.rxo-acts{display:flex;flex-wrap:wrap;gap:10px 12px;align-items:flex-start;margin:0 0 18px}
.rxo-act{position:relative;display:flex;flex-direction:column;gap:3px;min-width:0}
.rxo-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:38px;padding:7px 15px;border-radius:10px;font:inherit;font-size:14px;font-weight:700;
  cursor:pointer;text-decoration:none;border:1px solid transparent;line-height:1.3}
.rxo-btn-pri{background:var(--navy,#1e3a5f);color:#fff}
.rxo-btn-pri:hover{background:var(--navy-deep,#0f2942);color:#fff}
.rxo-btn-ghost{background:var(--card,#fff);color:var(--navy,#1e3a5f);border-color:var(--line,#dfe5ed)}
.rxo-btn-ghost:hover{border-color:var(--navy,#1e3a5f)}
.rxo-btn:focus-visible{outline:none;box-shadow:var(--ring)}
.rxo-btn[disabled]{opacity:.6;cursor:default}
.rxo-qn{font-size:12px;color:var(--mut,#566378);max-width:220px}
.rxo-ind{position:absolute;z-index:40;top:calc(100% + 6px);left:0;width:min(360px,calc(100vw - 32px));max-height:70vh;overflow:auto;padding:14px;
  background:var(--card,#fff);border:1px solid var(--line,#dfe5ed);border-radius:var(--r-md,12px);box-shadow:var(--sh-lg)}
.rxo-ind[hidden]{display:none}
.rxo-ind-h{margin:0 0 8px;font-weight:700}
.rxo-ind-fs,.rxo-cmp-fs{border:0;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}
.rxo-chk{display:flex;align-items:flex-start;gap:8px;min-height:32px;padding:4px 6px;border-radius:8px;cursor:pointer;font-size:14px}
.rxo-chk:hover{background:var(--navy-soft,#eef2f8)}
.rxo-chk input{margin:2px 0 0;width:20px;height:20px;flex:0 0 auto;accent-color:var(--navy,#1e3a5f)}
.rxo-in{width:100%;min-height:38px;padding:7px 10px;border:1px solid var(--line,#dfe5ed);border-radius:8px;font:inherit;font-size:14px;margin:4px 0 0}
.rxo-in:focus{outline:none;box-shadow:var(--ring);border-color:var(--gold,#c8a35b)}
.rxo-ind-act,.rxo-cmp-act{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 4px}
@media (max-width:640px){
  .rxo-acts{display:grid;grid-template-columns:1fr 1fr;gap:10px}
  .rxo-act .rxo-btn{width:100%}
  .rxo-ind{position:fixed;left:16px;right:16px;top:auto;bottom:16px;width:auto;max-height:75vh}
}

/* 段落 */
.rxo-secs{display:flex;flex-direction:column;gap:12px}
.rxo-sec{background:var(--card,#fff);border:1px solid var(--line,#dfe5ed);border-radius:var(--r-lg,16px);box-shadow:var(--sh-xs);scroll-margin-top:72px}
.rxo-sum{list-style:none;cursor:pointer;display:flex;flex-direction:column;gap:2px;padding:14px 46px 14px 18px;position:relative;min-height:48px;border-radius:var(--r-lg,16px)}
.rxo-sum::-webkit-details-marker{display:none}
.rxo-sum::after{content:"";position:absolute;right:18px;top:20px;width:9px;height:9px;border-right:2px solid var(--navy,#1e3a5f);border-bottom:2px solid var(--navy,#1e3a5f);transform:rotate(45deg);transition:transform .15s}
.rxo-sec[open]>.rxo-sum::after{transform:rotate(-135deg);top:24px}
.rxo-sum:focus-visible{outline:none;box-shadow:var(--ring)}
.rxo-stitle{font-size:var(--fs-lg,19px);font-weight:800;color:var(--navy-deep,#0f2942);line-height:1.3}
.rxo-public .rxo-stitle{font-size:var(--fs-md,16px)}
.rxo-ssum{font-size:var(--fs-sm,13px);color:var(--mut,#566378)}
.rxo-sbody{padding:0 18px 16px;border-top:1px solid var(--line-soft,#eaeef4)}
.rxo-b{margin:14px 0 0;min-width:0}
.rxo-bt{font-size:15px;margin:0 0 6px;color:var(--ink,#16233a)}
.rxo-sub{font-size:12.5px;color:var(--mut,#566378);margin:0 0 8px}
.rxo-kv{display:grid;grid-template-columns:minmax(120px,32%) 1fr;gap:6px 14px;margin:0}
.rxo-kv dt{color:var(--mut,#566378);font-size:13.5px}
.rxo-kv dd{margin:0;font-weight:600;overflow-wrap:anywhere;font-variant-numeric:tabular-nums}
.rxo-tw{overflow-x:auto;max-width:100%;border:1px solid var(--line-soft,#eaeef4);border-radius:10px}
.rxo-tw:focus-visible{outline:none;box-shadow:var(--ring)}
.rxo-t{border-collapse:collapse;width:100%;font-size:13.5px}
.rxo-t th,.rxo-t td{padding:8px 10px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line-soft,#eaeef4)}
.rxo-t thead th{background:var(--bg,#f4f6f9);color:var(--ink-2,#3b4a61);font-weight:700;font-size:12.5px;white-space:nowrap}
.rxo-t tbody tr:last-child td{border-bottom:0}
.rxo-t td{font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.rxo-expand{margin:8px 0 0}
.rxo-list{margin:0;padding:0;list-style:none;display:flex;flex-direction:column;gap:2px}
.rxo-list li{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;padding:3px 0;border-bottom:1px dashed var(--line-soft,#eaeef4)}
.rxo-tag{font-size:12px;padding:1px 8px;border-radius:999px;background:var(--navy-soft,#eef2f8);color:var(--ink-2,#3b4a61)}
.rxo-note{font-size:12.5px;color:var(--mut,#566378);margin:10px 0 0}
.rxo-more{margin:8px 0 0;font-size:14px}
.rxo-secmore{margin-top:14px;padding-top:10px;border-top:1px solid var(--line-soft,#eaeef4);font-weight:600}
.rxo-err{color:var(--bad,#a51b1b);font-size:14px;margin:10px 0 0;display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.rxo-err[hidden],.rxo [hidden]{display:none}
.rxo-lock{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:14px 0 0;padding:10px 12px;border-radius:10px;
  background:var(--gold-soft,#f7f1e3);border:1px dashed var(--gold,#c8a35b);font-size:13.5px}
.rxo-lock-t{flex:1 1 220px;color:var(--ink-2,#3b4a61)}
.rxo-lock-a{font-weight:700;white-space:nowrap}
.rxo-lock-ic{width:14px;height:14px;flex:0 0 auto;border:2px solid var(--gold-deep,#7a5c26);border-radius:3px;position:relative;margin-top:4px}
.rxo-lock-ic::before{content:"";position:absolute;left:1px;top:-8px;width:6px;height:6px;border:2px solid var(--gold-deep,#7a5c26);border-bottom:0;border-radius:5px 5px 0 0}

/* 比較 */
.rxo-cmp-fs{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:2px 10px}
.rxo-cmp-out{margin:6px 0 0}
.rxo-cmp-t th[scope=row]{background:var(--bg,#f4f6f9);font-weight:600;color:var(--ink-2,#3b4a61);white-space:nowrap;position:sticky;left:0;z-index:1}
.rxo-cmp-t thead th{white-space:normal;min-width:140px}
.rxo-cmp-t thead th:first-child{min-width:0;position:sticky;left:0;z-index:2}

/* 手機：資料表轉卡片 */
@media (max-width:640px){
  .rxo-kv{grid-template-columns:1fr;gap:0}
  .rxo-kv dt{margin-top:6px}
  .rxo-tw:not(.rxo-cmp-tw){border:0;overflow:visible}
  .rxo-tw:not(.rxo-cmp-tw) .rxo-t thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0)}
  .rxo-tw:not(.rxo-cmp-tw) .rxo-t tr{display:block;border:1px solid var(--line-soft,#eaeef4);border-radius:10px;padding:6px 10px;margin:0 0 8px}
  .rxo-tw:not(.rxo-cmp-tw) .rxo-t td{display:grid;grid-template-columns:42% 1fr;gap:8px;padding:3px 0;border:0}
  .rxo-tw:not(.rxo-cmp-tw) .rxo-t td::before{content:attr(data-th);color:var(--mut,#566378);font-size:12.5px}
  .rxo-sum{padding:12px 42px 12px 14px}
  .rxo-sbody{padding:0 14px 14px}
  .rxo-title{font-size:24px}
  .rxo-public{padding:12px}
  .rxo-cmp-t thead th{min-width:108px}
  .rxo-cmp-t th[scope=row]{white-space:normal;min-width:92px;max-width:110px}
}

/* 骨架（固定高度，避免版面跳動） */
.rxo-loading{min-height:420px}
.rxo-sk,.rxo-sk-card{background:linear-gradient(90deg,var(--line-soft,#eaeef4) 25%,#f6f8fb 50%,var(--line-soft,#eaeef4) 75%);background-size:200% 100%;animation:rxo-sh 1.2s infinite linear;border-radius:12px}
.rxo-sk{height:64px;margin:0 0 12px}
.rxo-sk-card{min-height:86px;border:0;cursor:default}
@keyframes rxo-sh{0%{background-position:200% 0}100%{background-position:-200% 0}}
@media (prefers-reduced-motion:reduce){.rxo-sk,.rxo-sk-card{animation:none}.rxo-sum::after{transition:none}}

/* 未登入預覽（公開藥品頁） */
.rxo-preview{margin:18px 0 22px}
.rxo-pv{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;padding:12px 14px;border-radius:12px;background:var(--gold-soft,#f7f1e3);border:1px solid #ecd9ac;font-size:14px}
.rxo-pv-t{flex:1 1 260px;color:var(--ink-2,#3b4a61)}
.rxo-pv-t b{color:var(--navy-deep,#0f2942)}

/* 12-03 QA：次數說明一行、日期欄不換行、公開藥品頁上下兩塊 */
.rxo-actw{margin:0 0 16px}
.rxo-actw .rxo-acts{margin:0}
.rxo-qline{margin:8px 0 0;font-size:12.5px;color:var(--mut,#566378)}
@media (min-width:641px){.rxo-t td.rxo-nw{white-space:nowrap}}
.rxo-public.rxo-top{margin:14px 0 18px}
.rxo-public.rxo-secbox{margin:22px 0 26px}
.rxo-top.rxo-loading{min-height:230px}
.rxo-top .rxo-sk{display:none}
@media (max-width:640px){.rxo-kv.rxo-kv-c{grid-template-columns:4.2em 1fr;gap:4px 10px}.rxo-kv.rxo-kv-c dt{margin-top:0}}
