:root {
  --accent: #0e5e56;
  --accent-soft: #e9f1ed;
  --ink: #22322e;
  --ink-2: #6b7a74;
  --line: #e7e2d6;
  --bg: #faf7f0;
  --zone-a: #7c3aed;
  --zone-b: #0e7466;
  --zone-c: #d6249f;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", sans-serif;
  background: var(--bg); color: var(--ink);
  padding-bottom: 76px;
}
body.detail-open { padding-bottom: 84px; }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button, a, input { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:active, .btn:active { transform: scale(.97); }
[hidden] { display: none !important; }

/* ---- sticky header (search) ---- */
.top {
  position: sticky; top: 0; z-index: 10;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: 10px 16px 0;
}
.event-line {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  font-size: 12px; color: var(--ink-2); padding-bottom: 8px;
}
.event-line b { color: var(--ink); font-size: 14px; }
.event-line .date {
  margin-left: auto; background: var(--accent-soft); color: var(--accent);
  font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap;
}
.searchbox {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 8px;
}
.searchbox:focus-within { border-color: var(--accent); }
.searchbox svg { flex: none; }
.searchbox input {
  border: 0; outline: 0; background: transparent; width: 100%;
  font-size: 16px; color: var(--ink);
}
.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 4px;
  font-size: 13px; padding: 7px 12px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
  white-space: nowrap;
}
.chip.on {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600;
}
.chip .x { opacity: .8; font-weight: 400; }
.count {
  font-size: 13px; color: var(--ink-2); padding: 12px 16px 4px;
}
.count b { color: var(--accent); font-size: 15px; }

