/* ==========================================================================
   YSGT — Global styles & components
   ========================================================================== */

/* ---- Reset ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-body);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }
h1, h2, h3, h4, p { margin: 0; }
::selection { background: var(--ys-red-600); color: var(--white); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 1ms !important; animation-duration: 1ms !important; }
}

/* ---- Layout ------------------------------------------------------------ */
.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
}
.section { padding: var(--section-rhythm) 0; }
.section--subtle { background: var(--surface-subtle); }
.section--dark { background: var(--ink-900); }
.section--dark, .section--dark p { color: rgba(255, 255, 255, .75); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--section-rhythm);
  align-items: start;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 40px; } }

/* ---- Skip link --------------------------------------------------------- */
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ys-red-600); color: var(--white);
  padding: 12px 20px; font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 2px solid var(--ys-red-600); outline-offset: 2px; }
/* 深色區塊上的焦點框：品牌紅在深色底不夠顯眼，改用白色並保留紅色內襯，
   讓鍵盤使用者在任何背景下都看得見目前焦點在哪。 */
.hero :focus-visible,
.cta-band :focus-visible,
.site-footer :focus-visible,
.quote-bar :focus-visible,
.tile :focus-visible {
  outline-color: var(--white);
  box-shadow: 0 0 0 4px var(--ys-red-600);
}

/* 保險：任何寬元素都不該讓整頁能左右滑動。
   這裡用 clip 而不是 hidden —— hidden 會讓 body 變成捲動容器，
   連帶讓表頭與型錄分類列的 position: sticky 失效。 */
body { max-width: 100%; overflow-x: clip; }

/* 觸控裝置：把主要操作放大到好按的尺寸 */
@media (pointer: coarse) {
  .btn { min-height: 48px; }
  .site-nav a { padding-top: 16px; padding-bottom: 16px; }
  .quote-list__del, .modal__close { width: 44px; height: 44px; }
  .faq-item__q { padding: 22px 0; }
}

/* ---- Header ------------------------------------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(184, 190, 200, .72);
  box-shadow: 0 10px 26px rgba(14, 16, 19, .05);
  backdrop-filter: saturate(150%) blur(14px);
}
.site-header__inner {
  height: 76px;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 var(--page-pad);
  display: flex; align-items: center; gap: 40px;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img { height: 36px; width: auto; }
.brand__text { display: flex; flex-direction: column; line-height: 1.25; }
.brand__zh { font-size: 18px; font-weight: 700; color: var(--text-heading); white-space: nowrap; }
.brand__en {
  font-family: var(--font-display); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; color: var(--text-muted); white-space: nowrap;
}
.site-nav {
  display: flex; gap: 22px; margin-left: auto;
  font-size: var(--fs-body); font-weight: 500;
}
.site-nav a {
  position: relative;
  color: var(--text-heading);
  transition: color var(--t-control) var(--ease);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--ys-red-600); }
.site-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -10px; height: 2px;
  background: var(--ys-red-600);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-control) var(--ease);
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.site-nav a[aria-current="page"] { color: var(--ys-red-600); }

.nav-toggle {
  display: none; margin-left: auto; background: none; border: 1px solid var(--border-default);
  width: 44px; height: 40px; cursor: pointer; color: var(--text-heading);
  align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: currentColor; position: relative;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

@media (max-width: 1180px) {
  .site-nav { gap: 16px; font-size: 15px; }
  .brand__zh { font-size: 16px; }
}
@media (max-width: 480px) {
  /* 小螢幕縮小品牌字，避免表頭三個元素擠到溢出 */
  .brand img { height: 30px; }
  .brand__zh { font-size: 15px; }
  .brand__en { font-size: 9px; letter-spacing: .1em; }
  .site-header__inner { gap: 8px; }
}

@media (max-width: 960px) {
  .site-header__inner { gap: 12px; }
  .search { margin-left: auto; }
  .nav-toggle { display: flex; margin-left: 0; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 76px;
    flex-direction: column; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--border-default);
    max-height: 0; overflow: hidden;
    transition: max-height var(--t-surface) var(--ease);
  }
  .site-nav a { padding: 14px var(--page-pad); border-top: 1px solid var(--border-default); }
  .site-header.is-open .site-nav { max-height: 60vh; overflow-y: auto; }
}

