/* 環宙集團官網 —— 版型與樣式
   沒有照片素材，所以靠排版、線條與留白撐住畫面，不塞圖庫照。 */

:root {
  --ink: #12212e;
  --navy: #0f3457;          /* 品牌深藍，取自公司表頭 */
  --navy-deep: #0a2440;
  --gold: #caaa77;          /* 品牌金，裝飾與主要按鈕用 */
  --gold-dark: #b8945e;
  --accent: #8a6d3b;        /* 金色系但夠深，小字用得住 */
  --accent-dark: #6f562c;
  --accent-soft: #f7f1e6;
  --paper: #ffffff;
  --surface: #f5f7f9;
  --line: #e3e8ed;
  --muted: #5d6f80;
  --radius: 4px;
  --container: 1120px;
  --sans: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei",
          system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--navy); text-decoration: none; }
a:hover { color: var(--accent); }

img { max-width: 100%; height: auto; }

h1, h2, h3, h4 {
  line-height: 1.4;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
  font-weight: 700;
}

p { margin: 0 0 1.1em; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px; top: 12px; z-index: 100;
  background: var(--paper); padding: 8px 14px;
  border: 2px solid var(--accent);
}

/* ---------------------------------------------------------- 頁首 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; line-height: 1.25; }
.brand img { height: 42px; width: auto; flex: 0 0 auto; }
.brand .brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand strong {
  font-size: 19px;
  letter-spacing: 0.06em;
  color: var(--navy-deep);
}
.brand span {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.site-nav { margin-left: auto; }
.site-nav .nav-root {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}
.site-nav a {
  display: block;
  padding: 8px 12px;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.is-active {
  color: var(--navy);
  border-bottom-color: var(--gold);
  font-weight: 700;
}
/* 下拉選單 */
.site-nav li { position: relative; }
.caret {
  display: inline-block; width: 0; height: 0; margin-left: 6px;
  border-left: 4px solid transparent; border-right: 4px solid transparent;
  border-top: 5px solid currentColor; vertical-align: middle; opacity: 0.5;
}
.subnav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(14, 34, 51, 0.12);
  z-index: 60;
}
.has-children:hover > .subnav,
.has-children:focus-within > .subnav { display: block; }
.subnav a {
  padding: 9px 18px;
  font-size: 14.5px;
  white-space: nowrap;
  border-bottom: 0;
  color: var(--ink);
}
.subnav a:hover { background: var(--surface); color: var(--accent); }
.subnav a.is-active { color: var(--accent); font-weight: 700; border-bottom: 0; }

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: var(--radius);
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}

/* ---------------------------------------------------------- 主視覺 */
.hero {
  background-color: var(--navy-deep);
  background-image:
    linear-gradient(100deg, rgba(10, 36, 64, 0.94) 0%,
                            rgba(10, 36, 64, 0.80) 48%,
                            rgba(10, 36, 64, 0.42) 100%),
    url("/static/img/hero-freight.jpg");
  background-size: cover;
  background-position: center 42%;
  color: #eaf1f7;
  padding: 96px 0 84px;
  position: relative;
  overflow: hidden;
}
.hero .container { position: relative; z-index: 1; }
.hero .eyebrow {
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #9dc0dc;
  margin-bottom: 18px;
}
.hero h1 {
  font-size: clamp(28px, 4.4vw, 46px);
  color: #fff;
  max-width: 20ch;
  margin-bottom: 20px;
}
.hero p {
  max-width: 46ch;
  color: #c6d8e6;
  font-size: 17px;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 30px; }

