/*
Theme Name: YULI Electric
Theme URI: https://yuli-electric.com
Author: Ready-Market
Description: Custom WordPress theme for 友笠電機 YULI Electric Ltd. — industrial electrical & automation solutions.
Version: 1.1.0
Requires at least: 6.0
Tested up to: 6.7
License: Private
Text Domain: yuli-electric
*/

/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  --color-brand:       #E25128;
  --color-brand-light: #FFB950;
  --color-white:       #FFFFFF;
  --color-bg:          #F5F4F4;
  --color-dark:        #1A1A1A;
  --color-gray:        #616161;
  --color-gray-light:  #D9D9D9;
  --color-black:       #000000;

  --gradient-brand: linear-gradient(180deg, #E25128 0%, #FFFDD0 100%);

  --font-en:  'Inter', 'Roboto', sans-serif;
  --font-zh:  'Noto Sans HK', 'Noto Sans TC', sans-serif;

  --max-width: 1920px;
  --content-width: 1440px;
  --gap: 32px;

  --transition: 0.25s ease;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-zh);
  background: var(--color-bg);
  color: var(--color-dark);
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

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

a { color: inherit; text-decoration: none; }

ul { list-style: none; }

button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--content-width);
  margin-inline: auto;
  padding-inline: 80px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.btn-primary {
  background: var(--color-brand);
  color: var(--color-white);
}

.btn-primary:hover {
  background: #c43e1a;
}

.btn-outline-white {
  border: 1.5px solid var(--color-white);
  color: var(--color-white);
  border-radius: 12px;
}

.btn-outline-white:hover {
  background: rgba(255,255,255,0.15);
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-en);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-brand);
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background: var(--color-brand);
  border-radius: 2px;
  flex-shrink: 0;
}

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  background: var(--color-white);
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  height: 72px;
  display: flex;
  align-items: center;
}

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

.site-logo {
  flex-shrink: 0;
  height: 52px;
}

.site-logo img {
  height: 100%;
  width: auto;
}

.site-logo .logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-logo .logo-zh {
  font-family: var(--font-zh);
  font-size: 18px;
  font-weight: 900;
  color: var(--color-brand);
  letter-spacing: 0.08em;
}

.site-logo .logo-en {
  font-family: var(--font-en);
  font-size: 11px;
  font-weight: 600;
  color: var(--color-gray);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 36px;
  flex: 1;
  justify-content: center;
}

.primary-nav a {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-dark);
  transition: color var(--transition);
  white-space: nowrap;
  position: relative;
}

.primary-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-brand);
  transition: width var(--transition);
}

.primary-nav a:hover,
.primary-nav a.current-menu-item {
  color: var(--color-brand);
}

.primary-nav a:hover::after,
.primary-nav a.current-menu-item::after {
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.lang-switcher {
  font-size: 13px;
  color: var(--color-gray);
  font-weight: 500;
}

.header-cta {
  background: var(--color-brand);
  color: var(--color-white);
  padding: 9px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition);
}

.header-cta:hover { background: #c43e1a; }

/* Mobile hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 4px;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-dark);
  transition: var(--transition);
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.site-hero {
  margin-top: 72px;
  position: relative;
  background: var(--color-bg);
  overflow: hidden;
  min-height: calc(100vh - 72px);
  display: flex;
  align-items: stretch;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  min-height: calc(100vh - 72px);
}

/* Left panel — main large image */
.hero-panel-main {
  position: relative;
  overflow: hidden;
}

.hero-panel-main .hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.hero-panel-main .hero-img-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(226,81,40,0.55) 0%, rgba(0,0,0,0.25) 100%);
}

.hero-panel-main .hero-text {
  position: absolute;
  bottom: 60px;
  left: 60px;
  right: 60px;
  color: var(--color-white);
}

