/* =========================================================
   SK-160 Dose Guidance (唯一合併版 CSS / 去重後)
   - 統一容器寬度、字體、卡片風格
   - 表格 + 試算器視覺同一套
   - 移除 vw 字級，改用 clamp 避免破版
   ========================================================= */

/* -----------------------------
   Tokens / Base
----------------------------- */
:root {
    --dose-max: 1100px;
    --dose-radius: 16px;
    --dose-pad: 2rem;

    --bg-soft: #fafafa;
    --card: #fff;
    --text: #111;
    --muted: rgba(0, 0, 0, .72);
    --line: rgba(0, 0, 0, .08);

    --accent: #007aff;
    /* 試算器藍 */
    --green: #2e7d32;
    /* 日常維持綠 */
    --amber: #ffb300;

    --shadow: 0 10px 28px rgba(0, 0, 0, .08);

    --fs-base: 18px;
}

html {
    box-sizing: border-box;
}

*,
*:before,
*:after {
    box-sizing: inherit;
}

body {
    font-size: var(--fs-base);
    color: var(--text);
}

/* -----------------------------
   Container + Typography
----------------------------- */
.dose-guidance {
    width:80vw;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
}

.dose-reference {
    display: flex;
    flex-direction: column;
    gap: .8rem;
}

.dose-guidance h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.2rem);
    font-weight: 900;
    letter-spacing: .4px;
    margin: 0;
}

.dose-guidance h3 {
    font-size: clamp(1.2rem, 1.5vw, 1.5rem);
    font-weight: 900;
    margin: 0;
}

.dose-guidance h4 {
    font-size: clamp(1.05rem, 1.2vw, 1.2rem);
    font-weight: 900;
    margin: 0;
}

.section-intro,
.table-note,
.ref {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--muted);
    margin: 0;
}

.section-intro b,
.table-note b {
    color: var(--text);
    font-weight: 900;
}

/* -----------------------------
   Shared Card System
----------------------------- */
.dose-table,
.dose-pro {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--dose-radius);
    box-shadow: var(--shadow);
}

/* =========================================================
   方法一：Dose Table
========================================================= */
.dose-table {
    padding: 1.8rem var(--dose-pad);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* 表格區標題：綠色識別 */
.dose-table h3 {
    padding-left: 14px;
    border-left: 6px solid var(--green);
    letter-spacing: .3px;
}

.table-note {
    margin-top: .2rem;
}

/* 支援 table--sk100 / table--sk160（避免你未來換 class 就失效） */
.table--sk100,
.table--sk160 {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
}

/* 表頭 */
.table--sk100 thead th,
.table--sk160 thead th {
    background: #e8f5e9;
    color: #1b5e20;
    font-weight: 900;
    font-size: 1rem;
    padding: 14px 10px;
    text-align: center;
    border-bottom: 2px solid rgba(46, 125, 50, .18);
}

/* 內容 */
.table--sk100 tbody td,
.table--sk160 tbody td {
    font-size: 1rem;
    padding: 14px 10px;
    text-align: center;
    border-bottom: 1px solid var(--line);
}

/* 第一欄 RT 加強辨識 */
.table--sk100 tbody td:first-child,
.table--sk160 tbody td:first-child {
    font-weight: 800;
    background: #fbfbfb;
}

/* Hover */
.table--sk100 tbody tr:hover,
.table--sk160 tbody tr:hover {
    background: rgba(46, 125, 50, .06);
}

/* 最後一列去底線 */
.table--sk100 tbody tr:last-child td,
.table--sk160 tbody tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   方法二：Dose Calculator
========================================================= */
.dose-pro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.6rem;
    padding: 1.8rem var(--dose-pad);
    margin-bottom: 12vh;
}

/* 左側標題：你用的是 h3.dose-title */
.dose-title {
    font-size: clamp(1.35rem, 2vw, 2rem);
    font-weight: 900;
    letter-spacing: .4px;
    margin: 0 0 .35rem;
}