.btn {
  display: inline-block;
  padding: 12px 26px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
}
.btn-primary { background: var(--gold); color: var(--navy-deep); }
.btn-primary:hover { background: var(--gold-dark); color: var(--navy-deep); }
.btn-ghost { border-color: rgba(255,255,255,0.45); color: #fff; }
.btn-ghost:hover { border-color: #fff; color: #fff; background: rgba(255,255,255,0.08); }
.btn-outline { border-color: var(--line); color: var(--navy); background: var(--paper); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------- 數字帶 */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(255,255,255,0.16);
  margin-top: 54px;
  padding-top: 26px;
  gap: 18px;
}
.stats div span {
  display: block;
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.stats div small { color: #9dc0dc; font-size: 13px; letter-spacing: 0.04em; }

/* ---------------------------------------------------------- 區塊 */
.section { padding: 72px 0; }
.section.tint { background: var(--surface); }
.section-head { max-width: 62ch; margin-bottom: 40px; }
.section-head .eyebrow {
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}
.section-head h2 { font-size: clamp(22px, 3vw, 30px); color: var(--navy-deep); }
.section-head p { color: var(--muted); margin-bottom: 0; }

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 46px 0 40px;
}
.page-head h1 { font-size: clamp(24px, 3.4vw, 34px); color: var(--navy-deep); margin-bottom: 8px; }
.page-head p { color: var(--muted); margin: 0; max-width: 62ch; }
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.crumb a { color: var(--muted); }

/* ---------------------------------------------------------- 卡片 */
.grid { display: grid; gap: 22px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}
.card h3 { font-size: 18px; color: var(--navy-deep); }
.card p { color: var(--muted); margin-bottom: 0; font-size: 15px; }
.card .meta { font-size: 13px; color: var(--muted); }

.value-card { border-top: 3px solid var(--gold); }
.value-card h3 { margin-bottom: 2px; }
.value-card .sub {
  font-size: 13px; color: var(--accent); font-weight: 700;
  letter-spacing: 0.08em; margin-bottom: 12px;
}

.company-card { display: flex; flex-direction: column; height: 100%; }
.company-card .role {
  font-size: 12px; letter-spacing: 0.1em; color: var(--accent); font-weight: 700;
  margin-bottom: 8px;
}
.company-card .en {
  font-size: 12.5px; color: var(--muted); letter-spacing: 0.03em;
  margin: -4px 0 12px;
}
.company-card .founded {
  margin-top: auto; padding-top: 14px; font-size: 13px; color: var(--muted);
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------- 服務 */
.service-block {
  border-top: 1px solid var(--line);
  padding: 40px 0;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
}
.service-block:first-of-type { border-top: 0; }
.service-block .side h2 { font-size: 22px; color: var(--navy-deep); margin-bottom: 6px; }
.service-block .side .company { font-size: 13px; color: var(--accent); font-weight: 700; }
.service-block .side .lead { color: var(--muted); font-size: 15px; margin-top: 12px; }
.service-items { display: grid; gap: 20px; }
.service-item { border-left: 3px solid var(--line); padding-left: 20px; }
.service-item h3 { font-size: 16px; margin-bottom: 6px; }
.service-item p { color: var(--muted); font-size: 15px; margin: 0; }

/* ---------------------------------------------------------- 圖片 */
.media {
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
  background: var(--surface);
}
.media img { width: 100%; height: auto; display: block; }
.media-band { margin: -1px 0 0; }
.media-band img { width: 100%; max-height: 380px; object-fit: cover; }
.media-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
.intro-split { margin-bottom: 44px; }
.logo-strip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}
.logo-strip img { max-width: 100%; height: auto; }
.shop-logo {
  height: 34px; width: auto; margin-bottom: 12px;
  align-self: flex-start;
}

/* ---------------------------------------------------------- 沿革 */
.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; }
.timeline li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 24px;
  align-items: baseline;
  padding: 18px 0 18px 26px;
  border-left: 2px solid var(--line);
  position: relative;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 27px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 3px solid var(--gold);
}
.timeline li:last-child { border-left-color: transparent; }
.timeline .year {
  font-weight: 700;
  font-size: 19px;
  color: var(--navy-deep);
  font-variant-numeric: tabular-nums;
}
.timeline .text { color: var(--muted); font-size: 15.5px; }

/* ------------------------------------------------ 品牌落地服務 */
.chain { display: grid; gap: 0; counter-reset: chain; margin: 0; padding: 0; list-style: none; }
.chain li {
  display: grid;
  grid-template-columns: 56px 190px 1fr;
  gap: 22px;
  align-items: start;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}
.chain li:first-child { border-top: 0; }
.chain .num {
  counter-increment: chain;
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--navy-deep); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 15px;
}
.chain .num::before { content: counter(chain); }
.chain .step { font-weight: 700; color: var(--navy-deep); }
.chain .step small { display: block; font-weight: 400; color: var(--accent); font-size: 12.5px; }
.chain .desc { color: var(--muted); font-size: 15px; }