.hero-tag {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  background: var(--color-brand);
  color: var(--color-white);
  display: inline-block;
  padding: 5px 14px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.hero-headline {
  font-family: var(--font-en);
  font-size: clamp(32px, 3.5vw, 56px);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 12px;
}

.hero-subhead {
  font-family: var(--font-zh);
  font-size: clamp(18px, 2vw, 28px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 0.05em;
  opacity: 0.92;
  margin-bottom: 32px;
}

/* Right panel — two stacked cards */
.hero-panel-cards {
  display: grid;
  grid-template-rows: 1fr 1fr;
}

.hero-card {
  position: relative;
  overflow: hidden;
}

.hero-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.hero-card:hover img { transform: scale(1.04); }

.hero-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, transparent 60%);
}

.hero-card-text {
  position: absolute;
  bottom: 32px;
  left: 32px;
  right: 32px;
  color: var(--color-white);
}

.hero-card-text h3 {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.3;
}

.hero-card-text p {
  font-size: 13px;
  opacity: 0.85;
  font-family: var(--font-zh);
}

/* ============================================================
   BRAND STORY SECTION
   ============================================================ */
.brand-story {
  position: relative;
  overflow: hidden;
}

.brand-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 600px;
}

.brand-story-image {
  position: relative;
  overflow: hidden;
}

.brand-story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.brand-story-content {
  background: var(--gradient-brand);
  padding: 80px 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}

.brand-story-content .en-headline {
  font-family: var(--font-en);
  font-size: clamp(22px, 2.5vw, 40px);
  font-weight: 700;
  color: var(--color-white);
  line-height: 1.2;
}

.brand-story-content .zh-headline {
  font-family: var(--font-zh);
  font-size: clamp(24px, 2.8vw, 44px);
  font-weight: 900;
  color: var(--color-white);
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.brand-story-content p {
  font-size: 16px;
  color: rgba(255,255,255,0.88);
  line-height: 1.8;
  max-width: 480px;
}

/* ============================================================
   QUALITY / VALUE PROPOSITION
   ============================================================ */
.quality-section {
  position: relative;
}

.quality-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 500px;
}

.quality-content {
  padding: 80px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  background: var(--color-dark);
  color: var(--color-white);
}

.quality-content .en-headline {
  font-family: var(--font-en);
  font-size: clamp(20px, 2.2vw, 36px);
  font-weight: 700;
  color: var(--color-brand-light);
  line-height: 1.3;
}

.quality-content .zh-headline {
  font-family: var(--font-zh);
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.4;
}

.quality-content p {
  font-size: 16px;
  color: rgba(255,255,255,0.75);
  max-width: 440px;
  line-height: 1.8;
}

.quality-image {
  position: relative;
  overflow: hidden;
}

.quality-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================================
   VALUES SECTION
   ============================================================ */
.values-section {
  padding: 100px 0;
  background: var(--color-white);
}

.values-section .container { max-width: 1440px; }

.values-header {
  text-align: center;
  margin-bottom: 64px;
}

.values-header h2 {
  font-family: var(--font-zh);
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 900;
  letter-spacing: 0.08em;
  color: var(--color-dark);
  margin-bottom: 16px;
}

.values-header p {
  font-size: 16px;
  color: var(--color-gray);
  max-width: 560px;
  margin-inline: auto;
}

.values-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.value-card {
  background: var(--color-bg);
  border-radius: 16px;
  padding: 40px 32px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.value-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--color-brand);
}

.value-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 48px rgba(226,81,40,0.15);
}

.value-icon {
  width: 56px;
  height: 56px;
  background: var(--color-brand);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  color: var(--color-white);
}

.value-icon svg { width: 28px; height: 28px; }

.value-card h3 {
  font-family: var(--font-zh);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-dark);
  margin-bottom: 12px;
}

.value-card p {
  font-size: 14px;
  color: var(--color-gray);
  line-height: 1.8;
}

/* ============================================================
   PRODUCTS PREVIEW
   ============================================================ */
.products-preview {
  padding: 100px 0;
  background: var(--color-bg);
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 48px;
}

.section-header h2 {
  font-family: var(--font-zh);
  font-size: clamp(26px, 2.8vw, 44px);
  font-weight: 900;
  letter-spacing: 0.06em;
}

.section-header .view-all {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-brand);
  transition: gap var(--transition);
}

.section-header .view-all:hover { gap: 14px; }

