:root{
  --ui-bg:#f3f1ec;
  --ui-surface:#fcfbf8;
  --ui-surface-muted:#f7f5f0;
  --ui-text:#243042;
  --ui-muted:#657080;
  --ui-border:#ded9d0;
  --ui-primary:#5267b8;
  --ui-primary-hover:#4057a5;
  --ui-primary-soft:#e8ebf7;
  --ui-success:#197b69;
  --ui-success-soft:#e5f1ec;
  --ui-danger:#b6504b;
  --ui-radius:10px;
  --ui-shadow:0 10px 28px rgba(15,23,42,.06);
}

body{
  background:radial-gradient(circle at 18% 0,#e7e5ee 0,transparent 32rem),var(--ui-bg);
  color:var(--ui-text);
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI","Microsoft YaHei",sans-serif;
}

.top-bar,.mast{
  background:rgba(252,251,248,.9);
  color:var(--ui-text);
  border-bottom:1px solid var(--ui-border);
  box-shadow:none;
  padding:14px clamp(16px,3vw,32px);
  backdrop-filter:blur(14px);
}

.top-bar h1,.brand h1{
  color:var(--ui-text);
  font-family:inherit;
  font-size:18px;
  font-weight:700;
  letter-spacing:-.2px;
}
.top-bar h1{display:inline-flex;align-items:center;gap:8px}
.top-bar h1 svg{width:18px;height:18px;color:var(--ui-primary);stroke-width:2.2}

.top-bar h1 span{
  background:var(--ui-primary-soft)!important;
  color:var(--ui-primary)!important;
  border:1px solid #d6daed;
}

.header-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.header-actions .btn{margin-left:0}
.gh-link{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:8px;color:var(--ui-text)}
.gh-link:hover{background:var(--ui-primary-soft)}
.gh-link svg{width:18px;height:18px;fill:#24292f;transition:fill .15s}
.gh-link:hover svg{fill:var(--ui-primary)}
.icon-only{width:36px;padding:0!important}
.compact-btn{margin-left:0!important;padding:7px 10px!important}
.search-field{position:relative;display:flex;align-items:center}
.search-field>svg{position:absolute;left:11px;width:16px;height:16px;color:var(--ui-muted);pointer-events:none}
.search-field .s-input{padding-left:34px}
.search-field .s-select{min-height:36px;border:1px solid var(--ui-border);border-right:none;border-radius:8px 0 0 8px;background:var(--ui-surface-muted);color:var(--ui-text);padding:0 2px 0 32px;font-size:13px;cursor:pointer;font-weight:650}
.search-field .s-select:focus{outline:none;border-color:var(--ui-primary);box-shadow:0 0 0 3px rgba(49,86,200,.14);position:relative;z-index:1}
.search-field .s-select+.s-input{border-radius:0 8px 8px 0;padding-left:12px}
.quick-guide{margin:12px clamp(16px,3vw,32px) 0;border:1px solid var(--ui-border);border-radius:var(--ui-radius);background:var(--ui-surface);box-shadow:var(--ui-shadow)}
.quick-guide summary{display:flex;align-items:center;gap:8px;padding:11px 14px;color:var(--ui-text);font-size:13px;font-weight:650;cursor:pointer;list-style:none}
.quick-guide summary::-webkit-details-marker{display:none}.quick-guide summary>svg{width:16px;height:16px;color:var(--ui-primary)}
.quick-guide .guide-summary{margin-left:4px;color:var(--ui-muted);font-weight:400}.quick-guide .guide-chevron{margin-left:auto;transition:transform .16s}.quick-guide[open] .guide-chevron{transform:rotate(180deg)}
.guide-content{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0 14px 14px}.guide-content>div{min-height:94px;padding:12px;border:1px solid var(--ui-border);border-radius:8px;background:var(--ui-surface-muted)}
.guide-step{display:block;margin-bottom:7px;color:var(--ui-primary);font-size:11px;font-weight:750;letter-spacing:.08em}.guide-content strong{font-size:13px}.guide-content p{margin-top:4px;color:var(--ui-muted);font-size:12px;line-height:1.55}
#crawlProgress{display:flex!important;align-items:center;gap:8px}#crawlProgress[style*="display:none"]{display:none!important}#crawlProgress svg{width:17px;height:17px;animation:spin .9s linear infinite}
#empty .icon{display:flex;align-items:center;justify-content:center;width:68px;height:68px;margin:0 auto 14px;border-radius:50%;background:var(--ui-primary-soft);color:var(--ui-primary)}#empty .icon svg{width:31px;height:31px}
.modal-box h2{display:flex;align-items:center;gap:8px}.modal-box h2>svg{width:20px;height:20px;color:var(--ui-primary)}.close-x{display:flex;align-items:center;justify-content:center;width:32px;height:32px;padding:0}.close-x svg{width:18px;height:18px}
.settings-box{max-width:520px}.settings-heading{display:flex;align-items:flex-start;gap:12px;margin-bottom:22px}.settings-heading h2{margin:0}.settings-heading p{margin-top:5px;color:var(--ui-muted);font-size:13px;line-height:1.55}.settings-icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:38px;height:38px;border-radius:10px;background:var(--ui-primary-soft);color:var(--ui-primary)}.settings-icon svg{width:19px;height:19px}
.setting-group{display:block;margin-top:16px}.setting-group>span{display:flex;align-items:center;gap:7px;margin-bottom:7px;color:var(--ui-text);font-size:13px;font-weight:650}.setting-group em{font-style:normal;color:var(--ui-muted);font-size:11px;font-weight:500}.setting-group .key-input{width:100%}.setting-group small{display:block;margin-top:6px;color:var(--ui-muted);font-size:12px;line-height:1.5}.settings-footer{display:flex;justify-content:flex-end;margin-top:24px}.settings-footer .btn{margin-left:0}

.top-nav,.nav{gap:4px;margin-left:16px}
.top-nav a,.nav a{
  color:var(--ui-muted);
  border-radius:7px;
  font-weight:600;
}
.top-nav a.active,.top-nav a:hover,.nav a.active,.nav a:hover{
  background:var(--ui-primary-soft);
  color:var(--ui-primary);
}
.privacy{color:var(--ui-muted)}

.toolbar{
  background:var(--ui-surface);
  border-bottom:1px solid var(--ui-border);
  padding:14px clamp(16px,3vw,32px);
  gap:8px;
}

.s-input,.key-input,.select,.mode{
  min-height:36px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  background:var(--ui-surface-muted);
  color:var(--ui-text);
  box-shadow:none;
}
.s-input:focus,.key-input:focus,.select:focus,.mode:focus{
  border-color:var(--ui-primary);
  box-shadow:0 0 0 3px rgba(49,86,200,.14);
}
.stats{color:var(--ui-muted)}

.btn,.import-label{
  min-height:36px;
  border:1px solid var(--ui-border);
  border-radius:8px;
  background:var(--ui-surface);
  color:var(--ui-text);
  box-shadow:none;
  font-weight:600;
  transition:background .16s,border-color .16s,color .16s,transform .16s;
}
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.btn svg{width:15px;height:15px;stroke-width:2.2}
.btn:hover,.import-label:hover{
  background:var(--ui-surface-muted);
  border-color:#c9c2b8;
  transform:translateY(-1px);
}
.btn:focus-visible,.import-label:focus-within,.link-btn:focus-visible,.manage-btn:focus-visible,.row-delete:focus-visible,.del-btn:focus-visible,.copy-btn:focus-visible,.close-x:focus-visible{
  outline:3px solid rgba(49,86,200,.22);
  outline-offset:2px;
}
.btn-g,.btn.primary{
  background:var(--ui-primary)!important;
  border-color:var(--ui-primary)!important;
  color:#fff!important;
}
.btn-g:hover,.btn.primary:hover{background:var(--ui-primary-hover)!important;border-color:var(--ui-primary-hover)!important}
.btn-p,.btn-o,.btn-d{background:var(--ui-surface)!important;color:var(--ui-text)!important;border:1px solid var(--ui-border)!important}
.btn-p:hover,.btn-o:hover,.btn-d:hover{background:var(--ui-surface-muted)!important;color:var(--ui-primary)!important;border-color:#c9c2b8!important}

.hint{
  max-width:calc(100% - 48px);
  margin:12px 24px 0;
  padding:10px 14px;
  color:var(--ui-muted);
  background:transparent;
  border-left:3px solid #c9c2b8;
  line-height:1.65;
}
#crawlProgress{margin:12px 24px!important;background:var(--ui-primary-soft)!important;border:1px solid #d6daed;border-radius:var(--ui-radius)!important;color:var(--ui-primary)!important;box-shadow:none!important}

table,.table-wrap,#empty,#pagination,.table-shell{
  border:1px solid var(--ui-border);
  border-radius:var(--ui-radius);
  box-shadow:var(--ui-shadow);
}
table{background:var(--ui-surface);box-shadow:none}
.table-wrap{background:var(--ui-surface)}
thead th,.tabulator .tabulator-header,.tabulator .tabulator-header .tabulator-col{
  background:var(--ui-surface-muted)!important;
  color:var(--ui-muted);
  border-color:var(--ui-border)!important;
  font-weight:600;
}
tbody tr,.tabulator-row{border-color:#edf0f4!important}
tbody tr:hover,.tabulator-row:hover{background:#f1f0f5!important}
tbody td{color:#3d4755}
.tabulator,.tabulator .tabulator-tableholder,.tabulator-row.tabulator-row-even{background:var(--ui-surface)!important}
.tabulator .tabulator-cell{color:#3d4755!important;border-color:#ebe6dd!important}
.cname{color:var(--ui-text)}

.tag{font-weight:600}
.tag-g{background:#e8ecf8;color:#5267b8}.tag-y{background:#fbf1df;color:#9a6814}.tag-t{background:var(--ui-success-soft);color:var(--ui-success)}.tag-a{background:#f9e9ed;color:#af4860}.tag-b{background:#eeeaf8;color:#7055a9}.tag-s{background:#eeeef0;color:#596270}
.link-btn,.manage-btn{
  border-color:#d6daed;
  background:var(--ui-primary-soft);
  color:var(--ui-primary);
  border-radius:7px;
}
.link-btn:hover,.manage-btn:hover{background:var(--ui-primary);border-color:var(--ui-primary);color:#fff}
.manage-btn.added{background:var(--ui-success-soft);border-color:#beded4;color:var(--ui-success)}
.manage-actions{display:flex;align-items:center;gap:6px;white-space:nowrap}
.exclude-btn{border:0;background:transparent;color:var(--ui-muted);padding:5px 4px;font:inherit;font-size:12px;cursor:pointer}
.exclude-btn:hover{color:var(--ui-danger);text-decoration:underline}
.exclude-btn.added,.exclude-btn:disabled{color:var(--ui-muted);cursor:default;text-decoration:none;opacity:.72}
.exclude-btn:focus-visible{outline:3px solid rgba(82,103,184,.22);outline-offset:2px;border-radius:4px}
.cell-expand{display:flex;align-items:flex-start;gap:6px;width:100%;max-width:340px;padding:2px 0;border:0;background:transparent;color:#3d4755;font:inherit;line-height:1.45;text-align:left;cursor:pointer}
.industry-expand{max-width:220px;color:#596270}
.cell-expand-text{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cell-expand[aria-expanded="true"] .cell-expand-text{overflow:visible;white-space:normal}
.cell-expand svg{flex:0 0 auto;width:14px;height:14px;margin-top:3px;color:var(--ui-muted);transition:transform .16s}
.cell-expand[aria-expanded="true"] svg{transform:rotate(180deg)}
.cell-expand:hover .cell-expand-text{text-decoration:underline;text-decoration-color:#c9c2b8;text-underline-offset:3px}
.cell-expand:focus-visible{outline:3px solid rgba(82,103,184,.22);outline-offset:3px;border-radius:4px}
.status-pill{background:var(--ui-success-soft);color:var(--ui-success)}
.del-btn:hover,.row-delete:hover{color:var(--ui-danger)}

#empty,#pagination{background:var(--ui-surface);color:var(--ui-muted);box-shadow:var(--ui-shadow)}
#empty h3,.modal-box h2{color:var(--ui-text)}
.toast{background:#243042;border:1px solid #243042;border-radius:8px;box-shadow:var(--ui-shadow)}
.spinner{border-color:#ded9d0;border-top-color:var(--ui-primary)}
.pfill{background:var(--ui-primary)}
.modal{background:rgba(15,23,42,.42)}
.modal-box{background:var(--ui-surface);border:1px solid var(--ui-border);border-radius:14px;box-shadow:0 20px 48px rgba(36,48,66,.18)}
.tier-card{border-color:var(--ui-border);background:var(--ui-surface-muted)}
.tier-card.pri{border-color:#d6daed;background:var(--ui-primary-soft)}
.tier-card.b2,.tier-card.b3{border-color:var(--ui-border);background:var(--ui-surface-muted)}
.cmd{background:#172033;border-radius:8px}
.copy-btn{background:#334155;border-radius:6px}

.page{max-width:1680px;padding:28px clamp(16px,3vw,32px) 44px}
.hero{margin-bottom:22px}.hero h2{font-family:inherit;font-size:28px;letter-spacing:-.5px}.hero p,.empty-note{color:var(--ui-muted)}
.summary{gap:12px;margin-bottom:18px}.metric{background:var(--ui-surface);border-color:var(--ui-border);border-radius:var(--ui-radius);box-shadow:none}.metric:before{background:var(--ui-primary)}.metric .n{font-family:inherit;color:var(--ui-text)}
.table-shell{padding:12px;background:var(--ui-surface)}

@media (max-width:980px){
  .top-bar{position:static;align-items:flex-start;gap:12px;flex-wrap:wrap}
  .top-bar>div:last-child{display:flex;gap:8px;flex-wrap:wrap}
  .top-bar .btn{margin-left:0}
  .toolbar{padding:12px 16px}
  .stats{width:100%;margin-left:0}
  .guide-content{grid-template-columns:1fr}
}
@media (max-width:640px){
  .top-bar>div:first-child{flex-wrap:wrap}.top-nav,.nav{width:100%;margin-left:0}
  .s-input,.key-input{width:100%}
  .search-field{width:100%}
  .search-field .s-select{max-width:96px;flex-shrink:0}
  .hint{max-width:none;margin:10px 16px 0}
  .table-wrap,table,#empty,#pagination{margin-left:16px;margin-right:16px}
  #crawlProgress{margin:10px 16px!important}
  .hero h2{font-size:24px}
  .actions .btn,.actions .import-label,.actions .mode{width:100%;text-align:center}
}