/* ---- Eyebrow ----------------------------------------------------------- */
.eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: var(--ls-eyebrow); text-transform: uppercase;
  color: var(--ys-red-600);
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--ys-red-600); flex: none; }
.eyebrow--onDark { color: rgba(255, 255, 255, .68); }
.eyebrow--muted { color: var(--text-muted); }

/* ---- Hero -------------------------------------------------------------- */
.hero { position: relative; background: var(--ink-900); overflow: hidden; }
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: var(--blueprint-grid);
  background-size: 44px 44px;
  opacity: .36;
  mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.7) 48%, transparent 88%);
  pointer-events: none;
}
.hero__media {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: .32;
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(90deg, rgba(14,16,19,.96) 0%, rgba(14,16,19,.66) 48%, rgba(14,16,19,.18) 100%),
    linear-gradient(180deg, rgba(14,16,19,.12) 0%, rgba(14,16,19,.78) 100%);
}
.hero__scrim--deep {
  background:
    linear-gradient(90deg, rgba(14,16,19,.98) 0%, rgba(14,16,19,.64) 60%, rgba(14,16,19,.32) 100%),
    linear-gradient(180deg, rgba(14,16,19,.06) 0%, rgba(14,16,19,.74) 100%);
}
.hero__sheen { position: absolute; inset: 0; background: var(--sheen-steel); opacity: .16; }
.hero__inner {
  position: relative;
  max-width: var(--content-max); margin: 0 auto;
  padding: 64px var(--page-pad) 40px;
}
.hero--home .hero__inner { padding: 112px var(--page-pad) 92px; }
.hero:has(+ .cat-switch) {
  min-height: 408px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}
.hero:has(+ .cat-switch) .hero__inner {
  min-height: 408px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 78px var(--page-pad) 42px;
}
.hero:has(+ .cat-switch) h1 {
  max-width: 860px;
  font-size: clamp(42px, 4vw, 60px);
}
.hero:has(+ .cat-switch) .hero__lead {
  max-width: 720px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.22);
}
.hero:has(+ .cat-switch) .breadcrumb { margin-top: 22px; }
.hero h1 {
  max-width: 760px;
  font-family: var(--font-display); font-size: var(--fs-h1); font-weight: 700;
  line-height: var(--lh-display); color: var(--white);
  text-wrap: balance;
}
.hero__break { white-space: nowrap; }
.hero__mark { color: rgba(255,255,255,.88); }
.hero__lead {
  margin-top: 20px; max-width: 560px;
  font-size: var(--fs-lead); line-height: var(--lh-body); color: rgba(255,255,255,.8);
}
.hero__lead--wide { max-width: 720px; margin-top: 16px; font-size: 17px; color: rgba(255,255,255,.72); }
.hero__specs {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(3, minmax(128px, 1fr));
  max-width: 560px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(14,16,19,.28);
  backdrop-filter: blur(8px);
}
.hero__spec {
  padding: 16px 18px;
  border-right: 1px solid rgba(255,255,255,.14);
}
.hero__spec:last-child { border-right: none; }
.hero__spec b {
  display: block;
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--white);
  line-height: 1.2;
}
.hero__spec span {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: rgba(255,255,255,.62);
}
@media (max-width: 640px) {
  .hero--home .hero__inner { padding: 72px var(--page-pad) 64px; }
  .hero:has(+ .cat-switch),
  .hero:has(+ .cat-switch) .hero__inner { min-height: 0; }
  .hero:has(+ .cat-switch) .hero__inner { padding: 62px var(--page-pad) 36px; }
  .hero:has(+ .cat-switch) h1 { font-size: 36px; }
  .hero h1 { font-size: 31px; }
  .hero__mark { display: none; }
  .hero__break { display: block; white-space: normal; }
  .hero__specs { grid-template-columns: 1fr; }
  .hero__spec { border-right: 0; border-bottom: 1px solid rgba(255,255,255,.14); }
  .hero__spec:last-child { border-bottom: none; }
}

.breadcrumb {
  margin-top: 20px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  font-size: var(--fs-xs); color: rgba(255,255,255,.68);
}
.breadcrumb a { color: rgba(255,255,255,.68); transition: color var(--t-control) var(--ease); }
.breadcrumb a:hover { color: var(--white); }
.breadcrumb .sep { font-family: var(--font-mono); color: rgba(255,255,255,.4); }
.breadcrumb .current { color: var(--white); }

