/* charter-tc-section.css — 包車「條款及細則」區塊
   站方設計：品牌橙 var(--secondary-color)、12px 圓角、平面（無漸變／陰影）、RWD
   所有規則限定喺 .charter-tc 之內，唔會影響頁面其他部分 */

.charter-tc {
    --tc-brand: var(--secondary-color, #e27513);
    --tc-brand-soft: #fff8f1;
    --tc-ink: #1f2328;
    --tc-muted: #6b7280;
    --tc-line: #ececec;
    --tc-bg-soft: #f7f8fa;
    --tc-r: 12px;
    color: var(--tc-ink);
}

.charter-tc .tc-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

/* ---------- 標題 ---------- */
.charter-tc .tc-head {
    position: static;           /* 站方有 header{} 全域規則（fixed），元件內要覆蓋 */
    padding: 8px 0 4px;
}

.charter-tc .tc-title {
    margin: 0 0 8px;
    font-size: 22px;
    font-weight: 300;
    line-height: 1.4;
    color: #565656;
    text-align: center;
}

.charter-tc .tc-meta {
    margin: 0;
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--tc-muted);
    text-align: center;
}

/* ---------- sticky 目錄 ---------- */
.charter-tc .tc-toc {
    position: sticky;
    top: 0;
    z-index: 20;
    margin: 14px 0 4px;
    padding: 8px 0;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--tc-line);
}

.charter-tc .tc-toc-inner {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.charter-tc .tc-toc-inner::-webkit-scrollbar {
    display: none;
}

.charter-tc .tc-toc-link {
    flex: 0 0 auto;
    padding: 6px 12px;
    font-size: 13px;
    line-height: 1.2;
    color: var(--tc-muted);
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-r);
    text-decoration: none;
    white-space: nowrap;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease;
}

.charter-tc .tc-toc-link:hover,
.charter-tc .tc-toc-link:focus-visible {
    color: var(--tc-brand);
    border-color: var(--tc-brand);
}

.charter-tc .tc-toc-link.is-active {
    color: #fff;
    background: var(--tc-brand);
    border-color: var(--tc-brand);
}

/* ---------- 卡片 ---------- */
.charter-tc .tc-card {
    scroll-margin-top: 64px;
    margin-top: 0;
    padding: 0;                                  /* padding 交由 summary／body 處理 */
    background: #fff;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.charter-tc .tc-h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 14px 0;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.4;
    color: var(--tc-brand);
    cursor: pointer;
    list-style: none;
    transition: background-color .18s ease;
}

.charter-tc .tc-h2::-webkit-details-marker { display: none; }
.charter-tc .tc-h2::marker { content: ''; }
.charter-tc .tc-h2:focus-visible { outline: 2px solid var(--tc-brand); outline-offset: -2px; }

.charter-tc .tc-h2__text { flex: 1 1 auto; }

/* 收合指示：預設向下，展開時向上 */
.charter-tc .tc-caret {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    margin-left: auto;
    border-right: 2px solid var(--tc-brand);
    border-bottom: 2px solid var(--tc-brand);
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.charter-tc .tc-card[open] .tc-caret { transform: rotate(-135deg); }

.charter-tc .tc-body { padding: 0 0 18px; }

.charter-tc .tc-h3 {
    margin: 16px 0 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tc-ink);
}

.charter-tc p {
    margin: 0 0 10px;
    font-size: 14.5px;
    line-height: 1.8;
}

.charter-tc p:last-child {
    margin-bottom: 0;
}

.charter-tc .tc-list {
    margin: 0 0 10px;
    padding-left: 1.3em;
    font-size: 14.5px;
    line-height: 1.8;
}

.charter-tc .tc-list:last-child {
    margin-bottom: 0;
}

.charter-tc .tc-list > li {
    margin: 4px 0;
}

.charter-tc .tc-list .tc-list {
    margin: 6px 0 0;
}

.charter-tc a {
    color: var(--tc-brand);
    text-decoration: none;
}

.charter-tc a:hover {
    text-decoration: underline;
}

/* ---------- 匯率 ---------- */
.charter-tc .tc-rates {
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-r);
    overflow: hidden;
}

.charter-tc .tc-rates > li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--tc-line);
}

.charter-tc .tc-rates > li:last-child {
    border-bottom: 0;
}

.charter-tc .tc-rates-k {
    color: var(--tc-muted);
}

.charter-tc .tc-rates-v {
    font-weight: 700;
    white-space: nowrap;
}

/* ---------- 摺疊（accordion）---------- */
.charter-tc .tc-details {
    margin: 10px 0;
    background: #fff;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-r);
    overflow: hidden;
}

.charter-tc .tc-details > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tc-ink);
    cursor: pointer;
    list-style: none;
}

