:root {
  color-scheme: light;
  --text: #1e293b;
  --muted: #64748b;
  --line: #e2e8f0;
  --blue: #2f6df6;
  --blue-soft: #d7e8ff;
  --green: #009a72;
  --red: #ff3f63;
  --amber: #f59e0b;
  --bg: #f6f8fb;
  --panel: #ffffff;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: #f8fafc;
}

.shell {
  width: min(1920px, calc(100vw - 32px));
  height: 100%;
  margin: 0 auto;
  padding: 10px 0;
}

.panel {
  overflow: hidden;
  min-height: 760px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 24px 70px rgba(31, 49, 84, .13);
  border-radius: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1, h2, p { margin: 0; }

h1 {
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.hidden { display: none !important; }

.auth-screen {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 56px);
  position: relative;
  overflow: hidden;
}

.auth-screen::before,
.auth-screen::after {
  display: none;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: min(430px, calc(100vw - 32px));
  padding: 38px 32px 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 22px 36px rgba(15, 23, 42, .1), 0 8px 12px rgba(15, 23, 42, .06);
}

.auth-brand {
  display: grid;
  justify-items: center;
  gap: 12px;
  margin-bottom: 4px;
  text-align: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 0;
  color: #000;
  background: transparent;
  box-shadow: none;
}

.brand-mark svg,
.apple-solid {
  fill: #3f4654;
  stroke: #000000;
  stroke-width: 1.7;
  stroke-linejoin: round;
}

.brand-mark svg { width: 52px; height: 52px; }

.auth-subtitle {
  margin: 0 0 20px;
  color: #94a3b8;
  font-size: 15px;
  text-align: center;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f5f9;
}

.auth-tabs button {
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-weight: 800;
}

.auth-tabs button.active {
  color: #4f46e5;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .08);
}

.login-form {
  display: grid;
  gap: 14px;
}

.login-form label {
  display: grid;
  gap: 7px;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
}

.field {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.field svg { width: 17px; height: 17px; color: #7790b2; flex: 0 0 auto; }

.field input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  font: inherit;
  color: var(--text);
  background: transparent;
}

.field-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 0;
  background: transparent;
  color: #64748b;
}

.remember { color: #64748b !important; }

.login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: #4f46e5;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 4px 14px rgba(79, 70, 229, .25);
}

.login-btn svg { width: 18px; height: 18px; }

.login-note {
  color: #8291a7;
  font-size: 12px;
  line-height: 1.6;
}

.text-link {
  display: inline;
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #4f46e5;
  font-weight: 850;
}

.admin-layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  align-items: stretch;
  gap: 0;
  height: 100%;
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(31, 49, 84, .12);
  overflow: hidden;
}

.admin-sidebar {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  border-right: 1px solid var(--line);
  background: #ffffff;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 24px 22px;
  border-bottom: 1px solid var(--line);
}

.sidebar-logo .apple-solid {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
}

.sidebar-logo strong {
  display: block;
  font-size: 22px;
  line-height: 1.2;
}

.sidebar-logo span {
  display: none;
}

.admin-nav {
  display: grid;
  gap: 8px;
  padding: 20px 14px;
}

.advanced-nav { min-width: 0; }

.advanced-toggle .advanced-chevron {
  width: 17px;
  height: 17px;
  margin-left: auto;
  transition: transform .15s ease;
}

.advanced-toggle[aria-expanded="true"] .advanced-chevron { transform: rotate(180deg); }

.advanced-menu {
  display: grid;
  gap: 4px;
  margin: 4px 0 0 18px;
  padding: 5px 0 5px 8px;
  border-left: 1px solid var(--line);
}

.advanced-menu .feature-card { min-height: 42px; padding-left: 12px; font-size: 15px; }

.sidebar-binding-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0 14px 14px;
}