/* ---- Headings ---------------------------------------------------------- */
.h2 {
  font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700;
  line-height: var(--lh-display); color: var(--text-heading);
}
.h3 {
  font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700;
  color: var(--text-heading);
}
.lead { margin-top: 16px; max-width: 720px; font-size: var(--fs-lead); line-height: var(--lh-body); color: var(--text-muted); }
.prose { margin-top: 20px; max-width: 720px; font-size: var(--fs-lead); line-height: var(--lh-body); color: var(--text-muted); }
.section--dark .h2, .section--dark .h3 { color: var(--white); }
.section--dark .lead, .section--dark .prose { color: rgba(255,255,255,.75); }

/* ---- Button ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 44px; padding: 0 20px;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700;
  letter-spacing: .02em; border: 1px solid transparent; cursor: pointer;
  border-radius: var(--radius-none); text-align: center;
  transition: background var(--t-control) var(--ease),
              color var(--t-control) var(--ease),
              box-shadow var(--t-control) var(--ease),
              transform var(--t-control) var(--ease);
}
.btn--lg { height: 48px; padding: 0 32px; font-size: var(--fs-body); }
.btn .arrow {
  font-family: var(--font-mono); font-size: 15px; line-height: 1;
  transition: transform var(--t-control) var(--ease);
}
.btn:hover .arrow { transform: translateX(4px); }
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn:disabled:active { transform: none; }

.btn--primary {
  background: var(--ys-red-600); color: var(--white);
  box-shadow: var(--shadow-cta), inset 0 -2px 0 rgba(14,16,19,.22);
}
.btn--primary:hover:not(:disabled) { background: var(--ys-red-700); transform: translateY(-1px); }

/* ghost：無框文字連結（設計檔中為純文字 + 箭頭） */
.btn--ghost {
  background: none; border: none; box-shadow: none;
  height: auto; padding: 0; font-size: 15px; color: var(--text-heading);
}
.btn--ghost:hover { color: var(--ys-red-600); background: none; box-shadow: none; }
.btn--ghost:active { transform: none; }

/* 深色主視覺上的次要按鈕：白色細框，與紅色主按鈕並排時層級分明 */
.btn--ghost-onDark {
  background: none;
  border: 1px solid rgba(255,255,255,.4);
  color: var(--white);
  box-shadow: none;
}
.btn--ghost-onDark:hover:not(:disabled) {
  border-color: var(--white);
  background: rgba(255,255,255,.08);
  color: var(--white);
}

/* 主視覺裡的按鈕列。窄螢幕時改成上下排列，按鈕才不會被擠到爆版 */
.hero__actions {
  margin-top: 24px;
  display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
}
@media (max-width: 640px) {
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; justify-content: center; }
}

.btn--invert { background: var(--white); color: var(--ys-red-600); box-shadow: var(--shadow-cta); }
.btn--invert:hover { background: var(--ink-050); }

.btn--secondary { background: var(--white); color: var(--text-heading); border-color: var(--border-default); }
.btn--secondary:hover { background: var(--surface-subtle); box-shadow: var(--shadow-1); }

/* ---- SpecTable --------------------------------------------------------- */
.spec-table { background: transparent; }
.spec-table__caption {
  display: block;
  padding-bottom: 16px;
  font-family: var(--font-display); font-size: var(--fs-xs); font-weight: 600;
  letter-spacing: .18em; color: var(--ys-red-600);
}
.spec-table__row {
  display: grid; grid-template-columns: 1fr auto 68px; gap: 12px; align-items: baseline;
  padding: 20px 0; border-top: 1px solid var(--border-default);
}
.spec-table__row:last-child { border-bottom: 1px solid var(--border-default); }
.spec-table__label { font-size: var(--fs-body); color: var(--text-heading); }
.spec-table__value {
  font-family: var(--font-mono); font-size: 17px; font-weight: 500;
  color: var(--text-heading); text-align: right; white-space: nowrap;
}
.spec-table__unit { font-family: var(--font-mono); font-size: 14px; color: var(--text-muted); text-align: left; }

