/* ==========================================================================
   華翔興業 Hwa Shine — 全站統一「明亮現代化工風」設計系統 (Bright Industrial Theme)
   Version: 2.0.0
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;600&family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
  /* Core Surfaces (明亮清爽白底系) */
  --hs-bg-canvas: #f4f7fb;
  --hs-bg-surface: #ffffff;
  --hs-bg-elevated: #ffffff;
  --hs-bg-card: #ffffff;
  --hs-bg-subtle: #eef3f9;
  --hs-bg-hover: #e2ebf5;

  /* Borders & Hairlines */
  --hs-border-subtle: #e2e8f0;
  --hs-border-default: #cbd5e1;
  --hs-border-accent: rgba(2, 132, 199, 0.5);

  /* Typography (高對比深灰字) */
  --hs-text-primary: #0f172a;
  --hs-text-secondary: #334155;
  --hs-text-muted: #64748b;
  --hs-text-dim: #94a3b8;

  /* Unified Brand Palette (全站單一品牌色系) */
  --hs-brand-primary: #0284c7;       /* 精密科技藍 */
  --hs-brand-primary-strong: #0369a1;
  --hs-brand-primary-soft: rgba(2, 132, 199, 0.09);
  --hs-brand-accent: #d97706;        /* 工業琥珀強調色 */
  --hs-brand-accent-soft: rgba(217, 119, 6, 0.11);
  --hs-brand-success: #059669;
  --hs-brand-danger: #dc2626;

  /* Elevation & Radius */
  --hs-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --hs-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --hs-shadow-lg: 0 16px 36px rgba(15, 23, 42, 0.12);
  --hs-radius-sm: 6px;
  --hs-radius-md: 10px;
  --hs-radius-lg: 14px;

  /* Fonts */
  --hs-font-sans: 'Noto Sans TC', 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --hs-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

  /* Legacy CSS variable mapping */
  --primary-color: #0284c7;
  --primary-dark: #0369a1;
  --secondary-color: #0f172a;
  --original-primary: #0284c7;
  --original-secondary: #0f172a;
  --original-accent: #d97706;
  --accent-color: #d97706;
  --corporate-blue: #0284c7;
  --corporate-blue-dim: #0369a1;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-tertiary: #64748b;
  --text-color: #334155;
  --bg-color: #f4f7fb;
  --bg-body: #f4f7fb;
  --bg-card: #ffffff;
  --card-bg: #ffffff;
  --border-light: #e2e8f0;
}

/* ==========================================================================
   1. Base Reset & Typography
   ========================================================================== */
html {
  scroll-behavior: smooth;
  background-color: var(--hs-bg-canvas);
  color: var(--hs-text-primary);
  color-scheme: light;
}

body.hs-dark {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--hs-font-sans) !important;
  background-color: var(--hs-bg-canvas) !important;
  background-image:
    radial-gradient(circle at 12% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 88% 8%, rgba(2, 132, 199, 0.05) 0%, transparent 38%);
  background-attachment: fixed;
  color: var(--hs-text-secondary) !important;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.hs-dark main {
  flex: 1 0 auto;
}

:where(body.hs-dark) :where(h1, h2, h3, h4, h5, h6) {
  color: var(--hs-text-primary);
  letter-spacing: -0.01em;
}

/* 保護深色區塊內的標題維持亮白字體 */
.text-white h1,
.text-white h2,
.text-white h3,
.text-white h4,
.bg-slate-900 h1,
.bg-slate-900 h2,
.bg-slate-900 h3,
.bg-slate-800 h1,
.bg-slate-800 h2,
.bg-slate-800 h3,
.bg-gray-900 h1,
.bg-gray-900 h2,
.bg-gray-900 h3,
.bg-gray-800 h1,
.bg-gray-800 h2,
.bg-gray-800 h3 {
  color: #ffffff;
}

:where(body.hs-dark) :where(a) {
  color: var(--hs-brand-primary);
  transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

:where(body.hs-dark) :where(a:hover) {
  color: var(--hs-brand-primary-strong);
}

body.hs-dark code,
body.hs-dark pre,
.hs-mono {
  font-family: var(--hs-font-mono);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   2. Unified Site Navbar (<custom-header>) — 深藍黑質感導航列
   ========================================================================== */
header.hs-navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  background: rgba(11, 21, 38, 0.94) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16) !important;
  box-shadow: 0 4px 18px rgba(8, 13, 23, 0.22) !important;
  padding: 0 !important;
  margin: 0 !important;
  text-align: left !important;
  overflow: visible !important;
}

header.hs-navbar::before,
header.hs-navbar::after {
  display: none !important;
  content: none !important;
}

