/* V2 前台樣式:外觀沿用舊站(白底、黑字、藍色 SAMSUNG 標誌),版面改成手機優先的響應式 */
:root {
    --text: #222;
    --muted: #666;
    --line: #e2e2e2;
    --grey: #f2f2f2;
    --brand: #305985;
    --dark: #111;
    --wrap: 1120px;
    --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: #fff; line-height: 1.7; font-size: 16px; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.35; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: #000; color: #fff; padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; }

/* ---- 頁首 ---- */
.site-header { position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 420px; max-width: 100%; height: auto; display: block; }
.menu-toggle { display: none; width: 44px; height: 44px; border: 0; background: none; cursor: pointer; position: relative; }
.menu-toggle-bar, .menu-toggle-bar::before, .menu-toggle-bar::after { position: absolute; left: 10px; width: 24px; height: 2px; background: #000; content: ""; transition: transform .2s; }
.menu-toggle-bar { top: 21px; }
.menu-toggle-bar::before { left: 0; top: -7px; }
.menu-toggle-bar::after { left: 0; top: 7px; }
.header-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; padding: 8px 0; }
.social-links, .main-menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.social-links a { display: block; background: #333; color: #fff; font-size: 13px; padding: 3px 10px; text-decoration: none; }
.main-menu a { display: block; padding: 6px 10px; text-decoration: none; font-size: 16px; }
.main-menu a:hover, .main-menu a:focus { color: var(--brand); }
/* 大選單(947:手機維修、筆電維修) */
.main-menu .has-children { position: relative; }
.main-menu summary { padding: 6px 10px; font-size: 16px; cursor: pointer; list-style: none; }
.main-menu summary::-webkit-details-marker { display: none; }
.main-menu summary::after { content: " ▾"; font-size: 12px; }
.main-menu .sub-menu { position: absolute; right: 0; top: 100%; z-index: 60; width: min(880px, 92vw); padding: 16px; margin: 0; list-style: none; background: #fff; border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.12); display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; }
.main-menu .menu-group-title { display: block; font-weight: 700; padding: 4px 0; border-bottom: 2px solid var(--brand); margin-bottom: 4px; }
.main-menu .menu-group ul { list-style: none; margin: 0; padding: 0; }
.main-menu .menu-group a { padding: 3px 0; font-size: 14px; }

@media (max-width: 860px) {
    .brand { min-width: 0; flex: 1; }
    .brand img { width: 320px; }
    .menu-toggle { display: block; }
    .header-right { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line); align-items: stretch; padding: 8px 16px 16px; }
    .site-header.is-open .header-right { display: flex; }
    .site-header.is-open .menu-toggle-bar { background: transparent; }
    .site-header.is-open .menu-toggle-bar::before { transform: translateY(7px) rotate(45deg); }
    .site-header.is-open .menu-toggle-bar::after { transform: translateY(-7px) rotate(-45deg); }
    .header-right nav { order: -1; }
    .main-menu { flex-direction: column; gap: 0; }
    .main-menu a { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .main-menu summary { padding: 12px 4px; border-bottom: 1px solid var(--line); }
    .main-menu .sub-menu { position: static; width: auto; box-shadow: none; border: 0; padding: 8px 0 8px 12px; grid-template-columns: repeat(2, 1fr); }
    .main-menu .menu-group a { padding: 6px 0; border-bottom: 0; }
    .social-links { margin-top: 12px; }
}

/* ---- 輪播 ---- */
.slider { position: relative; background: #000; }
.slider-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.slider-track::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: start; display: block; position: relative; }
.slide-link { display: block; }
/* 947 新版輪播:遮罩、文字、按鈕(顏色由 App\Support\BannerStyle 依每張設定產生) */
.slide.has-text::before { content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.slide-text { position: absolute; z-index: 2; top: 60%; left: 50%; width: 80%; transform: translate(-50%, -50%); color: #fff; pointer-events: none; }
.slide-text span { display: block; }
.slide-title { font-size: 50px; line-height: 1.3; padding-bottom: 10px; font-weight: 700; }
.slide-title i { font-style: normal; }
.slide-cont { font-size: 20px; padding-bottom: 20px; }
.slide-btn { pointer-events: auto; display: inline-block; font-size: 20px; font-weight: 700; padding: 11px 27px; margin-bottom: 20px; border: 3px solid; text-decoration: none; transition: background-color .4s ease, color .4s ease, border-color .4s ease; }
.slide-btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.slide .d-mob { display: none; }
@media (max-width: 991px) {
    .slide .d-web { display: none; }
    .slide .d-mob { display: block; }
    .slide-text { width: 72%; }
    .slide-title { font-size: 30px; line-height: 38px; }
    .slide-cont { font-size: 15px; line-height: 26px; }
    .slide-btn { font-size: 15px; }
}
.slide img, .slide video { display: block; width: 100%; aspect-ratio: var(--slide-ratio, 1920 / 600); object-fit: cover; }
@media (max-width: 767px) { .slide img, .slide video { aspect-ratio: var(--slide-ratio-mobile, 800 / 580); } }
.slider-track { cursor: grab; user-select: none; }
.slider-track.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.slider-track.is-dragging .slide { pointer-events: none; }
.slider-arrow { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 64px; border: 0; border-radius: 6px; background: rgba(0,0,0,.35); color: #fff; font-size: 40px; line-height: 1; cursor: pointer; }
.slider-arrow:hover, .slider-arrow:focus-visible { background: rgba(0,0,0,.6); }
.slider-arrow.prev { left: 12px; }
.slider-arrow.next { right: 12px; }
@media (max-width: 767px) { .slider-arrow { width: 32px; height: 48px; font-size: 28px; } }
.slider-dots { position: absolute; bottom: 10px; left: 0; right: 0; display: flex; justify-content: center; gap: 10px; }
.slider-dots button { width: 10px; height: 10px; padding: 0; border-radius: 50%; border: 2px solid #fff; background: rgba(0,0,0,.4); cursor: pointer; }
.slider-dots button[aria-current="true"] { background: #fff; }

/* ---- 區塊 ---- */
.section { padding: 48px 0; }
.section-grey { background: var(--grey); }
.section-title { text-align: center; font-size: clamp(22px, 3vw, 28px); margin: 0 0 8px; }
.section-lead { text-align: center; color: var(--muted); margin: 0 auto 24px; max-width: 720px; }
.more { display: inline-block; margin-top: 8px; color: var(--brand); text-decoration: none; font-weight: 500; }
.more:hover { text-decoration: underline; }

.daily-blocks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.daily-block { background: #fff; padding: 20px; border-top: 3px solid #000; }
.daily-block h3 { margin: 0 0 4px; font-size: 18px; }
.daily-updated { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.daily-block > a:not(.more) { display: block; text-decoration: none; }

.article-columns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 960px) { .article-columns { grid-template-columns: 1fr; } }
.column-title { font-size: 18px; letter-spacing: .1em; background: #000; color: #fff; display: inline-block; padding: 6px 28px 6px 16px; clip-path: polygon(0 0, 92% 0, 100% 50%, 92% 100%, 0 100%); margin: 0 0 16px; }

.news-card { display: grid; grid-template-columns: 88px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.news-card img { width: 88px; height: 88px; object-fit: cover; background: var(--grey); }
.news-card-title { margin: 0; font-size: 16px; font-weight: 500; }
/* 九宮格對齊:標題固定 2 行、摘要固定 3 行,超過以「…」收尾,每格高度一致(文字仍完整保留在網頁裡給搜尋引擎) */
.news-card-title, .news-card p { display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
.news-card-title { -webkit-line-clamp: 2; line-height: 1.5; min-height: 3em; }
.news-card-title a { text-decoration: none; }
.news-card-title a:hover { color: var(--brand); }
.news-card time { font-size: 13px; color: var(--muted); }
.news-card p { margin: 4px 0 0; font-size: 14px; color: var(--muted); -webkit-line-clamp: 3; line-height: 1.6; min-height: 4.8em; }

.repair-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.repair-grid a { display: block; background: #fff; border: 1px solid var(--line); padding: 16px; text-align: center; text-decoration: none; font-weight: 500; }
.repair-grid a:hover { border-color: #000; }

.regions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.region { border: 1px solid var(--line); background: #fff; }
.region summary { padding: 12px 16px; cursor: pointer; font-weight: 500; }
.region ul { margin: 0; padding: 0 16px 12px 32px; }
.region li { padding: 4px 0; }

.store-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 32px; margin: 0; }
.store-card > div { display: grid; grid-template-columns: 6em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.store-card dt { color: var(--muted); }
.store-card dd { margin: 0; overflow-wrap: anywhere; }

/* ---- 內頁 ---- */
.page { padding-top: 40px; padding-bottom: 56px; }
.page-head { text-align: center; margin-bottom: 24px; }
.page-head h1, .page-title { margin: 0; font-weight: 700; font-size: clamp(24px, 4vw, 32px); }
.page-sub { text-align: center; color: var(--muted); letter-spacing: .15em; margin: 4px 0 16px; }
.tabs { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.tabs a { padding: 6px 16px; border: 1px solid #000; text-decoration: none; }
.tabs a[aria-current="page"] { background: #000; color: #fff; }
.news-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 0 32px; }
@media (max-width: 400px) { .news-list { grid-template-columns: 1fr; } }
.daily-list { list-style: none; padding: 0; margin: 0; }
.daily-list li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.daily-list a { text-decoration: none; }
.daily-list time { color: var(--muted); white-space: nowrap; font-size: 14px; }

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.pagination a, .pagination span { min-width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); text-decoration: none; }
.pagination [aria-current="page"] { background: #000; color: #fff; border-color: #000; }

.article { max-width: 880px; }
.article-nav { display: flex; justify-content: center; gap: 24px; margin-bottom: 24px; }
.article-nav a { text-decoration: none; border: 1px solid var(--line); padding: 6px 14px; }
.article-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.article-head .label { background: #000; color: #fff; padding: 6px 36px 6px 20px; letter-spacing: .15em; clip-path: polygon(0 0, 94% 0, 100% 50%, 94% 100%, 0 100%); }
.article-head time { letter-spacing: .1em; }
.article-title { display: flex; align-items: center; gap: 20px; padding: 24px 0; border-bottom: 1px solid #ccc; margin-bottom: 32px; }
.article-title img { width: 80px; height: 80px; object-fit: cover; flex: none; background: var(--grey); }
.article-title h1 { margin: 0; font-size: clamp(20px, 3vw, 26px); font-weight: 500; }
@media (max-width: 600px) { .article-title img { width: 56px; height: 56px; } }

/* 文章內文:統一字型,舊文章貼上時帶進來的字型設定在程式端已移除 */
.rich-content { font-size: 17px; line-height: 1.9; overflow-wrap: anywhere; }
.rich-content * { font-family: inherit !important; }
.rich-content img, .rich-content video { max-width: 100% !important; height: auto !important; }
.rich-content .embed { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.rich-content .table-scroll { overflow-x: auto; margin: 1em 0; }
.rich-content table { border-collapse: collapse; max-width: 100%; }
.rich-content td, .rich-content th { padding: 6px; vertical-align: top; }
.rich-content h2 { font-size: 1.35em; margin: 1.6em 0 .6em; }
.rich-content h3 { font-size: 1.15em; margin: 1.4em 0 .5em; }
@media (max-width: 600px) { .rich-content { font-size: 16px; } }

.repair .breadcrumb { color: var(--muted); font-size: 14px; }
.repair h1 { font-size: clamp(24px, 4vw, 32px); }
.repair-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 24px 0; }
.repair-nav a { padding: 8px 14px; border: 1px solid #000; text-decoration: none; font-size: 15px; }
.repair-nav a[aria-current="page"] { background: #000; color: #fff; }
.repair-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
@media (max-width: 400px) { .repair-list { grid-template-columns: 1fr; } }
.repair-card { border: 1px solid var(--line); padding: 18px; }
.repair-card h3 { margin: 0 0 8px; font-size: 17px; }
.repair-card h3 a { text-decoration: none; }
.repair-card p { margin: 0; color: var(--muted); font-size: 15px; }
.faq { border-top: 1px solid var(--line); padding: 12px 0; }
.faq h3 { font-size: 17px; margin: 0 0 6px; }

/* ---- 頁尾 ---- */
.site-footer { background: var(--dark); color: #ddd; padding: 40px 0 24px; text-align: center; }
.site-footer { padding-top: 0; }
/* 照舊站:三個圖示等寬排列,中間有直線分隔,下方一條橫線 */
.footer-links { list-style: none; margin: 0 0 24px; padding: 40px 0; display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid #555; }
.footer-links li + li { border-left: 1px solid #555; }
.footer-links a { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 8px; text-decoration: none; color: #fff; }
.footer-links a:hover span { text-decoration: underline; }
.footer-links img { width: 64px; height: 64px; }
@media (max-width: 600px) {
    .footer-links { grid-template-columns: 1fr; padding: 16px 0; }
    .footer-links li + li { border-left: 0; border-top: 1px solid #555; }
}
.footer-company { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; font-size: 14px; }
.footer-company a { color: #fff; }
.copyright { margin: 20px 0 0; font-size: 13px; color: #999; }

/* 分店地圖 */
.store-map-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.store-map-tabs button { padding: 8px 14px; border: 1px solid #c8ccd2; border-radius: 999px; background: #fff; font: inherit; cursor: pointer; }
.store-map-tabs button[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.store-map-body { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.store-map-canvas { width: 100%; height: 440px; border: 0; border-radius: 8px; background: #eef0f3; }
.store-map-list { max-height: 440px; overflow-y: auto; margin: 0; padding: 0; list-style: none; border: 1px solid #e3e5e8; border-radius: 8px; }
.store-map-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #eef0f3; }
.store-map-list li[hidden] { display: none; }
.store-map-list button { padding: 0; border: 0; background: none; font: inherit; text-align: left; color: inherit; cursor: pointer; }
.store-map-list button:hover, .store-map-list button[aria-pressed="true"] { color: var(--brand); font-weight: 700; }
.store-map-list a { flex: none; font-size: .9em; color: var(--brand); text-decoration: none; }
@media (max-width: 767px) {
    .store-map-body { grid-template-columns: 1fr; }
    .store-map-canvas { height: 300px; }
    .store-map-list { max-height: 320px; }
}

/* 關於團隊(947) */
.about-page .page-title { font-size: 26px; margin: 24px 0 12px; }
.about-lead { line-height: 1.9; margin-bottom: 24px; }
.about-section { border-top: 1px solid var(--line); }
.about-section:last-of-type { border-bottom: 1px solid var(--line); }
.about-section summary { padding: 14px 4px; font-size: 18px; font-weight: 700; cursor: pointer; }
.about-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 20px; padding: 0 4px 20px; }
.about-images img { width: 100%; height: auto; display: block; margin-bottom: 8px; }
.about-text { line-height: 1.9; }
@media (max-width: 767px) { .about-body { grid-template-columns: 1fr; } }

/* 947 首頁:每日內容區塊圖片、手機/筆電維修連結 */
.daily-block-image img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; margin-bottom: 12px; }
.repair-links { padding-top: 0; }
.repair-links-banner img { display: block; width: 100%; height: auto; aspect-ratio: 1920 / 600; object-fit: cover; }
@media (max-width: 767px) { .repair-links-banner img { aspect-ratio: 800 / 580; } }
.repair-links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px; padding-top: 24px; }
.repair-links-group h2 { font-size: 18px; margin: 0 0 8px; padding-bottom: 6px; border-bottom: 2px solid var(--brand); }
.repair-links-group ul { list-style: none; margin: 0; padding: 0; }
.repair-links-group a { display: block; padding: 4px 0; text-decoration: none; }
.repair-links-group a:hover { color: var(--brand); }

/* 後台預覽提示 */
.preview-banner { position: sticky; top: 0; z-index: 100; background: #fff3cd; color: #664d03; text-align: center; padding: 8px 16px; font-weight: 700; border-bottom: 1px solid #ffe69c; }

/* 站內搜尋(沿用舊站 newssearch.php / dailysearch.php) */
.search-form { display: flex; gap: 8px; margin: 0 0 24px; max-width: 480px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 12px; font-size: 16px; border: 1px solid #ccc; border-radius: 6px; }
.search-form button { padding: 10px 18px; font-size: 16px; border: 0; border-radius: 6px; background: #1428a0; color: #fff; cursor: pointer; }
.store-region { margin-bottom: 28px; }
.store-region h2 { font-size: 20px; margin: 0 0 8px; }

/* 暫停營業的分店:頁面保留,改請聯絡總公司收送 */
.store-closed { border: 1px solid #f0c36d; background: #fff8e6; border-radius: 8px; padding: 14px 16px; margin: 0 0 20px; }
.store-closed p { margin: 4px 0; }
