:root{
  --surface:rgba(255,255,255,.66);
  --surface-strong:rgba(255,255,255,.90);
  --surface-muted:rgba(247,247,248,.70);
  --text:#1d1d1f;
  --muted:#6e6e73;
  --subtle:#8e8e93;
  --line:rgba(29,29,31,.075);
  --line-strong:rgba(29,29,31,.12);
  --accent:#0878df;
  --accent-hover:#006ed1;
  --accent-soft:rgba(0,113,227,.07);
  --danger:#b42318;
  --radius-card:18px;
  --radius-control:10px;
  --shadow:0 12px 32px rgba(45,45,48,.045);
  --shadow-soft:0 5px 16px rgba(45,45,48,.045);
}

*{box-sizing:border-box}
html,body{min-height:100%;background:transparent}
body{
  margin:0;
  min-height:100vh;
  padding:10px 11px 12px;
  color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"SF Pro Display","SF Pro Text","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
  background:transparent;
}
button,input,textarea{font:inherit}
button{user-select:none}
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
.fileChooseButton:focus-visible{
  outline:3px solid rgba(0,113,227,.15);
  outline-offset:2px;
}

main{
  width:100%;
  min-height:calc(100vh - 22px);
  display:grid;
  grid-template-columns:218px minmax(0,1fr);
  gap:10px;
  align-items:start;
}

.card{
  overflow:hidden;
  border:1px solid rgba(255,255,255,.72);
  border-radius:var(--radius-card);
  background:var(--surface);
  box-shadow:var(--shadow),inset 0 1px 0 rgba(255,255,255,.92);
  backdrop-filter:blur(20px) saturate(1.02);
  -webkit-backdrop-filter:blur(20px) saturate(1.02);
}

.import-card{
  position:sticky;
  top:10px;
  align-self:start;
}
.cardBody{padding:10px}
.importBody{padding:7px}

.dropZone{
  position:relative;
  padding:12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.54);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92);
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease,transform .18s ease;
}
.dropZone.dragging{
  border-color:rgba(0,113,227,.30);
  background:rgba(248,251,255,.92);
  box-shadow:0 0 0 3px rgba(0,113,227,.055),inset 0 1px 0 #fff;
  transform:translateY(-1px);
}

.dropLead{
  display:flex;
  align-items:center;
  gap:9px;
  margin-bottom:12px;
}
.dropIcon{
  flex:0 0 32px;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
  border-radius:10px;
  background:var(--accent-soft);
  color:var(--accent);
  font-size:14px;
  font-weight:650;
}
.dropCopy{min-width:0}
.dropTitle{
  margin:0 0 1px;
  color:var(--text);
  font-size:12px;
  font-weight:650;
  letter-spacing:-.01em;
}
.hint{
  color:var(--muted);
  font-size:10px;
  line-height:1.45;
}