.products-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.product-tab {
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid var(--color-gray-light);
  color: var(--color-gray);
  transition: var(--transition);
}

.product-tab.active,
.product-tab:hover {
  background: var(--color-brand);
  border-color: var(--color-brand);
  color: var(--color-white);
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.product-card {
  background: var(--color-white);
  border-radius: 16px;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.1);
}

.product-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--color-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-card-img img { transform: scale(1.05); }

.product-card-body {
  padding: 24px 28px 28px;
}

.product-model {
  font-family: var(--font-en);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-brand);
  margin-bottom: 6px;
}

.product-name {
  font-family: var(--font-zh);
  font-size: 15px;
  color: var(--color-gray);
  margin-bottom: 12px;
}

.product-specs {
  font-size: 13px;
  color: var(--color-gray);
  line-height: 1.7;
}

.product-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--color-brand);
}

/* ============================================================
   APPLICATION SECTION
   ============================================================ */
.applications-section {
  padding: 100px 0;
  background: var(--color-dark);
  color: var(--color-white);
}

.applications-section .section-label { color: var(--color-brand-light); }
.applications-section .section-label::before { background: var(--color-brand-light); }

.applications-section h2 {
  font-family: var(--font-zh);
  font-size: clamp(26px, 2.8vw, 44px);
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 48px;
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.app-card {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  padding: 36px 32px;
  transition: var(--transition);
}

.app-card:hover {
  background: rgba(226,81,40,0.18);
  border-color: var(--color-brand);
}

.app-icon {
  font-size: 40px;
  margin-bottom: 20px;
}

.app-card h3 {
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.app-card h4 {
  font-family: var(--font-zh);
  font-size: 16px;
  font-weight: 600;
  color: rgba(255,255,255,0.7);
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.app-card p {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
}

.app-saving {
  margin-top: 16px;
  display: inline-block;
  background: var(--color-brand);
  color: var(--color-white);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ============================================================
   NEWS SECTION
   ============================================================ */
.news-section {
  padding: 100px 0;
  background: var(--color-white);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 16px;
}

.news-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--color-gray-light);
  transition: var(--transition);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,0.08);
}

.news-card-img {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--color-bg);
}

.news-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.news-card:hover .news-card-img img { transform: scale(1.04); }

.news-card-body {
  padding: 24px 28px 28px;
}

.news-date {
  font-size: 13px;
  color: var(--color-brand);
  font-weight: 600;
  margin-bottom: 10px;
  font-family: var(--font-en);
}

.news-card h3 {
  font-family: var(--font-zh);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.5;
  margin-bottom: 12px;
  color: var(--color-dark);
}