/* ---- Tag --------------------------------------------------------------- */
.tag {
  display: inline-flex; align-items: center; height: 36px; padding: 0 14px;
  border: 1px solid var(--border-default); border-radius: var(--radius-badge);
  font-size: var(--fs-sm); color: var(--text-heading); background: var(--white);
  transition: border-color var(--t-control) var(--ease), box-shadow var(--t-control) var(--ease);
}
.tag:hover { border-color: var(--ys-red-600); box-shadow: var(--shadow-1); }
.tag-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }

/* ---- Card -------------------------------------------------------------- */
.card {
  background: var(--white); border: 1px solid var(--border-default); padding: 24px;
  transition: box-shadow var(--t-surface) var(--ease), transform var(--t-surface) var(--ease);
}
.card:hover { box-shadow: var(--shadow-hover); }
.card--accent { border-top: 3px solid var(--ys-red-600); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--grid-gap); margin-top: 40px; }
@media (max-width: 900px) { .grid-3 { grid-template-columns: 1fr; } }

.card__title { display: flex; align-items: center; gap: 12px; }
.card__title .icon { color: var(--ys-red-600); flex: none; }
.card__title span { font-family: var(--font-display); font-size: var(--fs-body); font-weight: 600; color: var(--text-heading); }

/* ---- Case card --------------------------------------------------------- */
.case__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-subtle); border: 1px dashed var(--ink-300); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; padding: 12px; }
.case__media span { font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--text-muted); }
.case__body { padding-top: 20px; display: flex; flex-direction: column; gap: 12px; }
.case__tag { font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ys-red-600); }
.case__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-heading); }
.case__text { margin-top: 4px; font-size: var(--fs-sm); line-height: var(--lh-body); color: var(--text-muted); }

/* ---- Philosophy panel -------------------------------------------------- */
.panel-accent { border-top: 3px solid var(--ys-red-600); padding-top: 24px; }

/* ---- Marquee ----------------------------------------------------------- */
.marquee {
  background: var(--ink-900); overflow: hidden; padding: 32px 0;
  --marquee-duration: 28s;
}
.marquee__track { display: flex; width: max-content; animation: marquee var(--marquee-duration) linear infinite; }
.marquee__item {
  font-family: var(--font-display); font-size: 40px; font-weight: 700;
  letter-spacing: .06em; color: rgba(255,255,255,.9); white-space: nowrap; padding-right: 64px;
}
.marquee__item .dot { color: var(--ys-red-600); }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee:hover .marquee__track { animation-play-state: paused; }

/* ---- CTA band ---------------------------------------------------------- */
.cta-band { background: var(--ys-red-600); }
.cta-band__inner {
  max-width: var(--content-max); margin: 0 auto;
  padding: 64px var(--page-pad);
  display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap;
}
.cta-band h2 { font-family: var(--font-display); font-size: var(--fs-h2); font-weight: 700; color: var(--white); }
.cta-band p { margin-top: 12px; font-size: var(--fs-lead); color: rgba(255,255,255,.85); }

/* ---- Footer ------------------------------------------------------------ */
.site-footer { background: var(--ink-900); color: rgba(255,255,255,.68); padding: var(--section-rhythm) 0 0; }
.site-footer__grid {
  display: grid; grid-template-columns: 1.2fr 1fr 1fr 1.3fr; gap: 40px; padding-bottom: 64px;
}
@media (max-width: 1080px) { .site-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .site-footer__grid { grid-template-columns: 1fr; } }
.site-footer__col { display: flex; flex-direction: column; gap: 12px; }
.site-footer__col--brand { gap: 16px; }
.site-footer__col--brand img { height: 44px; width: auto; align-self: flex-start; }
.site-footer__col p { font-size: var(--fs-xs); line-height: var(--lh-body); }
.site-footer__head {
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--white);
}
.site-footer__col a, .site-footer__col span:not(.site-footer__head) { font-size: var(--fs-xs); color: rgba(255,255,255,.68); }
/* LINE 是目前的主要聯絡方式，在頁尾這一疊灰字裡拉亮一點 */
.site-footer__line { color: rgba(255,255,255,.9) !important; }
.site-footer__line strong {
  font-family: var(--font-mono); font-weight: 600; letter-spacing: .03em; color: var(--white);
}
.site-footer__col a { transition: color var(--t-control) var(--ease); }
.site-footer__col a:hover { color: var(--white); }
.site-footer__pdf {
  margin-top: 4px; align-self: flex-start;
  border: 1px solid rgba(255,255,255,.3); padding: 7px 12px;
  font-family: var(--font-mono);
  transition: border-color var(--t-control) var(--ease), background var(--t-control) var(--ease);
}
.site-footer__pdf:hover { border-color: var(--ys-red-600); background: var(--ys-red-600); color: var(--white) !important; }

