:root {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: #263631;
  background: #f5f8f7;
  --green: #176b60;
  --deep: #104c45;
  --muted: #63746c;
  --line: #dce5e0;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
a { color: inherit; text-decoration: none; }
button, select, input { font: inherit; }
button, select, a, input[type=checkbox] { cursor: pointer; }
button { color: inherit; }
button:disabled, input:disabled { cursor: default; }
:focus-visible { outline: 3px solid #309f90; outline-offset: 3px; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 5; background: white; padding: 10px; }
.skip:focus { top: 8px; }
.masthead { background: white; border-bottom: 1px solid var(--line); }
.mast-inner, .shell { width: min(1440px, 100%); margin: 0 auto; }
.mast-inner { display: flex; align-items: center; min-height: 68px; gap: 18px; padding: 0 clamp(20px, 3.4vw, 56px); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 22px; }
.brand-separator { height: 22px; width: 1px; background: var(--line); }
.workspace-name { font-size: 15px; font-weight: 600; color: var(--deep); }
.return-link { margin-left: auto; padding: 10px 0; font-size: 14px; color: var(--muted); }
.return-link:hover, .crm-link:hover { color: var(--green); text-decoration: underline; }
.shell { display: grid; grid-template-columns: 194px minmax(0, 1fr); align-items: start; gap: clamp(24px, 3.4vw, 56px); padding: 38px clamp(20px, 3.4vw, 56px) 60px; }
.rail { padding: 7px 0 0; }
.rail nav { display: grid; gap: 6px; }
.rail nav a { display: flex; align-items: center; gap: 12px; min-height: 45px; padding: 8px 13px; border-radius: 8px; font-size: 15px; color: #526058; }
.rail nav a[aria-current=page] { background: #dceee7; color: var(--deep); font-weight: 670; }
.rail nav a:hover { background: #e8f0ec; }
.nav-count { font-size: 12px; color: #536f61; margin-left: auto; font-variant-numeric: tabular-nums; }
.crm-link { display: flex; align-items: center; justify-content: space-between; margin: 23px 9px 0; padding: 22px 3px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
main { min-width: 0; }
.page-heading { display: flex; justify-content: space-between; align-items: start; gap: 12px; margin: 0 0 24px; }
h1, h2, p { margin: 0; }
h1 { font-size: clamp(26px, 3vw, 36px); line-height: 1.25; letter-spacing: -.045em; color: #172f27; }
.page-heading p { margin-top: 10px; color: var(--muted); line-height: 1.65; font-size: 15px; }
.source-pill { display: inline-flex; align-items: center; gap: 7px; background: #e8f0ea; border: 1px solid #d1e2d9; border-radius: 32px; padding: 6px 11px; font-size: 12px; color: var(--deep); flex-shrink: 0; }
.source-pill i { width: 6px; height: 6px; border-radius: 50%; background: #33856b; }
.filter-panel, .results { border: 1px solid var(--line); border-radius: 14px; background: white; box-shadow: 0 4px 18px #17372604; }
.filter-panel { display: grid; align-items: end; grid-template-columns: minmax(170px,1.8fr) repeat(2,minmax(110px,1fr)) auto; gap: 14px; padding: 22px; background: linear-gradient(105deg,#f0f7f3,#fff 80%); }
.filter-panel label { display: grid; gap: 8px; font-size: 14px; color: #43564c; font-weight: 600; min-width: 0; }
.filter-panel select, .input-wrap { background: #fff; border: 1px solid #cad8cf; border-radius: 7px; width: 100%; min-height: 40px; color: #2d3d33; }
.filter-panel select { padding: 0 9px; }
.input-wrap { display: flex; gap: 8px; align-items: center; padding-left: 12px; }
.input-wrap:focus-within { outline: 2px solid #309f90; }
.input-wrap svg { color: #819088; flex-shrink: 0; }
.input-wrap input { min-width: 0; flex: 1; border: 0; outline: 0; border-radius: 7px; padding: 10px 5px 10px 0; font-size: 14px; background: transparent; color: inherit; font-weight: 400; }
input::placeholder { color: #7c8982; }
.filter-actions, .dialog-actions, .pager div { display: flex; align-items: center; gap: 7px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 7px; min-height: 40px; padding: 7px 15px; white-space: nowrap; font-size: 14px; font-weight: 600; }
.primary { color: #fff; background: var(--green); }
.primary:hover:not(:disabled) { background: #0e5148; }
.primary:disabled { background: #e9efeb; color: #6a796e; }
.plain { background: transparent; color: var(--green); padding: 7px 8px; }
.plain:hover, .text-btn:hover { text-decoration: underline; }
.secondary { color: var(--green); border-color: #cdded4; background: #f0f7f3; }
.results { margin-top: 20px; overflow: hidden; }
.results-head, .pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.results-head h2, dialog h2 { font-size: 19px; }
.results-head h2 span { color: var(--muted); font-size: 15px; margin-left: 5px; font-weight: 500; }
.table-scroll { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 14px; line-height: 1.45; }
th { font-size: 13px; color: #65766b; font-weight: 500; background: #f4f7f4; }
th, td { padding: 11px 12px; border-bottom: 1px solid #e6ece7; white-space: nowrap; }
th:first-child, td:first-child { width: 42px; padding-left: 22px; padding-right: 3px; }
td small { display: block; color: #69786e; font-size: 12px; margin-top: 3px; }
tbody tr:hover { background: #fafcfb; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); vertical-align: middle; margin: 0; }
.company-link, .text-btn { padding: 4px 0; background: none; border: 0; text-align: left; font-size: 14px; }
.company-link { color: #1a4433; font-weight: 650; }
.company-link:hover { text-decoration: underline; }
.text-btn { color: var(--green); }
.status { display: inline-block; font-size: 12px; color: #55645b; background: #f0f3f0; padding: 3px 8px; border-radius: 5px; }
.status.done { color: #206444; background: #e1f3e6; }
.empty { padding: 46px 20px; text-align: center; border-top: 1px solid var(--line); }
.empty p, .scope-note, .notice { font-size: 13px; margin: 9px 0 0; color: var(--muted); line-height: 1.7; }
.notice { color: #9c492c; }
.scope-note { margin: 16px 3px; }
.pager { color: var(--muted); font-size: 13px; flex-wrap: wrap; padding-top: 13px; padding-bottom: 13px; }
.btn.small { min-height: 32px; min-width: 32px; background: white; border-color: var(--line); padding: 4px 10px; font-size: 19px; line-height: 1; }
.btn.small:disabled { color: #b0b9b2; background: #f6f8f6; }
dialog { width: min(480px, calc(100% - 32px)); border: 1px solid var(--line); border-radius: 16px; padding: 0; background: white; color: inherit; }
dialog::backdrop { background: #162d276b; }
.dialog-heading, .dialog-body, .dialog-actions { padding: 18px 23px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.close { background: #f1f5f2; border: none; border-radius: 7px; display: grid; place-items: center; height: 36px; width: 36px; }
.detail-description { line-height: 1.7; }
.dialog-body dl { display: grid; gap: 9px 19px; grid-template-columns: max-content 1fr; font-size: 14px; }
.dialog-body dt { color: var(--muted); }
.dialog-body dd { margin: 0; }
.dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
#feedback { position: fixed; z-index: 3; bottom: 22px; left: 50%; transform: translate(-50%,12px); opacity: 0; pointer-events: none; background: #15392e; color: white; font-size: 14px; padding: 12px 18px; max-width: calc(100vw - 26px); border-radius: 8px; transition: .16s; }
#feedback.visible { transform: translate(-50%,0); opacity: 1; }
@media(max-width:1120px) {
  .shell { grid-template-columns: 160px minmax(0,1fr); gap: 22px; }
  .filter-panel { grid-template-columns: 1.35fr 1fr 1fr; }
  .filter-actions { grid-column: 1/-1; }
}
@media(max-width:760px) {
  .shell { display: block; padding: 16px 16px 38px; }
  .mast-inner { min-height: 56px; padding: 0 16px; gap: 10px; }
  .brand { font-size: 18px; gap: 6px; }
  .brand img { width: 24px; height: 24px; }
  .workspace-name, .return-link { font-size: 13px; }
  .rail { padding: 0 0 21px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
  .rail nav { display: flex; gap: 4px; flex-wrap: wrap; }
  .rail nav a { min-height: 36px; padding: 7px 9px; font-size: 13px; gap: 5px; }
  .rail nav svg { display: none; }
  .crm-link { margin: 0; padding: 0; border: 0; font-size: 13px; min-height: 28px; }
  .page-heading { margin-bottom: 16px; flex-wrap: wrap; }
  .filter-panel { padding: 16px; gap: 12px; }
  .results { margin-top: 14px; }
}
@media(max-width:540px) {
  .filter-panel { grid-template-columns: 1fr 1fr; }
  .keyword { grid-column: 1/-1; }
  .filter-panel input, .filter-panel select { font-size: 16px; }
  .page-heading { gap: 8px; }
  .page-heading p { font-size: 14px; margin-top: 6px; }
  .source-pill { font-size: 11px; padding: 3px 8px; }
  .results-head, .pager { padding: 13px; }
  .results-head h2 { font-size: 17px; }
  th, td { padding: 10px; }
  th:first-child, td:first-child { padding-left: 13px; }
  #feedback { width: max-content; }
}
@media(prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
.region-panel, .relation-panel {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: white;
}
.region-panel { display: grid; grid-template-columns: 1.4fr 1fr; }
.region-map {
  position: relative; min-height: 246px; overflow: hidden;
  background-color: #e8f2eb;
  background-image: radial-gradient(#b6ccc0 1px, transparent 1px), linear-gradient(138deg, transparent 69%, #cce7e9 69.3%);
  background-size: 14px 14px, 100% 100%;
}
.map-pin {
  position: absolute; transform: translate(-50%, -50%);
  z-index: 1; background: #fff; color: #235d50; display: flex; gap: 6px; align-items: center;
  border: 1px solid #adc6b9; padding: 6px 10px; border-radius: 8px; font-size: 14px;
}
.map-pin b { font-size: 12px; }
.map-pin[aria-pressed=true], .map-pin:hover { background: var(--green); color: white; }
.map-caption { position: absolute; bottom: 6px; right: 8px; font-size: 11px; color: #526b60; }
.region-info, .relation-panel { padding: 23px; }
.region-info h2 { font-size: 23px; }
.region-info p, .relation-hint { font-size: 14px; color: var(--muted); line-height: 1.6; }
.region-info p { margin-top: 8px; }
.city-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 16px 0; }
.city-tags span { background: #edf4ef; color: #466356; padding: 3px 8px; border-radius: 5px; font-size: 12px; }
.origin-picker { display: flex; align-items: center; gap: 15px; font-size: 14px; font-weight: 600; }
.origin-picker select { border: 1px solid #cad8cf; height: 40px; border-radius: 6px; padding: 0 9px; background: white; color: inherit; }
.relation-path { margin: 19px 0 12px; border-radius: 10px; background: #f0f6f2; padding: 16px; display: flex; gap: 19px; align-items: center; }
.origin-chip { font-size: 15px; display: inline-flex; align-items: center; gap: 7px; color: #205e48; flex-shrink: 0; }
.relation-partners { display: flex; flex-wrap: wrap; gap: 8px; border-left: 1px solid #a6c3b3; padding-left: 20px; }
.relation-node { display: grid; grid-template-columns: auto auto; text-align: left; padding: 9px 11px; border: 1px solid #cbded1; background: white; border-radius: 7px; gap: 3px 8px; }
.relation-node small { grid-column: 1/-1; color: var(--muted); font-size: 12px; }
.relation-node strong { font-size: 14px; }
.relation-node:hover { border-color: var(--green); }
.personal-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 13px; }
.tab { border: 1px solid #d7e1d9; background: white; font-size: 14px; padding: 7px 12px; border-radius: 7px; }
.tab b { font-size: 12px; }
.tab[aria-pressed=true] { color: var(--deep); background: #e4f0e8; border-color: #a4bdac; }
@media(max-width:760px) {
  .region-panel { grid-template-columns: 1fr; }
  .region-map { min-height: 210px; }
  .region-info, .relation-panel { padding: 16px; }
  .region-info h2 { font-size: 19px; }
  .relation-path { display: block; padding: 13px; }
  .relation-partners { margin-top: 11px; padding-left: 10px; }
  .origin-picker select { font-size: 16px; max-width: 70%; }
}
.result-actions, .pills { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.discovery-tools { display: grid; grid-template-columns: 1fr; gap: 12px; margin: 15px 3px 0; }
.discovery-tools > div { display: flex; align-items: start; gap: 14px; }
.discovery-tools strong { padding-top: 6px; color: #465c50; font-size: 13px; white-space: nowrap; }
.pill, .bookmark, .bookmark-add { border: 1px solid var(--line); background: white; color: #345342; border-radius: 6px; font-size: 13px; }
.pill, .bookmark-add { padding: 5px 10px; }
.pill[aria-pressed=true] { background: #dcefe3; color: var(--deep); border-color: #aac9b6; }
.bookmark { display: inline-flex; max-width: 20em; }
.bookmark button { border: 0; background: transparent; color: inherit; padding: 5px; }
.bookmark button:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bookmark-add { border-style: dashed; }
.hint { font-size: 12px; color: var(--muted); }
@media(max-width:760px) {
  .rail nav { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 5px; border-bottom: 1px solid var(--line); }
  .rail nav a { flex-shrink: 0; }
  .rail { gap: 4px; padding-bottom: 14px; }
  .rail .crm-link { margin-left: auto; }
}
@media(max-width:540px) {
  .results-head { flex-wrap: wrap; }
  .result-actions .btn { min-height: 36px; padding: 5px 9px; font-size: 13px; }
  .discovery-tools > div { gap: 9px; }
}
.mobile-nav { display: none; }
@media(max-width:760px) {
  .rail nav { display: none; }
  .mobile-nav { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; }
  .mobile-nav select { color: var(--deep); border: 1px solid #c1d5c8; border-radius: 6px; background: #fff; padding: 6px; font-size: 16px; max-width: 160px; }
  .rail .crm-link { min-height: 36px; }
}