.news-card p {
  font-size: 14px;
  color: var(--color-gray);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============================================================
   CONTACT CTA BANNER
   ============================================================ */
.contact-cta {
  background: var(--color-brand);
  padding: 80px 0;
  text-align: center;
  color: var(--color-white);
}

.contact-cta h2 {
  font-family: var(--font-zh);
  font-size: clamp(28px, 3vw, 48px);
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.contact-cta p {
  font-size: 17px;
  opacity: 0.88;
  margin-bottom: 40px;
  max-width: 540px;
  margin-inline: auto;
  margin-bottom: 40px;
}

.contact-cta .btn-white {
  background: var(--color-white);
  color: var(--color-brand);
  padding: 16px 40px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.contact-cta .btn-white:hover {
  background: #f0ece8;
  transform: translateY(-2px);
}

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #111111;
  color: rgba(255,255,255,0.75);
  padding: 64px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo-zh {
  font-family: var(--font-zh);
  font-size: 22px;
  font-weight: 900;
  color: var(--color-brand);
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.footer-brand .logo-en {
  font-family: var(--font-en);
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

.footer-brand p {
  font-size: 14px;
  line-height: 1.8;
  max-width: 300px;
}

.footer-contact {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.5;
}

.footer-contact .icon {
  width: 16px;
  height: 16px;
  color: var(--color-brand);
  flex-shrink: 0;
  margin-top: 2px;
}

.footer-col h4 {
  font-family: var(--font-zh);
  font-size: 15px;
  font-weight: 700;
  color: var(--color-white);
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-col ul a {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: color var(--transition);
}

.footer-col ul a:hover { color: var(--color-brand); }

.footer-bottom {
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: rgba(255,255,255,0.4);
  text-align: center;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* ============================================================
   SCROLL REVEAL ANIMATION
   ============================================================ */
.will-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.5s ease var(--reveal-delay, 0ms),
              transform 0.5s ease var(--reveal-delay, 0ms);
}

.will-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Sticky header shadow */
.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(0,0,0,0.12);
}

/* ============================================================
   CONTACT FORM STYLES
   ============================================================ */
.contact-form-section {
  padding: 100px 0;
  background: var(--color-bg);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 64px;
  align-items: start;
}

.contact-info h2 {
  font-family: var(--font-zh);
  font-size: clamp(26px, 3vw, 44px);
  font-weight: 900;
  letter-spacing: 0.06em;
  margin-bottom: 20px;
}

.contact-info p {
  font-size: 16px;
  color: var(--color-gray);
  line-height: 1.8;
  margin-bottom: 40px;
}

.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contact-details li {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  font-size: 15px;
  line-height: 1.6;
}

.contact-details .ci-icon {
  width: 40px;
  height: 40px;
  background: rgba(226,81,40,0.1);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-brand);
  flex-shrink: 0;
}

.contact-form-wrap {
  background: var(--color-white);
  border-radius: 20px;
  padding: 48px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.06);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-dark);
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.form-group label .req {
  color: var(--color-brand);
  margin-left: 2px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--color-gray-light);
  border-radius: 8px;
  font-family: var(--font-zh);
  font-size: 15px;
  color: var(--color-dark);
  background: var(--color-bg);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--color-brand);
  box-shadow: 0 0 0 3px rgba(226,81,40,0.12);
  background: var(--color-white);
}

.form-group textarea {
  resize: vertical;
  min-height: 140px;
}

.form-submit {
  width: 100%;
  padding: 16px;
  background: var(--color-brand);
  color: var(--color-white);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-zh);
  letter-spacing: 0.06em;
  transition: background var(--transition), transform var(--transition);
}

.form-submit:hover:not(:disabled) {
  background: #c43e1a;
  transform: translateY(-1px);
}

.form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-message {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  display: none;
}

.form-message:not(:empty) { display: block; }