.dose-sub {
    font-size: clamp(.95rem, 1.1vw, 1.05rem);
    letter-spacing: .6px;
    margin: 0 0 1.2rem;
    color: var(--muted);
}

/* Left Form */
.dose-pro__left label {
    font-weight: 900;
    font-size: 1rem;
    display: block;
    margin-top: 1rem;
}

.dose-pro__left input,
.dose-pro__left select {
    width: 100%;
    font-size: 1.05rem;
    padding: 14px 14px;
    margin-top: 8px;
    border: 2px solid rgba(0, 0, 0, .18);
    border-radius: 12px;
    background: #fff;
}

.dose-pro__left input:focus,
.dose-pro__left select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, .15);
    outline: none;
}

.dose-btn-lg {
    margin-top: 1.2rem;
    width: 100%;
    padding: 16px 12px;
    font-size: 1.1rem;
    font-weight: 900;
    border-radius: 12px;
    border: 0;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.dose-btn-lg:hover {
    filter: brightness(.92);
}

/* Right Side */
.dose-pro__right h4 {
    padding-left: 12px;
    border-left: 6px solid var(--accent);
    margin-bottom: .9rem;
}

/* ppm 區塊 */
.ppm-guide {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: .9rem;
}

.ppm-guide li {
    border-radius: 14px;
    padding: .9rem 1rem;
    line-height: 1.7;
    border: 1px solid var(--line);
    border-left: 6px solid rgba(0, 0, 0, .18);
    background: #fff;
}

.ppm-guide li:nth-child(1) {
    background: #e8f5e9;
    border-left-color: var(--green);
}

.ppm-guide li:nth-child(2) {
    background: #fff4e6;
    border-left-color: #ef6c00;
}

.ppm-guide li:nth-child(3) {
    background: #fdecea;
    border-left-color: #c62828;
}

/* 建議區 */
.base-advice {
    margin-top: 1rem;
    background: #fff3cd;
    border: 1px solid rgba(255, 179, 0, .35);
    border-left: 6px solid var(--amber);
    padding: 1rem 1rem;
    border-radius: 12px;
    font-size: 1rem;
}

/* =========================================================
   Summary Card（你 UI 輸出用的 base-advice 內部可以替換成這套）
========================================================= */
.summary-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 1.4rem 1.6rem;
    margin-top: 1.2rem;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .06);
}

.summary-title {
    font-size: 1.15rem;
    margin: 0 0 1rem;
    font-weight: 900;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.summary-block {
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    border: 1px solid var(--line);
}

.summary-block--maintain {
    background: #e8f5e9;
}

.summary-block--reinforce {
    background: #fff3e0;
}

.summary-label {
    font-size: .95rem;
    opacity: .75;
    margin: 0 0 .4rem;
}

.summary-value {
    font-size: 1.9rem;
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
}

.summary-value span {
    font-size: 1rem;
    margin-left: .25rem;
    font-weight: 800;
}

.summary-sub {
    font-size: .92rem;
    opacity: .85;
    margin: .35rem 0 0;
}

.summary-footer {
    margin-top: 1.1rem;
    padding-top: 1rem;
    border-top: 1px dashed rgba(0, 0, 0, .18);
    font-size: .95rem;
    line-height: 1.7;
    color: var(--muted);
}

.summary-footer span {
    font-size: .85rem;
    opacity: .75;
}

/* =========================================================
   RWD
========================================================= */
@media (max-width: 1024px) {
    body {
        font-size: 17px;
    }

    .dose-table,
    .dose-pro {
        padding: 1.4rem 1.2rem;
    }

    .dose-pro {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    body {
        font-size: 16px;
    }

    .table--sk100 thead th,
    .table--sk160 thead th,
    .table--sk100 tbody td,
    .table--sk160 tbody td {
        font-size: .95rem;
        padding: 12px 8px;
    }

    .dose-btn-lg {
        font-size: 1.05rem;
        padding: 14px 12px;
    }
}