header.hs-navbar nav {
  position: static !important;
  background: transparent !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

.hs-navbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.hs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none !important;
  flex-shrink: 0;
}

.hs-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  color: #080d17;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.35);
}

.hs-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.hs-brand-name {
  color: #f8fafc;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

.hs-brand-sub {
  color: #38bdf8;
  font-family: var(--hs-font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hs-nav-links {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.hs-nav-links a {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.85rem;
  border-radius: 7px;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
}

.hs-nav-links a:hover,
.hs-nav-links a.active {
  color: #ffffff !important;
  background: rgba(56, 189, 248, 0.14);
}

.hs-nav-links a.active {
  color: #38bdf8 !important;
  box-shadow: inset 0 -2px 0 #38bdf8;
}

.hs-nav-cta {
  padding: 0.48rem 1.05rem !important;
  background: #0284c7 !important;
  color: #ffffff !important;
  border: 1px solid rgba(56, 189, 248, 0.45);
  font-weight: 600 !important;
  margin-left: 0.35rem;
  box-shadow: 0 2px 10px rgba(2, 132, 199, 0.35);
}

.hs-nav-cta:hover {
  background: #38bdf8 !important;
  color: #080d17 !important;
}

.hs-mobile-toggle {
  display: none;
  background: rgba(30, 41, 59, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: #f8fafc;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
}

.hs-mobile-menu {
  display: none;
  background: #0f172a;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 0.75rem 1.25rem 1.25rem;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}

.hs-mobile-menu.open {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.hs-mobile-menu a {
  padding: 0.65rem 0.9rem;
  border-radius: 8px;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-weight: 600;
}

.hs-mobile-menu a:hover,
.hs-mobile-menu a.active {
  background: rgba(56, 189, 248, 0.14);
  color: #38bdf8 !important;
}

@media (max-width: 980px) {
  .hs-nav-links {
    display: none;
  }
  .hs-mobile-toggle {
    display: inline-flex;
  }
}

/* ==========================================================================
   2.5 Section Sub-Navigation Bar (MXD6 / 螢光增白劑專區次導航列)
   ========================================================================== */
.hs-subnav {
  background: #13233b;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  box-shadow: 0 2px 10px rgba(8, 13, 23, 0.14);
}

.hs-subnav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.hs-subnav-inner::-webkit-scrollbar {
  display: none;
}

.hs-subnav-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.hs-subnav-links {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.hs-subnav-links a {
  padding: 0.35rem 0.8rem;
  border-radius: 6px;
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.hs-subnav-links a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff !important;
}

.hs-subnav-links a.active {
  background: #0284c7;
  color: #ffffff !important;
}

/* ==========================================================================
   3. Deep Industrial Page Hero Banner — 深藍質感主視覺橫幅
   ========================================================================== */
.hs-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0b1526 0%, #13294b 58%, #0e3a5c 100%) !important;
  border-bottom: 1px solid rgba(56, 189, 248, 0.22);
  padding: 3.35rem 1.25rem 2.85rem;
}

.hs-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.06) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
  -webkit-mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent);
  pointer-events: none;
}

.hs-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.hs-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.38);
  color: #7dd3fc;
  font-family: var(--hs-font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}

.hs-hero h1 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.85rem, 3.6vw, 2.75rem);
  font-weight: 900;
  line-height: 1.2;
  color: #ffffff !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.hs-hero p {
  margin: 0;
  max-width: 780px;
  font-size: 1.05rem;
  color: #cbd5e1 !important;
}

/* News Ticker Bar */
.hs-ticker {
  background: linear-gradient(90deg, #fffbeb, #f0f9ff);
  border-bottom: 1px solid #e2e8f0;
  color: var(--hs-text-primary);
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  overflow: hidden;
  white-space: nowrap;
}

.hs-ticker-content {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding-left: 100%;
  animation: hs-ticker-scroll 30s linear infinite;
}

.hs-ticker-tag {
  background: var(--hs-brand-accent);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.72rem;
  padding: 0.15rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

@keyframes hs-ticker-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   4. Reusable Components
   ========================================================================== */
.hs-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem;
}

.hs-section-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--hs-text-primary);
  margin: 0 0 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--hs-border-subtle);
}

.hs-section-title::before {
  content: "";
  width: 4px;
  height: 1.35em;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--hs-brand-primary), var(--hs-brand-accent));
  flex-shrink: 0;
}

.hs-card {
  background: var(--hs-bg-card);
  border: 1px solid var(--hs-border-subtle);
  border-radius: var(--hs-radius-lg);
  box-shadow: var(--hs-shadow-sm);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.hs-card:hover {
  border-color: var(--hs-border-accent);
  box-shadow: var(--hs-shadow-md);
}

.hs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--hs-radius-sm);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none !important;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.hs-btn-primary {
  background: var(--hs-brand-primary);
  color: #ffffff !important;
}