.form-message.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.form-message.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1280px) {
  .container { padding-inline: 48px; }
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 1024px) {
  .primary-nav { gap: 24px; }
  .hero-inner { grid-template-columns: 1fr; grid-template-rows: 60vh 40vh; }
  .hero-panel-cards { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; }
  .brand-story-grid,
  .quality-grid { grid-template-columns: 1fr; }
  .brand-story-image,
  .quality-image { min-height: 400px; }
  .products-grid { grid-template-columns: repeat(2, 1fr); }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .container { padding-inline: 24px; }

  .primary-nav,
  .header-actions .lang-switcher { display: none; }

  .menu-toggle { display: flex; }

  .primary-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--color-white);
    padding: 24px;
    gap: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }

  .hero-inner { grid-template-rows: 55vh 45vh; }
  .hero-panel-main .hero-text { left: 24px; right: 24px; bottom: 32px; }
  .hero-card-text { left: 20px; bottom: 20px; }

  .brand-story-content { padding: 56px 32px; }
  .quality-content { padding: 56px 32px; }

  .values-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: 1fr; }
  .app-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr; }

  .footer-inner { grid-template-columns: 1fr; gap: 32px; }

  .section-header { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ============================================================
   ============================================================
   REDESIGN v2 — 對齊 Figma 首頁（覆寫先前樣式）
   ============================================================
   ============================================================ */

/* ---------- HEADER ---------- */
.site-header {
  background: var(--color-bg);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 rgba(0,0,0,.05);
}
.site-header__inner {
  max-width: 1760px; margin-inline: auto;
  padding: 22px 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 32px;
}
.site-logo img { height: 56px; width: auto; }

.primary-nav { display: flex; align-items: center; gap: 6px; }
.primary-nav a {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px; border-radius: 8px;
  font-size: 17px; font-weight: 500; color: var(--color-black);
  position: relative;
  transition: background var(--transition), color var(--transition);
}
/* 項目之間的分隔線（hover/current 的橘膠囊不顯示分隔） */
.primary-nav a + a::before {
  content: ""; position: absolute; left: -3px; top: 50%;
  transform: translateY(-50%);
  width: 1px; height: 30px; background: #d3d3d3;
}
.primary-nav a:hover::before,
.primary-nav a.current-menu-item::before,
.primary-nav a:hover + a::before,
.primary-nav a.current-menu-item + a::before { opacity: 0; }
/* hover / 目前頁 = 橘色膠囊 + 白字白圖示（對齊設計稿變體） */
.primary-nav a:hover,
.primary-nav a.current-menu-item {
  background: var(--color-brand); color: #fff;
}
.primary-nav a:hover .nav-icon,
.primary-nav a.current-menu-item .nav-icon { filter: brightness(0) invert(1); }
.primary-nav .nav-icon { width: 14px; height: 18px; transition: filter var(--transition); }

/* 右側社群直條 */
.social-rail {
  position: fixed; right: 14px; top: 50%; transform: translateY(-50%);
  z-index: 90;
}
.social-rail img { width: 40px; height: auto; }

/* ---------- HERO（精確對齊 Figma 2001:117）---------- */
.home-hero {
  max-width: 1760px; margin: 40px auto 0;
  padding: 0 64px;
}
/* 舞台＝Group 6 範圍，比例 1587:809，產品可凸出 */
.home-hero__stage {
  position: relative;
  aspect-ratio: 1587 / 809;
  width: 100%;
}
/* 視窗（圓角矩形，產品凸出於上下） */
.home-hero__window {
  position: absolute; top: 9.82%; left: 0; width: 100%; height: 77%;
  border-radius: 28px; overflow: hidden; z-index: 1;
  background: #b8431f;
}
/* 彩色工業底圖（露在色塊之下，提高鮮明度） */
.home-hero__montage {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: saturate(1.18) contrast(1.05);
}
/* 半透明色塊網格（5×2），每格透明度交錯變化＝色塊此起彼落 */
.home-hero__blocks {
  position: absolute; inset: 0; z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(2, 1fr);
}
.home-hero__blocks span {
  background: var(--color-brand);
}
@media (prefers-reduced-motion: no-preference) {
  .home-hero__blocks span { animation: heroBlock 4.8s ease-in-out infinite; }
}
/* 高對比：覆蓋時近實心紅、露出時幾乎全透（鮮明底圖透出） */
@keyframes heroBlock {
  0%, 100% { opacity: .9; }
  50%      { opacity: .08; }
}
/* 露出較多的格（固定偏透，讓彩色底圖明顯） */
@keyframes heroBlockLight {
  0%, 100% { opacity: .5; }
  50%      { opacity: .06; }
}
/* 交錯延遲：由左到右、上到下形成波動 */
.home-hero__blocks span:nth-child(1)  { animation-delay: 0s;    animation-name: heroBlockLight; }
.home-hero__blocks span:nth-child(2)  { animation-delay: .45s;  }
.home-hero__blocks span:nth-child(3)  { animation-delay: .9s;   }
.home-hero__blocks span:nth-child(4)  { animation-delay: 1.35s; }
.home-hero__blocks span:nth-child(5)  { animation-delay: 1.8s;  animation-name: heroBlockLight; }
.home-hero__blocks span:nth-child(6)  { animation-delay: .7s;   animation-name: heroBlockLight; }
.home-hero__blocks span:nth-child(7)  { animation-delay: 1.15s; }
.home-hero__blocks span:nth-child(8)  { animation-delay: 1.6s;  }
.home-hero__blocks span:nth-child(9)  { animation-delay: 2.05s; animation-name: heroBlockLight; }
/* 右下深色塊：放標語，固定深色不全透 */
.home-hero__blocks span:nth-child(10) {
  background: rgba(34,28,24,.9); animation: heroBlockDark 4.8s ease-in-out infinite; animation-delay: 1.2s;
}
@keyframes heroBlockDark { 0%,100% { opacity: .9; } 50% { opacity: .62; } }
/* 上下兩段接縫 */
.home-hero__seam {
  position: absolute; top: 50%; left: 0; right: 0; z-index: 2;
  border-top: 1px solid rgba(255,255,255,.16); pointer-events: none;
}
/* 產品圖：滿版高度、置中偏右(55.4%)、凸出色帶 */
.home-hero__product {
  position: absolute; z-index: 3;
  left: 55.4%; top: 0; transform: translateX(-50%);
  height: 100%; width: auto; max-width: none;
  object-fit: contain;
  filter: drop-shadow(0 24px 36px rgba(0,0,0,.42));
}
/* 上帶內文字（座標來自設計稿） */
.home-hero__label {
  position: absolute; z-index: 4; top: 17.2%;
  color: #fff; font-family: var(--font-en); font-weight: 600;
  line-height: 1.45; letter-spacing: .1em; text-transform: uppercase;
  font-size: clamp(12px, 1.2vw, 18px); text-shadow: 0 2px 14px rgba(0,0,0,.35);
}
.home-hero__label--left  { left: 15.5%; display: flex; align-items: center; gap: 14px; }
.home-hero__label--right { left: 62%; }
.home-hero__mark { width: 46px; height: auto; filter: brightness(0) invert(1); flex-shrink: 0; }

.home-hero__caption {
  position: absolute; z-index: 4; left: 82%; top: 60%;
  display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
  color: #fff; font-weight: 700; line-height: 1.5;
  font-size: clamp(14px, 1.15vw, 19px);
}
.home-hero__arrow { height: 92px; }

/* ---------- MOSAIC ---------- */
.home-mosaic {
  max-width: 1760px; margin: 60px auto 0; padding: 0 64px;
}
.home-mosaic__grid {
  display: grid;
  grid-template-columns: 1.52fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 18px;
}
.mcard {
  position: relative; overflow: hidden; border-radius: 6px;
  background-size: cover; background-position: center;
  min-height: 300px; isolation: isolate;
  transition: box-shadow .4s ease, transform .4s ease;
}
.mcard:hover { transform: translateY(-5px); box-shadow: 0 22px 46px rgba(0,0,0,.20); }
/* 背景影像層：靜態乾淨照片；hover 緩慢放大變暗 */
.mcard::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: inherit; background-size: cover; background-position: center;
  transform: scale(1); transition: transform 1.1s cubic-bezier(.2,.6,.2,1), filter .45s ease;
}
.mcard:hover::after { transform: scale(1.06); filter: brightness(.82); }
/* 僅做極輕微暗角，確保白字可讀；不蓋橘色 */
.mcard::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.18) 0%, rgba(0,0,0,0) 22%, rgba(0,0,0,0) 64%, rgba(0,0,0,.30) 100%);
}
.mcard--a { grid-column: 1; grid-row: 1; }
.mcard--b { grid-column: 1; grid-row: 2; }
.mcard--c { grid-column: 2; grid-row: 1 / span 2; }