/* ---- auth ---- */
.auth-slot { position: relative; flex: none; }
.auth-login {
  font-size: 12px; font-weight: 600; color: var(--accent);
  border: 1.5px solid var(--accent); border-radius: 999px; padding: 3px 10px;
  background: #fff;
}
.auth-avatar {
  width: 28px; height: 28px; border-radius: 999px; overflow: hidden;
  display: grid; place-items: center; background: var(--accent); color: #fff;
  font-size: 13px; font-weight: 700; padding: 0;
}
.auth-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.auth-menu {
  position: absolute; right: 0; top: 34px; z-index: 30;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 10px 14px; min-width: 160px;
}
.auth-menu .name { font-size: 13px; font-weight: 600; color: var(--ink); margin-bottom: 8px; white-space: nowrap; }
.auth-menu .signout { font-size: 13px; color: #b91c1c; font-weight: 600; padding: 4px 0; }

/* ---- job cards ---- */
.cards { padding: 4px 12px; display: flex; flex-direction: column; gap: 10px; }
.card {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 14px; position: relative;
}
.card h3 {
  font-size: 16px; line-height: 1.4; padding-right: 34px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card .fav {
  position: absolute; top: 12px; right: 12px; width: 28px; height: 28px;
  display: grid; place-items: center; color: #cfc9bc; font-size: 20px;
}
.card .fav.on { color: #d6249f; }
.co { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--ink-2); }
.booth {
  flex: none; font-size: 11px; font-weight: 700; color: #fff;
  padding: 1px 6px; border-radius: 5px; letter-spacing: .5px;
  background: var(--ink-2);
}
.booth.a { background: var(--zone-a); } .booth.b { background: var(--zone-b); } .booth.c { background: var(--zone-c); }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-top: 10px; }
.card .salary { font-size: 15px; font-weight: 700; color: #0e7466; }
.card .salary small { font-weight: 500; font-size: 12px; color: var(--ink-2); }
.tag {
  font-size: 11px; color: var(--ink-2); background: var(--bg);
  border: 1px solid var(--line); padding: 2px 7px; border-radius: 6px;
}
.tag.hot { color: #a81b7d; background: #fdeef8; border-color: #f5c9e6; }

.load-more {
  margin: 14px 16px 20px; display: block; width: calc(100% - 32px);
  padding: 12px 0; border-radius: 12px; text-align: center;
  font-size: 14px; font-weight: 600; color: var(--accent);
  background: #fff; border: 1.5px solid var(--line);
}
.empty {
  text-align: center; color: var(--ink-2); font-size: 14px;
  padding: 60px 24px; line-height: 1.8;
}

/* ---- bottom tabs ---- */
.tabs {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--ink-2);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  text-decoration: none;
}
.tab.on { color: var(--accent); font-weight: 600; }
.tab svg { width: 22px; height: 22px; }
.tab .lbl { display: inline-flex; align-items: center; gap: 3px; }
.tab .badge { font-size: 10px; font-weight: 700; }

/* ---- detail bar (job / company) ---- */
.bar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-bottom: 1px solid var(--line); padding: 12px 16px;
}
.bar .back { font-size: 22px; line-height: 1; color: var(--ink-2); text-decoration: none; padding: 0 4px; }
.bar b { font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar .fav { color: #cfc9bc; font-size: 22px; width: 32px; height: 28px; display: grid; place-items: center; }
.bar .fav.on { color: #d6249f; }

/* ---- job detail ---- */
.hero { background: #fff; padding: 18px 16px; border-bottom: 1px solid var(--line); }
.hero h1 { font-size: 19px; line-height: 1.45; }
.co-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 14px; flex-wrap: wrap; }
.co-row a { color: var(--accent); text-decoration: none; font-weight: 600; }
.type { font-size: 12px; color: var(--ink-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 7px; }
.hero .salary { margin-top: 12px; font-size: 20px; font-weight: 800; color: #0e7466; }
.hero .salary small { font-size: 13px; font-weight: 500; color: var(--ink-2); }

.facts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  background: var(--line); border-bottom: 1px solid var(--line);
}
.fact { background: #fff; padding: 12px 16px; }
.fact .k { font-size: 11px; color: var(--ink-2); margin-bottom: 3px; }
.fact .v { font-size: 14px; font-weight: 600; }
.fact .v small { font-weight: 400; font-size: 12px; color: var(--ink-2); display: block; margin-top: 2px; }
.fact .v.noexp { color: #a81b7d; }

.detail section { background: #fff; margin-top: 10px; padding: 16px; }
.detail section h2 {
  font-size: 14px; color: var(--accent); margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.detail section h2::before { content: ""; width: 4px; height: 16px; background: var(--accent); border-radius: 2px; }
.detail section p { font-size: 14px; line-height: 1.8; color: #33413c; }
.detail section p.pre { white-space: pre-line; }

.cta {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; gap: 10px; background: #fff; border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.btn {
  flex: 1; text-align: center; padding: 13px 0; border-radius: 12px;
  font-size: 15px; font-weight: 700; text-decoration: none;
}
.btn.ghost { color: var(--accent); background: var(--accent-soft); }
.btn.solid { color: #fff; background: var(--accent); flex: 1.6; }

/* ---- company detail ---- */
.co-hero .row { display: flex; gap: 12px; align-items: center; }
.logo {
  width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center;
  font-weight: 800; color: var(--accent); font-size: 13px; flex: none;
  overflow: hidden; position: relative;
}
.logo::before { content: attr(data-init); }
.logo img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; display: block; background: #fff; padding: 2px;
}
.co-hero h1 { font-size: 17px; line-height: 1.4; }
.sub { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--ink-2); }
.links { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.link {
  font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft);
  padding: 7px 12px; border-radius: 999px; text-decoration: none;
}
.more { font-size: 13px; color: var(--ink-2); margin-top: 6px; cursor: pointer; }
.intro-clamp {
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.benefits { display: flex; flex-wrap: wrap; gap: 6px; }
.benefit {
  font-size: 12px; color: #33413c; background: var(--bg);
  border: 1px solid var(--line); padding: 4px 10px; border-radius: 999px;
}
.benefit.toggle { cursor: pointer; color: var(--accent); border-color: var(--accent); background: var(--accent-soft); font-weight: 600; }

.job {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
  text-decoration: none;
}
.job:last-child { border-bottom: 0; }
.job .t { font-size: 14px; font-weight: 600; line-height: 1.4; }
.job .s { font-size: 12px; color: #0e7466; font-weight: 700; margin-top: 3px; }
.job .s small { color: var(--ink-2); font-weight: 400; }
.job .go { color: #cfc9bc; font-size: 18px; flex: none; }
.job .fav {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center;
  color: #cfc9bc; font-size: 20px;
}
.job .fav.on { color: #d6249f; }

/* ---- companies list ---- */
.zone-head { padding: 16px 16px 8px; font-size: 13px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 8px; }
.co-cards { padding: 0 12px; display: flex; flex-direction: column; gap: 10px; }
.co-card {
  display: flex; gap: 12px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  padding: 12px; text-decoration: none;
}
.co-card .info { min-width: 0; flex: 1; }
.co-card .name { font-size: 14px; font-weight: 700; line-height: 1.4; }
.co-card .line2 { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.co-card .blurb {
  margin-top: 5px; font-size: 12px; color: var(--ink-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.co-card .logo { width: 44px; height: 44px; font-size: 11px; }

/* ---- favorites ---- */
.fav-group { background: #fff; border: 1px solid var(--line); border-radius: 14px; margin: 0 12px 10px; padding: 4px 14px; }
.fav-group .head {
  display: flex; align-items: center; gap: 8px; padding: 12px 0;
  border-bottom: 1px solid var(--line); font-size: 14px; font-weight: 700;
}
.fav-group .head .n { margin-left: auto; font-size: 12px; color: var(--ink-2); font-weight: 400; }
.fav-hint { font-size: 12px; color: var(--ink-2); padding: 12px 16px 10px; }

/* ---- bottom sheet ---- */
.sheet-backdrop { position: fixed; inset: 0; background: rgba(15,23,42,.4); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21;
  background: #fff; border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 70vh; overflow-y: auto;
}
.sheet h3 { font-size: 15px; margin-bottom: 12px; }
.sheet .opts { display: flex; flex-wrap: wrap; gap: 8px; }
.sheet .opt-chip {
  font-size: 13px; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--line); background: #fff; color: var(--ink);
}
.sheet .opt-chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.sheet .opt-chip small { color: inherit; opacity: .7; }
.sheet .done {
  margin-top: 16px; width: 100%; padding: 12px 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-size: 15px; font-weight: 700;
}

.disclaimer {
  background: #fffbeb; color: #92400e; border-bottom: 1px solid #fde68a;
  font-size: 12px; line-height: 1.6; padding: 7px 16px; text-align: center;
}
.disclaimer a { color: inherit; font-weight: 600; }

/* ---- touch & a11y (44px hit areas, keyboard nav) ---- */
.chip { position: relative; }
.chip::before { content: ""; position: absolute; inset: -6px 0; }
.bar .fav, .job .fav, .bar .back, .auth-login, .auth-avatar { position: relative; }
.card .fav::after, .bar .fav::after, .job .fav::after,
.bar .back::after, .auth-login::after, .auth-avatar::after {
  content: ""; position: absolute; inset: -8px;
}
.card .fav { z-index: 1; }
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; }
.sheet { outline: none; }
.sheet .opt-chip { min-height: 44px; }
.count, .card .salary, .hero .salary, .job .s, .tab .badge {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 640px) {
  .cards, .co-cards { max-width: 640px; margin: 0 auto; }
  .fav-group { max-width: 616px; margin-left: auto; margin-right: auto; }
}