.case-card { display: flex; flex-direction: column; }
.case-card .partner {
  font-size: 12px; letter-spacing: 0.08em; color: var(--accent);
  font-weight: 700; margin-bottom: 6px;
}
.case-card .go { margin-top: auto; padding-top: 16px; font-weight: 700; font-size: 14px; }

/* ---------------------------------------------------------- 清單 */
.region-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; padding: 0; margin: 0 0 26px; }
.region-list li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 18px;
  font-size: 15px;
  background: var(--paper);
}

.channel-card { display: flex; flex-direction: column; }
.channel-card .kind {
  align-self: flex-start;
  font-size: 12px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
  font-weight: 700;
}
.channel-card .go { margin-top: auto; padding-top: 16px; font-size: 14px; font-weight: 700; }

.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--line); }
.post-list a {
  display: grid;
  grid-template-columns: 110px 90px 1fr;
  gap: 16px;
  align-items: baseline;
  padding: 18px 4px;
}
.post-list a:hover { background: var(--surface); }
.post-list .date { color: var(--muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.post-list .title { color: var(--ink); font-weight: 500; }
.post-list a:hover .title { color: var(--accent); }

.tag {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  justify-self: start;
}
.tag.announcement { border-color: var(--accent); color: var(--accent-dark); background: var(--accent-soft); }
.tag.pinned { border-color: var(--navy); color: var(--navy); }

.filter-row { display: flex; gap: 8px; margin-bottom: 26px; flex-wrap: wrap; }
.filter-row a {
  padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px;
  font-size: 14px; color: var(--muted); background: var(--paper);
}
.filter-row a.is-active { border-color: var(--navy); color: var(--navy); font-weight: 700; }

.article { max-width: 74ch; }
.article .meta { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.article p { font-size: 16.5px; }

.file-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.file-row {
  display: flex; align-items: center; gap: 16px;
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 18px; background: var(--paper);
}
.file-row .name { font-weight: 500; }
.file-row .sub { font-size: 13px; color: var(--muted); }
.file-row .spacer { margin-left: auto; }

/* ---------------------------------------------------------- 表單 */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 22px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 700; color: var(--navy-deep); }
.field .req { color: var(--accent); margin-left: 4px; }
.field input, .field select, .field textarea {
  font: inherit;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  width: 100%;
}
.field textarea { min-height: 160px; resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field button, .field .btn { align-self: flex-start; }
.field .err { color: #b3261e; font-size: 13px; }
.field.has-error input, .field.has-error textarea, .field.has-error select {
  border-color: #b3261e;
}
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice {
  border-left: 4px solid var(--gold);
  background: var(--accent-soft);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  font-size: 15px;
}
.notice.ok { border-color: #1e7a46; background: #eef8f1; }
.notice.warn { border-color: #b3261e; background: #fdeeee; }

mark.todo {
  background: #fff3bf;
  border-bottom: 2px solid #f0b400;
  padding: 0 3px;
  color: #6b4b00;
}

/* ---------------------------------------------------------- 頁尾 */
.site-footer {
  background: var(--navy-deep);
  color: #b9cddd;
  padding: 56px 0 28px;
  margin-top: 80px;
  font-size: 14.5px;
}
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 36px; }
.site-footer h4 {
  color: #fff; font-size: 14px; letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 14px;
}
.site-footer a { color: #b9cddd; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 7px; }
.office { margin-bottom: 18px; line-height: 1.8; }
.office strong { color: #fff; display: block; font-weight: 700; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  margin-top: 34px;
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #8ba6ba;
}

/* ---------------------------------------------------------- 後台 */
.admin-body { background: var(--surface); }
.admin-header {
  background: var(--navy-deep);
  color: #fff;
  padding: 0;
  border: 0;
  position: sticky; top: 0; z-index: 50;
}
.admin-header .header-inner { min-height: 62px; }
.admin-header .brand strong { color: #fff; }
.admin-header .brand span { color: #8ba6ba; }
.admin-header a { color: #cfe0ec; }
.admin-header a:hover, .admin-header a.is-active { color: #fff; }
.admin-header .site-nav a.is-active { border-bottom-color: var(--accent); }
.admin-header .who { font-size: 13px; color: #8ba6ba; margin-left: 18px; }

.admin-main { padding: 34px 0 60px; }
.panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}
.panel h2 { font-size: 17px; margin-bottom: 16px; }
.panel h3 { font-size: 15px; }

table.data { width: 100%; border-collapse: collapse; font-size: 14.5px; }
table.data th, table.data td {
  text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th { font-size: 13px; color: var(--muted); font-weight: 700; }
table.data tr:hover td { background: var(--surface); }

.pill { font-size: 12px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: #eef8f1; color: #1e7a46; }
.pill.bad { background: #fdeeee; color: #b3261e; }
.pill.warn { background: #fff6e5; color: #8a5a00; }
.pill.mute { background: var(--surface); color: var(--muted); }

.kpi-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin-bottom: 22px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
.kpi b { display: block; font-size: 30px; line-height: 1.2; color: var(--navy-deep); }
.kpi small { color: var(--muted); }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-danger { background: #b3261e; color: #fff; }
.btn-danger:hover { background: #8f1e18; color: #fff; }
.inline-form { display: inline; }

.lang-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.lang-tabs button {
  font: inherit; font-size: 13px; padding: 6px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
}
.lang-tabs button.is-active { border-color: var(--navy); color: var(--navy); font-weight: 700; }
.lang-pane[hidden] { display: none; }
.lang-hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

/* ---------------------------------------------------------- RWD */
@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .service-block { grid-template-columns: 1fr; gap: 22px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .media-split { grid-template-columns: 1fr; gap: 24px; }
  .stats { grid-template-columns: repeat(2, 1fr); row-gap: 24px; }
  .kpi-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; flex: 0 0 auto; margin-left: 8px; }
  .header-inner { gap: 8px; min-height: 58px; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand strong { font-size: 15px; letter-spacing: 0.02em; }
  .brand span { font-size: 9px; letter-spacing: 0.08em; }
  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    padding-bottom: 12px;
  }
  .site-nav.is-open { display: block; }
  .site-nav .nav-root { flex-direction: column; gap: 0; }
  .site-nav a { padding: 11px 4px; border-bottom: 1px solid var(--line); }
  .caret { display: none; }
  .subnav {
    display: block; position: static; border: 0; box-shadow: none;
    padding: 0; min-width: 0; background: transparent;
  }
  .subnav a {
    padding-left: 18px; color: var(--muted); font-size: 14px;
    white-space: normal;
  }
  .media-split { grid-template-columns: 1fr; gap: 22px; }
  .timeline li { grid-template-columns: 1fr; gap: 4px; padding-left: 22px; }
  .chain li { grid-template-columns: 40px 1fr; gap: 12px; }
  .chain .desc { grid-column: 2; }
  .header-inner { flex-wrap: wrap; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .post-list a { grid-template-columns: 1fr; gap: 4px; }
  .section { padding: 52px 0; }
  .hero { padding: 60px 0 52px; }
}

@media print {
  .site-header, .site-footer, .hero-actions { display: none; }
}