.hs-btn-primary:hover {
  background: var(--hs-brand-primary-strong);
  color: #ffffff !important;
}

.hs-btn-outline {
  background: #ffffff;
  color: var(--hs-text-primary) !important;
  border-color: var(--hs-border-default);
}

.hs-btn-outline:hover {
  border-color: var(--hs-brand-primary);
  color: var(--hs-brand-primary) !important;
  background: var(--hs-brand-primary-soft);
}

/* ==========================================================================
   5. Crisp Light Data Tables
   ========================================================================== */
body.hs-dark table {
  width: 100%;
  border-collapse: collapse;
  background-color: #ffffff !important;
  border: 1px solid var(--hs-border-subtle) !important;
  border-radius: var(--hs-radius-md);
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}

body.hs-dark thead,
body.hs-dark thead tr {
  background-color: #eef5fc !important;
}

body.hs-dark th {
  background-color: #eef5fc !important;
  color: #0369a1 !important;
  font-weight: 700 !important;
  font-size: 0.85rem;
  letter-spacing: 0.03em;
  padding: 0.9rem 1rem !important;
  border-bottom: 1px solid var(--hs-border-default) !important;
  border-color: var(--hs-border-subtle) !important;
  text-align: left;
}

body.hs-dark td {
  padding: 0.85rem 1rem !important;
  color: var(--hs-text-secondary) !important;
  border-bottom: 1px solid var(--hs-border-subtle) !important;
  border-color: var(--hs-border-subtle) !important;
}

body.hs-dark tbody tr:nth-child(even) {
  background-color: #f8fafc !important;
}

body.hs-dark tbody tr:hover {
  background-color: #f0f9ff !important;
}

/* ==========================================================================
   6. Unified Deep Industrial Site Footer (<custom-footer>) — 深藍黑質感頁尾
   ========================================================================== */
.hs-footer {
  background: #0b1526 !important;
  border-top: 1px solid rgba(56, 189, 248, 0.2) !important;
  color: #94a3b8 !important;
  margin-top: auto !important;
  padding: 0 !important;
  text-align: left !important;
}

.hs-footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 3.5rem 1.25rem 2.25rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: 2.5rem;
}

.hs-footer h4 {
  color: #f8fafc !important;
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 1rem;
  letter-spacing: 0.04em;
}

.hs-footer p {
  margin: 0 0 0.65rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #94a3b8 !important;
}

.hs-footer strong {
  color: #e2e8f0;
}

.hs-footer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.hs-footer a {
  color: #cbd5e1 !important;
  text-decoration: none !important;
  font-size: 0.9rem;
}

.hs-footer a:hover {
  color: #38bdf8 !important;
}

.hs-footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  padding: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: #64748b;
}

.hs-footer-legal {
  display: flex;
  gap: 1.5rem;
}

@media (max-width: 900px) {
  .hs-footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .hs-footer-inner {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   7. Unified Brand Harmonization Layer (明亮風格統一品牌主色)
   ========================================================================== */

/* Unify legacy per-product custom color utilities into single brand blue */
body.hs-dark [class*="text-original-"] {
  color: var(--hs-brand-primary) !important;
}

body.hs-dark [class*="bg-original-"] {
  background-color: var(--hs-brand-primary) !important;
  color: #ffffff !important;
}

body.hs-dark [class*="bg-original-"]:hover {
  background-color: var(--hs-brand-primary-strong) !important;
  color: #ffffff !important;
}

body.hs-dark [class*="border-original-"] {
  border-color: var(--hs-brand-primary) !important;
}

/* Form controls */
body.hs-dark input,
body.hs-dark select,
body.hs-dark textarea {
  background-color: #ffffff;
  color: var(--hs-text-primary);
  border: 1px solid var(--hs-border-default);
  border-radius: var(--hs-radius-sm);
}

body.hs-dark input:focus,
body.hs-dark select:focus,
body.hs-dark textarea:focus {
  outline: none;
  border-color: var(--hs-brand-primary);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Blockquote & HR */
body.hs-dark blockquote {
  background: #f8fafc;
  border-left: 3px solid var(--hs-brand-primary);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--hs-radius-sm) var(--hs-radius-sm) 0;
  color: var(--hs-text-secondary);
}

body.hs-dark hr {
  border: 0;
  border-top: 1px solid var(--hs-border-subtle);
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 5px;
  border: 2px solid #f1f5f9;
}
::-webkit-scrollbar-thumb:hover {
  background: #0284c7;
}