.fileInput{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.fileChooseButton,
button,
.buttonLink{
  min-height:34px;
  border:1px solid transparent;
  border-radius:var(--radius-control);
  padding:6px 10px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  cursor:pointer;
  text-decoration:none;
  font-size:10.5px;
  font-weight:610;
  letter-spacing:-.005em;
  transition:background .16s ease,border-color .16s ease,color .16s ease,box-shadow .16s ease,transform .16s ease;
}

.fileChooseButton{
  width:100%;
  color:#343437;
  border-color:var(--line-strong);
  background:rgba(255,255,255,.86);
  box-shadow:0 1px 2px rgba(0,0,0,.02);
}
.fileChooseButton:hover{
  background:#fff;
  border-color:rgba(29,29,31,.16);
  box-shadow:var(--shadow-soft);
  transform:translateY(-1px);
}
.fileChooseButton:active{transform:translateY(0)}

button{
  color:#3a3a3c;
  background:rgba(255,255,255,.68);
}
button:hover,.buttonLink:hover{
  transform:translateY(-1px);
  box-shadow:0 5px 14px rgba(45,45,48,.045);
}
button:active,.buttonLink:active{transform:translateY(0)}
button:disabled{opacity:.45;cursor:not-allowed;transform:none;box-shadow:none}

.primary{
  color:#fff;
  border-color:rgba(0,113,227,.12);
  background:var(--accent);
}
.primary:hover{background:var(--accent-hover)}
.secondary{
  color:#66666b;
  border-color:var(--line);
  background:rgba(247,247,248,.58);
}
.secondary:hover{
  color:#303033;
  border-color:var(--line-strong);
  background:rgba(255,255,255,.88);
}
.green{color:#fff;background:var(--accent);border-color:rgba(0,113,227,.12)}
.yellow{color:#6b4d16;background:#f5e6bf}
.danger{color:var(--danger);background:rgba(180,35,24,.06)}
.wide{width:100%}

.generateButton{
  width:100%;
  min-height:36px;
  margin-top:7px;
  color:#fff;
  border-color:rgba(0,113,227,.12);
  background:var(--accent);
  box-shadow:0 5px 14px rgba(0,113,227,.11);
}
.generateButton:hover{
  background:var(--accent-hover);
  box-shadow:0 7px 17px rgba(0,113,227,.14);
}

.utilityActions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px;
  margin-top:6px;
}
.utilityButton{
  min-height:29px;
  padding:4px 7px;
  border-color:transparent;
  background:transparent;
  color:#7b7b80;
  font-size:9.8px;
}
.utilityButton:hover{
  border-color:var(--line);
  background:rgba(255,255,255,.62);
  box-shadow:none;
}

.fileName{
  margin-top:7px;
  padding:7px 8px;
  overflow:hidden;
  border:1px solid rgba(0,113,227,.07);
  border-radius:9px;
  color:#55555a;
  background:rgba(0,113,227,.035);
  font-size:9.5px;
  line-height:1.4;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.fileName:empty{display:none}
.actionDivider{display:none}

.work-card{
  min-width:0;
  min-height:calc(100vh - 22px);
}
.tabs{
  min-height:44px;
  display:flex;
  gap:3px;
  overflow:auto;
  padding:5px;
  border-bottom:1px solid var(--line);
  background:rgba(255,255,255,.20);
  scrollbar-width:none;
}
.tabs::-webkit-scrollbar{display:none}
.tab{
  min-height:32px;
  padding:0 12px;
  border:0;
  border-radius:9px;
  white-space:nowrap;
  color:#7c7c80;
  background:transparent;
  box-shadow:none;
  font-size:10.5px;
  font-weight:610;
}
.tab:hover{
  color:#3f3f42;
  background:rgba(255,255,255,.42);
  box-shadow:none;
  transform:none;
}
.tab.active{
  color:#1d1d1f;
  background:rgba(255,255,255,.86);
  box-shadow:0 1px 3px rgba(0,0,0,.045);
}
.tabPanel{display:none}
.tabPanel.active{display:block}
.workBody{padding:9px}

.statusBar{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-bottom:7px;
}
.compactStatusBar{align-items:center;flex-wrap:nowrap}
.badge{
  padding:4px 7px;
  border:1px solid var(--line);
  border-radius:8px;
  color:#7a7a7f;
  background:rgba(255,255,255,.46);
  font-size:9.5px;
  line-height:1.35;
}
.badge strong{color:#333336;font-weight:650}
.headerBadge{
  min-width:0;
  max-width:72%;
  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
}

.tableWrap{
  overflow:auto;
  max-height:calc(100vh - 117px);
  border:1px solid var(--line);
  border-radius:11px;
  background:rgba(255,255,255,.30);
}
table{
  width:100%;
  min-width:900px;
  border-collapse:separate;
  border-spacing:0;
}
th,td{
  padding:7px 8px;
  text-align:left;
  vertical-align:top;
  border-bottom:1px solid var(--line);
  color:#5e5e63;
  font-size:9.8px;
  line-height:1.42;
}
th{
  position:sticky;
  top:0;
  z-index:3;
  color:#3b3b3e;
  background:rgba(247,247,248,.97);
  font-weight:650;
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
th:first-child{left:0;z-index:5}
td:first-child{
  position:sticky;
  left:0;
  z-index:1;
  background:rgba(252,252,253,.97);
}
tr:last-child td{border-bottom:0}
tbody tr:hover td{background:rgba(0,113,227,.025)}
tbody tr:hover td:first-child{background:rgba(247,249,252,.98)}
.emptyCell{color:#9a9a9f}

.btnRow{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
  margin-top:7px;
}
.promptToolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:7px;
  flex-wrap:wrap;
  margin-bottom:7px;
}
.promptMeta{display:flex;gap:5px;flex-wrap:wrap}
.promptActions{
  margin-top:0;
  align-items:center;
  justify-content:flex-end;
}
.networkBadge{white-space:nowrap}

textarea{
  width:100%;
  min-height:140px;
  resize:vertical;
  padding:10px 11px;
  border:1px solid var(--line);
  border-radius:11px;
  outline:none;
  color:var(--text);
  background:rgba(255,255,255,.76);
  font-size:10.3px;
  line-height:1.6;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.92);
}
textarea::placeholder{color:#a1a1a6}
textarea:focus{
  border-color:rgba(0,113,227,.25);
  box-shadow:0 0 0 3px rgba(0,113,227,.055),inset 0 1px 0 #fff;
}
.promptShell{position:relative}
.promptTextarea{
  min-height:calc(100vh - 132px);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
  tab-size:4;
  white-space:pre;
}
.parseTextarea{
  min-height:calc(100vh - 190px);
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace;
}
.parseHint{margin-bottom:7px}
.parseActions{
  align-items:center;
  justify-content:space-between;
  margin-top:7px;
}
.parseActionGroup{display:flex;gap:6px;flex-wrap:wrap}
.message{
  min-height:15px;
  margin-top:6px;
  color:var(--muted);
  font-size:9.5px;
}
.ok{color:#207a43}
.bad{color:var(--danger)}
.warning{color:#8b6b38}
.outputTableWrap,.dataTableWrap{max-height:calc(100vh - 117px)}

.moduleToast{
  position:fixed;
  left:50%;
  bottom:18px;
  z-index:100;
  max-width:min(380px,calc(100% - 28px));
  padding:8px 12px;
  border:1px solid rgba(255,255,255,.78);
  border-radius:999px;
  color:#3a3a3d;
  background:rgba(255,255,255,.91);
  box-shadow:0 12px 32px rgba(0,0,0,.10),inset 0 1px 0 #fff;
  backdrop-filter:blur(16px);
  -webkit-backdrop-filter:blur(16px);
  font-size:10.5px;
  opacity:0;
  visibility:hidden;
  transform:translate(-50%,8px);
  transition:opacity .18s ease,visibility .18s ease,transform .18s ease;
}
.moduleToast.show{
  opacity:1;
  visibility:visible;
  transform:translate(-50%,0);
}
.clipboardHelper{position:fixed;left:-9999px;top:0;opacity:0}

@media(max-width:980px){
  main{grid-template-columns:200px minmax(0,1fr)}
  .networkBadge{display:none}
}
@media(max-width:760px){
  body{padding:8px}
  main{min-height:auto;grid-template-columns:1fr}
  .import-card{position:static}
  .work-card{min-height:auto}
  .tableWrap{max-height:520px}
  .promptTextarea,.parseTextarea{min-height:380px}
}
@media(max-width:520px){
  .compactStatusBar{flex-wrap:wrap}
  .headerBadge{max-width:100%}
  .promptToolbar{align-items:stretch;flex-direction:column}
  .promptActions{justify-content:flex-start}
  .parseActions{align-items:stretch;flex-direction:column}
  .parseActionGroup{width:100%}
  .parseActionGroup button{flex:1}
}

/* V2.27 · 采集筛选转入与字段级优化工作台 */
.sourceMode{
  width:max-content;
  max-width:100%;
  display:inline-flex;
  align-items:center;
  gap:6px;
  margin-bottom:10px;
  padding:4px 8px;
  border:1px solid rgba(29,29,31,.07);
  border-radius:999px;
  color:#68686d;
  background:rgba(255,255,255,.58);
  font-size:9.4px;
  font-weight:610;
  line-height:1.2;
}
.sourceModeDot{
  width:6px;
  height:6px;
  flex:0 0 6px;
  border-radius:50%;
  background:#34c759;
  box-shadow:0 0 0 3px rgba(52,199,89,.09);
}
.collectorSourceCard{
  margin:0 0 10px;
  padding:10px;
  border:1px solid rgba(0,113,227,.10);
  border-radius:12px;
  background:linear-gradient(145deg,rgba(246,250,255,.92),rgba(255,255,255,.72));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.96);
}
.collectorSourceCard.hidden{display:none}
.collectorSourceTop{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  color:#343438;
  font-size:10px;
}
.collectorSourceTop span{font-weight:650}
.collectorSourceTop strong{
  color:var(--accent);
  font-size:9.5px;
  font-weight:650;
  white-space:nowrap;
}
.collectorSourceCard p{
  margin:6px 0 0;
  color:#77777c;
  font-size:9.2px;
  line-height:1.55;
}
.dataToolbar{
  display:grid;
  gap:7px;
  margin-bottom:7px;
}
.dataToolbar .statusBar{margin-bottom:0}
.fieldSelectionPanel{
  padding:9px 10px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.40);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.90);
}
.fieldSelectionTitle{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:8px;
}
.fieldSelectionTitle > div:first-child{
  min-width:0;
  display:flex;
  align-items:baseline;
  gap:7px;
}
.fieldSelectionTitle strong{
  color:#313135;
  font-size:10.4px;
  font-weight:670;
}
.fieldSelectionTitle span{
  overflow:hidden;
  color:#939398;
  font-size:9px;
  white-space:nowrap;
  text-overflow:ellipsis;
}
.fieldSelectionActions{display:flex;align-items:center;gap:2px}
.fieldTextButton{
  min-height:24px;
  padding:3px 6px;
  border:0;
  color:#77777c;
  background:transparent;
  font-size:9px;
  box-shadow:none;
}
.fieldTextButton:hover{
  color:var(--accent);
  background:rgba(0,113,227,.05);
  box-shadow:none;
  transform:none;
}
.fieldSelector{
  display:flex;
  flex-wrap:wrap;
  gap:5px;
}
.fieldSelector button{
  min-height:28px;
  padding:4px 9px;
  border-color:rgba(29,29,31,.075);
  color:#77777c;
  background:rgba(248,248,249,.72);
  font-size:9.5px;
  font-weight:610;
  box-shadow:none;
}
.fieldSelector button:hover{
  color:#4a4a4e;
  border-color:rgba(29,29,31,.12);
  background:#fff;
  box-shadow:none;
  transform:none;
}
.fieldSelector button.selected{
  color:#075fae;
  border-color:rgba(0,113,227,.16);
  background:rgba(0,113,227,.075);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.78);
}
.selectedFieldColumn{
  background-color:rgba(0,113,227,.022);
}
th.selectedFieldColumn{
  color:#215d91;
  background:rgba(241,247,253,.98);
}
tbody tr:hover td.selectedFieldColumn{background:rgba(0,113,227,.045)}
.dataTableWrap{max-height:calc(100vh - 202px)}
.outputTableWrap{max-height:calc(100vh - 117px)}

@media(max-width:760px){
  .fieldSelectionTitle{align-items:flex-start}
  .fieldSelectionTitle > div:first-child{align-items:flex-start;flex-direction:column;gap:2px}
  .dataTableWrap{max-height:480px}
}
