/* THD 官網樣式 — 手機優先 RWD */
:root {
    /* 主色沿用舊站的綠色識別。--brand 刻意比舊站的亮黃綠深一階，
       白字疊在上面才有足夠對比（約 4.6:1）；亮綠留給裝飾與強調。 */
    --brand:        #4F8A1E;
    --brand-dark:   #3B6916;
    --brand-light:  #8DC63F;   /* 舊站的亮綠 */
    --brand-bg:     #F2F8EA;   /* 淺綠底 */
    --brand-line:   #D6E8BE;
    --ink:          #1E2419;
    --ink-2:        #4A5348;
    --ink-3:        #7B857A;
    --line:         #E1E7DC;
    --bg:           #FFFFFF;
    --bg-2:         #F6F9F2;
    --bg-3:         #EAF0E2;
    --radius:       10px;
    --shadow:       0 1px 3px rgba(30,45,20,.08), 0 6px 20px rgba(30,45,20,.07);
    --maxw:         1200px;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC",
            "Noto Sans SC", "Noto Sans JP", "Noto Sans Thai", "PingFang TC",
            "Microsoft JhengHei", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0; font-family: var(--font); color: var(--ink);
    background: var(--bg); line-height: 1.7; font-size: 16px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.35; margin: 0 0 .6em; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.45rem; }
h3 { font-size: 1.15rem; }
p  { margin: 0 0 1em; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.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;
}
.skip-link {
    position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff;
    padding: 10px 16px; z-index: 999;
}
.skip-link:focus { left: 0; }

/* ── 頁首 ────────────────────────────── */
.topbar {
    background: #23331A; color: #fff; font-size: .82rem;
}
.topbar .wrap { display: flex; justify-content: space-between; align-items: center;
    gap: 12px; min-height: 38px; flex-wrap: wrap; }
