/* ==========================================================================
   PanYield 磐屹投資 官網樣式
   色彩：深綠主色、金色點綴、淺色底。金色僅用於線條、大型元素與裝飾，
   不作為淺底上的小字顏色（對比不足）。
   ========================================================================== */

:root {
  --green-900: #0d2a22;
  --green-800: #143f34;
  --green-700: #1d5445;
  --green-100: #e4efe9;
  --green-050: #f2f7f4;
  --gold-600: #846432;   /* 深金：標籤小字用（白底 5.4:1、淺綠底 5.0:1） */
  --gold-500: #b59058;   /* 品牌金：線條、裝飾 */
  --gold-100: #f3ead9;
  --ink: #1f2a27;
  --ink-soft: #46554f;
  --ink-mute: #5f6d67;
  --line: #d9e2dd;
  --surface: #ffffff;
  --surface-alt: #f6f9f7;
  --focus: #c9780c;

  --font-sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
  --container: 1160px;
  --gutter: 20px;
  --header-h: 68px;
  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(13, 42, 34, .06), 0 2px 8px rgba(13, 42, 34, .06);
  --shadow-md: 0 8px 24px rgba(13, 42, 34, .10);
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

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

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background: var(--surface);
  overflow-x: hidden;
}

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

a { color: var(--green-800); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--green-700); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3 { line-height: 1.3; margin: 0; font-weight: 700; letter-spacing: .01em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--green-800);
  color: #fff;
  border-radius: 8px;
  font-weight: 600;
}
.skip-link:focus { top: 12px; }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  text-decoration: none;
  color: var(--green-800);
}
.brand-mark { width: 44px; height: 44px; flex: 0 0 44px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; white-space: nowrap; }
.brand-zh { font-size: 17px; font-weight: 700; }
.brand-en { font-size: 12.5px; color: var(--ink-mute); letter-spacing: .02em; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px;
}
.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  font-weight: 600;
  text-decoration: none;
  color: var(--green-800);
}
.site-nav a:hover { background: var(--green-050); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  min-width: 44px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--green-800);
  font: inherit;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
}
.nav-toggle-bar {
  position: relative;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
}
.nav-toggle-bar::before,
.nav-toggle-bar::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: transform .2s ease, top .2s ease;
}
.nav-toggle-bar::before { top: -6px; }
.nav-toggle-bar::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { top: 0; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { top: 0; transform: rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  isolation: isolate;
  /* 圖片載入失敗時仍有明亮底色 */
  background-color: #dcebf7;
  background-image:
    linear-gradient(180deg, rgba(255, 255, 255, .25) 0%, rgba(255, 255, 255, .45) 45%, rgba(255, 255, 255, .55) 100%),
    url("/assets/img/hero-bg-mobile.jpg");
  background-size: cover;
  background-position: 60% 50%;
  background-repeat: no-repeat;
  padding: 48px 0 56px;
}
.hero-inner {
  display: flex;
  justify-content: flex-start;
}
.hero-panel {
  width: 100%;
  max-width: 640px;
  padding: 32px 24px 36px;
  border-radius: 24px;
  background: rgba(255, 255, 255, .10);   /* 90% 穿透 */
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 8px 24px rgba(13, 42, 34, .06);
  text-align: center;
}
.hero-logo {
  width: 150px;
  margin: 0 auto 16px;
}
.hero-kicker {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.hero h1 {
  font-size: 30px;
  color: var(--green-800);
  text-wrap: balance;
  text-shadow: 0 0 14px rgba(255, 255, 255, .95), 0 0 28px rgba(255, 255, 255, .8);
}
.hero-lead {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  text-wrap: pretty;
  text-shadow: 0 0 10px rgba(255, 255, 255, .95), 0 0 20px rgba(255, 255, 255, .85);
}
.hero-kicker { text-shadow: 0 0 10px rgba(255, 255, 255, .95); }
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
}
.br-mobile { display: inline; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 2px solid transparent;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary {
  background: var(--green-800);
  color: #fff;
  border-color: var(--green-800);
}
.btn-primary:hover { background: var(--green-700); border-color: var(--green-700); color: #fff; }
.btn-secondary {
  background: #fff;
  color: var(--green-800);
  border-color: var(--green-800);
}
.btn-secondary:hover { background: var(--green-050); }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  padding: 64px 0;
  scroll-margin-top: calc(var(--header-h) + 8px);
}
.section-kicker {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold-600);
}
.section-title {
  position: relative;
  font-size: 28px;
  color: var(--green-800);
  padding-bottom: 14px;
  margin-bottom: 24px;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--gold-500), var(--green-800));
}
.section-lead {
  margin: -8px 0 28px;
  max-width: 640px;
  color: var(--ink-soft);
}

/* About */
.section-about { background: var(--surface); }
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}
.about-copy p { margin: 0 0 14px; }
.about-name {
  font-size: 21px;
  font-weight: 700;
  color: var(--green-800);
  line-height: 1.4;
}
.about-name-en {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-mute);
}
.info-list {
  margin: 0;
  padding: 8px 24px;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold-500);
  border-radius: var(--radius);
}
.info-item {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.info-item:last-child { border-bottom: 0; }
.info-item dt { font-weight: 700; color: var(--green-800); font-size: 15px; }
.info-item dd { margin: 0; overflow-wrap: anywhere; }

/* Services */
.section-services { background: var(--surface-alt); }
.service-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
.service-card {
  position: relative;
  padding: 28px 24px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--gold-500);
}
.service-num {
  position: absolute;
  top: 20px;
  right: 22px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--gold-600);
}
.service-icon {
  width: 48px;
  height: 48px;
  color: var(--green-800);
  padding: 10px;
  box-sizing: content-box;
  background: var(--green-050);
  border-radius: 14px;
  margin-bottom: 18px;
}
.service-card h3 {
  font-size: 20px;
  color: var(--green-800);
  margin-bottom: 8px;
}
.service-card p { margin: 0; color: var(--ink-soft); }

