:root {
  --ink: #17332f;
  --ink-2: #38524d;
  --muted: #6f827e;
  --line: #dce7e3;
  --paper: #ffffff;
  --canvas: #f4f7f5;
  --yellow: #f5c842;
  --yellow-soft: #fff4c2;
  --yellow-deep: #b87800;
  --green: #087d61;
  --green-deep: #055d49;
  --green-soft: #dff5ed;
  --danger: #c64242;
  --danger-soft: #fff0ee;
  --shadow: 0 18px 48px rgba(20, 62, 53, 0.10);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid rgba(8,125,97,.34);
  outline-offset: 3px;
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-mark {
  position: relative;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--yellow);
  box-shadow: inset 0 -13px 0 var(--green);
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  position: absolute;
  width: 12px;
  height: 18px;
  left: 13px;
  top: 7px;
  border: 3px solid var(--ink);
  border-radius: 5px;
}
.brand-mark::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 3px;
  left: 16.5px;
  top: 3px;
  border-radius: 2px;
  background: var(--ink);
}
.brand-title { display: block; font-size: 17px; line-height: 1.05; }
.brand-sub { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(220,231,227,.85);
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(16px);
}
.nav-wrap {
  width: min(1180px, calc(100% - 40px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-links { display: flex; align-items: center; gap: 30px; color: var(--ink-2); font-weight: 650; }
.nav-links a:hover { color: var(--green-deep); }
.nav-actions { display: flex; gap: 10px; }

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 17px;
  color: var(--ink);
  background: var(--paper);
  font-weight: 750;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--ink); color: #fff; box-shadow: 0 9px 24px rgba(23,51,47,.18); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-outline { border-color: var(--line); }
.btn-quiet { background: transparent; color: var(--ink-2); }
.btn-sm { min-height: 36px; padding: 7px 12px; border-radius: 10px; font-size: 13px; }
.icon { width: 18px; height: 18px; display: inline-block; }

.hero {
  position: relative;
  overflow: hidden;
  padding: 82px 0 72px;
  background:
    radial-gradient(circle at 92% 10%, rgba(245,200,66,.38), transparent 24%),
    radial-gradient(circle at 4% 90%, rgba(12,159,120,.18), transparent 29%),
    #fbfdfc;
}
.hero::after {
  content: "";
  position: absolute;
  width: 540px;
  height: 540px;
  right: -260px;
  bottom: -360px;
  border: 72px solid rgba(12,159,120,.08);
  border-radius: 50%;
}
.hero-grid {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.03fr .97fr;
  align-items: center;
  gap: 64px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border: 1px solid #cfe5dd;
  border-radius: 999px;
  background: rgba(255,255,255,.78);
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px var(--green-soft); }
h1, h2, h3, p { margin-top: 0; }
h1 { margin: 22px 0 20px; font-size: clamp(42px, 6vw, 72px); line-height: 1.06; letter-spacing: -.055em; }
.hero-copy > p { max-width: 620px; color: var(--ink-2); font-size: 18px; }
.hero-actions { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 12px; }
.trust-row { display: flex; flex-wrap: wrap; gap: 16px 24px; margin-top: 28px; color: var(--muted); font-size: 13px; }
.trust-item { display: flex; align-items: center; gap: 7px; }
.trust-check { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 11px; }

.control-card {
  position: relative;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.9);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
}
.control-card::before {
  content: "";
  position: absolute;
  inset: -12px 42px auto -16px;
  height: 74px;
  z-index: -1;
  border-radius: 24px;
  background: var(--yellow);
  transform: rotate(-3deg);
}
.mini-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.mini-title { font-size: 13px; font-weight: 800; }
.live-pill { padding: 5px 9px; border-radius: 999px; background: var(--green-soft); color: var(--green-deep); font-size: 11px; font-weight: 800; }
.route-map { position: relative; height: 220px; overflow: hidden; border-radius: 20px; background: #e8f0ed; }
.route-map svg { width: 100%; height: 100%; }
.map-pin { position: absolute; width: 28px; height: 28px; display: grid; place-items: center; border: 4px solid #fff; border-radius: 50% 50% 50% 8px; background: var(--green); color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 5px 12px rgba(13,87,68,.25); transform: rotate(-45deg); }
.map-pin span { transform: rotate(45deg); }
.pin-1 { left: 22%; top: 54%; }
.pin-2 { left: 48%; top: 30%; background: var(--yellow); color: var(--ink); }
.pin-3 { right: 16%; top: 54%; }
.route-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 12px; }
.route-stat { padding: 12px; border-radius: 13px; background: var(--canvas); }
.route-stat strong { display: block; font-size: 20px; letter-spacing: -.03em; }
.route-stat span { color: var(--muted); font-size: 11px; }

.section { padding: 88px 0; }
.section-white { background: var(--paper); }
.container { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.section-head { max-width: 720px; margin-bottom: 38px; }
.section-kicker { margin-bottom: 9px; color: var(--green-deep); font-size: 12px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.section-title { margin-bottom: 12px; font-size: clamp(30px, 4vw, 46px); line-height: 1.15; letter-spacing: -.04em; }
.section-desc { color: var(--muted); font-size: 16px; }
.service-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 16px; }
.service-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; }
.service-card:nth-child(2), .service-card:nth-child(4) { background: #f9fbfa; }
.service-icon { width: 42px; height: 42px; display: grid; place-items: center; margin-bottom: 25px; border-radius: 13px; background: var(--yellow-soft); color: var(--yellow-deep); }
.service-card:nth-child(even) .service-icon { background: var(--green-soft); color: var(--green-deep); }
.service-card h3 { margin-bottom: 8px; font-size: 18px; }
.service-card p { margin: 0; color: var(--muted); font-size: 13px; }

.process-panel { padding: 40px; border-radius: var(--radius-xl); color: #fff; background: var(--ink); }
.process-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 22px; }
.process-step { position: relative; }
.step-number { width: 32px; height: 32px; display: grid; place-items: center; margin-bottom: 20px; border: 1px solid rgba(255,255,255,.22); border-radius: 50%; color: var(--yellow); font-size: 12px; font-weight: 800; }
.process-step h3 { margin-bottom: 7px; font-size: 16px; }
.process-step p { margin: 0; color: #b9c9c5; font-size: 13px; }
.process-step:not(:last-child)::after { content: ""; position: absolute; top: 16px; right: -11px; width: 22px; height: 1px; background: #5b716c; }

.portal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.portal-card { min-height: 310px; display: flex; flex-direction: column; justify-content: space-between; padding: 34px; overflow: hidden; border-radius: var(--radius-xl); }
.portal-agent { background: var(--yellow); }
.portal-worker { color: #fff; background: var(--green); }
.portal-card .label { font-size: 12px; font-weight: 850; letter-spacing: .09em; text-transform: uppercase; opacity: .7; }
.portal-card h3 { max-width: 420px; margin: 12px 0; font-size: 34px; line-height: 1.16; letter-spacing: -.04em; }
.portal-card p { max-width: 480px; opacity: .78; }
.portal-card .btn { align-self: flex-start; }
.portal-worker .btn { background: #fff; color: var(--green-deep); }

.site-footer { padding: 38px 0; color: #b8c9c5; background: #102722; }
.footer-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.footer-note { max-width: 600px; font-size: 12px; }

/* App shell */
.app-body { background: #f2f5f3; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px 1fr; }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 22px 16px; border-right: 1px solid var(--line); background: #fff; }
.sidebar .brand { padding: 4px 8px 22px; }
.side-nav { display: grid; gap: 5px; }
.side-link { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 10px 12px; border-radius: 12px; color: var(--muted); font-weight: 700; }
.side-link:hover { color: var(--ink); background: var(--canvas); }
.side-link.active { color: var(--ink); background: var(--yellow-soft); }
.theme-worker .side-link.active { color: var(--green-deep); background: var(--green-soft); }
.theme-admin .side-link.active { color: var(--green-deep); background: linear-gradient(90deg,var(--yellow-soft),var(--green-soft)); }
.side-icon { width: 22px; text-align: center; font-size: 16px; }
.sidebar-foot { position: absolute; left: 16px; right: 16px; bottom: 18px; padding: 14px; border-radius: 13px; background: var(--canvas); }
.sidebar-foot strong { display: block; font-size: 13px; }
.sidebar-foot span { color: var(--muted); font-size: 11px; }
.app-main { min-width: 0; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 30px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.9); }
.page-heading strong { display: block; font-size: 18px; }
.page-heading span { color: var(--muted); font-size: 12px; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.avatar { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--yellow); font-weight: 850; }
.theme-admin .avatar { color: #fff; background: var(--green); }
.app-content { padding: 28px 30px 48px; }
.demo-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; padding: 11px 15px; border: 1px solid #eedb9c; border-radius: 12px; background: #fff8db; color: #6f5713; font-size: 12px; }
.kpi-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { padding: 19px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.kpi-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--yellow); }
.theme-admin .kpi-card:nth-child(even) .kpi-dot { background: var(--green); }
.kpi-value { margin: 10px 0 2px; font-size: 30px; font-weight: 850; letter-spacing: -.04em; }
.kpi-note { color: var(--muted); font-size: 11px; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(280px,.8fr); gap: 18px; }
.panel { border: 1px solid var(--line); border-radius: 18px; background: #fff; overflow: hidden; }
.panel-head { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.panel-title { font-weight: 800; }
.panel-subtitle { color: var(--muted); font-size: 11px; }
.panel-body { padding: 18px; }
.filter-row { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-pill { min-height: 34px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: #fff; font-size: 12px; font-weight: 700; }
.filter-pill.active { border-color: var(--ink); color: #fff; background: var(--ink); }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; white-space: nowrap; }
.data-table th { padding: 12px 15px; border-bottom: 1px solid var(--line); color: var(--muted); background: #fafcfb; font-size: 11px; font-weight: 750; text-align: left; }
.data-table td { padding: 14px 15px; border-bottom: 1px solid #edf2f0; font-size: 12px; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.merchant-cell strong { display: block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.merchant-cell span { display: block; color: var(--muted); font-size: 10px; }
.status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-warn { color: #9a6300; background: #fff2c4; }
.status-progress { color: #0a7b60; background: var(--green-soft); }
.status-neutral { color: #5d6f6b; background: #edf2f0; }
.status-danger { color: #a53939; background: var(--danger-soft); }
.drop-zone { padding: 26px 18px; border: 1.5px dashed #c6d3cf; border-radius: 15px; text-align: center; background: #fbfcfc; }
.drop-icon { width: 44px; height: 44px; display: grid; place-items: center; margin: 0 auto 12px; border-radius: 13px; background: var(--yellow-soft); font-size: 20px; }
.drop-zone strong { display: block; font-size: 14px; }
.drop-zone p { margin: 4px 0 14px; color: var(--muted); font-size: 11px; }
.mapping-list { display: grid; gap: 10px; margin-top: 16px; }
.mapping-row { display: grid; grid-template-columns: 1fr 24px 1fr; align-items: center; gap: 8px; color: var(--muted); font-size: 11px; }
.mapping-row strong { color: var(--ink); font-weight: 700; }
.missing-box { margin-top: 14px; padding: 12px; border-radius: 12px; background: var(--danger-soft); color: #854040; font-size: 11px; }
.activity-list { display: grid; gap: 14px; }
.activity { display: grid; grid-template-columns: 9px 1fr auto; gap: 10px; align-items: start; }
.activity::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--green); }
.activity strong { display: block; font-size: 12px; }
.activity span, .activity time { color: var(--muted); font-size: 10px; }

/* Worker mobile-first */
.worker-page { min-height: 100vh; padding-bottom: 84px; background: #f3f7f5; }
.worker-page .btn-sm { min-height: 44px; }
.worker-header { position: sticky; top: 0; z-index: 10; padding: 16px 18px 12px; color: #fff; background: var(--green-deep); }
.worker-head-row { display: flex; align-items: center; justify-content: space-between; }
.worker-header .brand-sub { color: rgba(255,255,255,.64); }
.worker-header .brand-mark { width: 34px; height: 34px; border-radius: 11px; }
.worker-header .brand-mark::before { left: 11px; top: 6px; }
.worker-header .brand-mark::after { left: 14.5px; }
.worker-hello { margin-top: 22px; }
.worker-hello span { color: rgba(255,255,255,.68); font-size: 12px; }
.worker-hello h1 { margin: 3px 0 0; font-size: 26px; letter-spacing: -.04em; }
.worker-main { width: min(620px, 100%); margin: 0 auto; padding: 18px; }
.balance-card { display: grid; grid-template-columns: 1fr auto; align-items: end; margin-top: -2px; margin-bottom: 16px; padding: 18px; border-radius: 18px; background: linear-gradient(135deg,var(--yellow),#ffe48a); box-shadow: 0 12px 28px rgba(92,75,10,.12); }
.balance-card span { display: block; font-size: 11px; opacity: .7; }
.balance-card strong { display: block; font-size: 28px; letter-spacing: -.04em; }
.balance-card small { font-size: 10px; opacity: .72; }
.worker-section-head { display: flex; align-items: end; justify-content: space-between; margin: 24px 0 10px; }
.worker-section-head h2 { margin: 0; font-size: 18px; }
.worker-section-head a { color: var(--green-deep); font-size: 12px; font-weight: 750; }
.route-card { margin-bottom: 12px; padding: 17px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 8px 25px rgba(30,75,64,.05); }
.route-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.route-zone { display: flex; align-items: center; gap: 10px; }
.zone-icon { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; color: #fff; background: var(--green); font-size: 13px; font-weight: 850; }
.route-zone h3 { margin: 0; font-size: 16px; }
.route-zone p { margin: 2px 0 0; color: var(--muted); font-size: 11px; }
.reward { color: var(--green-deep); font-size: 18px; font-weight: 850; }
.reward small { font-size: 10px; }
.route-meta { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin: 15px 0; }
.meta-item { padding: 9px; border-radius: 11px; background: var(--canvas); }
.meta-item span { display: block; color: var(--muted); font-size: 9px; }
.meta-item strong { display: block; margin-top: 2px; font-size: 11px; }
.route-actions { display: flex; gap: 8px; }
.route-actions .btn { flex: 1; }
.accepted-detail { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.accepted-detail.show { display: block; }
.task-stop { display: grid; grid-template-columns: 22px 1fr auto; gap: 9px; padding: 10px 0; border-bottom: 1px solid #edf2f0; }
.task-stop:last-child { border-bottom: 0; }
.stop-no { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; color: #fff; background: var(--green); font-size: 9px; font-weight: 800; }
.task-stop strong { display: block; font-size: 11px; }
.task-stop span { display: block; color: var(--muted); font-size: 10px; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; z-index: 20; width: min(620px,100%); height: 70px; display: grid; grid-template-columns: repeat(4,1fr); transform: translateX(-50%); border-top: 1px solid var(--line); background: rgba(255,255,255,.96); backdrop-filter: blur(16px); }
.bottom-link { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 10px; }
.bottom-link b { font-size: 17px; line-height: 1; }
.bottom-link.active { color: var(--green-deep); font-weight: 800; }

.toast { position: fixed; left: 50%; bottom: 92px; z-index: 50; padding: 11px 16px; border-radius: 12px; color: #fff; background: var(--ink); box-shadow: var(--shadow); opacity: 0; transform: translate(-50%,12px); pointer-events: none; transition: .22s ease; }
.toast.show { opacity: 1; transform: translate(-50%,0); }

@media (max-width: 980px) {
  .nav-links { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-copy > p { margin-left: auto; margin-right: auto; }
  .hero-actions, .trust-row { justify-content: center; }
  .control-card { max-width: 620px; margin: 0 auto; transform: none; }
  .service-grid { grid-template-columns: repeat(2,1fr); }
  .app-shell { grid-template-columns: 80px 1fr; }
  .sidebar .brand-title, .sidebar .brand-sub, .side-link span:not(.side-icon), .sidebar-foot { display: none; }
  .sidebar .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  .side-link { justify-content: center; }
  .kpi-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav-wrap { width: calc(100% - 28px); height: 64px; }
  .brand-sub { display: none; }
  .nav-actions .btn-outline { display: none; }
  .hero { padding: 55px 0; }
  .hero-grid, .container { width: calc(100% - 28px); }
  h1 { font-size: 43px; }
  .hero-copy > p { font-size: 16px; }
  .hero-actions .btn { width: 100%; }
  .control-card { padding: 13px; border-radius: 22px; }
  .route-map { height: 190px; }
  .section { padding: 62px 0; }
  .service-grid, .portal-grid, .process-grid { grid-template-columns: 1fr; }
  .process-step:not(:last-child)::after { display: none; }
  .portal-card { min-height: 260px; padding: 26px; }
  .portal-card h3 { font-size: 28px; }
  .footer-row { align-items: flex-start; flex-direction: column; }
  .app-shell { display: block; }
  .sidebar { display: none; }
  .topbar { height: 68px; padding: 0 16px; }
  .top-actions .btn-outline { display: none; }
  .app-content { padding: 18px 14px 35px; }
  .demo-banner { align-items: flex-start; flex-direction: column; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi-card { padding: 15px; }
  .kpi-value { font-size: 25px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .hide-mobile { display: none !important; }
}