.site-footer__bar {
  border-top: 1px solid rgba(255,255,255,.22); padding: 20px 0;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: var(--fs-eyebrow); color: rgba(255,255,255,.5);
}

/* ---- Inquiry modal ----------------------------------------------------- */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0; background: rgba(14,16,19,.6);
  display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 24px;
}
.modal__card {
  background: var(--white); max-width: 560px; width: 100%; max-height: 90vh; overflow: auto;
  border: 1px solid var(--border-default); box-shadow: var(--shadow-2);
}
.modal__head {
  padding: 28px 32px; border-bottom: 1px solid var(--border-default);
  display: flex; align-items: center; justify-content: space-between;
}
.modal__head h3 { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; color: var(--text-heading); }
.modal__close {
  border: none; background: none; font-size: 22px; line-height: 1; cursor: pointer; color: var(--text-muted);
  width: 32px; height: 32px;
}
.modal__close:hover { color: var(--ys-red-600); }
.modal__body { padding: 28px 32px; display: flex; flex-direction: column; gap: 20px; }
.modal__done { padding: 48px 32px; text-align: center; }
.modal__done strong { display: block; font-family: var(--font-display); font-size: 20px; font-weight: 700; color: var(--text-heading); }
.modal__done p { margin-top: 12px; color: var(--text-muted); font-size: 15px; line-height: var(--lh-body); }

