:root {
  --bg: #edf3f9;
  --surface: #ffffff;
  --surface-soft: #f7faff;
  --surface-blue: #edf5ff;
  --ink: #0b1830;
  --muted: #60718c;
  --subtle: #8c9bb1;
  --line: #d4e0ef;
  --line-soft: #e5edf6;
  --blue: #2467ed;
  --blue-dark: #1554cf;
  --blue-soft: #e8f1ff;
  --green: #12875b;
  --green-soft: #e9f8f1;
  --red: #d64b5d;
  --red-soft: #fff0f2;
  --amber: #a56a09;
  --amber-soft: #fff7e7;
  --shadow: 0 16px 42px rgba(36, 66, 105, .08);
  --shadow-soft: 0 8px 24px rgba(36, 66, 105, .055);
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 286px;
  --content-max: 1520px;
  --sans: "Segoe UI Variable", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% -10%, rgba(36, 103, 237, .08), transparent 31%),
    var(--bg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, select { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }
::selection { color: #fff; background: var(--blue); }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 10px;
  left: 10px;
  padding: 9px 13px;
  color: #fff;
  background: var(--blue);
  border-radius: 9px;
  transform: translateY(-160%);
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.loading-line {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  opacity: 0;
  background: linear-gradient(90deg, transparent, var(--blue), #69a0ff, transparent);
  background-size: 220% 100%;
  transition: opacity .2s ease;
}
.loading-line.active { opacity: 1; animation: loading 1.2s linear infinite; }
@keyframes loading { to { background-position: -220% 0; } }

.tool-app { min-height: 100vh; }
.tool-sidebar {
  position: fixed;
  inset: 14px auto 14px 14px;
  z-index: 40;
  display: flex;
  width: calc(var(--sidebar) - 28px);
  padding: 22px 16px 16px;
  overflow: hidden;
  background: rgba(255, 255, 255, .94);
  border: 1px solid rgba(198, 214, 233, .95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  flex-direction: column;
}
.tool-brand { display: flex; min-height: 54px; padding: 0 9px; align-items: center; gap: 12px; }
.brand-mark {
  position: relative;
  display: block;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #367cf5, #1553ca);
  border-radius: 13px;
  box-shadow: 0 10px 24px rgba(36, 103, 237, .27);
  transform: rotate(-2deg);
}
.brand-mark i { position: absolute; width: 15px; height: 5px; background: #fff; border-radius: 6px; transform: rotate(-42deg); }
.brand-mark i:first-child { top: 12px; left: 10px; }
.brand-mark i:last-child { right: 8px; bottom: 12px; }
.tool-brand strong { display: block; font-size: 18px; letter-spacing: .13em; line-height: 1.1; }
.tool-brand small { display: block; margin-top: 4px; color: var(--subtle); font-size: 9px; letter-spacing: .11em; }
.sidebar-caption { display: flex; margin: 27px 10px 10px; align-items: center; gap: 10px; color: #8d9bb0; font-size: 9px; font-weight: 800; letter-spacing: .15em; }
.sidebar-caption i { height: 1px; flex: 1; background: var(--line-soft); }
.tool-nav {
  display: grid;
  min-height: 0;
  margin-top: 15px;
  padding: 1px 2px 8px 0;
  overflow-x: hidden;
  overflow-y: auto;
  align-content: start;
  flex: 1 1 auto;
  gap: 5px;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tool-nav::-webkit-scrollbar { display: none; width: 0; height: 0; }
.tool-nav-item {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 52px;
  padding: 7px 10px;
  align-items: center;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  color: #53647e;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 650;
  transition: color .2s ease, background .2s ease, transform .2s ease;
}
.tool-nav-item:hover { color: var(--ink); background: #f4f7fb; transform: translateX(2px); }
.tool-nav-item:active { transform: translateX(2px) scale(.99); }
.tool-nav-item.active { color: var(--blue); background: var(--blue-soft); }
.tool-nav-item.active::after { position: absolute; right: 0; width: 3px; height: 24px; content: ""; background: var(--blue); border-radius: 4px 0 0 4px; }
.nav-icon {
  display: grid;
  width: 36px;
  height: 36px;
  color: #687a94;
  background: #eef3f8;
  border: 1px solid #e8eef5;
  border-radius: 11px;
  place-items: center;
  font: 800 17px/1 var(--sans);
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.tool-nav-item.active .nav-icon { color: var(--blue); background: #dceaff; border-color: #d2e4ff; }
.nav-icon.facebook { font-family: Arial, sans-serif; font-size: 20px; }
.nav-icon.threads { font-size: 15px; }
.nav-icon.tiktok { font-size: 18px; }
.nav-icon.converter { font-family: var(--mono); font-size: 18px; }
.nav-icon.text { font-family: var(--mono); }
.sidebar-support {
  display: grid;
  min-height: 56px;
  margin-top: 8px;
  padding: 8px 10px;
  flex: 0 0 auto;
  align-items: center;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  color: #405572;
  background: #f6f9fd;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  transition: color .2s ease, background .2s ease, border-color .2s ease, transform .2s ease;
}
.sidebar-support:hover { color: var(--blue); background: #edf5ff; border-color: #cfe0fa; transform: translateY(-1px); }
.sidebar-support:focus-visible { outline: 3px solid rgba(36, 103, 237, .2); outline-offset: 2px; }
.support-icon { display: grid; width: 34px; height: 34px; color: #fff; background: var(--blue); border-radius: 10px; place-items: center; font: 800 10px/1 var(--sans); }
.sidebar-support small, .sidebar-support strong { display: block; }
.sidebar-support small { color: #8291a6; font-size: 9px; font-weight: 650; }
.sidebar-support strong { margin-top: 1px; color: inherit; font: 750 11px/1.3 var(--mono); }
.sidebar-support i { color: #8a99ad; font-size: 11px; font-style: normal; }
.sidebar-footer { margin-top: auto; padding: 24px 10px 4px; }
.preview-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 9px; font-weight: 850; letter-spacing: .11em; }
.preview-badge i, .stage-status i { width: 7px; height: 7px; background: #24b97a; border-radius: 50%; box-shadow: 0 0 0 5px rgba(36, 185, 122, .1); }
.sidebar-footer p { margin: 9px 0 0; color: var(--subtle); font-size: 10px; line-height: 1.65; }

.tool-stage { display: flex; min-height: 100vh; margin-left: var(--sidebar); padding: 14px 14px 28px 0; flex-direction: column; }
.stage-header {
  position: sticky;
  z-index: 30;
  top: 14px;
  display: flex;
  width: min(100%, var(--content-max));
  min-height: 88px;
  margin-inline: auto;
  padding: 16px 24px;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, .9);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}
.stage-heading span { display: block; margin-bottom: 3px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .14em; }
.stage-heading h1 { margin: 0; font-size: clamp(23px, 2.25vw, 34px); letter-spacing: -.035em; line-height: 1.2; }
.stage-status { display: flex; margin-left: auto; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; font-weight: 750; }
.stage-extra { width: min(46vw, 620px); margin-left: auto; }
.stage-extra:empty { display: none; }
.stage-batch-metrics {
  display: grid;
  padding: 12px 14px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: #f7f9fd;
  border: 1px solid #dce6f3;
  border-radius: 13px;
}
.stage-batch-metrics > span { padding: 0 18px; border-left: 1px solid #dfe7f2; }
.stage-batch-metrics > span:first-child { border-left: 0; }
.stage-batch-metrics small, .stage-batch-metrics strong { display: block; }
.stage-batch-metrics small { color: #748299; font-size: 11px; font-weight: 650; }
.stage-batch-metrics strong { margin-top: 2px; color: #24334b; font: 760 24px/1.15 var(--mono); font-variant-numeric: tabular-nums; }
.stage-batch-metrics .alive strong { color: var(--green); }
.stage-batch-metrics .dead strong { color: var(--red); }
.stage-batch-metrics .codes strong { color: var(--blue); }
.stage-header.chatgpt-stage-header {
  min-height: 124px;
  padding-block: 20px;
  background: #fff;
  backdrop-filter: none;
}
.chatgpt-stage-header .stage-heading { min-width: 290px; }
.chatgpt-stage-header .stage-extra { width: min(62vw, 900px); }
.stage-cpa-summary {
  display: grid;
  padding-left: 26px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  border-left: 1px solid var(--line-soft);
}
.stage-cpa-copy { min-width: 0; }
.stage-cpa-copy strong {
  display: block;
  font-size: clamp(16px, 1.4vw, 21px);
  line-height: 1.25;
  letter-spacing: -.025em;
  text-wrap: balance;
}
.stage-cpa-copy p {
  max-width: 760px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
  text-wrap: pretty;
}
.stage-cpa-retention {
  display: grid;
  min-width: 132px;
  padding: 13px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.stage-cpa-retention strong {
  color: var(--blue);
  font: 800 19px/1.2 var(--mono);
  font-variant-numeric: tabular-nums;
}
.stage-cpa-retention span { margin-top: 5px; color: var(--subtle); font-size: 9px; white-space: nowrap; }
.sidebar-toggle { display: none; width: 38px; height: 38px; padding: 0; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 10px; }
.tool-content { width: min(100%, var(--content-max)); margin: 14px auto 0; outline: 0; flex: 1 0 auto; }
.tool-footer {
  display: flex;
  width: min(100%, var(--content-max));
  min-height: 54px;
  margin: 24px auto 0;
  padding: 16px 5px 0;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #8291a6;
  border-top: 1px solid rgba(199, 214, 232, .9);
  font-size: 10px;
}
.tool-footer > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.tool-footer strong { color: #40516b; font-size: 11px; letter-spacing: .08em; }
.tool-footer-links { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.tool-footer a { transition: color .18s ease; }
.tool-footer a:hover { color: var(--blue); }
.tool-footer a:focus-visible { color: var(--blue); outline: 2px solid rgba(36, 103, 237, .2); outline-offset: 3px; border-radius: 3px; }

.tool-panel {
  padding: 24px;
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.tool-panel + .tool-panel { margin-top: 14px; }
.tool-panel.compact-panel { padding: 14px 18px; }
.panel-heading { display: flex; margin-bottom: 18px; align-items: flex-start; justify-content: space-between; gap: 20px; }
.panel-heading h2 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.panel-heading p { max-width: 720px; margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.panel-heading .panel-tag { flex: 0 0 auto; color: var(--blue); font: 750 9px/1 var(--mono); letter-spacing: .08em; }
.tool-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.tool-grid.equal { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inner-card { padding: 18px; background: var(--surface-soft); border: 1px solid var(--line-soft); border-radius: var(--radius); }
.inner-card.white { background: #fff; border-color: var(--line); }
.field { display: grid; gap: 7px; }
.field + .field { margin-top: 13px; }
.field label, .field > span:first-child { color: #253550; font-size: 11px; font-weight: 750; }
.field small { color: var(--subtle); font-size: 10px; }
textarea, input, select {
  width: 100%;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd9ea;
  border-radius: 10px;
  outline: 0;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
textarea:focus, input:focus, select:focus { border-color: #7ba7f6; box-shadow: 0 0 0 4px rgba(36, 103, 237, .09); }
textarea { min-height: 172px; padding: 14px 15px; resize: vertical; line-height: 1.65; }
.compact-area { min-height: 140px; }
.checker-input { min-height: 128px; }
.mail-credential-input { min-height: 132px; }
.text-editor { min-height: 260px; }
input, select { min-height: 42px; padding: 0 12px; }
textarea::placeholder, input::placeholder { color: #97a7be; }
.action-row { display: flex; margin-top: 14px; align-items: center; flex-wrap: wrap; gap: 9px; }
.action-row.end { justify-content: flex-end; }
.button {
  display: inline-flex;
  min-height: 42px;
  padding: 0 16px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #40516c;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 750;
  box-shadow: 0 3px 10px rgba(36, 66, 105, .035);
  transition: transform .2s ease, color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.button:hover { color: var(--ink); border-color: #b8c9dd; transform: translateY(-1px); }
.button:active { transform: translateY(0) scale(.985); }
.button.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 10px 22px rgba(36, 103, 237, .22); }
.button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button.danger { color: var(--red); background: var(--red-soft); border-color: #f5ccd2; }
.button.subtle { color: var(--muted); background: #f7f9fc; }
.button.small { min-height: 34px; padding: 0 11px; font-size: 10px; }
.button:disabled { opacity: .48; transform: none; box-shadow: none; }
.check-row { display: inline-flex; min-height: 42px; padding: 0 12px; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 10px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.check-row input { width: 15px; min-height: 0; height: 15px; padding: 0; accent-color: var(--blue); }

.stat-strip { display: grid; margin-bottom: 14px; grid-template-columns: repeat(5, minmax(0, 1fr)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat-strip > span { min-width: 0; padding: 13px 14px; border-left: 1px solid var(--line-soft); }
.stat-strip > span:first-child { border-left: 0; }
.stat-strip small { display: block; color: var(--subtle); font-size: 9px; }
.stat-strip strong { display: block; margin-top: 3px; font: 750 18px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.stat-strip .good strong { color: var(--green); }
.stat-strip .bad strong { color: var(--red); }
.stat-strip .warn strong { color: var(--amber); }
.progress-shell { margin-top: 14px; }
.progress-meta { display: flex; margin-bottom: 7px; justify-content: space-between; color: var(--muted); font-size: 10px; }
.progress-track { height: 6px; overflow: hidden; background: #eaf0f7; border-radius: 99px; }
.progress-track i { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--blue), #6ea2ff); border-radius: inherit; transition: width .25s ease; }

.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.result-column { min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.result-column > header { display: flex; min-height: 46px; padding: 10px 13px; align-items: center; gap: 8px; background: #f8fafd; border-bottom: 1px solid var(--line-soft); }
.result-column > header strong { font-size: 11px; }
.result-column > header span { margin-left: auto; color: var(--subtle); font: 700 11px/1 var(--mono); }
.result-column > header i { width: 7px; height: 7px; border-radius: 50%; }
.result-copy { padding: 4px 7px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 6px; font-size: 9px; font-weight: 750; }
.result-column.alive > header i { background: var(--green); }
.result-column.dead > header i { background: var(--red); }
.result-column.unknown > header i { background: #d39a33; }
.result-list { min-height: 132px; max-height: 330px; padding: 8px; overflow: auto; }
.result-item { padding: 10px; background: #fafcff; border: 1px solid var(--line-soft); border-radius: 9px; }
.result-item + .result-item { margin-top: 6px; }
.result-item strong { display: block; overflow: hidden; font: 700 10px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.result-item p { margin: 4px 0 0; color: var(--muted); font-size: 9px; line-height: 1.55; }
.empty-result { display: grid; min-height: 160px; padding: 20px; color: var(--subtle); place-items: center; text-align: center; font-size: 10px; }

.info-card { padding: 13px 16px; color: #42536d; background: var(--surface-blue); border: 1px solid #d3e3fa; border-radius: 11px; }
.info-card h3 { margin: 0 0 8px; color: var(--blue-dark); font-size: 12px; }
.info-card ul { margin: 0; padding-left: 18px; }
.info-card li + li { margin-top: 5px; }
.info-card li { font-size: 10px; line-height: 1.65; }

.totp-reference-panel { padding-bottom: 26px; }
.totp-reference-input { min-height: 208px; padding: 17px 18px; font: 12px/1.75 var(--mono); }
.totp-action-row { margin-top: 12px; }
.totp-action-row .button { min-width: 142px; }
.totp-reference-result { margin-top: 22px; padding: 21px 22px 17px; background: #edf6ff; border: 1px solid #d9eaff; border-radius: var(--radius); }
.totp-current-card { min-height: 132px; padding: 2px 2px 12px; }
.totp-current-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.totp-current-head strong { color: var(--blue-dark); font-size: 12px; }
.totp-current-head span { color: #6e819d; font-size: 10px; }
.totp-current-head b { color: var(--blue); font: 750 11px/1 var(--mono); }
.totp-list.reference { display: grid; min-height: 86px; margin-top: 12px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: stretch; gap: 9px; }
.totp-placeholder { display: grid; min-height: 86px; color: #91a8c5; place-items: center; font: 760 36px/1 var(--mono); letter-spacing: .2em; }
.totp-card { position: relative; min-height: 86px; padding: 15px 16px; background: rgba(255, 255, 255, .85); border: 1px solid #d5e5f8; border-radius: 11px; }
.totp-card small { display: block; max-width: calc(100% - 52px); overflow: hidden; color: var(--subtle); font: 9px/1.4 var(--mono); text-overflow: ellipsis; white-space: nowrap; }
.totp-card strong { display: block; margin-top: 9px; color: #163a70; font: 760 30px/1 var(--mono); letter-spacing: .15em; font-variant-numeric: tabular-nums; }
.totp-card button { position: absolute; top: 12px; right: 12px; padding: 5px 8px; color: var(--blue); background: var(--blue-soft); border: 0; border-radius: 7px; font-size: 9px; font-weight: 750; }
.totp-error { display: block; margin-top: 13px; color: var(--red); font-size: 10px; }
.totp-refresh-track { height: 6px; overflow: hidden; background: rgba(255, 255, 255, .9); border: 1px solid #d9e8fa; border-radius: 99px; }
.totp-refresh-track i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--blue), #76a9ff); border-radius: inherit; transition: width .3s linear; }
.totp-reference-result > p { margin: 8px 0 0; color: #74869f; text-align: center; font-size: 10px; }
.totp-help ol { margin: 0; padding-left: 20px; }
.totp-help li { padding-left: 2px; font-size: 10px; line-height: 1.7; }
.totp-help li + li { margin-top: 4px; }

.mail-controls { display: grid; margin-top: 12px; grid-template-columns: minmax(210px, 1.15fr) minmax(145px, .66fr) minmax(165px, .74fr) minmax(105px, .4fr) auto auto; align-items: end; gap: 10px; }
.mail-controls .field { margin: 0; }
.mail-actions { display: flex; align-items: center; gap: 8px; }
.mail-actions .button { min-height: 42px; white-space: nowrap; }
.mail-result-head { display: flex; align-items: center; gap: 10px; }
.mail-result-head strong { font-size: 13px; }
.mail-result-head span { color: var(--muted); font-size: 10px; }
.mail-result-head .status-pill { margin-left: auto; }
.status-pill { display: inline-flex; padding: 5px 8px; align-items: center; gap: 6px; color: var(--muted); background: #f2f5f9; border-radius: 7px; font-size: 9px; font-weight: 750; }
.status-pill.good { color: var(--green); background: var(--green-soft); }
.status-pill.bad { color: var(--red); background: var(--red-soft); }
.code-row { display: flex; margin-top: 13px; flex-wrap: wrap; gap: 8px; }
.code-chip { padding: 9px 12px; color: var(--blue-dark); background: var(--blue-soft); border: 1px solid #d2e2fc; border-radius: 9px; font: 750 17px/1 var(--mono); letter-spacing: .08em; }
.mail-list { display: grid; margin-top: 12px; gap: 8px; }
.mail-list > .empty-result { min-height: 126px; }
.mail-help { max-width: 720px; margin: 10px auto 0; color: var(--text); font-size: 13px; line-height: 1.7; }
.mail-card { padding: 13px 14px; background: #fff; border: 1px solid var(--line); border-radius: 11px; }
.mail-card header { display: flex; align-items: flex-start; gap: 12px; }
.mail-card h3 { margin: 0; font-size: 11px; }
.mail-card time { margin-left: auto; color: #71809a; font: 10.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mail-card p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.65; }
.mail-card details { margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.mail-card summary { color: var(--blue); font-size: 10px; font-weight: 700; }
.mail-body { margin-top: 8px; color: #3e4e67; white-space: pre-wrap; word-break: break-word; font-size: 10px; }

.batch-native-host {
  display: block;
  width: 100%;
  min-height: 640px;
  color: #172036;
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --ink: #172036;
  --muted: #6e7688;
  --soft: #99a1b1;
  --paper: #f5f6f9;
  --surface: #fff;
  --line: #e2e5eb;
  --line-soft: #edf0f4;
  --primary: #6557e8;
  --primary-dark: #4d42c6;
  --primary-soft: #eeecff;
  --green: #139765;
  --green-soft: #e6f8ef;
  --red: #d44d59;
  --red-soft: #fcebed;
  --orange: #df8b31;
  --orange-soft: #fff2e4;
  --dark: #171c30;
  --radius: 15px;
  --shadow: 0 16px 44px rgba(27, 34, 60, .07);
}
.batch-native-loading, .batch-native-error {
  display: grid;
  min-height: 420px;
  padding: 30px;
  place-items: center;
  align-content: center;
  text-align: center;
  background: rgba(255, 255, 255, .94);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.batch-native-loading { color: var(--muted); font-size: 11px; gap: 12px; }
.batch-native-loading i { width: 25px; height: 25px; border: 3px solid #dfe8f5; border-top-color: var(--blue); border-radius: 50%; animation: batch-native-spin .75s linear infinite; }
.batch-native-error strong { color: var(--red); font-size: 14px; }
.batch-native-error p { margin: 7px 0 15px; color: var(--muted); font-size: 10px; }
@keyframes batch-native-spin { to { transform: rotate(360deg); } }

.text-workbench { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.editor-card { min-width: 0; }
.editor-toolbar { display: flex; margin-bottom: 9px; align-items: center; gap: 8px; }
.editor-toolbar strong { font-size: 12px; }
.editor-toolbar span { margin-left: auto; color: var(--subtle); font: 9px/1 var(--mono); }
.editor-card textarea { min-height: 260px; }
.operation-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; }
.operation-grid .button { min-height: 38px; padding: 0 8px; }
.replace-grid { display: grid; margin-top: 12px; padding-top: 12px; grid-template-columns: 1fr 1fr auto; gap: 8px; border-top: 1px solid var(--line-soft); }
.replace-grid.prefix { grid-template-columns: 1fr 1fr auto; }
.output-meta { display: flex; margin-top: 8px; color: var(--subtle); font-size: 9px; gap: 14px; }

.toast {
  position: fixed;
  z-index: 90;
  right: 22px;
  bottom: 22px;
  max-width: min(380px, calc(100% - 28px));
  padding: 11px 14px;
  color: #fff;
  background: #12213a;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  box-shadow: 0 14px 38px rgba(11, 24, 48, .24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity .2s ease, transform .2s ease;
  font-size: 11px;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #7e2634; }

@media (max-width: 1180px) {
  :root { --sidebar: 258px; }
  .tool-sidebar { width: 230px; }
  .tool-nav-item { padding-inline: 7px; font-size: 11px; }
  .tool-grid { grid-template-columns: 1fr; }
  .mail-controls { grid-template-columns: 1fr 1fr; }
  .mail-actions { grid-column: 1 / -1; }
  .operation-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stage-extra { width: min(48vw, 520px); }
  .stage-header.chatgpt-stage-header { align-items: flex-start; flex-wrap: wrap; }
  .chatgpt-stage-header .stage-extra { width: 100%; margin-left: 0; }
  .stage-cpa-summary { padding: 15px 0 0; border-top: 1px solid var(--line-soft); border-left: 0; }
  .stage-batch-metrics > span { padding-inline: 12px; }
}

@media (max-width: 820px) {
  .tool-sidebar { inset: 0 auto 0 0; width: 270px; border-width: 0 1px 0 0; border-radius: 0; transform: translateX(-102%); transition: transform .25s cubic-bezier(.2,.8,.2,1); }
  .tool-sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(8, 20, 39, .44); }
  .tool-stage { margin-left: 0; padding: 8px 8px 45px; }
  .stage-header { top: 8px; min-height: 74px; padding: 12px 14px; border-radius: 14px; }
  .stage-header.chatgpt-stage-header { min-height: 0; padding: 14px; }
  .chatgpt-stage-header .stage-heading { min-width: 0; flex: 1; }
  .stage-cpa-summary { gap: 14px; }
  .sidebar-toggle { display: inline-grid; flex: 0 0 auto; place-items: center; }
  .stage-heading h1 { font-size: 21px; }
  .stage-status { display: none; }
  .stage-header.batch-stage-header { align-items: stretch; flex-wrap: wrap; }
  .batch-stage-header .stage-heading { align-self: center; }
  .batch-stage-header .stage-extra { width: 100%; margin-left: 0; }
  .tool-content { margin-top: 8px; }
  .tool-panel { padding: 17px; border-radius: 14px; }
  .tool-panel.compact-panel { padding: 12px 14px; }
  .result-grid, .text-workbench { grid-template-columns: 1fr; }
  .result-list { min-height: 120px; }
}

@media (max-height: 780px) and (min-width: 821px) {
  .tool-sidebar { padding-block: 15px 12px; }
  .tool-brand { min-height: 48px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .tool-nav { margin-top: 10px; gap: 2px; }
  .tool-nav-item { min-height: 47px; }
}

@media (max-width: 560px) {
  .stage-heading span { display: none; }
  .stage-heading h1 { font-size: 18px; }
  .stage-cpa-summary { grid-template-columns: 1fr; }
  .stage-cpa-retention { min-width: 0; grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
  .stage-cpa-retention span { margin-top: 0; white-space: normal; }
  .stage-batch-metrics { padding: 10px 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 0; }
  .stage-batch-metrics > span:nth-child(3) { border-left: 0; }
  .stage-batch-metrics strong { font-size: 21px; }
  .panel-heading { flex-direction: column; gap: 7px; }
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-strip > span { border-bottom: 1px solid var(--line-soft); }
  .stat-strip > span:nth-child(odd) { border-left: 0; }
  .stat-strip > span:last-child { grid-column: 1 / -1; border-bottom: 0; }
  .mail-controls { grid-template-columns: 1fr; }
  .mail-actions { grid-column: auto; }
  .totp-reference-input { min-height: 178px; }
  .totp-reference-result { padding: 17px 15px 14px; }
  .totp-list.reference { grid-template-columns: 1fr; }
  .totp-card strong { font-size: 27px; }
  .operation-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .replace-grid, .replace-grid.prefix { grid-template-columns: 1fr; }
  .editor-card textarea { min-height: 230px; }
  .action-row .button { flex: 1; }
  .tool-footer { align-items: flex-start; flex-direction: column; gap: 7px; }
  .tool-footer-links { justify-content: flex-start; gap: 10px 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
