/* ==========================================================================
   佰洋科技有限公司 — 全站共用樣式
   目錄：1 設計變數 / 2 基礎 / 3 版面 / 4 按鈕 / 5 Header / 6 Hero
        7 區塊標題 / 8 卡片與網格 / 9 元件 / 10 表單 / 11 Footer / 12 RWD
   ========================================================================== */

/* 1. 設計變數 -------------------------------------------------------------- */
:root {
  --c-primary: #0d2b52;
  --c-primary-700: #08203f;
  --c-primary-900: #051528;
  --c-accent: #00a3c4;
  --c-accent-600: #008aa6;
  --c-accent-50: #e6f7fb;
  --c-ink: #1b2533;
  --c-muted: #5b6b7f;
  --c-bg: #ffffff;
  --c-surface: #f3f6fa;
  --c-border: #dde4ee;
  --c-white: #ffffff;
  --c-success: #1f9d6b;

  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;

  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-base: 1rem;
  --fs-lg: clamp(1.0625rem, .3vw + 1rem, 1.1875rem);
  --fs-h4: clamp(1.0625rem, .4vw + 1rem, 1.25rem);
  --fs-h3: clamp(1.1875rem, .6vw + 1rem, 1.5rem);
  --fs-h2: clamp(1.5rem, 1.6vw + 1rem, 2.25rem);
  --fs-h1: clamp(1.875rem, 3vw + 1rem, 3.25rem);

  --container: 1200px;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3.5rem, 7vw, 6rem);
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(13, 43, 82, .08);
  --shadow: 0 8px 24px rgba(13, 43, 82, .10);
  --header-h: 72px;
  --ease: .2s ease;
}

