/* Light is the default; the inline script in <head> sets data-theme before first paint. */
:root {
  color-scheme: light;
  --bg: #f4f1ea; --card: #fffdf8; --ink: #17242f; --muted: #66727c; --line: #e2dccf; --field: #f4f1ea;
  --sea: #0f4c5c; --sea-soft: #e0eced; --on-sea: #fff; --brass: #a8761f; --on-brass: #fff; --bad: #a33a2c;
  --bar: #fffdf8; --bar-ink: #17242f; --bar-muted: #5b6872;
  --radius: 10px;
  font-family: "Google Sans", "Google Sans Flex", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e1a22; --card: #15252f; --ink: #e6ecef; --muted: #93a2ad; --line: #26394a; --field: #1c303d;
  --sea: #7cc4cf; --sea-soft: #1d3a45; --on-sea: #0e1a22; --brass: #dcae5c; --on-brass: #1c1405; --bad: #e88a7b;
  --bar: #0a141b; --bar-ink: #eef3f2; --bar-muted: #a9b9c0;
}
:root[data-theme="dark"] .for-light, :root:not([data-theme="dark"]) .for-dark { display: none; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
a { color: var(--sea); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.top { background: var(--bar); color: var(--bar-ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-in { max-width: 1160px; margin: auto; padding: 10px 16px; display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.brand { display: block; line-height: 0; flex: none; }
.brand img { height: 38px; width: auto; }
.search { flex: 1 1 280px; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; padding: 8px 12px; border: 1px solid var(--line); border-right: 0; border-radius: 8px 0 0 8px; font-size: 15px; background: var(--field); color: var(--ink); }
.search button { border: 0; padding: 0 16px; border-radius: 0 8px 8px 0; background: var(--brass); color: var(--on-brass); cursor: pointer; font-size: 14px; }
.top nav { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.top nav a { color: var(--bar-muted); padding: 2px 0; border-bottom: 2px solid transparent; }
.top nav a.on, .top nav a:hover { color: var(--bar-ink); border-color: var(--brass); text-decoration: none; }
.top nav form { margin: 0; }
.link { background: none; border: 0; color: var(--bar-muted); cursor: pointer; font: inherit; padding: 0; }
.theme-toggle { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; background: transparent; color: var(--bar-muted); border: 1px solid var(--line); border-radius: 8px; flex: none; }
.theme-toggle:hover { color: var(--bar-ink); border-color: var(--brass); }
main { width: 100%; max-width: 1160px; margin: 20px auto 0; padding: 0 16px; flex: 1; }
.foot { text-align: center; background: var(--bar); color: var(--bar-muted); border-top: 1px solid var(--line); font-size: 13px; padding: 28px 16px; margin-top: 32px; }
.foot img { width: min(285px, 70vw); height: auto; display: block; margin: 0 auto 12px; }
.foot a { color: var(--bar-ink); }
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 20px; align-items: start; }
.narrow { max-width: 820px; margin: auto; }
.tiny { max-width: 360px; margin: 60px auto; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow: auto; }
.filters > summary { display: none; }
.filters section { padding-top: 12px; margin-top: 12px; border-top: 1px solid var(--line); }
.filters section:first-of-type { padding-top: 0; margin-top: 0; border-top: 0; }
.filters h3 { font-size: 13px; color: var(--muted); font-weight: 600; margin-bottom: 6px; }
.facet, .facet ul { list-style: none; margin: 0; padding: 0; }
.facet ul { margin: 1px 0 4px 8px; padding-left: 6px; border-left: 1px solid var(--line); }
.facet-row { display: flex; align-items: center; }
summary.facet-row { list-style: none; cursor: pointer; border-radius: 6px; }
summary.facet-row::-webkit-details-marker { display: none; }
summary.facet-row:focus-visible { outline: 2px solid var(--brass); outline-offset: -2px; }
.caret, .caret-gap { flex: none; width: 18px; height: 28px; }
.caret { display: grid; place-items: center; color: var(--muted); }
.caret::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateX(-1px) rotate(-45deg); transition: transform .12s; }
details[open] > summary > .caret::before { transform: translateY(-1px) rotate(45deg); }
summary.facet-row:hover > .caret { color: var(--ink); }
.flat .caret-gap { display: none; }
.facet a { flex: 1; min-width: 0; display: flex; justify-content: space-between; gap: 8px; color: var(--ink); padding: 2px 6px; border-radius: 6px; font-weight: 600; font-size: 14px; line-height: 1.7; }
.flat a { font-weight: 400; }
.facet a span { min-width: 0; overflow-wrap: anywhere; }
.facet a b { flex: none; font-weight: 400; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.facet ul a { font-weight: 400; color: var(--muted); font-size: 13.5px; }
.facet a:hover { background: var(--sea-soft); color: var(--ink); text-decoration: none; }
.facet a.path { color: var(--sea); font-weight: 600; }
.facet a.on { background: var(--sea); color: var(--on-sea); font-weight: 600; }
.facet a.on b { color: inherit; }
.facet-head { display: flex; justify-content: space-between; align-items: baseline; }
.facet-head a { font-weight: 400; }
.check a { justify-content: flex-start; }
.check a span { flex: 1; }
.check a::before { content: ""; flex: none; box-sizing: border-box; align-self: center; display: grid; place-items: center; width: 15px; height: 15px; border: 1.5px solid var(--muted); border-radius: 4px; font-size: 12px; font-weight: 700; line-height: 1; color: var(--on-sea); }
.check a:hover::before { border-color: var(--sea); }
.check a.on::before { content: "\2713"; background: var(--sea); border-color: var(--sea); }
.check a.path::before { content: "\2212"; background: var(--sea-soft); border-color: var(--sea); color: var(--sea); }
.check a.on { background: transparent; color: var(--ink); }
.check a.on:hover { background: var(--sea-soft); }
.check a.on b { color: var(--muted); }
#jobs { scroll-margin-top: 84px; }
.results > .page:first-child { margin-top: 0; }
.bar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.grow { flex: 1; }
.sort { color: var(--muted); font-size: 14px; }
.sort.on { color: var(--ink); font-weight: 600; }
.chip { border: 1px solid var(--line); border-radius: 999px; padding: 1px 12px; font-size: 13px; color: var(--muted); display: inline-block; margin-right: 6px; }
.chip.on { background: var(--sea); border-color: var(--sea); color: var(--on-sea); }
.chips { margin-bottom: 12px; }
.job, .company { display: flex; gap: 14px; }
.logo { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; background: #fff; border: 1px solid var(--line); padding: 4px; flex: none; display: block; }
.logo.ph { display: grid; place-items: center; background: var(--sea-soft); color: var(--sea); font-weight: 700; font-size: 22px; }
.body { flex: 1; min-width: 0; }
.job h2, .company h2 { font-size: 17px; line-height: 1.35; font-weight: 600; }
.en { color: var(--muted); font-size: 14px; }
.co { margin-top: 2px; }
.meta { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 4px; }
.tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { background: var(--sea-soft); color: var(--sea); border-radius: 6px; padding: 0 8px; font-size: 13px; }
.side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 13px; white-space: nowrap; }
.due { color: var(--brass); font-weight: 600; }
.late { color: var(--bad); }
.count { font-size: 24px; font-weight: 700; color: var(--sea); line-height: 1.1; }
.empty { color: var(--muted); padding: 24px; text-align: center; }
.pager { display: flex; gap: 16px; justify-content: center; padding: 12px; }
.page { font-size: 20px; margin: 18px 0 10px; }
h1.page { font-size: 30px; line-height: 1.3; margin: 22px 0 14px; }
.crumbs { font-size: 14px; color: var(--muted); margin-top: 18px; }
.crumbs + h1.page { margin-top: 4px; }
.tag-intro { font-size: 14px; margin: -6px 0 6px; }
.sub-nav { display: flex; flex-wrap: wrap; gap: 8px; }
.sub-nav .chip { margin: 0; color: var(--ink); background: var(--card); padding: 3px 12px; }
.sub-nav .chip:hover { border-color: var(--sea); text-decoration: none; }
.sub-nav .chip b { color: var(--muted); font-weight: 400; margin-left: 2px; }
.co-group { margin: 18px 0 8px; scroll-margin-top: 84px; }
.co-group h3 { font-size: 16px; margin-bottom: 8px; }
.co-group h3 small { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.co-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.co-chip { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); min-width: 0; }
.co-chip:hover { border-color: var(--sea); text-decoration: none; }
.co-chip .logo { width: 34px; height: 34px; padding: 2px; border-radius: 6px; }
.co-chip .logo.ph { font-size: 15px; }
.co-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.co-chip b { flex: none; font-weight: 400; color: var(--muted); font-size: 13px; }
.page small { color: var(--muted); font-weight: 400; font-size: 15px; }
.head { display: flex; gap: 16px; align-items: center; }
.head .logo { width: 72px; height: 72px; }
.detail h1, .profile h1 { font-size: 23px; line-height: 1.3; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; margin: 16px 0 0; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; }
.md { margin-top: 16px; }
.md h3 { font-size: 16px; margin: 16px 0 6px; color: var(--sea); }
.md ul { margin: 0; padding-left: 20px; }
.intro { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.intro h3 { font-size: 16px; margin-bottom: 6px; }
.intro-full { margin-top: 14px; }
.intro-p { font-size: 14px; }
.tabs { margin-top: 16px; }
.tabs input { position: absolute; opacity: 0; }
.tabs label { display: inline-block; padding: 3px 14px; border: 1px solid var(--line); border-radius: 6px; cursor: pointer; margin-right: 6px; font-size: 14px; }
.tabs input:checked + label { background: var(--sea); border-color: var(--sea); color: var(--on-sea); }
.tabs input:focus-visible + label { outline: 2px solid var(--brass); }
.tab-en { display: none; }
#en:checked ~ .tab-en { display: block; }
#en:checked ~ .tab-zh { display: none; }
.admin { margin-top: 16px; font-size: 14px; padding-top: 10px; border-top: 1px dashed var(--line); }
.flag { background: var(--brass); color: var(--on-brass); font-size: 12px; border-radius: 5px; padding: 1px 6px; font-weight: 400; vertical-align: middle; }
.tree h2 { font-size: 16px; color: var(--muted); margin-bottom: 8px; }
.node { padding: 6px 0; border-top: 1px solid var(--line); }
.node .strong { font-weight: 600; }
.node b { font-weight: 400; color: var(--muted); font-size: 13px; }
.kids { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 14px; }
.kids small { color: var(--muted); }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row.child { padding-left: 20px; }
.tag-main { min-width: 0; }
.tag-desc { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 2px; }
.tag-count { white-space: nowrap; font-size: 14px; }
.row-item { display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form h1 { font-size: 20px; }
.form h2 { font-size: 17px; }
.form label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
input:not([type=checkbox]):not([type=radio]):not([type=search]):not([type=file]), textarea, .form select { width: 100%; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font: inherit; }
button { background: var(--sea); color: var(--on-sea); border: 0; border-radius: 6px; padding: 7px 18px; cursor: pointer; font: inherit; }
button.danger { background: var(--bad); }
.form > button { align-self: flex-start; }
.form + p { margin-top: 12px; }
.err { color: var(--bad); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 44px 16px; border-style: dashed; border-width: 2px; cursor: pointer; text-align: center; }
.drop.over { border-color: var(--sea); background: var(--sea-soft); }
.drop input { display: none; }
.uploads { list-style: none; padding: 0; margin: 0; }
.uploads li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; overflow-wrap: anywhere; }
.uploads b { font-weight: 500; white-space: nowrap; }
/* Home hero: photo, shade and title are separate layers. --p is scroll
   progress (0 to 1) set by home-hero.js; without script it stays 0 and nothing moves. */
.hero { --p: 0; position: relative; overflow: hidden; isolation: isolate; height: clamp(380px, 74vh, 780px); background: #04090e; }
.hero-bg, .hero-shade, .hero::after { position: absolute; inset: 0; }
.hero-bg { transform: translate3d(0, calc(var(--p) * 24%), 0) scale(calc(1 + var(--p) * .06)); will-change: transform; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 64%; display: block; animation: hero-photo 2.6s cubic-bezier(.2, .7, .2, 1) both; }
.hero-shade { background: radial-gradient(ellipse 58% 40% at 50% 44%, rgba(3, 8, 13, .55), transparent 72%), linear-gradient(180deg, rgba(3, 8, 13, .5), rgba(3, 8, 13, .08) 32%, rgba(3, 8, 13, .2) 68%, rgba(3, 8, 13, .72)); }
.hero::after { content: ""; background: #03080d; opacity: calc(var(--p) * .75); pointer-events: none; }
.hero-title { position: absolute; z-index: 1; left: 50%; top: 44%; width: min(1100px, 86vw); margin: 0; line-height: 0; opacity: calc(1 - var(--p) * 1.6); transform: translate3d(-50%, calc(-50% + var(--p) * 36vh), 0) scale(calc(1 - var(--p) * .1)); filter: drop-shadow(0 2px 16px rgba(0, 0, 0, .5)); will-change: transform, opacity; }
.hero-title svg { width: 100%; height: auto; display: block; }
@keyframes hero-photo { from { transform: scale(1.12); filter: brightness(.3) saturate(.6); } to { transform: none; filter: none; } }
@media (prefers-reduced-motion: reduce) {
  .hero-bg img { animation: none; }
}
.home { max-width: 900px; margin: -48px auto 0; position: relative; }
.hero-search { display: flex; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: 0 8px 28px rgba(5, 15, 22, .35); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 17px; padding: 8px 10px; outline: none; }
.hero-search:focus-within { border-color: var(--sea); }
.hero-search button { padding: 8px 26px; background: var(--brass); color: var(--on-brass); font-size: 16px; }
.stats { display: flex; justify-content: center; gap: clamp(28px, 9vw, 96px); margin: 26px 0 22px; text-align: center; }
.stats dd { margin: 0; font-size: 34px; font-weight: 700; color: var(--sea); line-height: 1.15; }
.stats dt { font-size: 14px; }
.browse { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; }
.browse h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.browse .chips { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.browse .chip { margin: 0; color: var(--ink); background: var(--card); padding: 3px 12px; }
.browse .chip:hover { border-color: var(--sea); text-decoration: none; }
.browse .chip b { color: var(--muted); font-weight: 400; margin-left: 2px; }
.more { text-align: center; padding: 8px; }
[data-field] { cursor: text; border-radius: 4px; }
[data-field]:hover { outline: 1px dashed var(--brass); outline-offset: 2px; }
.ed-empty { color: var(--muted); font-size: 13px; font-weight: 400; }
.ed-box { display: block; font-size: 15px; font-weight: 400; line-height: 1.5; margin: 6px 0; padding: 10px; background: var(--bg); border: 1px solid var(--sea); border-radius: 8px; color: var(--ink); }
.ed-box input:not([type=checkbox]), .ed-box select, .ed-box textarea { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--ink); font: inherit; }
.ed-box textarea { resize: vertical; font-size: 14px; }
.ed-tags { columns: 12em; column-gap: 28px; max-height: 360px; overflow: auto; }
.ed-tag-group { break-inside: avoid; padding-bottom: 8px; }
.ed-tags label { display: flex; gap: 8px; align-items: center; color: var(--ink); line-height: 1.7; cursor: pointer; }
.ed-tag-top { font-weight: 600; }
.ed-tag-sub { padding-left: 23px; font-size: 14px; }
.ed-box input[type=checkbox] { accent-color: var(--sea); width: 15px; height: 15px; margin: 0; flex: none; }
.ed-tag-new { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); font-size: 14px; }
.ed-box .ed-tag-new input { flex: 1 1 9em; width: auto; }
.ed-box .ed-tag-new select { flex: 0 1 auto; width: auto; }
.ed-tag-new button { padding: 5px 12px; font-size: 14px; background: transparent; color: var(--sea); border: 1px solid var(--sea); white-space: nowrap; }
.row:has(.ed-box) { flex-wrap: wrap; }
.row:has(.ed-box) > :first-child { flex: 1 1 100%; }
.ed-note { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.ed-err { font-size: 13px; color: var(--bad); margin: 6px 0 0; }
.ed-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.ed-actions button { padding: 4px 14px; font-size: 14px; white-space: nowrap; }
.facts > div:has(.ed-box) { grid-column: 1 / -1; }
.ed-actions .ed-cancel { background: transparent; color: var(--muted); border: 1px solid var(--line); }
.ed-actions small { color: var(--muted); font-size: 12px; }
.ed-tip { color: var(--muted); }
@media (max-width: 760px) {
  #jobs { scroll-margin-top: 124px; }
  .home { margin-top: -22px; }
  .hero { height: clamp(300px, 58vh, 520px); }
  .hero-title { top: 42%; width: 88vw; }
  .hero-search { padding: 6px; }
  .hero-search input { font-size: 15px; }
  .hero-search button { padding: 8px 16px; font-size: 15px; }
  .browse { grid-template-columns: minmax(0, 1fr); }
  .split { grid-template-columns: minmax(0, 1fr); }
  .filters { position: static; max-height: none; }
  .filters > summary { display: list-item; cursor: pointer; font-weight: 600; }
  .filters:not([open]) { padding-bottom: 12px; }
  .job, .company { flex-wrap: wrap; }
  .side { flex-direction: row; width: 100%; justify-content: space-between; }
  .top nav { width: 100%; }
}
