/* ===== 富順電子連接線 - 前台樣式 ===== */
:root {
    --navy: #0f2a4a;
    --blue: #2563eb;
    --blue-dark: #1d4ed8;
    --orange: #f59e0b;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-500: #64748b;
    --gray-700: #334155;
    --radius: 10px;
    --shadow: 0 6px 20px rgba(15,42,74,.08);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
    color: var(--gray-700);
    line-height: 1.7;
    background: #fff;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.center { text-align: center; }

/* ---- 按鈕 ---- */
.btn {
    display: inline-block; background: var(--blue); color: #fff;
    padding: 11px 26px; border-radius: 8px; font-weight: 600;
    border: none; cursor: pointer; font-size: 15px; transition: .2s;
}
.btn:hover { background: var(--blue-dark); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: var(--gray-100); }

/* ---- 頂欄 ---- */
.topbar { background: var(--navy); color: #cbd5e1; font-size: 13px; }
.topbar-inner { display: flex; gap: 24px; padding: 8px 20px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.topbar-hours { color: #cbd5e1; }
.lang-switch { display: flex; gap: 2px; background: rgba(255,255,255,.12); padding: 3px; border-radius: 6px; }
.lang-switch a { padding: 2px 9px; border-radius: 5px; font-size: 13px; color: #cbd5e1; }
.lang-switch a:hover { color: #fff; }
.lang-switch a.active { background: #fff; color: var(--navy); font-weight: 600; }
.site-header { background: #fff; border-bottom: 1px solid var(--gray-200); position: sticky; top: 0; z-index: 50; }
.header-main { display: flex; align-items: center; gap: 24px; padding: 14px 20px; }
.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
    width: 46px; height: 46px; border-radius: 10px; background: linear-gradient(135deg, var(--blue), var(--navy));
    color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.3; }
.logo-text strong { font-size: 19px; color: var(--navy); }
.logo-text small { font-size: 12px; color: var(--gray-500); }
.logo img { height: 48px; }

/* ---- 導覽 ---- */
.main-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.main-nav > a, .nav-drop > a {
    padding: 9px 14px; border-radius: 8px; font-weight: 600; color: var(--gray-700); font-size: 15px;
}
.main-nav a:hover, .main-nav a.active { color: var(--blue); background: #eff6ff; }
.nav-drop { position: relative; }
.dropdown {
    position: absolute; top: 100%; left: 0; min-width: 200px; background: #fff;
    border: 1px solid var(--gray-200); border-radius: 10px; box-shadow: var(--shadow);
    padding: 8px; display: none; z-index: 60;
}
.nav-drop:hover .dropdown { display: block; }
.dropdown a { display: block; padding: 9px 14px; border-radius: 8px; font-weight: 500; font-size: 14px; }
.dropdown a:hover { background: #eff6ff; color: var(--blue); }
.nav-toggle { display: none; margin-left: auto; background: none; border: none; font-size: 26px; color: var(--navy); cursor: pointer; }

/* ---- Hero ---- */
.hero { position: relative; height: 480px; overflow: hidden; }
.hero-fallback { background: linear-gradient(135deg, var(--navy), var(--blue)); display: flex; align-items: center; }
.hero-slide {
    position: absolute; inset: 0; background-size: cover; background-position: center;
    display: flex; align-items: center; opacity: 0; transition: opacity .8s;
}
.hero-slide.active { opacity: 1; }
.hero-content { color: #fff; }
.hero-content h1 { font-size: 40px; margin-bottom: 12px; }
.hero-content p { font-size: 18px; margin-bottom: 24px; color: #e2e8f0; }
.hero-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 5;
    background: rgba(255,255,255,.2); color: #fff; border: none; width: 48px; height: 48px;
    border-radius: 50%; font-size: 26px; cursor: pointer; transition: .2s;
}
.hero-arrow:hover { background: rgba(255,255,255,.4); }
.hero-arrow.prev { left: 24px; }
.hero-arrow.next { right: 24px; }
.hero-dots { position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; z-index: 5; }
.hero-dots .dot { width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,.4); cursor: pointer; }
.hero-dots .dot.active { background: #fff; }

/* ---- 區塊 ---- */
.section { padding: 64px 0; }
.section-alt { background: var(--gray-50); }
.section-head { text-align: center; margin-bottom: 40px; }
.section-head.align-left { text-align: left; }
.section-head h2 { font-size: 30px; color: var(--navy); margin-bottom: 4px; }
.section-head p { color: var(--gray-500); letter-spacing: 2px; }

/* ---- 分類 ---- */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; }
.cat-card {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 28px 22px; text-align: center; transition: .25s;
}
.cat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue); }
.cat-icon { font-size: 34px; }
.cat-card h3 { color: var(--navy); margin: 10px 0 6px; font-size: 17px; }
.cat-card p { font-size: 13px; color: var(--gray-500); }

/* ---- 產品 ---- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 22px; }
.product-card {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
    overflow: hidden; transition: .25s; display: flex; flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--blue); }
.product-thumb { background: var(--gray-100); aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.product-info { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 16px; color: var(--navy); margin-bottom: 4px; }
.product-info .model { color: var(--blue); font-size: 13px; margin-bottom: 6px; }
.product-info p { font-size: 13px; color: var(--gray-500); flex: 1; }
.cat-tag {
    display: inline-block; margin-top: 10px; align-self: flex-start; background: #eff6ff; color: var(--blue);
    font-size: 12px; padding: 3px 10px; border-radius: 20px;
}

/* ---- 關於 ---- */
.about-split { display: grid; grid-template-columns: 1.2fr 1fr; gap: 48px; align-items: center; }
.about-text p { margin-bottom: 18px; }
.tick-list { list-style: none; margin: 0 0 24px; }
.tick-list li { padding: 6px 0 6px 28px; position: relative; }
.tick-list li::before { content: "✓"; position: absolute; left: 0; color: var(--blue); font-weight: 800; }
.about-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 28px 12px; text-align: center; }
.stat strong { display: block; font-size: 30px; color: var(--orange); }
.stat span { font-size: 13px; color: #cbd5e1; }

/* ---- 新聞 ---- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.news-card { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 22px; transition: .25s; }
.news-card:hover { box-shadow: var(--shadow); border-color: var(--blue); }
.news-date { color: var(--gray-500); font-size: 13px; margin-bottom: 8px; }
.news-card h3 { color: var(--navy); font-size: 17px; margin-bottom: 8px; }
.news-card p { font-size: 14px; color: var(--gray-500); }

/* ---- 頁面橫幅 ---- */
.page-banner { background: linear-gradient(135deg, var(--navy), var(--blue)); color: #fff; padding: 56px 0; }
.page-banner h1 { font-size: 32px; margin-bottom: 6px; }
.page-banner p { color: #cbd5e1; }
.page-banner a { color: #fff; }
.page-banner a:hover { text-decoration: underline; }

/* ---- 產品目錄 ---- */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; }
.catalog-side { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; height: fit-content; }
.catalog-side h3 { color: var(--navy); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--blue); }
.catalog-side ul { list-style: none; }
.catalog-side a { display: block; padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.catalog-side a:hover, .catalog-side a.active { background: #eff6ff; color: var(--blue); font-weight: 600; }
.search-bar { display: flex; gap: 10px; margin-bottom: 20px; }
.search-bar input[type=text] { flex: 1; padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 15px; }
.catalog-desc { color: var(--gray-500); margin-bottom: 20px; font-size: 14px; }
.empty { text-align: center; color: var(--gray-500); padding: 50px 0; }

/* ---- 分頁 ---- */
.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 36px; flex-wrap: wrap; }
.pagination a {
    display: inline-block; padding: 8px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 14px;
}
.pagination a:hover { border-color: var(--blue); color: var(--blue); }
.pagination a.current { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ---- 產品內頁 ---- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-bottom: 40px; }
.product-gallery { border: 1px solid var(--gray-200); border-radius: var(--radius); overflow: hidden; background: var(--gray-50); }
.product-gallery img { width: 100%; aspect-ratio: 4/3; object-fit: contain; }
.product-meta h1 { font-size: 26px; color: var(--navy); margin-bottom: 14px; }
.product-meta .model { color: var(--blue); font-size: 15px; }
.product-meta p { margin-bottom: 8px; }
.product-meta .lead { font-size: 16px; color: var(--gray-500); margin: 14px 0 22px; }
.detail-tabs { display: flex; border-bottom: 2px solid var(--gray-200); gap: 4px; }
.detail-tabs .tab { padding: 12px 24px; cursor: pointer; font-weight: 600; color: var(--gray-500); border-bottom: 3px solid transparent; margin-bottom: -2px; }
.detail-tabs .tab.active { color: var(--blue); border-bottom-color: var(--blue); }
.tab-panel { display: none; padding: 28px 0; }
.tab-panel.active { display: block; }
.tab-panel ul, .page-content ul { padding-left: 22px; margin: 12px 0; }
.tab-panel h2, .page-content h2 { color: var(--navy); margin: 20px 0 10px; }
.tab-panel p, .page-content p { margin-bottom: 12px; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { border: 1px solid var(--gray-200); padding: 12px 16px; text-align: left; }
.spec-table th { background: var(--gray-50); width: 200px; color: var(--navy); }

/* ---- 單頁內容 ---- */
.page-content { max-width: 860px; }
.page-content h2 { font-size: 24px; }
.article { padding-bottom: 40px; }
.back-link { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--gray-200); }
.back-link a { color: var(--blue); }

/* ---- 新聞列表 ---- */
.news-list { display: flex; flex-direction: column; gap: 18px; }
.news-item { display: flex; gap: 20px; background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 18px; transition: .25s; }
.news-item:hover { box-shadow: var(--shadow); border-color: var(--blue); }
.news-thumb { width: 180px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--gray-100); }
.news-thumb img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.news-body h2 { font-size: 18px; color: var(--navy); margin: 6px 0; }
.news-body p { font-size: 14px; color: var(--gray-500); }

/* ---- 聯絡 ---- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; }
.contact-info h2 { color: var(--navy); margin-bottom: 16px; }
.contact-detail { list-style: none; margin-bottom: 18px; }
.contact-detail li { padding: 7px 0; border-bottom: 1px dashed var(--gray-200); }
.contact-detail strong { color: var(--navy); }
.contact-form-wrap { background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius); padding: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; color: var(--navy); margin-bottom: 6px; font-size: 14px; }
.form-group input, .form-group textarea {
    width: 100%; padding: 11px 14px; border: 1px solid var(--gray-200); border-radius: 8px; font-size: 15px; font-family: inherit;
}
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-error { background: #fee2e2; color: #b91c1c; }

/* ---- 頁尾 ---- */
.site-footer { background: var(--navy); color: #cbd5e1; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 32px; padding: 48px 20px; }
.footer-col h4 { color: #fff; margin-bottom: 16px; font-size: 16px; }
.footer-col p { font-size: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 9px; }
.footer-col ul a:hover { color: #fff; }
.contact-list li { font-size: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding: 18px 0; font-size: 13px; text-align: center; }

/* ---- 響應式 ---- */
@media (max-width: 900px) {
    .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: #fff; flex-direction: column; align-items: stretch; padding: 12px; border-bottom: 1px solid var(--gray-200); }
    .main-nav.open { display: flex; }
    .main-nav .dropdown { position: static; border: none; box-shadow: none; padding-left: 18px; }
    .nav-toggle { display: block; }
    .hero { height: 380px; }
    .hero-content h1 { font-size: 28px; }
    .about-split, .product-detail, .catalog-layout, .contact-layout { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    .about-stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    .footer-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .news-item { flex-direction: column; }
    .news-thumb { width: 100%; }
    .topbar-inner { flex-wrap: wrap; }
    .topbar-right { margin-left: 0; width: 100%; }
}