/* 2. 基礎 ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: 1.75;
  color: var(--c-ink);
  background: var(--c-bg);
  overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--c-accent-600); text-decoration: none; transition: color var(--ease); }
a:hover { color: var(--c-primary); }
h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.35; color: var(--c-primary); font-weight: 700; }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p { margin: 0 0 1em; }
ul, ol { margin: 0 0 1em; padding-left: 1.25em; }
:focus-visible { outline: 3px solid var(--c-accent); outline-offset: 2px; }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 200;
  background: var(--c-primary); color: var(--c-white);
  padding: .6em 1em; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 1rem; color: var(--c-white); }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* 3. 版面 ------------------------------------------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-y); }
.section--alt { background: var(--c-surface); }
.section--dark { background: var(--c-primary); color: rgba(255, 255, 255, .86); }
.section--dark h2, .section--dark h3, .section--dark h4 { color: var(--c-white); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }

.grid { display: grid; gap: clamp(1.25rem, 2.5vw, 2rem); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr)); }
.grid--4 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}
.split__media img {
  width: 100%; aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.split--reverse .split__media { order: 2; }
.split__content > :last-child { margin-bottom: 0; }

.text-center { text-align: center; }
.mt-lg { margin-top: clamp(2rem, 4vw, 3rem); }
.narrow { max-width: 52rem; margin-inline: auto; }

/* 4. 按鈕 ------------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  padding: .7em 1.6em;
  font: inherit; font-size: var(--fs-base); font-weight: 600; line-height: 1.4;
  border: 2px solid transparent; border-radius: 999px;
  cursor: pointer; text-align: center;
  transition: background var(--ease), color var(--ease), border-color var(--ease), transform var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--c-accent); color: var(--c-white); }
.btn--primary:hover { background: var(--c-accent-600); color: var(--c-white); }
.btn--outline { border-color: var(--c-primary); color: var(--c-primary); background: transparent; }
.btn--outline:hover { background: var(--c-primary); color: var(--c-white); }
.btn--light { border-color: rgba(255, 255, 255, .8); color: var(--c-white); background: transparent; }
.btn--light:hover { background: var(--c-white); color: var(--c-primary); }
.btn-group { display: flex; flex-wrap: wrap; gap: .75rem 1rem; }
.btn-group--center { justify-content: center; }

.link-arrow { font-weight: 600; display: inline-flex; align-items: center; gap: .35em; }
.link-arrow::after { content: "→"; transition: transform var(--ease); }
.link-arrow:hover::after { transform: translateX(3px); }

/* 5. Header / Nav ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: var(--header-h);
}
.brand { display: inline-flex; align-items: center; gap: .65rem; color: var(--c-primary); }
.brand:hover { color: var(--c-primary); }
.brand__mark { width: 40px; height: 40px; flex-shrink: 0; }
.brand__text { display: flex; flex-direction: column; line-height: 1.2; }
.brand__name { font-size: 1.125rem; font-weight: 700; letter-spacing: .04em; }
.brand__en { font-size: .6875rem; letter-spacing: .12em; color: var(--c-muted); }

.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 44px; height: 44px; padding: 0;
  background: transparent; border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  color: var(--c-primary); cursor: pointer;
}
.nav-toggle__bar,
.nav-toggle__bar::before,
.nav-toggle__bar::after {
  content: ""; display: block; width: 20px; height: 2px; background: currentColor;
  border-radius: 2px; transition: transform var(--ease), opacity var(--ease);
}
.nav-toggle__bar { position: relative; }
.nav-toggle__bar::before { position: absolute; top: -6px; }
.nav-toggle__bar::after { position: absolute; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-6px) rotate(-45deg); }

.site-nav__list {
  display: flex; align-items: center; gap: .25rem;
  list-style: none; margin: 0; padding: 0;
}
.site-nav__link {
  display: block; padding: .5em .9em; border-radius: 999px;
  color: var(--c-ink); font-weight: 500; font-size: var(--fs-sm);
}
.site-nav__link:hover { color: var(--c-accent-600); background: var(--c-accent-50); }
.site-nav__link[aria-current="page"] { color: var(--c-accent-600); font-weight: 700; }
.site-nav__cta { margin-left: .5rem; }
.site-nav__cta .btn { padding: .5em 1.2em; font-size: var(--fs-sm); }

/* 6. Hero（首頁）與 Page hero（內頁） ------------------------------------- */
.hero {
  position: relative;
  display: flex; align-items: center;
  min-height: clamp(30rem, 82vh, 46rem);
  padding-block: clamp(4rem, 10vw, 7rem);
  color: var(--c-white);
  background: var(--c-primary-900) center / cover no-repeat;
  isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(5, 21, 40, .92) 0%, rgba(5, 21, 40, .72) 50%, rgba(5, 21, 40, .25) 100%);
}
.hero__content { max-width: 40rem; }
.hero__eyebrow {
  display: inline-block; margin-bottom: 1rem;
  padding: .3em 1em; border: 1px solid rgba(255, 255, 255, .35); border-radius: 999px;
  font-size: var(--fs-xs); letter-spacing: .12em; color: rgba(255, 255, 255, .9);
  max-width: 100%;
}
.hero__title { color: var(--c-white); font-size: var(--fs-h1); margin-bottom: .5em; }
.hero__title span { color: #5fd6ee; }
.hero__lead { font-size: var(--fs-lg); color: rgba(255, 255, 255, .86); margin-bottom: 2rem; }

.page-hero {
  position: relative;
  padding-block: clamp(4rem, 9vw, 6.5rem);
  color: var(--c-white);
  background: var(--c-primary-900) center / cover no-repeat;
  isolation: isolate;
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgba(5, 21, 40, .9) 0%, rgba(5, 21, 40, .65) 60%, rgba(5, 21, 40, .4) 100%);
}
.page-hero__content { max-width: 42rem; }
.page-hero__title { color: var(--c-white); font-size: var(--fs-h1); margin-bottom: .35em; }
.page-hero__lead { font-size: var(--fs-lg); color: rgba(255, 255, 255, .86); margin: 0; }
.breadcrumb {
  display: flex; flex-wrap: wrap; gap: .4rem; list-style: none;
  margin: 0 0 1rem; padding: 0; font-size: var(--fs-xs); color: rgba(255, 255, 255, .75);
}
.breadcrumb a { color: rgba(255, 255, 255, .9); }
.breadcrumb a:hover { color: var(--c-white); text-decoration: underline; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; opacity: .6; }