.charter-tc .tc-details > summary::-webkit-details-marker {
    display: none;
}

.charter-tc .tc-details > summary:hover {
    color: var(--tc-brand);
}

.charter-tc .tc-sign {
    position: relative;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    border-radius: 6px;
    background: var(--tc-brand-soft);
}

.charter-tc .tc-sign::before,
.charter-tc .tc-sign::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 9px;
    height: 2px;
    margin: -1px 0 0 -4.5px;
    background: var(--tc-brand);
    border-radius: 1px;
}

.charter-tc .tc-sign::after {
    transform: rotate(90deg);
    transition: transform .18s ease;
}

.charter-tc .tc-details[open] .tc-sign::after {
    transform: rotate(0deg);
}

.charter-tc .tc-details-body {
    padding: 2px 16px 14px;
    border-top: 1px solid var(--tc-line);
}

.charter-tc .tc-details-body > :first-child {
    margin-top: 12px;
}

/* ---------- 表格 ---------- */
.charter-tc .tc-table-wrap {
    margin: 0 0 12px;
    border: 1px solid var(--tc-line);
    border-radius: var(--tc-r);
    overflow: hidden;
}

.charter-tc .tc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.charter-tc .tc-table th,
.charter-tc .tc-table td {
    padding: 10px 14px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--tc-line);
}

.charter-tc .tc-table thead th {
    background: var(--tc-bg-soft);
    font-weight: 700;
    white-space: nowrap;
}

.charter-tc .tc-table tbody tr:last-child th,
.charter-tc .tc-table tbody tr:last-child td {
    border-bottom: 0;
}

.charter-tc .tc-table td:first-child {
    font-weight: 600;
}

.charter-tc .tc-table td:last-child {
    white-space: nowrap;
    font-weight: 700;
}

/* ---------- 提示／警告 ---------- */
.charter-tc .tc-warn {
    margin: 0;
    padding: 14px 16px;
    background: #fff5f5;
    border: 1px solid #f3c6c6;
    border-radius: var(--tc-r);
    color: #b42318;
    font-weight: 700;
}

.charter-tc .tc-notice {
    margin: 12px 0 0;
    padding: 12px 16px;
    background: var(--tc-brand-soft);
    border: 1px solid #ffd9b3;
    border-radius: var(--tc-r);
    color: #8a4b12;
    font-size: 13.5px;
    line-height: 1.75;
}

/* ---------- 聯絡 ---------- */
.charter-tc .tc-contact {
    margin: 8px 0 10px;
    padding: 0;
    list-style: none;
}

.charter-tc .tc-contact > li {
    margin: 6px 0;
}

.charter-tc .tc-contact a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 700;
}

.charter-tc .tc-contact .fa {
    width: 18px;
    text-align: center;
}

/* ---------- 頁腳 ---------- */
.charter-tc .tc-foot {
    position: static;           /* 同上：避免 footer{} 全域規則 */
    margin-top: 22px;
    font-size: 12.5px;
    line-height: 1.8;
    color: var(--tc-muted);
    text-align: center;
}

.charter-tc .tc-foot p {
    margin: 2px 0;
    font-size: inherit;
}

/* ---------- RWD ---------- */
@media (max-width: 768px) {
    .charter-tc .tc-title {
        font-size: 24px;
    }

    .charter-tc .tc-card {
        padding: 0;
    }

    .charter-tc .tc-h2 {
        padding: 12px 0;
    }

    .charter-tc .tc-body {
        padding: 0 0 14px;
    }

    .charter-tc .tc-h2 {
        font-size: 17px;
    }
}

@media (max-width: 560px) {
    .charter-tc .tc-title {
        font-size: 22px;
    }

    .charter-tc .tc-table thead {
        display: none;
    }

    .charter-tc .tc-table,
    .charter-tc .tc-table tbody,
    .charter-tc .tc-table tr,
    .charter-tc .tc-table td {
        display: block;
        width: 100%;
    }

    .charter-tc .tc-table tr {
        padding: 4px 0;
        border-bottom: 1px solid var(--tc-line);
    }

    .charter-tc .tc-table tr:last-child {
        border-bottom: 0;
    }

    .charter-tc .tc-table td {
        display: flex;
        justify-content: space-between;
        gap: 12px;
        border: 0;
        padding: 6px 14px;
        white-space: normal !important;
    }

    .charter-tc .tc-table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        color: var(--tc-muted);
        font-weight: 500;
    }

    .charter-tc .tc-table td:first-child {
        font-weight: 700;
    }
}

@media (prefers-reduced-motion: reduce) {
    .charter-tc .tc-toc-link,
    .charter-tc .tc-sign::after {
        transition: none;
    }
}