/* 卡內白字（絕對定位） */
.mcard__en, .mcard__zh, .mcard__btn, .mcard__wordmark { position: absolute; z-index: 2; color: #fff; }
.mcard__en {
  font-family: var(--font-en); font-weight: 600;
  font-size: clamp(18px, 1.9vw, 32px); line-height: 1.12;
  letter-spacing: .03em; text-transform: uppercase;
  text-shadow: 0 2px 16px rgba(0,0,0,.45);
}
.mcard__en--right { top: 30px; right: 34px; text-align: right; }
.mcard__en--bl    { left: 34px; bottom: 96px; }
.mcard__zh {
  font-size: clamp(22px, 2vw, 32px); font-weight: 700; line-height: 1.4;
  letter-spacing: .05em; text-shadow: 0 2px 16px rgba(0,0,0,.55);
}
.mcard__zh--bl { left: 34px; bottom: 110px; }
.mcard__zh--tr { top: 30px; right: 34px; text-align: right; }
.mcard__btn {
  display: inline-flex; align-items: center; gap: 16px;
  padding: 12px 26px; border: 1.5px solid rgba(255,255,255,.9);
  border-radius: 4px; font-weight: 600; font-size: 16px;
  background: transparent;
  transition: background var(--transition), border-color var(--transition), gap var(--transition), padding var(--transition);
}
/* hover：白框 → 填滿橘色（對齊設計稿變體） */
.mcard__btn:hover {
  background: var(--color-brand); border-color: var(--color-brand);
  gap: 22px; padding-right: 30px;
}
.mcard__btn--bl { left: 34px; bottom: 34px; }
.mcard__btn--br { right: 34px; bottom: 34px; }
/* YULI Electric 字標 */
.mcard__wordmark {
  left: 34px; top: 28px; display: flex; flex-direction: column;
  font-family: var(--font-en); line-height: 1; text-shadow: 0 2px 12px rgba(0,0,0,.6);
}
.mcard__wordmark strong { font-size: clamp(24px, 2.4vw, 40px); font-weight: 800; letter-spacing: .14em; font-style: normal; }
.mcard__wordmark em { font-size: clamp(11px, 1vw, 16px); font-weight: 600; letter-spacing: .34em; font-style: normal; margin-top: 4px; }

/* ---------- NEWS ---------- */
.home-news {
  max-width: 1760px; margin: 70px auto 90px; padding: 0 64px;
}
.home-news__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.home-news__head h2 { display: flex; align-items: baseline; gap: 22px; }
.home-news__en {
  color: var(--color-brand); font-family: var(--font-en);
  font-weight: 800; font-size: 40px; letter-spacing: .02em;
}
.home-news__zh { color: #000; font-size: 22px; font-weight: 600; }
.home-news__more {
  display: inline-flex; align-items: center; gap: 12px;
  color: var(--color-brand); font-family: var(--font-en);
  font-weight: 700; font-size: 17px; letter-spacing: .08em;
}

.home-news__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
}
.news-feature {
  position: relative; display: block; overflow: hidden;
  background: #bebebe;
}
.news-feature__viewport { aspect-ratio: 735 / 642; overflow: hidden; }
.news-feature__track {
  display: flex; height: 100%; width: 100%;
  transition: transform .7s cubic-bezier(.6,.04,.25,1);
}
.news-feature__slide { flex: 0 0 100%; width: 100%; height: 100%; display: block; }
.news-feature__slide img { width: 100%; height: 100%; object-fit: cover; }
.news-feature__dots {
  position: absolute; right: 22px; top: 28px; z-index: 3;
  display: flex; flex-direction: column; gap: 18px;
}
.news-feature__dots button {
  width: 12px; height: 12px; border-radius: 50%;
  background: rgba(255,255,255,.55);
}
.news-feature__dots .is-active { background: #fff; }
.news-feature__caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--color-brand); color: #fff;
  padding: 28px 50px; font-size: 19px; font-weight: 600;
}