/* 7. 區塊標題 -------------------------------------------------------------- */
.section-head { max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 3rem); }
.section-head--center { margin-inline: auto; text-align: center; }
.eyebrow {
  display: inline-block; margin-bottom: .6rem;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: var(--c-accent-600);
}
.section--dark .eyebrow { color: #5fd6ee; }
.section-head h2 { margin-bottom: .4em; }
.lead { font-size: var(--fs-lg); color: var(--c-muted); }
.section--dark .lead { color: rgba(255, 255, 255, .78); }

/* 8. 卡片與網格 ------------------------------------------------------------ */
.card {
  display: flex; flex-direction: column;
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow var(--ease), transform var(--ease);
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card__media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--c-surface); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { flex: 1; display: flex; flex-direction: column; padding: clamp(1.25rem, 2.5vw, 1.75rem); }
.card__title { font-size: var(--fs-h4); margin-bottom: .5em; }
.card__text { color: var(--c-muted); font-size: var(--fs-sm); }
.card__body > :last-child { margin-bottom: 0; }
.card__footer { margin-top: auto; padding-top: 1rem; }

.feature {
  padding: clamp(1.5rem, 3vw, 2rem);
  background: var(--c-white);
  border: 1px solid var(--c-border); border-radius: var(--radius);
  height: 100%;
}
.section--alt .feature { border-color: transparent; box-shadow: var(--shadow-sm); }
.section--dark .feature { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .14); }
.feature > :last-child { margin-bottom: 0; }
.feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 3rem; height: 3rem; margin-bottom: 1rem;
  border-radius: var(--radius-sm);
  background: var(--c-accent-50); color: var(--c-accent-600);
}
.section--dark .feature__icon { background: rgba(0, 163, 196, .18); color: #5fd6ee; }
.feature__icon svg { width: 1.5rem; height: 1.5rem; }
.feature__title { font-size: var(--fs-h4); margin-bottom: .4em; }
.feature__text { color: var(--c-muted); font-size: var(--fs-sm); margin: 0; }
.section--dark .feature__text { color: rgba(255, 255, 255, .75); }

/* 9. 元件 ------------------------------------------------------------------ */
/* 數據 */
.stat { padding: .25rem; }
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 1.5rem; text-align: center;
}
.stat__value { display: block; font-size: var(--fs-h2); font-weight: 700; line-height: 1.2; color: var(--c-white); }
.stat__value small { font-size: .5em; margin-left: .15em; }
.stat__label { display: block; margin-top: .35rem; font-size: var(--fs-sm); color: rgba(255, 255, 255, .78); }

/* 流程步驟 */
.steps {
  display: grid; grid-template-columns: 1fr;
  gap: 1.25rem; list-style: none; margin: 0; padding: 0; counter-reset: step;
}
@media (min-width: 420px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1100px) { .steps { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); } }
.step {
  position: relative; counter-increment: step;
  padding: 1.5rem 1.25rem 1.25rem;
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius);
}
.step::before {
  content: counter(step, decimal-leading-zero);
  display: block; margin-bottom: .5rem;
  font-size: 1.5rem; font-weight: 700; color: var(--c-accent);
}
.step__title { font-size: var(--fs-base); margin-bottom: .3em; }
.step__text { margin: 0; color: var(--c-muted); font-size: var(--fs-sm); }

/* 勾選清單 */
.checklist { list-style: none; padding: 0; margin: 0 0 1.5rem; display: grid; gap: .65rem; }
.checklist li { position: relative; padding-left: 1.9rem; }
.checklist li::before {
  content: ""; position: absolute; left: 0; top: .35em;
  width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--c-accent-50) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23008aa6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 10.5l3.2 3L15 7'/%3E%3C/svg%3E") center / 75% no-repeat;
}
.section--dark .checklist li::before { background-color: rgba(255, 255, 255, .12); }
.checklist--cross li::before {
  background: #fdecea url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23c0392b' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6.5 6.5l7 7M13.5 6.5l-7 7'/%3E%3C/svg%3E") center / 75% no-repeat;
}

/* 標籤 */
.tag-list { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1rem; }
.tag {
  display: inline-block; padding: .2em .8em;
  font-size: var(--fs-xs); border-radius: 999px;
  background: var(--c-accent-50); color: var(--c-accent-600);
}

/* 提示框 */
.notice {
  display: flex; gap: 1rem; align-items: flex-start;
  padding: 1.25rem 1.5rem;
  background: var(--c-accent-50); border-left: 4px solid var(--c-accent);
  border-radius: var(--radius-sm); color: var(--c-ink); font-size: var(--fs-sm);
}
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--c-primary); }

/* 常見問題 */
.faq { display: grid; gap: .75rem; max-width: 52rem; margin-inline: auto; }
.faq__item {
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
}
.faq__item summary {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 1.25rem; cursor: pointer; font-weight: 600; color: var(--c-primary);
  list-style: none;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; font-size: 1.4rem; line-height: 1; color: var(--c-accent); flex-shrink: 0; }
.faq__item[open] summary::after { content: "−"; }
.faq__answer { padding: 0 1.25rem 1.25rem; color: var(--c-muted); }
.faq__answer p:last-child { margin-bottom: 0; }

