/* ==========================================================================
   分影科技官網 — 設計代幣（數據驅動 AI 科技風格）
   概念：深色背景＋藍紫漸層節點光暈，呼應「數據驅動決策」的定位，
   同時保留專利文件線稿與圖章意象，維繫分影的專利科技本業識別。
   ========================================================================== */
:root {
  --bg: #080b16;
  --bg-alt: #0c101f;
  --panel: #121729;
  --panel-soft: #0e1322;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.18);

  --text: #edeff8;
  --text-soft: #a6adc9;
  --text-faint: #6d7492;

  --accent: #5b8def;
  --accent-2: #9b6cf0;
  --accent-soft: rgba(91, 141, 239, 0.14);
  --amber: #e0a458;

  --font-display: "Noto Serif TC", "Georgia", serif;
  --font-body: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --font-mono: "IBM Plex Mono", "Menlo", monospace;

  --max-width: 1160px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* 全站背景：細緻網點＋左右暈光，營造數據科技質感 */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    radial-gradient(circle at 15% 8%, rgba(91, 141, 239, 0.16), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(155, 108, 240, 0.12), transparent 45%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: auto, auto, 26px 26px;
  background-position: 0 0, 0 0, 0 0;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.35;
  margin: 0;
}

a { color: inherit; }

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #04070d;
  padding: 10px 16px;
  z-index: 200;
}
.skip-link:focus { left: 12px; top: 12px; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 11, 22, 0.82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text);
}
.brand-en {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--text-faint);
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
}
.site-nav a {
  text-decoration: none;
  color: var(--text-soft);
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.site-nav a:hover { color: var(--text); border-color: var(--line-strong); }
.nav-cta { color: var(--accent) !important; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06080f;
  border-color: transparent;
  font-weight: 500;
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(91, 141, 239, 0.35); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  margin-left: 12px;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 96px 24px 100px;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 48px;
  align-items: center;
}
.hero-copy h1 {
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 900;
  margin-bottom: 22px;
  background: linear-gradient(120deg, var(--text) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-sub {
  color: var(--text-soft);
  font-size: 17px;
  max-width: 46ch;
  margin: 0 0 32px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 4px; }

.hero-figure { display: flex; justify-content: center; }
#hero-schema { width: 100%; max-width: 440px; height: auto; }
.schema-doc { fill: var(--panel); stroke: var(--line-strong); stroke-width: 1.5; }
.schema-line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 2; }
.schema-glow { opacity: 0.55; }
.schema-node { fill: var(--bg); stroke: var(--accent); stroke-width: 2; }
.schema-link {
  stroke-width: 1.6;
  fill: none;
  stroke-dasharray: 720;
  stroke-dashoffset: 720;
  animation: draw-link 2s ease forwards 0.3s;
}
@keyframes draw-link { to { stroke-dashoffset: 0; } }

/* ---------- Sections ---------- */
.section { padding: 96px 0; border-bottom: 1px solid var(--line); }
.section:last-of-type { border-bottom: none; }
.section-alt { background: var(--bg-alt); }
.section-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }
.section-head h2 { font-size: clamp(26px, 3vw, 36px); font-weight: 700; margin-bottom: 40px; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1.3fr 0.9fr; gap: 56px; align-items: start; }
.about-body h2 { margin-bottom: 28px; }
.about-paragraphs p {
  color: var(--text-soft);
  margin: 0 0 20px;
  max-width: 68ch;
}
.tech-fields { margin-top: 36px; }
.tech-fields-heading {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 14px;
  text-transform: uppercase;
}
.chip-list { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; padding: 0; margin: 0; }
.chip {
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  background: var(--panel);
}

.about-figure { display: flex; justify-content: center; padding-top: 12px; }
.about-figure svg { width: 100%; max-width: 320px; height: auto; }
.orbit-ring { fill: none; stroke: var(--line-strong); stroke-width: 1.4; }
.orbit-ring-soft { stroke: rgba(255, 255, 255, 0.07); }
.orbit-core { fill: var(--accent); }
.orbit-node { fill: var(--bg); stroke: var(--accent-2); stroke-width: 2; }
.orbit-spoke { stroke: rgba(255, 255, 255, 0.14); stroke-width: 1.2; }
.stat-card { fill: var(--panel); stroke: var(--line); stroke-width: 1.2; }
.stat-line { stroke: rgba(255, 255, 255, 0.16); stroke-width: 3; stroke-linecap: round; }
.trend-line { fill: none; stroke: var(--amber); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trend-dot { fill: var(--amber); }

/* ---------- Services (icon cards) ---------- */
.services-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.service-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 30px 28px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.service-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.service-index {
  position: absolute;
  top: 22px;
  right: 24px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.05em;
}
.service-icon {
  display: block;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  border-radius: 9px;
  background: var(--accent-soft);
  position: relative;
}
.service-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 22px;
  height: 22px;
  background-color: var(--accent);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.service-icon[data-icon="chip"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='6' y='6' width='12' height='12' rx='1.5'/%3E%3Cpath d='M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='6' y='6' width='12' height='12' rx='1.5'/%3E%3Cpath d='M9 2v3M15 2v3M9 19v3M15 19v3M2 9h3M2 15h3M19 9h3M19 15h3'/%3E%3C/svg%3E");
}
.service-icon[data-icon="document"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M7 2h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M14 2v5h5M9 13h6M9 17h6M9 9h2'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M7 2h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1Z'/%3E%3Cpath d='M14 2v5h5M9 13h6M9 17h6M9 9h2'/%3E%3C/svg%3E");
}
.service-icon[data-icon="send"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M22 2 11 13'/%3E%3Cpath d='m22 2-7 20-4-9-9-4Z'/%3E%3C/svg%3E");
}
.service-icon[data-icon="network"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='5' r='2.4'/%3E%3Ccircle cx='5' cy='19' r='2.4'/%3E%3Ccircle cx='19' cy='19' r='2.4'/%3E%3Cpath d='M12 7.4v6M10 12l-3.6 5M14 12l3.6 5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='12' cy='5' r='2.4'/%3E%3Ccircle cx='5' cy='19' r='2.4'/%3E%3Ccircle cx='19' cy='19' r='2.4'/%3E%3Cpath d='M12 7.4v6M10 12l-3.6 5M14 12l3.6 5'/%3E%3C/svg%3E");
}
.service-title { font-size: 19px; margin: 0 0 10px; }
.service-desc { color: var(--text-soft); font-size: 14.5px; margin: 0; }

/* ---------- Solutions ---------- */
.solutions-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.solution-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 32px 26px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.solution-icon {
  display: block;
  width: 40px;
  height: 40px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-soft), transparent);
  border: 1px solid var(--line-strong);
  position: relative;
}
.solution-icon::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 20px;
  height: 20px;
  background-color: var(--accent-2);
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
}
.solution-icon[data-icon="rocket"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09Z'/%3E%3Cpath d='M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 19 4c0 2.44-.94 8.13-8.5 12L12 15Z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09Z'/%3E%3Cpath d='M12 15l-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 19 4c0 2.44-.94 8.13-8.5 12L12 15Z'/%3E%3Cpath d='M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5'/%3E%3C/svg%3E");
}
.solution-icon[data-icon="building"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 22V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v18M6 22h12M14 22v-6h4a1 1 0 0 1 1 1v5M9 7h1M9 11h1M9 15h1'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M6 22V4a1 1 0 0 1 1-1h6a1 1 0 0 1 1 1v18M6 22h12M14 22v-6h4a1 1 0 0 1 1 1v5M9 7h1M9 11h1M9 15h1'/%3E%3C/svg%3E");
}
.solution-icon[data-icon="chart"]::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-5 3 3 5-7'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M3 3v18h18'/%3E%3Cpath d='m7 15 4-5 3 3 5-7'/%3E%3C/svg%3E");
}
.solution-audience {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  margin: 0;
}
.solution-title { font-size: 19px; margin: 0; }
.solution-desc { color: var(--text-soft); font-size: 14.5px; margin: 0; flex-grow: 1; }
.solution-combo {
  font-size: 13px;
  color: var(--text);
  border-top: 1px dashed var(--line-strong);
  padding-top: 12px;
  margin: 0;
}

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.news-empty {
  grid-column: 1 / -1;
  color: var(--text-soft);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  padding: 40px;
  text-align: center;
  background: var(--panel-soft);
}
.news-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.news-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.news-card-thumb-fallback {
  width: 100%;
  height: 160px;
  background:
    radial-gradient(circle at 30% 30%, rgba(91, 141, 239, 0.35), transparent 55%),
    radial-gradient(circle at 75% 65%, rgba(155, 108, 240, 0.3), transparent 55%),
    var(--panel-soft);
  position: relative;
}
.news-card-thumb-fallback::before {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 30px;
  height: 30px;
  top: 0; bottom: 0; left: 0; right: 0;
  background-color: rgba(255, 255, 255, 0.5);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4 19.5V6a2 2 0 0 1 2-2h9l5 5v10.5a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 19.5Z'/%3E%3Cpath d='M15 4v5h5M8 13l2 2 4-5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Cpath d='M4 19.5V6a2 2 0 0 1 2-2h9l5 5v10.5a1.5 1.5 0 0 1-1.5 1.5h-13A1.5 1.5 0 0 1 4 19.5Z'/%3E%3Cpath d='M15 4v5h5M8 13l2 2 4-5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.news-card-body { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }
.news-date { font-family: var(--font-mono); font-size: 12px; color: var(--amber); }
.news-title { font-family: var(--font-display); font-size: 17px; margin: 0; }
.news-summary { color: var(--text-soft); font-size: 14px; margin: 0; flex-grow: 1; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; }
.contact-list { margin: 28px 0 0; }
.contact-list > div { display: grid; grid-template-columns: 90px 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.contact-list dt { font-family: var(--font-mono); font-size: 16px; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.contact-list dd { margin: 0; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.contact-list a:hover { color: var(--accent); border-color: var(--accent); }

.mark-wrap { display: flex; justify-content: center; }
.mark { width: 180px; height: 180px; }
.mark-ring-outer { fill: none; stroke: var(--accent-2); stroke-width: 2; }
.mark-ring-inner { fill: none; stroke: var(--accent-2); stroke-width: 1; stroke-dasharray: 2 4; }
.mark-text-cn { font-family: var(--font-display); font-size: 34px; fill: var(--accent-2); font-weight: 700; }
.mark-text-en { font-family: var(--font-mono); font-size: 11px; fill: var(--accent-2); letter-spacing: 0.12em; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 28px 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 13px;
  color: var(--text-faint);
}
.admin-link { color: var(--text-faint); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.admin-link:hover { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .hero-inner { grid-template-columns: 1fr; padding-top: 56px; }
  .hero-figure { order: -1; max-width: 280px; margin: 0 auto 24px; }
  .about-grid { grid-template-columns: 1fr; }
  .about-figure { order: -1; max-width: 240px; margin: 0 auto 16px; }
  .services-grid { grid-template-columns: 1fr; }
  .solutions-grid { grid-template-columns: 1fr; }
  .news-grid { grid-template-columns: 1fr 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .mark-wrap { order: -1; }
}
@media (max-width: 640px) {
  .site-nav { gap: 14px; font-size: 13px; }
  .site-nav a:not(.nav-cta) { display: none; }
  .section { padding: 64px 0; }
  .news-grid { grid-template-columns: 1fr; }
}
