/* ============================================
   守逸科技有限公司 官網樣式
   ============================================ */
:root {
  --brand: #0f4c81;
  --brand-dark: #0a2a47;
  --brand-deep: #071e33;
  --accent: #2aa5c9;
  --cta: #c65f10;
  --cta-dark: #a84e0a;
  --ink: #1d2b38;
  --muted: #5c6c7c;
  --bg: #f5f8fa;
  --surface: #ffffff;
  --line: #dfe8ee;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(10, 42, 71, 0.08);
  --shadow-lg: 0 8px 28px rgba(10, 42, 71, 0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

[id] { scroll-margin-top: 84px; }

body {
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgba(10, 42, 71, 0.06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.3; }
.brand-name { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.06em; line-height: 1.3; }
.brand-sub { font-size: 0.68rem; color: var(--muted); letter-spacing: 0.14em; }

.main-nav { display: flex; align-items: center; gap: 4px; }
.main-nav a {
  padding: 8px 14px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 500;
}
.main-nav a:hover { background: var(--bg); color: var(--brand); }
.main-nav a.active { color: var(--brand); font-weight: 700; }
.main-nav a.nav-cta {
  background: var(--cta);
  color: #fff;
  font-weight: 700;
  margin-left: 8px;
}
.main-nav a.nav-cta:hover { background: var(--cta-dark); color: #fff; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--ink);
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand-dark) 55%, var(--brand) 100%);
  color: #fff;
  overflow: hidden;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
  padding: 72px 0;
}
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: 0.04em;
}
.hero h1 .accent { color: #7fd4ee; }
.hero p.lead {
  margin-top: 18px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 34em;
}
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-tags span {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.9);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 30px; }

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-cta { background: var(--cta); color: #fff; }
.btn-cta:hover { background: var(--cta-dark); color: #fff; }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, 0.6); color: #fff; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-outline { border: 1.5px solid var(--brand); color: var(--brand); }
.btn-outline:hover { background: var(--brand); color: #fff; }

.hero-figure { position: relative; }
.hero-figure img {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  aspect-ratio: 4 / 5;
  object-fit: cover;
  width: 100%;
}
.hero-figure figcaption {
  position: absolute;
  left: 14px;
  bottom: 14px;
  background: rgba(7, 30, 51, 0.78);
  border-radius: 8px;
  padding: 6px 14px;
  font-size: 0.85rem;
}

/* ---------- Sections ---------- */
.section { padding: 64px 0; }
.section.alt { background: var(--surface); }

.section-head { text-align: center; margin-bottom: 40px; }
.section-head .eyebrow {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.24em;
  font-size: 0.8rem;
  text-transform: uppercase;
}
.section-head h2 { font-size: 1.7rem; font-weight: 800; margin-top: 6px; letter-spacing: 0.05em; }
.section-head p { color: var(--muted); margin-top: 10px; max-width: 42em; margin-inline: auto; }

/* ---------- Product cards ---------- */
.grid { display: grid; gap: 24px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card .card-media { aspect-ratio: 4 / 3; background: #eef4f8; overflow: hidden; }
.card .card-media img, .card .card-media svg { width: 100%; height: 100%; object-fit: cover; }
.card .card-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.card h3 { font-size: 1.08rem; font-weight: 700; }
.card p { color: var(--muted); font-size: 0.9rem; margin-top: 6px; flex: 1; }
.card .card-link { margin-top: 14px; font-weight: 700; font-size: 0.92rem; }
.card .card-link::after { content: " →"; }

/* ---------- Feature blocks ---------- */
.feature {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 22px;
  text-align: center;
}
.feature .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: #e8f3f8;
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
}
.feature .icon svg { width: 30px; height: 30px; }
.feature h3 { font-size: 1.02rem; font-weight: 700; }
.feature p { color: var(--muted); font-size: 0.88rem; margin-top: 8px; }

/* ---------- Application chips ---------- */
.app-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
.app-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
}
.app-item .app-icon { color: var(--accent); margin-bottom: 8px; }
.app-item .app-icon svg { width: 32px; height: 32px; }

/* ---------- Process steps ---------- */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; counter-reset: step; }
.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 16px;
  text-align: center;
  position: relative;
}
.step .num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 0.95rem;
}
.step h3 { font-size: 0.98rem; font-weight: 700; }
.step p { color: var(--muted); font-size: 0.82rem; margin-top: 6px; }

/* ---------- CTA band ---------- */
.cta-band {
  background: linear-gradient(120deg, var(--brand-dark), var(--brand));
  color: #fff;
  border-radius: var(--radius);
  padding: 44px 40px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.cta-band h2 { font-size: 1.5rem; font-weight: 800; }
.cta-band p { color: rgba(255, 255, 255, 0.85); margin-top: 6px; }
.cta-band .cta-phone { font-size: 1.3rem; font-weight: 800; color: #ffd9ae; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero {
  background: linear-gradient(120deg, var(--brand-deep), var(--brand-dark));
  color: #fff;
  padding: 44px 0;
}
.page-hero h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: 0.05em; }
.breadcrumb { font-size: 0.85rem; color: rgba(255, 255, 255, 0.75); margin-top: 8px; }
.breadcrumb a { color: rgba(255, 255, 255, 0.75); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { margin: 0 6px; }

/* ---------- Product detail ---------- */
.product-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 40px;
  align-items: start;
}
.gallery-main {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef4f8;
  aspect-ratio: 4 / 3;
}
.gallery-main img, .gallery-main svg { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumbs button {
  border: 2px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  padding: 0;
  width: 84px;
  height: 64px;
  cursor: pointer;
  background: #eef4f8;
}
.gallery-thumbs button img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs button.active { border-color: var(--brand); }

.product-info h2.product-title { font-size: 1.6rem; font-weight: 800; }
.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}
.product-summary { margin-top: 16px; color: var(--ink); }
.spec-list { margin-top: 18px; border-top: 1px solid var(--line); }
.spec-list .row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.93rem;
}
.spec-list .row dt { color: var(--muted); font-weight: 500; }
.product-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }

/* ---------- Tabs ---------- */
.tabs { margin-top: 52px; }
.tab-bar { display: flex; gap: 4px; border-bottom: 2px solid var(--line); }
.tab-bar button {
  border: none;
  background: none;
  padding: 12px 22px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  font-family: inherit;
}
.tab-bar button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-panel { display: none; padding: 26px 4px; }
.tab-panel.active { display: block; }
.tab-panel h3 { font-size: 1.05rem; font-weight: 700; margin: 18px 0 8px; }
.tab-panel h3:first-child { margin-top: 0; }
.tab-panel ul { padding-left: 1.4em; color: var(--ink); }
.tab-panel li { margin: 6px 0; }

.spec-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.spec-table th, .spec-table td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.spec-table th { background: #eef4f8; font-weight: 700; white-space: nowrap; }
.table-scroll { overflow-x: auto; }

.note {
  background: #fff8ef;
  border: 1px solid #f3dcbc;
  border-radius: 10px;
  padding: 14px 18px;
  color: #7a5216;
  font-size: 0.9rem;
  margin-top: 18px;
}

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: 1fr 1.2fr; gap: 40px; align-items: start; }
.contact-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
}
.contact-card h2 { font-size: 1.2rem; font-weight: 800; margin-bottom: 16px; }
.contact-rows { display: grid; gap: 14px; }
.contact-row { display: flex; gap: 12px; align-items: flex-start; }
.contact-row .icon { color: var(--brand); flex: none; margin-top: 3px; }
.contact-row .icon svg { width: 22px; height: 22px; }
.contact-row .label { font-size: 0.8rem; color: var(--muted); }
.contact-row .value { font-weight: 600; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-weight: 600; font-size: 0.92rem; }
.form-field label .req { color: #d64545; }
.form-field input, .form-field select, .form-field textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: 2px solid var(--accent);
  border-color: var(--accent);
}
.form-hint { font-size: 0.82rem; color: var(--muted); }

.form-fallback {
  display: none;
  margin-top: 16px;
  background: #eef7fb;
  border: 1px solid #bcdcec;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 0.9rem;
}
.form-fallback.show { display: block; }
.form-fallback textarea {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  background: var(--surface);
  color: var(--ink);
}

/* ---------- 訂購單品項列 ---------- */
.order-item {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.6fr auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafcfe;
}
.order-item + .order-item { margin-top: 10px; }
.order-item .remove-item {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 8px;
  min-width: 44px;
  min-height: 44px;
  cursor: pointer;
  font-size: 1.1rem;
}
.order-item .remove-item:hover { color: #c0392b; border-color: #e3b7b1; }
.add-item-btn {
  margin-top: 12px;
  border: 1.5px dashed var(--brand);
  background: none;
  color: var(--brand);
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
}
.add-item-btn:hover { background: #eef4f8; }

@media (max-width: 720px) {
  .order-item { grid-template-columns: 1fr; align-items: stretch; }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--brand-deep); color: rgba(255, 255, 255, 0.82); margin-top: 64px; }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 40px;
  padding: 48px 0 36px;
}
.site-footer h3 { color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 14px; letter-spacing: 0.06em; }
.site-footer ul { list-style: none; }
.site-footer li { margin: 8px 0; font-size: 0.9rem; }
.site-footer a { color: rgba(255, 255, 255, 0.82); }
.site-footer a:hover { color: #7fd4ee; }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  padding: 18px 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
}

/* ---------- Floating rail ---------- */
.float-rail {
  position: fixed;
  right: 14px;
  bottom: 90px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.float-rail a, .float-rail button {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand);
  cursor: pointer;
}
.float-rail a:hover, .float-rail button:hover { background: var(--brand); color: #fff; }
.float-rail svg { width: 22px; height: 22px; }
.float-rail .rail-label {
  position: absolute;
  right: 56px;
  background: var(--brand-deep);
  color: #fff;
  font-size: 0.78rem;
  border-radius: 6px;
  padding: 4px 10px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.float-rail a { position: relative; }
.float-rail a:hover .rail-label { opacity: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero-inner { grid-template-columns: 1fr; padding: 48px 0; gap: 32px; }
  .hero-figure { max-width: 420px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .app-grid { grid-template-columns: repeat(3, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .product-layout, .contact-layout { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px 16px;
    gap: 2px;
    box-shadow: var(--shadow-lg);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 14px; }
  .main-nav a.nav-cta { margin-left: 0; margin-top: 8px; text-align: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .cta-band { padding: 32px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .section { padding: 48px 0; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: 1fr; }
  .spec-list .row { grid-template-columns: 100px 1fr; }
}