/* CTA 橫幅 */
.cta-band {
  background: linear-gradient(120deg, var(--c-primary) 0%, var(--c-primary-700) 55%, #0b4f72 100%);
  color: var(--c-white);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}
.cta-band__inner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 2rem;
}
.cta-band__title { color: var(--c-white); font-size: var(--fs-h2); margin-bottom: .25em; }
.cta-band__text { margin: 0; color: rgba(255, 255, 255, .82); max-width: 38rem; }

/* 聯絡資訊 */
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.contact-list li { display: flex; gap: .85rem; align-items: flex-start; }
.contact-list__icon {
  flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  width: 2.5rem; height: 2.5rem; border-radius: 50%;
  background: var(--c-accent-50); color: var(--c-accent-600);
}
.contact-list__icon svg { width: 1.2rem; height: 1.2rem; }
.contact-list__label { display: block; font-size: var(--fs-xs); color: var(--c-muted); }
.contact-list__value { display: block; font-weight: 600; color: var(--c-primary); }

/* 10. 表單 ----------------------------------------------------------------- */
.form {
  display: grid; gap: 1.1rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.form__row { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); }
.form__field { display: grid; gap: .4rem; }
.form__label { font-weight: 600; font-size: var(--fs-sm); color: var(--c-primary); }
.form__label .req { color: #c0392b; margin-left: .15em; }
.form__control {
  width: 100%; padding: .7em .9em;
  font: inherit; font-size: var(--fs-base); color: var(--c-ink);
  background: var(--c-white); border: 1px solid var(--c-border); border-radius: var(--radius-sm);
  transition: border-color var(--ease), box-shadow var(--ease);
}
.form__control:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(0, 163, 196, .18); }
textarea.form__control { min-height: 9rem; resize: vertical; }
.form__check { display: flex; gap: .6rem; align-items: flex-start; font-size: var(--fs-sm); color: var(--c-muted); }
.form__check input { margin-top: .35em; accent-color: var(--c-accent); }
.form__note { font-size: var(--fs-xs); color: var(--c-muted); margin: 0; }
.form__status { margin: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--c-success); }
.form__status:empty { display: none; }

/* 11. Footer --------------------------------------------------------------- */
.site-footer { background: var(--c-primary-900); color: rgba(255, 255, 255, .72); font-size: var(--fs-sm); }
.site-footer__top {
  display: grid; gap: 2rem 3rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  padding-block: clamp(3rem, 6vw, 4rem);
}
.site-footer .brand,
.site-footer .brand:hover { color: var(--c-white); }
.site-footer .brand__en { color: rgba(255, 255, 255, .55); }
.site-footer .brand__mark-bg { fill: #12406f; }
@media (min-width: 961px) {
  .site-footer__top { grid-template-columns: minmax(0, 1.6fr) repeat(2, minmax(0, 1fr)) minmax(0, 1.4fr); }
}
.site-footer__about { margin-top: 1rem; }
.site-footer__title { font-size: var(--fs-base); color: var(--c-white); margin-bottom: 1rem; }
.site-footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.site-footer a { color: rgba(255, 255, 255, .72); }
.site-footer a:hover { color: var(--c-white); }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1.5rem;
  padding-block: 1.25rem; border-top: 1px solid rgba(255, 255, 255, .12);
  font-size: var(--fs-xs); color: rgba(255, 255, 255, .55);
}

/* 12. RWD ------------------------------------------------------------------ */
@media (max-width: 960px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--c-white); border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow);
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav__list {
    flex-direction: column; align-items: stretch; gap: 0;
    max-width: var(--container); margin-inline: auto;
    padding: .5rem var(--gutter) 1rem;
  }
  .site-nav__link { padding: .8em .75em; border-radius: var(--radius-sm); font-size: var(--fs-base); }
  .site-nav__cta { margin: .5rem 0 0; }
  .site-nav__cta .btn { width: 100%; padding: .7em 1.6em; font-size: var(--fs-base); }
}

@media (max-width: 640px) {
  :root { --header-h: 64px; }
  .brand__mark { width: 34px; height: 34px; }
  .brand__name { font-size: 1rem; }
  .hero__eyebrow { font-size: .6875rem; letter-spacing: .04em; padding: .3em .8em; }
  .hero::before { background: linear-gradient(180deg, rgba(5, 21, 40, .78) 0%, rgba(5, 21, 40, .9) 100%); }
  .hero .btn-group .btn,
  .cta-band .btn-group .btn { flex: 1 1 100%; }
  .split--reverse .split__media { order: 0; }
  .cta-band__inner { flex-direction: column; align-items: stretch; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}