/* ---- Contact modal（洽詢單關閉時的「聯絡我們」）------------------------- */
.contact-lead { color: var(--text-muted); font-size: 15px; line-height: var(--lh-body); }
.contact-list { display: flex; flex-direction: column; gap: 2px; }
.contact-list__row {
  display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: baseline;
  padding: 12px 0; border-top: 1px solid var(--border-default);
}
.contact-list__row dt { font-size: var(--fs-xs); font-weight: 600; color: var(--text-muted); }
.contact-list__row dd { font-size: 15px; color: var(--text-heading); line-height: var(--lh-body); }
.contact-list__row a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.contact-list__row a:hover { color: var(--ys-red-600); }
/* LINE 是主要聯絡方式，字級與粗細拉開，讓人一眼看到 */
.contact-list__row--line { border-top: none; padding-top: 0; }
.contact-list__row--line dd { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.contact-list__id {
  font-family: var(--font-mono); font-size: 22px; font-weight: 600;
  letter-spacing: .04em; color: var(--text-heading);
}
.contact-copy {
  border: 1px solid var(--border-default); background: none; cursor: pointer;
  font-size: 12px; padding: 5px 12px; color: var(--text-muted);
}
.contact-copy:hover { border-color: var(--ink-900); color: var(--text-heading); }
.contact-copy.is-done { border-color: #0a7d32; color: #0a7d32; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { font-size: var(--fs-xs); font-weight: 600; color: var(--text-heading); }
.field__label .req { color: var(--ys-red-600); margin-left: 4px; }
.field__hint { font-size: 12px; color: var(--text-muted); }
.field input, .field textarea {
  font-family: var(--font-body); font-size: var(--fs-sm); color: var(--text-heading);
  border: 1px solid var(--border-default); background: var(--white);
  padding: 0 12px; height: 44px; width: 100%;
  transition: border-color var(--t-control) var(--ease), box-shadow var(--t-control) var(--ease);
}
.field textarea { height: auto; padding: 12px; line-height: var(--lh-body); resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ys-red-600); box-shadow: 0 0 0 2px rgba(230,0,0,.14); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
body.is-locked { overflow: hidden; }

/* ---- 送出失敗提示 ------------------------------------------------------- */
.inquiry-error {
  border: 1px solid var(--ys-red-600); border-left-width: 3px;
  background: #fff5f5; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.inquiry-error[hidden] { display: none; }
.inquiry-error strong { font-family: var(--font-display); font-size: 15px; color: var(--ys-red-600); }
.inquiry-error p { font-size: var(--fs-xs); line-height: var(--lh-body); color: var(--text-body); }
.inquiry-error a { color: var(--ys-red-600); font-weight: 600; }
/* 上面那條把錯誤框裡的連結全染成紅色，連紅底的主要按鈕也一起中招，
   變成紅底紅字＝整顆看不見。按鈕要排除在外。 */
.inquiry-error a.btn--primary { color: var(--white); }
.inquiry-error a.btn--primary:hover { color: var(--white); }
.inquiry-error__contact { font-family: var(--font-mono); font-size: 12px; }
.inquiry-error__actions { display: flex; gap: 10px; flex-wrap: wrap; }
.inquiry-error__actions .btn { flex: none; }
.inquiry-error__detail { font-size: 12px; color: var(--text-muted); }
.inquiry-error__detail summary { cursor: pointer; user-select: none; }
.inquiry-error__detail pre {
  font-family: var(--font-mono); font-size: 11px; line-height: 1.6;
  background: var(--white); border: 1px solid var(--border-default);
  padding: 10px; margin-top: 8px; white-space: pre-wrap; word-break: break-all;
  max-height: 220px; overflow: auto;
}

/* ---- 詢價清單（彈窗內） -------------------------------------------------- */
#inquiry-models[hidden] { display: none; }
.quote-list__head {
  display: flex; align-items: baseline; justify-content: space-between;
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--ys-red-600);
  padding-bottom: 10px; border-bottom: 2px solid var(--ink-900);
}
.quote-list__head span { font-family: var(--font-mono); letter-spacing: 0; color: var(--text-muted); }
.quote-list { list-style: none; margin: 0; padding: 0; max-height: 200px; overflow-y: auto; overscroll-behavior: contain; }
.quote-list li {
  /* 型號 / 尺寸 / 數量 / 刪除 */
  display: grid; grid-template-columns: 1fr auto auto 28px; gap: 10px; align-items: center;
  padding: 9px 0; border-bottom: 1px solid var(--border-default);
}
@media (max-width: 520px) {
  /* 手機：尺寸換行到型號下方，數量與刪除留在同一列 */
  .quote-list li { grid-template-columns: 1fr auto 28px; }
  .quote-list__size { grid-column: 1; grid-row: 2; }
}
.quote-list__model { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--text-heading); word-break: break-all; }
.quote-list__size { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
.quote-list__del {
  border: none; background: none; cursor: pointer; font-size: 18px; line-height: 1;
  color: var(--text-muted); width: 28px; height: 28px;
}
.quote-list__del:hover { color: var(--ys-red-600); }

/* ---- 右下角浮動詢價籃 ---------------------------------------------------- */
.quote-bar {
  position: fixed; right: 24px; bottom: 24px; z-index: 900;
  display: flex; align-items: stretch; box-shadow: var(--shadow-2);
}
.quote-bar[hidden] { display: none; }
.quote-bar__main {
  display: flex; align-items: center; gap: 14px;
  background: var(--ink-900); color: var(--white);
  border: none; cursor: pointer; padding: 0 20px; height: 56px;
  font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 600;
  transition: background var(--t-control) var(--ease);
}
.quote-bar__main:hover { background: var(--ink-700); }
.quote-bar__icon { font-size: 13px; color: var(--ys-red-onDark); }
.quote-bar__count { font-family: var(--font-mono); font-size: 17px; color: var(--ys-red-onDark); }
.quote-bar__go {
  border-left: 1px solid rgba(255,255,255,.22); padding-left: 14px;
  font-size: var(--fs-xs); color: rgba(255,255,255,.8);
}
@media (max-width: 560px) {
  .quote-bar { right: 12px; left: 12px; bottom: 12px; }
  .quote-bar__main { flex: 1; justify-content: center; padding: 0 14px; }
  .quote-bar__go { display: none; }
}

/* ---- 詢價籃展開面板 ------------------------------------------------------ */
.quote-bar { flex-direction: column; align-items: stretch; gap: 8px; box-shadow: none; }
.quote-bar__main { box-shadow: var(--shadow-2); }

.quote-panel {
  width: 360px; max-width: calc(100vw - 48px);
  background: var(--white); border: 1px solid var(--ink-900);
  box-shadow: var(--shadow-2); display: flex; flex-direction: column;
}
.quote-panel[hidden] { display: none; }
.quote-panel__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--ink-900); color: var(--white);
  font-family: var(--font-display); font-size: var(--fs-eyebrow); font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase;
}
.quote-panel__close {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 20px; line-height: 1; cursor: pointer; width: 28px; height: 28px;
}
.quote-panel__close:hover { color: var(--white); }
.quote-panel__list {
  list-style: none; margin: 0; padding: 0 16px;
  max-height: 46vh; overflow-y: auto; overscroll-behavior: contain;
}
.quote-panel__list li {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--border-default);
}
/* 這條只想套用在「型號＋規格」那一欄。但數量元件也是 span，
   會一起被排成直向，變成 − / 數字 / ＋ 上下堆疊。用 :not() 排除掉。 */
