/* ==========================================================================
   大台北電腦維修站 — 共用樣式表
   2026-08-03 響應式改造：原本五個頁面各自內嵌一份 CSS、版型固定 1200px，
   手機開起來是縮到最小的桌機畫面。改成單一共用樣式 + 行動優先。
   · 主色沿用原網站的 #1A4484
   · 不引用任何外部字型/CDN：少一個連線就快一分，也不會把訪客資料送去第三方
   ========================================================================== */

:root {
    --brand: #1a4484;
    --brand-dark: #12305d;
    --brand-light: #e8eef7;
    /* 🎨 2026-08-03：原本 #d94f00 配白字只有 4.14:1，差一點點沒過 WCAG AA(4.5)。
       壓深到 #c44500 → 4.97:1，顏色幾乎看不出差別但合格了。 */
    --accent: #c44500;
    --ink: #23282d;
    --ink-soft: #4a5560;
    --line: #d8dee6;
    --bg: #ffffff;
    --bg-soft: #f5f7fa;
    --radius: 10px;
    --wrap: 1140px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: "Microsoft JhengHei", "微軟正黑體", "PingFang TC",
        "Noto Sans TC", "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.8;
    color: var(--ink);
    background: var(--bg);
    /* 中文長段落斷行：避免標點孤字與英數字撐破版面 */
    word-break: break-word;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--brand);
}

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-inline: 18px;
}

/* 鍵盤使用者：Tab 第一下就能跳過選單直接進內容 */
.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    background: var(--brand);
    color: #fff;
    padding: 10px 16px;
    z-index: 100;
}

.skip-link:focus {
    left: 0;
}

/* ---------- 頁首與導覽 ---------- */
.site-header {
    background: var(--brand);
    color: #fff;
}

.site-header a {
    color: #fff;
    text-decoration: none;
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-block: 14px;
}

.brand {
    font-size: 1.32rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.3;
}

.brand small {
    display: block;
    font-size: 0.72rem;
    font-weight: 400;
    opacity: 0.85;
    letter-spacing: 0;
}

/* 撥號鈕：維修店手機版最重要的按鈕，觸控目標不得小於 44px */
.header-tel {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    font-size: 1.05rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 8px 18px;
    border-radius: 999px;
    white-space: nowrap;
}

.header-tel:hover,
.header-tel:focus {
    background: rgba(255, 255, 255, 0.28);
}

/* 段落結尾的「→ 更多」連結：獨立成行時也要是合格的觸控目標 */
.more-link {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 2px solid var(--brand-light);
}

.more-link:hover,
.more-link:focus {
    border-bottom-color: var(--brand);
}

/* 頁首自訂連結（後台可增刪） */
.header-extra-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
}

.header-extra {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 6px 14px;
    font-size: 0.92rem;
    font-weight: 600;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header-extra:hover,
.header-extra:focus {
    background: rgba(255, 255, 255, 0.24);
}

/* 公告條（後台可開關）：只有真的有公告時才會被輸出到 HTML */
.announce {
    background: #fff3cd;
    border-bottom: 2px solid #e0a800;
    color: #6d4c00;
    font-weight: 700;
    padding: 12px 0;
}

.announce .wrap {
    /* 公告可能很長，手機上要能好好折行 */
    line-height: 1.6;
}

.site-nav {
    background: var(--brand-dark);
}

.site-nav ul {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav a {
    display: block;
    /* 🐛 2026-08-03：原本漏了 color，文字會繼承 body 的深色 (#23282d)，
       疊在深藍導覽列上幾乎看不見。白底那條 aria-current 反而正常，
       所以只有「非當前頁」的四個項目是暗的，很容易被忽略。 */
    color: #fff;
    padding: 12px 16px;
    font-size: 0.98rem;
    /* 手機上手指點得到：不小於 44px 高 */
    min-height: 44px;
    line-height: 20px;
}

.site-nav a:hover,
.site-nav a:focus {
    background: rgba(255, 255, 255, 0.14);
}

.site-nav a[aria-current="page"] {
    background: #fff;
    color: var(--brand-dark);
    font-weight: 700;
}

/* ---------- 首頁主視覺 ---------- */
.hero {
    background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: #fff;
    padding-block: 44px 40px;
}

.hero h1 {
    margin: 0 0 12px;
    font-size: 1.85rem;
    line-height: 1.4;
}

.hero p {
    margin: 0 0 22px;
    font-size: 1.05rem;
    opacity: 0.95;
    max-width: 40em;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-block;
    padding: 13px 24px;
    border-radius: var(--radius);
    font-weight: 700;
    text-decoration: none;
    min-height: 44px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: #a03800;
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.26);
}

/* ---------- 內容區塊 ---------- */
main {
    padding-block: 34px 44px;
}

h1,
h2,
h3 {
    line-height: 1.4;
    color: var(--brand-dark);
}

/* 🐛 2026-08-03：上面那條會把深藍色套到 hero 區的 h1 上，
   而 hero 是深藍漸層底 —— 深藍字疊深藍底，等於看不見。
   深色底上的標題一律改回白色。 */
.hero h1,
.hero h2,
.hero h3,
.site-header h1,
.site-header h2 {
    color: #fff;
}

main h1 {
    font-size: 1.7rem;
    margin: 0 0 8px;
}

.lead {
    color: var(--ink-soft);
    margin: 0 0 26px;
}

section {
    margin-bottom: 34px;
}

h2 {
    font-size: 1.3rem;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--brand-light);
}