/* Contact */
.section-contact { background: var(--surface); }
.contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
.contact-card {
  padding: 22px 24px;
  background: var(--green-050);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
}
.contact-card h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--gold-600);
  margin-bottom: 6px;
}
.contact-card p { margin: 0; overflow-wrap: anywhere; }
.contact-link { font-weight: 700; font-size: 18px; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--green-900);
  color: #dfe8e3;
  padding: 40px 0 32px;
  border-top: 4px solid var(--gold-500);
}
.footer-inner { display: grid; gap: 18px; }
.footer-brand p { margin: 0; }
.footer-name { font-size: 18px; font-weight: 700; color: #fff; }
.footer-name-en { font-size: 14px; color: #b9c9c1; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: #fff;
  font-weight: 600;
}
.footer-nav a:hover { color: var(--gold-100); }
.footer-copy {
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .14);
  font-size: 14px;
  color: #b9c9c1;
}

/* --------------------------------------------------------------------------
   Sub pages (privacy / 404)
   -------------------------------------------------------------------------- */
.page {
  padding: 48px 0 72px;
  scroll-margin-top: var(--header-h);
}
.page-head { margin-bottom: 28px; }
.page-head h1 { font-size: 30px; color: var(--green-800); }
.page-meta { margin: 10px 0 0; color: var(--ink-mute); font-size: 15px; }
.prose { max-width: 800px; }
.prose h2 {
  font-size: 22px;
  color: var(--green-800);
  margin: 36px 0 12px;
  padding-left: 14px;
  border-left: 4px solid var(--gold-500);
}
.prose h3 { font-size: 18px; color: var(--green-800); margin: 22px 0 8px; }
.prose p, .prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15.5px; margin: 0 0 18px; }
.prose th, .prose td { text-align: left; vertical-align: top; padding: 10px 12px; border: 1px solid var(--line); }
.prose th { background: var(--surface-alt); color: var(--green-800); }
.notice {
  padding: 16px 20px;
  background: var(--gold-100);
  border-left: 4px solid var(--gold-500);
  border-radius: 10px;
  color: var(--ink);
}

.error-page { text-align: center; padding: 72px 0 96px; }
.error-code {
  font-size: 72px;
  font-weight: 800;
  line-height: 1;
  color: var(--green-800);
  letter-spacing: .04em;
}
.error-page h1 { font-size: 28px; color: var(--green-800); margin: 16px 0 10px; }
.error-page p { color: var(--ink-soft); margin: 0 0 28px; }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 767px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: #fff;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { width: 100%; min-height: 48px; font-size: 17px; }
  .brand-en { display: none; }
  .brand-zh { font-size: 16px; }
}

@media (min-width: 480px) {
  .hero h1 { font-size: 34px; }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; --header-h: 76px; }
  body { font-size: 17.5px; }
  .hero {
    background-image:
      linear-gradient(90deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .25) 40%, rgba(255, 255, 255, 0) 60%),
      url("/assets/img/hero-bg.jpg");
    background-position: 70% 50%;
    padding: 72px 0 88px;
    min-height: 560px;
    display: flex;
    align-items: center;
  }
  .hero-panel {
    text-align: left;
    padding: 40px 40px 44px;
    max-width: 600px;
  }
  .hero-logo { margin-left: 0; width: 160px; }
  .hero-actions { justify-content: flex-start; }
  .hero h1 { font-size: 42px; }
  .hero-lead { font-size: 18px; }

  .section { padding: 88px 0; }
  .section-title { font-size: 34px; }
  .page-head h1 { font-size: 36px; }
  .service-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .contact-grid { grid-template-columns: repeat(3, 1fr); }
  .about-grid { grid-template-columns: 1.15fr 1fr; gap: 48px; align-items: start; }
  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .footer-copy { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  .hero { padding: 96px 0 112px; min-height: 640px; }
  .hero-panel { max-width: 640px; padding: 48px 48px 52px; }
  .hero h1 { font-size: 48px; }
  .error-page h1 { font-size: 32px; }
}

@media (min-width: 1440px) {
  .hero { min-height: 700px; }
  .hero h1 { font-size: 52px; }
}

/* WebP 版本：由 JS 偵測支援後在 html 加上 .webp */
.webp .hero { background-image:
  linear-gradient(180deg, rgba(255, 255, 255, .25) 0%, rgba(255, 255, 255, .45) 45%, rgba(255, 255, 255, .55) 100%),
  url("/assets/img/hero-bg-mobile.webp"); }
@media (min-width: 768px) {
  .webp .hero { background-image:
    linear-gradient(90deg, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, .25) 40%, rgba(255, 255, 255, 0) 60%),
    url("/assets/img/hero-bg.webp"); }
}

@media print {
  .site-header, .site-footer, .hero-actions, .nav-toggle { display: none; }
  .hero { background: none; }
  .hero-panel { box-shadow: none; }
}