.quote-panel__list li > span:not(.qty) { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.quote-panel__meta { font-size: 11px; color: var(--text-muted); }
.quote-panel__empty { justify-content: center; color: var(--text-muted); font-size: var(--fs-xs); }
.quote-panel__foot { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.quote-panel__foot .btn { width: 100%; }
/* 複製清單之後要幹嘛的一句話。字小、但別小到看不見 —— 這是客戶
   從「選好型號」走到「聯絡我們」之間唯一的指引。 */
.quote-panel__hint {
  font-size: 12px; line-height: 1.6; color: var(--text-muted); margin: -2px 0 2px;
}
.quote-panel__hint strong {
  font-family: var(--font-mono); font-weight: 600; color: var(--text-heading);
  letter-spacing: .03em;
}
.quote-panel__tools { display: flex; gap: 6px; }
.quote-panel__tools button {
  flex: 1; background: none; border: 1px solid var(--border-default);
  padding: 8px 4px; font-size: 11px; color: var(--text-muted); cursor: pointer;
  transition: border-color var(--t-control) var(--ease), color var(--t-control) var(--ease);
}
.quote-panel__tools button:hover { border-color: var(--ink-900); color: var(--text-heading); }
.quote-panel__tools button.is-done { border-color: #0a7d32; color: #0a7d32; }
@media (max-width: 560px) {
  .quote-panel { width: 100%; }
  .quote-panel__list { max-height: 40vh; }
}

/* ---- 全站搜尋 ------------------------------------------------------------ */
.search { position: relative; margin-left: 20px; }
.search__form { display: flex; align-items: center; }
.search__form input {
  font-family: var(--font-mono); font-size: var(--fs-xs);
  width: 190px; height: 38px; padding: 0 12px 0 34px;
  border: 1px solid var(--border-default); background: var(--surface-panel);
  color: var(--text-heading);
  transition: width var(--t-control) var(--ease), border-color var(--t-control) var(--ease),
              background var(--t-control) var(--ease), box-shadow var(--t-control) var(--ease);
}
.search__form input::placeholder { font-family: var(--font-body); color: var(--text-muted); }
.search__form input:focus {
  outline: none; width: 250px; background: var(--white);
  border-color: var(--ink-900); box-shadow: 0 0 0 3px rgba(230,0,0,.12), var(--shadow-1);
}
.search__icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none; display: flex;
}
.search-toggle { display: none; }

.search__results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 380px; max-height: 60vh;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--white); border: 1px solid var(--ink-900);
  box-shadow: var(--shadow-panel); z-index: 40;
}
.search__results[hidden] { display: none; }
.search-hit {
  display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left;
  background: none; border: none; border-bottom: 1px solid var(--border-default);
  padding: 11px 14px; cursor: pointer;
}
.search-hit:hover, .search-hit.is-on { background: var(--surface-subtle); box-shadow: inset 3px 0 0 var(--ys-red-600); }
.search-hit__model { font-family: var(--font-mono); font-size: var(--fs-xs); font-weight: 600; color: var(--text-heading); }
.search-hit__meta { font-size: 11px; color: var(--text-muted); }
.search-hit__size { font-family: var(--font-mono); }
.search-empty {
  padding: 20px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  font-size: var(--fs-xs); line-height: var(--lh-body);
}
.search-empty strong { font-family: var(--font-display); font-size: var(--fs-sm); color: var(--text-heading); }
.search-empty span { color: var(--text-muted); font-size: 12px; }
.search-empty .btn { margin-top: 4px; height: 40px; padding: 0 18px; font-size: var(--fs-xs); }