.news-list {
  background: var(--color-gray);
  padding: 40px 46px;
  display: flex; flex-direction: column; justify-content: center;
}
.news-list__item { border-bottom: 1px solid rgba(255,255,255,.28); }
.news-list__item:last-child { border-bottom: 0; }
.news-list__item a {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 21px 4px; color: #fff; transition: opacity var(--transition);
}
.news-list__item a:hover { opacity: .82; }
.news-list__text { font-size: 17px; }
.news-list__bullet { font-size: 9px; margin-right: 12px; vertical-align: middle; }
.news-list__arrow { flex-shrink: 0; }

/* ---------- FOOTER ---------- */
.site-footer { background: var(--color-brand); color: #fff; margin-top: 0; }
.site-footer__inner {
  max-width: 1760px; margin-inline: auto;
  padding: 40px 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 40px;
}
.site-footer__logo img { width: 280px; height: auto; }
.site-footer__contact { display: flex; flex-direction: column; gap: 10px; }
.site-footer__contact li { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.site-footer__contact .icon { width: 18px; height: 18px; flex-shrink: 0; }
.site-footer__contact a { color: #fff; }
.site-footer__copy { font-size: 13px; line-height: 1.9; text-align: right; opacity: .95; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
  .home-mosaic__grid { grid-template-columns: 1fr; grid-template-rows: auto; }
  .mcard--a, .mcard--b, .mcard--c { grid-column: 1; grid-row: auto; }
  .mcard--c { min-height: 460px; }
  .home-news__grid { grid-template-columns: 1fr; }
  .site-footer__inner { flex-direction: column; align-items: flex-start; }
  .site-footer__copy { text-align: left; }
}
@media (max-width: 768px) {
  .site-header__inner { padding: 16px 20px; }
  .primary-nav { display: none; }
  .home-hero, .home-mosaic, .home-news { padding: 0 20px; }
  .home-hero__stage { aspect-ratio: 1 / 1.2; }
  .home-hero__product { left: 52%; }
  .home-hero__label { font-size: 11px; letter-spacing: .06em; }
  .home-hero__label--left { left: 6%; gap: 8px; }
  .home-hero__label--left .home-hero__mark { width: 34px; }
  .home-hero__label--right { left: auto; right: 6%; }
  .home-hero__caption { left: auto; right: 6%; top: auto; bottom: 8%; align-items: flex-end; text-align: right; }
  .home-hero__caption .home-hero__arrow { display: none; }
  .social-rail { display: none; }
}

/* ============================================================
   INTERACTIONS v2 — 動態與互動
   ============================================================ */
@media (prefers-reduced-motion: no-preference) {
  /* Hero 產品緩慢浮動 */
  .home-hero__product { animation: yuliFloat 6.5s ease-in-out infinite; }
  @keyframes yuliFloat {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(-14px); }
  }
  /* Hero 向下箭頭彈跳 */
  .home-hero__arrow { animation: yuliBounce 2s ease-in-out infinite; }
  @keyframes yuliBounce {
    0%, 100% { transform: translateY(0); opacity: .9; }
    50%      { transform: translateY(8px); opacity: 1; }
  }
}

/* 捲動淡入（俐落、低位移） */
.will-reveal { opacity: 0; transform: translateY(14px); }
.is-visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease var(--reveal-delay, 0ms), transform .5s cubic-bezier(.2,.7,.2,1) var(--reveal-delay, 0ms);
}

/* Header hover：圖示輕微放大 */
.primary-nav a .nav-icon { transition: transform var(--transition); }
.primary-nav a:hover .nav-icon { transform: translateY(-2px) scale(1.12); }

/* MORE 與新聞列表箭頭互動 */
.home-news__more svg { transition: transform var(--transition); }
.home-news__more:hover svg { transform: translateX(4px); }
.news-list__arrow { transition: transform var(--transition); }
.news-list__item a:hover .news-list__arrow { transform: translateX(4px); }

/* 特色新聞 hover 放大 */
.news-feature__slide img { transition: transform 1.1s cubic-bezier(.2,.6,.2,1); }
.news-feature:hover .news-feature__slide img { transform: scale(1.04); }

/* 輪播圓點互動 */
.news-feature__dots button { cursor: pointer; transition: background .25s, transform .25s; }
.news-feature__dots button:hover { transform: scale(1.25); }
.news-feature__caption { transition: opacity .4s ease; }
.news-feature__caption.is-fading { opacity: 0; }

/* 社群條 hover */
.social-rail img { transition: transform var(--transition); }
.social-rail:hover img { transform: scale(1.04); }

/* ============================================================
   STATE FIXES v3 — 依設計稿變體校正互動
   ============================================================ */
/* 移除舊版導覽底線（與橘膠囊衝突） */
.primary-nav a::after { display: none !important; }

/* 新聞列表項 hover：圓圈箭頭填白、文字微亮 */
.news-list__item a:hover .news-list__arrow circle { fill: rgba(255,255,255,.16); }
.news-list__item a { transition: opacity var(--transition), padding-left var(--transition); }
.news-list__item a:hover { opacity: 1; padding-left: 8px; }
.news-list__item a:hover .news-list__text { color: #fff; }

/* MORE 按鈕 hover：圓圈填橘、箭頭轉白 */
.home-news__more:hover svg circle { fill: var(--color-brand); }
.home-news__more:hover svg polyline { stroke: #fff; }