h3 {
    font-size: 1.08rem;
    margin: 0 0 6px;
}

.card {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px 20px;
}

.card + .card {
    margin-top: 14px;
}

.grid {
    display: grid;
    gap: 14px;
    grid-template-columns: 1fr;
}

@media (min-width: 620px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.service-item h3 {
    color: var(--brand);
}

.service-item p {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.97rem;
}

ol.rules,
ul.plain {
    padding-left: 1.3em;
    margin: 0;
}

ol.rules li,
ul.plain li {
    margin-bottom: 10px;
}

.callout {
    background: #fff8e6;
    border-left: 5px solid #e0a800;
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 20px;
    margin-bottom: 20px;
}

.callout strong {
    color: #8a6100;
}

.price-tag {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 999px;
    white-space: nowrap;
}

/* 下載連結 */
.dl-list {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
    list-style: none;
    padding: 0;
    margin: 0;
}

@media (min-width: 620px) {
    .dl-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dl-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 12px 16px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
}

.dl-list a:hover {
    background: var(--brand-light);
    border-color: var(--brand);
}

/* 聯絡資訊 */
.contact-list {
    list-style: none;
    padding: 0;
    margin: 0 0 22px;
}

.contact-list li {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.contact-list .label {
    flex: 0 0 5.5em;
    font-weight: 700;
    color: var(--brand-dark);
}

.map-frame {
    position: relative;
    width: 100%;
    /* 手機直式看地圖太扁，比例放高一點 */
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}

@media (min-width: 760px) {
    .map-frame {
        aspect-ratio: 16 / 9;
    }
}

.map-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- 頁尾 ---------- */
.site-footer {
    background: var(--brand-dark);
    color: rgba(255, 255, 255, 0.9);
    padding-block: 26px;
    font-size: 0.93rem;
}

.site-footer a {
    color: #fff;
}

/* 頁尾自訂連結（後台可增刪） */
.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 18px;
    margin-top: 10px !important;
}

.footer-extra {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    font-weight: 600;
}

/* 頁尾的電話也是會被手指點的目標，撐到 44px */
.site-footer a[href^="tel:"] {
    display: inline-block;
    min-height: 44px;
    line-height: 44px;
    font-weight: 700;
    font-size: 1.05rem;
}

.site-footer p {
    margin: 0 0 6px;
}

/* ---------- 手機版微調 ---------- */
@media (max-width: 619px) {
    body {
        font-size: 16px;
    }

    .hero h1 {
        font-size: 1.5rem;
    }

    main h1 {
        font-size: 1.45rem;
    }

    .site-nav ul {
        /* 五個項目在窄螢幕平均分兩排，不擠成一直條 */
        display: grid;
        grid-template-columns: repeat(3, 1fr);
    }

    .site-nav a {
        text-align: center;
        padding: 12px 6px;
        font-size: 0.92rem;
    }

    .contact-list li {
        flex-direction: column;
        gap: 2px;
    }

    .hero-actions .btn {
        flex: 1 1 100%;
        text-align: center;
    }
}

/* ---------- 📺 右下角動態橫幅（原本舊版頁尾那張 GIF） ---------- */
.marquee {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 60;
    line-height: 0;                 /* 去掉 img 底下的行高空隙 */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}

.marquee img {
    display: block;
    width: 245px;
    height: auto;
}

.marquee-x {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 26px;
    height: 26px;
    padding: 0;
    line-height: 24px;
    font-size: 14px;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: 50%;
    cursor: pointer;
}

.marquee-x:hover,
.marquee-x:focus {
    background: rgba(0, 0, 0, .8);
}

/* 手機：整張等比縮小，否則 245px 會蓋掉小螢幕大半個下半部 */
@media (max-width: 619px) {
    .marquee {
        right: 8px;
        bottom: 8px;
    }

    .marquee img {
        width: 170px;
    }
}

/* 很矮的橫向手機：乾脆不顯示，不要擋住內容 */
@media (max-height: 420px) {
    .marquee {
        display: none;
    }
}

/* 列印時不要印出來 */
@media print {
    .marquee {
        display: none;
    }
}

/* 列印：把導覽與地圖去掉，客人列印報價/規則時比較乾淨 */
@media print {
    .site-nav,
    .hero-actions,
    .map-frame {
        display: none;
    }

    body {
        color: #000;
    }
}