@media (max-width: 1280px) { .search__form input { width: 150px; } }
@media (max-width: 1080px) {
  .search { margin-left: 8px; }
  .search-toggle {
    display: flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; background: none; border: 1px solid var(--border-default);
    cursor: pointer; color: var(--text-heading);
  }
  .search__form { display: none; }
  .search__form.is-open {
    display: flex; position: absolute; right: 0; top: calc(100% + 6px);
    background: var(--white); padding: 8px; border: 1px solid var(--border-default);
    box-shadow: var(--shadow-2); z-index: 41;
  }
  .search__form.is-open input { width: 260px; }
  .search__icon { display: none; }
  .search__form.is-open input { padding-left: 12px; }
  .search__results { width: 300px; }
}

/* 蜜罐欄位：用位移藏起來而不是 display:none —— 有些機器人會跳過
   display:none 的欄位，但看不懂位移。真人不會看到，也 tab 不到。 */
.hp {
  position: absolute; left: -9999px; top: auto;
  width: 1px; height: 1px; overflow: hidden;
}


/* 載入失敗的圖片：藏起來露出底下的佔位框，而不是顯示破圖圖示。
   由 js/site.js 在 error 事件時掛上這個 class。 */
img.is-broken {
  opacity: 0;
  /* 保留原本佔的空間，避免版面在載入失敗時跳動 */
  visibility: hidden;
}


/* ---- 詢價清單的數量欄位 ---------------------------------------------------
   加減按鈕與輸入框做成一組。觸控裝置上點按鈕比對準小輸入框容易，
   桌機則可以直接輸入數字。 */
.qty { display: inline-flex; align-items: stretch; flex: none; }
.qty__btn {
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  font: inherit; font-size: 14px; line-height: 1;
  background: var(--white); border: 1px solid var(--border-default); color: var(--text-heading);
  transition: background var(--t-control) var(--ease), border-color var(--t-control) var(--ease);
}
.qty__btn:hover:not(:disabled) { background: var(--ink-900); border-color: var(--ink-900); color: var(--white); }
.qty__btn:disabled { opacity: .35; cursor: not-allowed; }
.qty__input {
  width: 46px; height: 26px; padding: 0 4px; text-align: center;
  font-family: var(--font-mono); font-size: 12px;
  border: 1px solid var(--border-default); border-left: none; border-right: none;
  background: var(--white); color: var(--text-heading);
  -moz-appearance: textfield;
}
.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty__input:focus { outline: none; border-color: var(--ys-red-600); position: relative; z-index: 1; }

/* 詢價籃面板：型號資訊佔滿剩餘空間，數量與刪除靠右 */
.quote-panel__list li > span:first-child { flex: 1; }
/* 面板只有 360px 寬，數量元件不能被壓扁 */
.quote-panel__list .qty { flex: none; }
.quote-panel__list li { gap: 8px; }

/* ---- 洽詢單裡的核取方塊（索取 3D 圖檔）--------------------------------------
   原生 checkbox 在各瀏覽器長相不一，且無法配合品牌色。
   這裡把它藏起來、用旁邊的方框代畫，鍵盤操作與螢幕閱讀器仍然正常。 */
.check {
  display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
  padding: 14px 16px; border: 1px solid var(--border-default); background: var(--ink-050);
  transition: border-color var(--t-control) var(--ease), background var(--t-control) var(--ease);
}
.check:hover { border-color: var(--ink-300); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 1px solid var(--ink-300); background: var(--white);
  transition: background var(--t-control) var(--ease), border-color var(--t-control) var(--ease);
}
.check__box::after {
  content: ""; display: block; width: 5px; height: 10px; margin: 2px auto 0;
  border: solid var(--white); border-width: 0 2px 2px 0; transform: rotate(45deg) scale(0);
  transition: transform var(--t-control) var(--ease);
}
.check input:checked ~ .check__box { background: var(--ys-red-600); border-color: var(--ys-red-600); }
.check input:checked ~ .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible ~ .check__box { outline: 2px solid var(--ys-red-600); outline-offset: 2px; }
.check:has(input:checked) { border-color: var(--ys-red-600); background: #fff6f6; }

.check__text { display: flex; flex-direction: column; gap: 3px; }
.check__text strong { font-size: var(--fs-sm); color: var(--text-heading); }
.check__text span { font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.6; }