.topbar a { color: #DDE7D3; }
.lang-switch { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.lang-switch a {
    padding: 3px 9px; border-radius: 4px; font-size: .8rem; white-space: nowrap;
}
.lang-switch a[aria-current="true"] { background: var(--brand); color: #fff; }
.lang-switch a:hover { background: rgba(255,255,255,.14); text-decoration: none; }

header.site {
    position: sticky; top: 0; z-index: 50; background: #fff;
    border-bottom: 1px solid var(--line);
}
header.site .wrap {
    display: flex; align-items: center; gap: 16px; min-height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.logo:hover { text-decoration: none; }
.logo-mark {
    width: 42px; height: 42px; border-radius: 8px; background: var(--brand);
    color: #fff; display: grid; place-items: center; font-weight: 800;
    font-size: 1rem; letter-spacing: -.02em;
}
.logo-mark.demo {
    background: #C77700; font-size: .78rem; letter-spacing: .04em;
}
.logo-text strong { display: block; font-size: 1rem; color: var(--ink); line-height: 1.25; }
.logo-text span   { display: block; font-size: .72rem; color: var(--ink-3); }

nav.main { margin-left: auto; display: none; gap: 4px; }
nav.main a {
    color: var(--ink-2); padding: 9px 13px; border-radius: 7px;
    font-size: .95rem; font-weight: 500;
}
nav.main a:hover { background: var(--bg-2); color: var(--ink); text-decoration: none; }
nav.main a.active { color: var(--brand); font-weight: 600; }

.nav-toggle {
    margin-left: auto; display: grid; place-items: center;
    width: 42px; height: 42px; border: 1px solid var(--line);
    background: #fff; border-radius: 8px; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink);
    position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
    content: ''; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after  { top: 6px; }

.mobile-nav { display: none; border-top: 1px solid var(--line); background: #fff; }
.mobile-nav.open { display: block; }
.mobile-nav a {
    display: block; padding: 13px 20px; color: var(--ink-2);
    border-bottom: 1px solid var(--bg-3);
}

/* ── 搜尋 ────────────────────────────── */
.search-form { display: flex; gap: 0; max-width: 420px; width: 100%; }
.search-form input {
    flex: 1; padding: 10px 14px; border: 1px solid var(--line);
    border-radius: 8px 0 0 8px; font-size: .92rem; font-family: inherit;
    min-width: 0; background: #fff;
}
.search-form input:focus { outline: 2px solid var(--brand); outline-offset: -1px; }
.search-form button {
    padding: 10px 18px; background: var(--brand); color: #fff; border: 0;
    border-radius: 0 8px 8px 0; cursor: pointer; font-size: .92rem;
    font-family: inherit; font-weight: 600;
}
.search-form button:hover { background: var(--brand-dark); }

/* ── 主視覺 ──────────────────────────── */
.hero {
    background: linear-gradient(135deg, #23331A 0%, #375B1E 55%, #4F8A1E 100%);
    color: #fff; padding: 56px 0 60px;
}
.hero .eyebrow {
    display: inline-block; background: var(--brand); color: #fff;
    padding: 5px 13px; border-radius: 999px; font-size: .8rem;
    font-weight: 600; margin-bottom: 18px;
}
/* 公司標語：舊站主視覺上的大字，沿用為品牌主張 */
.hero .motto {
    font-size: 1.35rem; font-weight: 700; color: var(--brand-light);
    letter-spacing: .1em; margin: 0 0 .35em; line-height: 1.4;
    display: flex; align-items: center; gap: 14px;
}
.hero .motto::after {
    content: ''; flex: 1; height: 1px; max-width: 120px;
    background: linear-gradient(90deg, var(--brand-light), transparent);
}
.hero h1 { font-size: 2rem; margin-bottom: .4em; }
.hero p.lead { font-size: 1.05rem; color: #D8E6C7; max-width: 660px; margin-bottom: 1.6em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
    display: inline-block; padding: 12px 24px; border-radius: 8px;
    font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent;
    font-family: inherit; text-align: center;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); color: #fff; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); }
.btn-ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-outline { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

/* ── 區塊 ────────────────────────────── */
section.block { padding: 52px 0; }
section.block.alt { background: var(--bg-2); }
.section-head { margin-bottom: 28px; }
.section-head h2 { margin-bottom: .2em; }
.section-head p { color: var(--ink-2); margin: 0; }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: repeat(2, 1fr); }

/* ── 卡片 ────────────────────────────── */
.card {
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column;
    transition: box-shadow .18s, border-color .18s, transform .18s;
}
.card:hover { box-shadow: var(--shadow); border-color: var(--brand-line); transform: translateY(-2px); }
.card a { color: inherit; }
.card a:hover { text-decoration: none; }
.card-media {
    aspect-ratio: 4 / 3; background: var(--bg-2); display: grid; place-items: center;
    overflow: hidden;
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.card-media .placeholder { color: var(--ink-3); font-size: 2rem; }
.card-body { padding: 15px 16px 18px; flex: 1; display: flex; flex-direction: column; }
.card-body .eyebrow {
    font-size: .74rem; color: var(--brand); font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; margin-bottom: 5px;
}
.card-body h3 { font-size: 1rem; margin-bottom: .35em; }
.card-body p  { font-size: .87rem; color: var(--ink-2); margin: 0; }
.card-body .models {
    margin-top: 10px; font-size: .78rem; color: var(--ink-3);
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.cat-card { display: block; padding: 20px; border: 1px solid var(--line);
    border-radius: var(--radius); background: #fff; }
.cat-card:hover { border-color: var(--brand); text-decoration: none;
    box-shadow: var(--shadow); }
.cat-card h3 { margin-bottom: .3em; color: var(--ink); }
.cat-card .count { font-size: .82rem; color: var(--ink-3); }
.cat-card ul { list-style: none; padding: 0; margin: 12px 0 0; }
.cat-card ul li { font-size: .85rem; color: var(--ink-2); padding: 2px 0; }

/* ── 特色 ────────────────────────────── */
.feature { padding: 22px; background: #fff; border-radius: var(--radius);
    border: 1px solid var(--line); }
.feature .ico {
    width: 40px; height: 40px; border-radius: 9px; background: var(--brand-bg);
    color: var(--brand); display: grid; place-items: center; margin-bottom: 12px;
    font-size: 1.15rem; font-weight: 700;
}
.feature h3 { font-size: 1rem; }
.feature p  { font-size: .88rem; color: var(--ink-2); margin: 0; }

/* ── 麵包屑 ──────────────────────────── */
.breadcrumb { background: var(--bg-2); border-bottom: 1px solid var(--line);
    padding: 11px 0; font-size: .84rem; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 7px;
    margin: 0; padding: 0; align-items: center; }
.breadcrumb li:not(:last-child)::after { content: '›'; margin-left: 7px; color: var(--ink-3); }
.breadcrumb a { color: var(--ink-2); }
.breadcrumb li:last-child { color: var(--ink-3); }

/* ── 產品頁 ──────────────────────────── */
.product-layout { display: grid; gap: 28px; grid-template-columns: 1fr; padding: 34px 0 56px; }
.product-gallery { background: var(--bg-2); border-radius: var(--radius);
    border: 1px solid var(--line); padding: 20px; }
.product-gallery img { width: 100%; object-fit: contain; max-height: 380px; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery-thumbs img { width: 60px; height: 46px; object-fit: cover;
    border: 1px solid var(--line); border-radius: 5px; cursor: pointer; background: #fff; }

.product-summary {
    background: var(--brand-bg); border-left: 3px solid var(--brand-light);
    padding: 15px 18px; border-radius: 0 8px 8px 0; margin-bottom: 22px;
    font-size: .95rem; color: #33501A;
}
.model-chips { display: flex; flex-wrap: wrap; gap: 7px; margin: 14px 0 22px; }
.model-chips span {
    background: var(--bg-3); padding: 5px 11px; border-radius: 5px; font-size: .82rem;
    font-family: ui-monospace, "SF Mono", Menlo, monospace; color: var(--ink-2);
}
.spec-table { overflow-x: auto; margin: 0 0 24px; -webkit-overflow-scrolling: touch; }
.spec-table table { border-collapse: collapse; width: 100%; font-size: .87rem;
    min-width: 480px; background: #fff; }
.spec-table th, .spec-table td {
    border: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top;
}
.spec-table th { background: var(--bg-3); font-weight: 600; }
.spec-table tr:first-child td { background: var(--brand-bg); font-weight: 600; }
.spec-table p { margin: 0; }
.spec-table img { max-width: 100%; }

.notice {
    background: #EEF4FA; border-left: 3px solid #4E7FA8; padding: 12px 16px;
    border-radius: 0 8px 8px 0; font-size: .88rem; color: #2B4A6F; margin-bottom: 20px;
}

/* ── 側邊欄 ──────────────────────────── */
.sidebar { }
.sidebar-box { border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; margin-bottom: 18px; background: #fff; }
.sidebar-box > h3 { margin: 0; padding: 13px 16px; background: var(--bg-2);
    border-bottom: 1px solid var(--line); font-size: .95rem; }
.sidebar-nav { list-style: none; margin: 0; padding: 6px 0; }
.sidebar-nav > li > a {
    display: block; padding: 8px 16px; color: var(--ink-2); font-size: .9rem; font-weight: 600;
}
.sidebar-nav ul { list-style: none; margin: 0 0 6px; padding: 0; }
.sidebar-nav ul li a {
    display: block; padding: 6px 16px 6px 28px; color: var(--ink-2); font-size: .85rem;
    border-left: 2px solid transparent;
}
.sidebar-nav ul li a:hover { background: var(--bg-2); text-decoration: none; }
.sidebar-nav ul li a.active {
    color: var(--brand); border-left-color: var(--brand); background: var(--brand-bg); font-weight: 600;
}

/* ── FAQ ─────────────────────────────── */
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.faq-item summary {
    padding: 15px 18px; cursor: pointer; font-weight: 600; font-size: .96rem;
    list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; color: var(--brand); font-size: 1.3rem;
    line-height: 1; flex-shrink: 0; }
.faq-item[open] summary::after { content: '−'; }
.faq-item .answer { padding: 0 18px 16px; color: var(--ink-2); font-size: .92rem; }

/* ── 表單 ────────────────────────────── */
.form-grid { display: grid; gap: 15px; grid-template-columns: 1fr; }
.field label { display: block; font-size: .87rem; font-weight: 600;
    margin-bottom: 5px; color: var(--ink-2); }
.field .req { color: var(--brand); }
.field input, .field select, .field textarea {
    width: 100%; padding: 10px 13px; border: 1px solid var(--line);
    border-radius: 8px; font-size: .93rem; font-family: inherit; background: #fff;
    color: var(--ink);
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: 2px solid var(--brand); outline-offset: -1px; border-color: var(--brand);
}
.form-msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: .9rem; }
.form-msg.ok   { background: #E9F7EF; color: #1E6B3F; border: 1px solid #BFE5CE; }
.form-msg.err  { background: #FDECEE; color: #A31423; border: 1px solid #F5C6CD; }

/* ── 頁尾 ────────────────────────────── */
footer.site { background: #23331A; color: #C3D1B6; padding: 44px 0 24px;
    margin-top: 60px; font-size: .89rem; }
footer.site h4 { color: #fff; font-size: .95rem; margin-bottom: .8em; }
footer.site a { color: #C3D1B6; }
footer.site a:hover { color: #fff; }
footer.site ul { list-style: none; padding: 0; margin: 0; }
footer.site ul li { padding: 3px 0; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
.footer-bottom { border-top: 1px solid #3A4E2C; margin-top: 32px; padding-top: 18px;
    font-size: .82rem; color: #8FA083; display: flex; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; }

/* ── 內容排版（後台輸出的 HTML）──────── */
.prose { max-width: 78ch; }
.prose img { border-radius: 8px; margin: 1em 0; }
.prose table { border-collapse: collapse; width: 100%; font-size: .89rem; margin: 1em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 11px; }
.prose h2 { margin-top: 1.6em; }

.empty { text-align: center; padding: 56px 20px; color: var(--ink-3); }

/* ── 平板以上 ────────────────────────── */
@media (min-width: 700px) {
    h1 { font-size: 2.2rem; }
    .hero h1 { font-size: 2.6rem; }
    .hero .motto { font-size: 1.7rem; letter-spacing: .14em; }
    .hero { padding: 76px 0 82px; }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(3, 1fr); }
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .form-grid { grid-template-columns: repeat(2, 1fr); }
    .field.full { grid-column: 1 / -1; }
    .footer-grid { grid-template-columns: 1.6fr 1fr 1fr; }
    section.block { padding: 64px 0; }
}

@media (min-width: 960px) {
    nav.main { display: flex; }
    .nav-toggle, .mobile-nav { display: none !important; }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .product-layout { grid-template-columns: 420px 1fr; }
    .with-sidebar { display: grid; grid-template-columns: 250px 1fr; gap: 34px; }
}

@media print {
    header.site, footer.site, .topbar, .breadcrumb, .hero-actions { display: none; }
}

/* 尚未提供的資料：明確標示，避免誤讀為空白或沿用其他據點的資訊 */
.pending-tag {
    display: inline-block; background: #FFF4E0; color: #8A5A00;
    border: 1px dashed #E0B970; padding: 1px 9px; border-radius: 5px;
    font-size: .82rem; font-weight: 600;
}