.sidebar-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.sidebar-stat:hover { border-color: #9db5ff; background: #f3f6ff; }
.sidebar-stat:active { transform: translateY(1px); }
.sidebar-stat:focus-visible { outline: 3px solid rgba(59, 102, 241, .25); outline-offset: 2px; }

.sidebar-stat small { color: #64748b; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sidebar-stat b { font-size: 24px; line-height: 1; }
.sidebar-stat-success b { color: #2f855a; }
.sidebar-stat-failed b { color: #d14343; }

.sidebar-footer {
  margin-top: auto;
  padding: 14px;
  border-top: 1px solid var(--line);
}

.session-card {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.session-card span {
  color: #111827;
}

.session-card small {
  color: #64748b;
  font: inherit;
  font-size: 12px;
}

.sidebar-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  font-size: 16px;
  font-weight: 850;
}

.sidebar-logout:hover {
  border-color: #fecdd3;
  background: #fff8fa;
  color: var(--red);
}

.admin-main {
  min-width: 0;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: #f8fafc;
}

.admin-panel {
  height: calc(100% - 32px);
  margin: 16px;
  min-height: 0;
  border-radius: 14px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

#taskPanel {
  display: flex;
  flex-direction: column;
  height: calc(100% - 32px);
  min-height: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  margin: 16px;
  padding: 0;
}

.dashboard-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #fff;
  border: 1px solid var(--line);
}

.summary-grid.compact {
  flex: 0 0 auto;
  padding-top: 22px;
}

.info-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.advanced-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px;
  overflow: hidden;
  background: #f8fafc;
}

.advanced-top {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 12px;
  flex: 0 0 auto;
}

.advanced-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  gap: 8px;
}

.advanced-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.advanced-btn:hover { border-color: #9db6fb; color: #315fe7; background: #f4f7ff; }
.advanced-btn.primary { border-color: #4169f5; background: #4169f5; color: #fff; }
.advanced-btn.danger { border-color: #ffd0d9; background: #fff8fa; color: var(--red); }
.advanced-btn svg { width: 17px; height: 17px; }

.advanced-config {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  gap: 9px 14px;
  min-height: 94px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
}

.advanced-config p { flex: 1 1 100%; margin: 0; }
.advanced-config b { color: #4169f5; }
.advanced-config label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  color: #475569;
  font-weight: 800;
}

.advanced-config input,
.advanced-config select {
  min-width: 0;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 12px;
}

.advanced-config input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: #4169f5;
}

.change-config { gap: 8px 12px; }
.family-config { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; }
.family-config > label,
.family-config p { grid-column: 1 / -1; }

.icloud-config {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.icloud-plan {
  display: grid;
  align-content: center;
  gap: 10px;
  min-height: 116px;
  padding: 14px 18px;
  border-right: 1px solid var(--line);
}

.icloud-plan label { justify-content: space-between; }
.icloud-plan .advanced-check { justify-content: flex-start; }
.icloud-plan select { width: 180px; }
.icloud-info { padding: 12px 16px; }
.icloud-info p { margin: 0 0 5px; }
.icloud-info p:last-child { margin-bottom: 0; }
.icloud-info .icloud-tip b { color: #d97706; }

.country-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: 48px;
  padding: 8px 10px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.country-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.country-toolbar select,
.country-tool {
  height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-size: 12px;
}
.country-tool { display: inline-flex; align-items: center; gap: 5px; color: #4169f5; }
.country-tool svg { width: 14px; height: 14px; }
.country-toolbar input { width: 16px; height: 16px; accent-color: #4169f5; }
.country-note { color: #94a3b8; font-weight: 650; }
.country-top { margin-top: 10px; }
.country-configs { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 10px; min-width: 0; }
.country-info { min-height: 116px; }
.country-info .country-tip b { color: #d97706; }
.country-tax { display: grid; grid-template-columns: 1fr; min-height: 116px; }
.country-tax > input,
.country-tax > div { width: 100%; }
.country-tax > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.country-tax input:disabled { background: #f1f5f9; color: #94a3b8; }

.advanced-table {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.advanced-table table {
  width: max-content;
  min-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 11px;
}

.advanced-table th,
.advanced-table td { width: auto !important; }

.advanced-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 28px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  color: #475569;
  font-size: 12px;
  text-align: left;
  white-space: nowrap;
}

.advanced-table td {
  height: 26px;
  padding: 0 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf2f7;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.advanced-table th:last-child,
.advanced-table td:last-child { border-right: 0; }
.advanced-table th:nth-child(1), .advanced-table td:nth-child(1) { width: 58px !important; text-align: center; }
.advanced-table th:nth-child(2), .advanced-table td:nth-child(2) { width: 220px !important; }
.advanced-table th:nth-child(3), .advanced-table td:nth-child(3) { width: 170px !important; }
.advanced-table th:last-child, .advanced-table td:last-child { width: 280px !important; }
.advanced-table.wide-table table { min-width: 1200px; }

.advanced-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 16px;
  font-weight: 700;
  pointer-events: none;
}

.feature-placeholder {
  display: grid;
  place-content: center;
  flex: 1;
  gap: 10px;
  min-height: 0;
  color: #64748b;
  text-align: center;
}

.feature-placeholder svg { width: 34px; height: 34px; margin: 0 auto; color: #4169f5; }
.feature-placeholder strong { color: #1e293b; font-size: 20px; }
.feature-placeholder span { font-size: 14px; }

.feature-card {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #475569;
  text-align: left;
  font-size: 17px;
  font-weight: 800;
}

.feature-card:hover,
.feature-card.active {
  color: #4f46e5;
  background: #eef2ff;
  box-shadow: none;
}

.feature-card svg { width: 22px; height: 22px; color: currentColor; }
.feature-card strong { font-size: 16px; }
.feature-card span { color: currentColor; line-height: 1.55; }

.mini-action {
  justify-self: start;
  width: fit-content;
  height: 38px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  color: #4f46e5;
  background: #eef2ff;
  font-weight: 800;
}

.mini-action.primary-mini {
  background: #4169f5;
  color: #ffffff;
}

.mini-action.success-mini {
  border-color: #55ad78;
  background: #55ad78;
  color: #ffffff;
}

.tool-btn.danger-soft {
  color: var(--red);
  border-color: #ffd0d9;
  background: #fff8fa;
}

.recent-box {
  flex: 1;
  min-height: 0;
  margin: 0 42px 32px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
}

.section-head,
.progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.compact-list {
  display: grid;
  align-content: start;
  gap: 8px;
  max-height: calc(100% - 34px);
  margin-top: 12px;
  overflow-y: auto;
}

.compact-list div {
  display: grid;
  grid-template-columns: 120px 1fr 160px;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #64748b;
  background: #f8fafc;
  font-size: 15px;
}

.task-filters {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 42px 18px;
}

.field.slim {
  width: 340px;
  min-height: 48px;
}

.task-filters select {
  height: 48px;
  min-width: 140px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  font-weight: 700;
  padding: 0 10px;
}

.progress-box {
  margin: 0 42px 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.progress-top {
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
}

.progress-top strong { color: #4f46e5; }

.progress-track {
  overflow: hidden;
  height: 8px;
  margin-top: 10px;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4f46e5, #10b981);
  transition: width .22s ease;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 104px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid #bfd4ff;
  border-radius: 999px;
  color: #1f55c8;
  background: #f4f8ff;
  font-size: 13px;
  font-weight: 700;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 5px rgba(47, 109, 246, .12);
}

.workspace {
  display: block;
  flex: 0 0 auto;
  padding: 0 0 10px;
}

.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

button {
  font: inherit;
  cursor: pointer;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 16px;
  font-weight: 800;
  transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}

.tool-btn svg { width: 20px; height: 20px; }
.tool-btn:hover { transform: translateY(-1px); border-color: #b9c7dd; box-shadow: 0 8px 20px rgba(15, 23, 42, .08); }
.tool-btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); box-shadow: 0 8px 20px rgba(47, 109, 246, .26); }
.tool-btn.danger { color: var(--red); border-color: #ffd0d9; background: #fff8fa; }
.tool-btn.muted { color: #f19aab; border-color: #ffdbe2; background: #fffafa; }
.tool-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.thread-quick-control {
  display: inline-grid;
  grid-template-columns: auto 28px 42px 28px;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 6px 0 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
}

.thread-quick-label {
  padding-right: 3px;
  font-size: 14px;
  font-weight: 800;
}

.thread-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #dbe3ef;
  border-radius: 6px;
  background: #f8fafc;
  color: #475569;
}

.thread-step:hover {
  border-color: #9eb8f8;
  background: #f2f6ff;
  color: var(--blue);
}

.thread-step svg { width: 15px; height: 15px; }

.thread-quick-input {
  width: 42px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  appearance: textfield;
}

.thread-quick-input::-webkit-inner-spin-button,
.thread-quick-input::-webkit-outer-spin-button { margin: 0; appearance: none; }

.thread-step:disabled,
.thread-quick-input:disabled {
  opacity: .5;
  cursor: not-allowed;
}

.notice {
  position: relative;
  min-height: 176px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
  font-size: 15px;
  line-height: 1.5;
}

.notice strong { color: #2457d6; }
.notice .warn { color: var(--amber); }

.settings {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 12px;
  margin: 0 126px 10px 0;
  color: #53637a;
}

.settings select {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font: inherit;
  padding: 0 10px;
}

.segmented {
  display: inline-flex;
  overflow: hidden;
  height: 32px;
  border: 1px solid #9db8ff;
  border-radius: 8px;
}

.segmented button {
  min-width: 76px;
  border: 0;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.segmented button.active {
  color: #fff;
  background: #2f6df6;
}

.open-api-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-weight: 850;
}

input[type="number"] {
  width: 74px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 18px 42px 24px;
}

.summary-grid div {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
}

.summary-grid strong {
  display: block;
  margin-top: 4px;
  font-size: 34px;
}

.detail-grid,
.audit-list {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 24px 32px 32px;
}

.detail-grid div,
.audit-list div {
  display: grid;
  gap: 10px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfdff;
}

.detail-grid svg { width: 28px; height: 28px; color: var(--green); }
.detail-grid strong,
.audit-list strong { font-size: 16px; }
.detail-grid span,
.audit-list span { color: var(--muted); line-height: 1.6; }

.table-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fff;
}

table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

th, td {
  padding: 10px 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  height: 42px;
  background: #f8fafc;
  color: #475569;
  font-size: 15px;
}

td { font-size: 14px; }

th:nth-child(1), td:nth-child(1) { width: 4.5%; text-align: center; color: #8aa0bd; }
th:nth-child(2), td:nth-child(2) { width: 19%; }
th:nth-child(3), td:nth-child(3) { width: 13%; }
th:nth-child(4), td:nth-child(4) { width: 20%; }
th:nth-child(5), td:nth-child(5) { width: 20%; }
th:nth-child(6), td:nth-child(6) { width: 23.5%; border-right: 0; }

tbody tr:nth-child(odd) { background: #eef5ff; }
tbody tr:nth-child(even) { background: #f3fffb; }
tbody tr.active { background: var(--blue-soft); }

.table-wrap tbody tr.active-row td {
  background: #edf4ff;
}

.table-wrap th.active-column,
.table-wrap td.active-column {
  background: #dce9ff;
  color: #1d4ed8;
}

.table-wrap tbody tr.active-row td.active-column {
  background: #c8dcff;
}

.result {
  color: var(--green);
  font-weight: 850;
}

.pending { color: #7990ad; font-weight: 750; }
.running { color: #1f55c8; font-weight: 850; }
.failed { color: var(--red); font-weight: 850; }

.status-reason-trigger {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: help;
}

.status-reason-trigger:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 3px;
}

.status-reason-tooltip {
  position: fixed;
  z-index: 3000;
  width: max-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 9px 12px;
  border-radius: 6px;
  background: #1f2937;
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.24);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
  pointer-events: none;
}

.failure-reason-text {
  margin: 0;
  color: #b42318;
  font-weight: 750;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.row-actions {
  display: flex;
  gap: 8px;
}

.empty-state {
  position: absolute;
  left: 0;
  right: 0;
  top: 148px;
  color: #94a3b8;
  font-size: 19px;
  font-weight: 700;
  text-align: center;
}

.table-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  padding: 0 20px;
  border-top: 1px solid var(--line);
  color: #64748b;
  background: #fbfdff;
  font-size: 14px;
  font-weight: 750;
}

.table-footer .legend:first-of-type {
  margin-left: auto;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.legend i {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #cbd5e1;
}

.running-dot i { background: #6597ff; }
.success-dot i { background: #74c993; }
.warning-dot i { background: #dfb249; }
.error-dot i { background: #df6978; }

.task-bottom-stats {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: wrap;
  gap: 8px 22px;
  min-height: 46px;
  margin-top: 8px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}

.task-bottom-stats strong {
  color: #1e293b;
  font-size: 16px;
}

.task-bottom-stats span:nth-child(2) strong { color: #2f8f5b; }
.task-bottom-stats span:nth-child(3) strong { color: #d13f54; }
.task-bottom-stats span:nth-child(4) strong { color: #2f6df6; }
.task-bottom-stats span:nth-child(5) strong { color: #64748b; }
.task-bottom-stats .elapsed { margin-left: auto; }

.settings-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  align-content: start;
  grid-template-columns: minmax(0, 1fr);
  padding: 24px;
  overflow: hidden;
}

.settings-layout.runtime-only {
  grid-template-columns: minmax(0, 920px);
  justify-content: center;
}

.settings-content {
  min-width: 0;
  width: 100%;
}

.settings-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.settings-action-row strong {
  display: block;
  color: #475569;
  font-size: 18px;
}

.settings-action-row span {
  display: block;
  margin-top: 3px;
  color: #94a3b8;
  font-size: 13px;
}

.setting-section {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.runtime-config-card {
  min-height: 278px;
  padding: 24px;
}

.section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.section-title-row span {
  color: #1e293b;
  font-size: 20px;
  font-weight: 900;
}

.section-title-row small {
  color: #94a3b8;
  font-size: 13px;
}

.setting-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 18px;
}

.setting-grid.one {
  grid-template-columns: 1fr;
}

.setting-grid label {
  display: grid;
  gap: 8px;
  color: #475569;
  font-size: 14px;
  font-weight: 800;
}

.setting-grid .check {
  display: flex;
  align-items: center;
  min-height: 42px;
}

.setting-grid input,
.setting-grid select,
.setting-grid textarea,
.key-row input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #1e293b;
  font: inherit;
  padding: 0 12px;
}

.setting-grid textarea {
  min-height: 92px;
  padding: 12px;
  resize: vertical;
}

.muted-copy {
  margin-top: 12px;
  color: #94a3b8;
  font-size: 13px;
}

.manual-layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(420px, 1fr) minmax(320px, .72fr);
  gap: 18px;
  padding: 24px 32px 32px;
  overflow: hidden;
}

.manual-layout > .setting-section {
  min-height: 0;
  overflow: hidden;
}

.manual-result {
  height: calc(100% - 58px);
  min-height: 180px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.7;
  overflow-y: auto;
}

.manual-result p {
  margin: 0 0 8px;
}

.manual-result .ok {
  color: #059669;
}

.manual-result .bad {
  color: #dc2626;
}

.manual-result .result {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid #cbd7ff;
  border-radius: 8px;
  background: #f4f7ff;
  color: #315fe7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.manual-result-placeholder { color: #64748b; }
.manual-result-actions { display: inline-flex; gap: 6px; }
.manual-result-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}
.manual-result-actions button:hover:not(:disabled) { border-color: #9db6fb; color: #315fe7; background: #f4f7ff; }
.manual-result-actions button:disabled { cursor: not-allowed; opacity: .45; }
.manual-result-actions button svg { width: 14px; height: 14px; }

.bound-page {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  padding: 12px 28px 18px;
  background: #f8fafc;
  overflow: hidden;
}

.bound-filter-card,
.bound-data-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.bound-filter-card {
  flex: 0 0 auto;
  padding: 9px 10px;
}

.bound-searchbar,
.bound-actions,
.bound-status-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.bound-searchbar label,
.bound-searchbar select {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
}

.bound-searchbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 210px;
  padding: 0 9px;
  color: #94a3b8;
}

.bound-searchbar input,
.bound-searchbar select {
  border: 0;
  outline: 0;
  color: #1f2937;
  font-size: 12px;
  font-weight: 700;
}

.bound-searchbar input {
  width: 100%;
}

.bound-searchbar select {
  width: 170px;
  padding: 0 12px;
  border: 1px solid var(--line);
}

.date-separator {
  color: #475569;
  font-weight: 900;
}

.bound-status-tabs {
  margin-top: 7px;
}

.bound-status-tabs button {
  height: 24px;
  padding: 0 12px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-weight: 900;
}

.bound-status-tabs button.active {
  border-color: #4169f5;
  background: #4169f5;
  color: #ffffff;
}

.bound-refresh-result {
  min-height: 0;
  margin-top: 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.bound-refresh-result:not(:empty) {
  margin-top: 10px;
}

.bound-refresh-result p {
  margin: 0;
  line-height: 1.55;
}

.bound-refresh-result .ok { color: #15803d; }
.bound-refresh-result .bad { color: #dc2626; }

.bound-data-card {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  margin-top: 10px;
  padding: 8px 10px;
  overflow: hidden;
}

.bound-actions {
  justify-content: space-between;
  margin-bottom: 6px;
}

.bound-counts {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.bound-counts strong {
  color: #111827;
  font-size: 12px;
}

.bound-actions .tool-btn {
  height: 28px;
  padding: 0 9px;
  border-radius: 6px;
  font-size: 12px;
}

.bound-actions .tool-btn i {
  width: 14px;
  height: 14px;
}

.bound-filter-card .mini-action {
  height: 30px;
  padding: 0 11px;
  font-size: 12px;
}

.bound-table {
  --bound-time-width: 172px;
  --bound-status-width: 80px;
  position: relative;
  flex: 1;
  min-height: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  overflow-x: auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
  background: #ffffff;
}

.bound-table table {
  width: max-content;
  min-width: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 60%;
}

.bound-table th {
  position: sticky;
  top: 0;
  z-index: 3;
  height: 26px;
  padding: 0 8px;
  background: #eef2f7;
  color: #334155;
  white-space: nowrap;
  text-align: left;
}

.bound-table td {
  height: 26px;
  padding: 0 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bound-table .col-time { width: 172px; }
.bound-table .col-status { width: 80px; }
.bound-table .col-index { width: 58px; }
.bound-table .col-account { width: 210px; }
.bound-table .col-password { width: 150px; }
.bound-table .col-api { width: 430px; }
.bound-table .col-phone { width: 130px; }
.bound-table .col-sms { width: 130px; }

.bound-table th.col-time,
.bound-table th.col-status,
.bound-table th.col-index,
.bound-table td.col-time,
.bound-table td.col-status,
.bound-table td.col-index {
  position: sticky;
}

.bound-table th.col-time,
.bound-table td.col-time {
  left: 0;
}

.bound-table th.col-status,
.bound-table td.col-status {
  left: var(--bound-time-width);
}

.bound-table th.col-index,
.bound-table td.col-index {
  left: calc(var(--bound-time-width) + var(--bound-status-width));
  box-shadow: 1px 0 0 #dde5f0;
}

.bound-table th.col-time,
.bound-table th.col-status,
.bound-table th.col-index {
  z-index: 6;
  background: #eef2f7;
}

.bound-table td.col-time,
.bound-table td.col-status,
.bound-table td.col-index {
  z-index: 4;
}

.bound-table tbody tr:nth-child(odd) td {
  background: #eef4ff;
}

.bound-table tbody tr:nth-child(even) td {
  background: #f1fffb;
}

.bound-table tbody tr.active-row td {
  background: #edf4ff;
}

.bound-table th.active-column,
.bound-table td.active-column {
  background: #dce9ff !important;
  color: #1d4ed8;
}

.bound-table tbody tr.active-row td.active-column {
  background: #c8dcff !important;
}

.bound-table td.col-status {
  text-align: center;
  font-weight: 900;
}

.bound-table th.col-status,
.bound-table th.col-index,
.bound-table th.col-time,
.bound-table td.col-time,
.bound-table td.col-index {
  text-align: center;
}

.bound-table td.col-time {
  overflow: visible;
  text-overflow: clip;
}

.bound-table td.col-status span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 9px;
}

.table-wrap th {
  position: relative;
}

.bound-table th { position: sticky; }

.table-wrap th,
.table-wrap td,
.bound-table th,
.bound-table td {
  min-width: 50px;
}

.column-resizer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 20;
  width: 8px;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.column-resizer::after {
  position: absolute;
  top: 20%;
  right: 3px;
  width: 2px;
  height: 60%;
  border-radius: 99px;
  background: transparent;
  content: "";
  transition: background .15s ease;
}

th:hover .column-resizer::after,
.column-resizer:focus-visible::after,
.column-resizer.resizing::after {
  background: #4169f5;
}

.bound-table::-webkit-scrollbar {
  width: 10px;
  height: 12px;
}

.bound-table::-webkit-scrollbar-track {
  background: #edf2f7;
  border-radius: 999px;
}

.bound-table::-webkit-scrollbar-thumb {
  background: #a8b4c7;
  border: 3px solid #edf2f7;
  border-radius: 999px;
}

.bound-table::-webkit-scrollbar-thumb:hover {
  background: #8796ad;
}

.bound-table td.col-status.result span {
  background: #dcfce7;
  color: #15803d;
}

.bound-table td.col-status.failed span {
  background: #fee2e2;
  color: #dc2626;
}

.bound-table td.col-status.pending span {
  background: #e0e7ff;
  color: #4f46e5;
}

.bound-table td.col-status.running span {
  background: #dbeafe;
  color: #2563eb;
}

.api-health-row {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: stretch;
  gap: 12px;
}

.api-health-row > div {
  display: grid;
  gap: 6px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.api-health-row span {
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.api-health-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 15px;
}

.api-health-row .mini-action {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.api-health-row svg {
  width: 16px;
  height: 16px;
}

#taskPanel .table-wrap td.result,
#taskPanel .table-wrap td.running,
#taskPanel .table-wrap td.failed,
#taskPanel .table-wrap td.pending {
  display: table-cell;
}

#taskPanel .table-wrap th:nth-child(1),
#taskPanel .table-wrap td:nth-child(1) { width: 4.5%; }
#taskPanel .table-wrap th:nth-child(2),
#taskPanel .table-wrap td:nth-child(2) { width: 17%; }
#taskPanel .table-wrap th:nth-child(3),
#taskPanel .table-wrap td:nth-child(3) { width: 12%; }
#taskPanel .table-wrap th:nth-child(4),
#taskPanel .table-wrap td:nth-child(4) { width: 21%; }
#taskPanel .table-wrap th:nth-child(5),
#taskPanel .table-wrap td:nth-child(5) { width: 10%; }
#taskPanel .table-wrap th:nth-child(6),
#taskPanel .table-wrap td:nth-child(6) { width: 15%; border-right: 1px solid var(--line); }
#taskPanel .table-wrap th:nth-child(7),
#taskPanel .table-wrap td:nth-child(7) { width: 20.5%; border-right: 0; }

#taskPanel .table-wrap th {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

#taskPanel .table-wrap td {
  height: 26px;
  padding: 0 8px;
  font-size: 11px;
}

.copy-result {
  overflow-wrap: anywhere;
  user-select: all;
}

.copy-link-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: #2563eb;
  font: inherit;
  font-weight: 800;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.copy-link-btn:hover {
  text-decoration: underline;
}

@media (max-width: 1180px) {
  .bound-table table {
    min-width: 0;
  }

  .bound-table .col-time { width: 158px; }
  .bound-table .col-status { width: 74px; }
  .bound-table .col-index { width: 54px; }
  .bound-table .col-account { width: 190px; }
  .bound-table .col-password { width: 140px; }
  .bound-table .col-api { width: 383px; }
  .bound-table .col-phone { width: 125px; }
  .bound-table .col-sms { width: 130px; }

  .bound-table {
    --bound-time-width: 158px;
    --bound-status-width: 74px;
  }

  .bound-table th,
  .bound-table td {
    padding-left: 10px;
    padding-right: 10px;
  }
}

.bound-pager {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
  padding: 8px 0 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 800;
}

.bound-pager span {
  margin-right: auto;
  color: #94a3b8;
}

.bound-pager button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: #94a3b8;
  font-weight: 900;
}

.tool-btn.success-soft {
  border-color: #54b47a;
  background: #55ad78;
  color: #ffffff;
}

.tool-btn.warning-soft {
  border-color: #e4a137;
  background: #e19a27;
  color: #ffffff;
}

.header-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.icon-btn svg { width: 16px; height: 16px; }

dialog {
  width: min(560px, calc(100vw - 32px));
  border: 0;
  border-radius: 18px;
  padding: 0;
  box-shadow: 0 30px 90px rgba(15, 23, 42, .28);
}

dialog::backdrop { background: rgba(15, 23, 42, .36); }

dialog[open].execute-confirm-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  margin: auto;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .26);
}

.execute-confirm-modal::backdrop {
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

.execute-confirm-modal .modal-body {
  order: 1;
  display: grid;
  place-items: center;
  padding: 28px 24px 12px;
}

.execute-confirm-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #eef3ff;
  color: var(--blue);
}

.execute-confirm-icon svg {
  width: 25px;
  height: 25px;
  fill: currentColor;
  stroke-width: 2.4;
}

.execute-confirm-modal .modal-head {
  order: 2;
  justify-content: center;
  padding: 0 24px 22px;
  border-bottom: 0;
}

.execute-confirm-modal .modal-head h2 {
  font-size: 22px;
  line-height: 1.2;
}

.execute-confirm-modal .modal-head .icon-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.execute-confirm-modal .modal-actions {
  order: 3;
  justify-content: center;
  padding: 18px 24px 22px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.execute-confirm-modal .modal-actions button {
  width: 112px;
  height: 42px;
}

dialog[open].advanced-permission-modal {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  margin: auto;
  overflow: hidden;
  border: 1px solid #dbe4f0;
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .28);
}

.advanced-permission-modal::backdrop {
  background: rgba(15, 23, 42, .45);
  backdrop-filter: blur(2px);
}

.advanced-permission-modal .modal-head {
  justify-content: center;
  padding: 20px 24px 4px;
  border-bottom: 0;
}

.advanced-permission-modal .modal-head h2 { font-size: 21px; }
.advanced-permission-modal .modal-head .icon-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  border: 0;
  background: transparent;
  color: #94a3b8;
}

.advanced-permission-modal .modal-body { padding: 16px 24px 22px; }
.permission-notice { display: grid; justify-items: center; gap: 12px; text-align: center; }
.permission-notice-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff5e8;
  color: #d97706;
}
.permission-notice-icon svg { width: 25px; height: 25px; }
.permission-notice p { margin: 0; color: #475569; font-size: 15px; font-weight: 750; }
.advanced-permission-modal .modal-actions {
  justify-content: center;
  padding: 15px 24px 20px;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}
.advanced-permission-modal .modal-actions button { width: 112px; height: 40px; }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px 20px; color: #475569; line-height: 1.75; }
.modal-body textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 20px 20px;
}

.modal-actions button {
  min-width: 86px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.modal-actions .confirm { color: #fff; background: var(--blue); border-color: var(--blue); }

dialog.import-modal {
  width: min(940px, calc(100vw - 44px));
  border-radius: 24px;
}

.import-modal .modal-head {
  padding: 34px 42px 28px;
}

.import-modal .modal-head h2 {
  font-size: 26px;
}

.import-modal .modal-body {
  padding: 32px 76px 44px;
}

.import-modal .modal-actions {
  padding: 26px 64px 34px;
  border-top: 1px solid var(--line);
}

.import-modal .modal-actions button {
  min-width: 98px;
  height: 52px;
  border-radius: 16px;
  font-size: 20px;
}

.import-modal .modal-actions .confirm {
  min-width: 170px;
  background: #5cad7b;
  border-color: #5cad7b;
}

.import-form {
  display: grid;
  grid-template-columns: 126px minmax(0, 1fr);
  gap: 22px 24px;
  align-items: center;
}

.import-form label {
  color: #475569;
  font-size: 20px;
  font-weight: 900;
  text-align: right;
}

.import-form label.required::before {
  content: "*";
  margin-right: 4px;
  color: #d34a3e;
}

.field-tags,
.import-form input,
.import-form textarea {
  width: 100%;
  border: 2px solid #dbe2ee;
  border-radius: 16px;
  background: #ffffff;
  color: #111827;
  font: inherit;
  font-size: 20px;
}

.field-stack {
  position: relative;
}

.field-tags {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 116px;
  padding: 14px 18px;
}

.field-tags span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 18px;
  border: 1px solid #b9c6ff;
  border-radius: 999px;
  background: #eef2ff;
  color: #4457e8;
  font-weight: 900;
}

.field-tags button {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #7d8df2;
  font: inherit;
  font-size: 22px;
  line-height: 1;
}

#importFieldInput {
  flex: 1 1 90px;
  min-width: 90px;
  height: 48px;
  padding: 0;
  border: 0;
  border-radius: 0;
  font-size: 18px;
  outline: 0;
}

.field-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.field-suggestions button {
  height: 30px;
  padding: 0 12px;
  border: 1px solid #dbe2ee;
  border-radius: 999px;
  background: #ffffff;
  color: #64748b;
  font-size: 13px;
  font-weight: 800;
}

.field-suggestions button:hover {
  border-color: #9db0ff;
  color: #4457e8;
}

.import-form input {
  height: 58px;
  padding: 0 24px;
}

.import-form textarea {
  min-height: 192px;
  padding: 22px 24px;
  resize: vertical;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: #111827;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .24);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}

.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .shell { width: 100%; height: 100%; padding: 0; }
  .panel, .admin-layout { min-height: 0; border-radius: 0; }
  .admin-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 92px minmax(0, 1fr);
    height: 100%;
  }
  .admin-sidebar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    height: 92px;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .sidebar-logo { padding: 0 13px; border-bottom: 0; }
  .sidebar-logo .apple-solid { width: 31px; height: 31px; }
  .sidebar-logo strong { display: none; }
  .admin-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; padding: 0; }
  .advanced-nav { position: relative; }
  .advanced-toggle .advanced-chevron { display: none; }
  .advanced-menu {
    position: fixed;
    top: 94px;
    right: 8px;
    left: 8px;
    z-index: 200;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .16);
  }
  .advanced-menu .feature-card { min-height: 40px; padding: 0; }
  .feature-card { justify-content: center; min-height: 48px; padding: 0; border-radius: 8px; }
  .feature-card span { display: none; }
  .feature-card svg { width: 20px; height: 20px; }
  .sidebar-footer { margin: 0; padding: 0 12px; border-top: 0; }
  .sidebar-binding-stats { display: none; }
  .session-card { display: none; }
  .sidebar-logout { width: 42px; height: 42px; padding: 0; }
  .sidebar-logout span { display: none; }
  .sidebar-logout svg { width: 20px; height: 20px; }
  .admin-main { height: 100%; min-height: 0; overflow: hidden; }
  .admin-panel, #taskPanel { height: calc(100% - 16px); min-height: 0; margin: 8px; }
  .advanced-page { padding: 8px; }
  .advanced-top { grid-template-columns: 1fr; gap: 8px; }
  .advanced-actions { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .advanced-btn { min-height: 34px; padding: 0; font-size: 0; }
  .advanced-btn span { display: none; }
  .advanced-btn svg { width: 17px; height: 17px; }
  .advanced-config { max-height: 82px; min-height: 0; padding: 9px 10px; gap: 6px; overflow: auto; font-size: 12px; }
  .advanced-config p { display: none; }
  .icloud-config { display: grid; grid-template-columns: 1fr; max-height: 106px; padding: 0; overflow: auto; }
  .icloud-plan { min-height: 0; padding: 9px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .icloud-info { display: none; }
  .country-toolbar { gap: 7px; min-height: 42px; padding: 5px 7px; font-size: 12px; }
  .country-toolbar select, .country-tool { height: 30px; font-size: 11px; }
  .country-top { margin-top: 8px; }
  .country-configs { grid-template-columns: 1fr; gap: 6px; }
  .country-configs .country-tax { display: none; }
  .advanced-table { margin-top: 8px; }
  .advanced-empty { font-size: 13px; }
  .topbar { min-height: 50px; padding: 10px 12px; gap: 8px; }
  .topbar h1 { font-size: 20px; }
  .topbar p { display: none; }
  .topbar .header-buttons { width: auto; flex-wrap: nowrap; gap: 5px; }
  .topbar .header-buttons .tool-btn { height: 34px; padding: 0 8px; }
  .topbar .header-buttons .tool-btn span { display: none; }
  .topbar, .workspace, .summary-grid { padding-left: 12px; padding-right: 12px; }
  .workspace { padding-bottom: 8px; }
  .toolbar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .tool-btn { height: 36px; padding: 0 8px; gap: 6px; font-size: 13px; }
  .tool-btn svg { width: 17px; height: 17px; }
  .toolbar .tool-btn, .thread-quick-control { width: 100%; }
  .thread-quick-control { height: 36px; justify-content: center; }
  #runBtn { grid-column: 1 / -1; }
  .task-filters { display: none; }
  .progress-box { display: none; }
  .table-wrap { border-radius: 8px; }
  .table-footer { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .table-footer .legend { display: none; }
  .task-bottom-stats { min-height: 36px; gap: 4px 10px; margin-top: 6px; padding: 6px 10px; font-size: 12px; }
  .task-bottom-stats strong { font-size: 13px; }
  .task-bottom-stats .elapsed { margin-left: 0; }
  .summary-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; padding-top: 12px; padding-bottom: 12px; }
  .summary-grid div { padding: 10px 8px; }
  .summary-grid span { overflow: hidden; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; }
  .summary-grid strong { font-size: 22px; }
  .detail-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 0 12px 12px; }
  .detail-grid div { align-items: center; gap: 6px; padding: 10px 6px; text-align: center; }
  .detail-grid svg { width: 20px; height: 20px; }
  .detail-grid strong { font-size: 13px; }
  .detail-grid span, .detail-grid .mini-action { display: none; }
  .recent-box { min-height: 0; margin: 0 12px 12px; padding: 12px; }
  .recent-box .mini-action { display: none; }
  .compact-list div { grid-template-columns: 1fr; padding: 8px; font-size: 12px; }
  .settings-layout { grid-template-columns: 1fr; padding: 8px; overflow: hidden; }
  .settings-action-row { align-items: center; margin-bottom: 8px; padding: 12px; }
  .settings-action-row span { display: none; }
  .settings-action-row strong { font-size: 16px; }
  .settings-action-row .tool-btn { width: auto; height: 34px; }
  .runtime-config-card { min-height: 0; padding: 14px; }
  .runtime-config-card .section-title-row { margin-bottom: 10px; padding-bottom: 8px; }
  .runtime-config-card .section-title-row span { font-size: 16px; }
  .runtime-config-card .section-title-row small { display: none; }
  .setting-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
  .setting-grid label { gap: 4px; font-size: 12px; }
  .setting-grid input { min-height: 32px; padding: 0 8px; font-size: 13px; }
  .setting-grid .check { grid-column: 1 / -1; min-height: 24px; font-size: 12px; }
  .manual-layout { grid-template-columns: 1fr; gap: 8px; padding: 8px; overflow: hidden; }
  .manual-layout > .setting-section { padding: 14px; }
  .manual-layout > .setting-section:first-child { flex: 0 0 auto; }
  .manual-layout > .setting-section:last-child { flex: 1; }
  .manual-result { height: calc(100% - 48px); min-height: 0; padding: 12px; font-size: 13px; }
  .bound-page { padding: 8px; overflow: hidden; }
  .bound-filter-card { padding: 10px; }
  .bound-searchbar { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; }
  .bound-searchbar label { width: auto; height: 34px; }
  .bound-searchbar label:nth-of-type(n+2), .bound-searchbar select, .date-separator { display: none; }
  .bound-searchbar .mini-action { height: 34px; padding: 0 10px; }
  .bound-status-tabs { gap: 6px; margin-top: 8px; }
  .bound-status-tabs button { height: 28px; padding: 0 10px; font-size: 12px; }
  .bound-data-card { min-height: 0; margin-top: 8px; padding: 8px; }
  .bound-actions { margin-bottom: 6px; }
  .bound-actions .header-buttons { display: flex; gap: 6px; }
  .bound-actions .tool-btn { height: 30px; padding: 0 8px; font-size: 12px; }
  .bound-actions .tool-btn span { display: none; }
  .bound-counts { gap: 4px 8px; font-size: 11px; }
  .bound-refresh-result:not(:empty) { max-height: 36px; margin-top: 6px; overflow: hidden; }
  .bound-table { min-height: 0; }
  .bound-pager { min-height: 32px; padding: 6px 0 0; font-size: 12px; }
  .bound-pager button { height: 30px; padding: 0 8px; }
}

@media (max-height: 820px) and (min-width: 861px) {
  .shell { padding: 10px 0; }
  .admin-layout, .admin-sidebar { min-height: 0; }
  #taskPanel { height: calc(100% - 32px); min-height: 0; margin: 16px; }
  .notice { min-height: 154px; font-size: 14px; line-height: 1.42; }
  .tool-btn { height: 38px; font-size: 15px; }
  .thread-quick-control { height: 38px; }
  .workspace { padding-bottom: 10px; }
  .empty-state { top: 122px; }
  .task-bottom-stats { min-height: 46px; margin-top: 10px; }
}

@media (max-width: 1260px) and (min-width: 861px) {
  .admin-layout { grid-template-columns: 224px minmax(0, 1fr); }
  .sidebar-logo { padding: 20px 16px; }
  .sidebar-logo strong { font-size: 19px; }
  .admin-nav { padding: 16px 10px; }
  .feature-card { min-height: 46px; padding: 0 12px; font-size: 15px; }
  .toolbar { gap: 7px; }
  .tool-btn { height: 40px; padding: 0 11px; font-size: 14px; }
  .thread-quick-control { height: 40px; }
  .task-bottom-stats { gap: 6px 14px; }
  .task-bottom-stats .elapsed { margin-left: 0; }
}

@media (max-width: 1100px) {
  #taskPanel th:nth-child(5),
  #taskPanel td:nth-child(5),
  #taskPanel th:nth-child(6),
  #taskPanel td:nth-child(6) { display: none; }
  #taskPanel .table-wrap th:nth-child(1),
  #taskPanel .table-wrap td:nth-child(1) { width: 7%; }
  #taskPanel .table-wrap th:nth-child(2),
  #taskPanel .table-wrap td:nth-child(2) { width: 22%; }
  #taskPanel .table-wrap th:nth-child(3),
  #taskPanel .table-wrap td:nth-child(3) { width: 16%; }
  #taskPanel .table-wrap th:nth-child(4),
  #taskPanel .table-wrap td:nth-child(4) { width: 25%; }
  #taskPanel .table-wrap th:nth-child(7),
  #taskPanel .table-wrap td:nth-child(7) { width: 30%; }
}

@media (max-width: 620px) {
  .topbar .header-buttons .tool-btn:first-child { display: none; }
  .bound-counts { display: none; }
  .task-bottom-stats span:nth-child(5) { display: none; }
  dialog[open].execute-confirm-modal { width: min(360px, calc(100vw - 24px)); }
}
