:root {
  --bg: #eef1f4;
  --card: #ffffff;
  --ink: #1a2332;
  --muted: #5c6b7a;
  --line: #d5dde5;
  --accent: #0b6e4f;
  --accent-hover: #095c42;
  --danger: #b42318;
  --ok: #027a48;
  --warn: #b54708;
  --radius: 12px;
  --font: "IBM Plex Sans", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "IBM Plex Mono", "SF Mono", Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, #d4e8df 0%, transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, #d9e4f0 0%, transparent 50%),
    var(--bg);
}

.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 20px 64px;
}

.page-wide {
  max-width: 960px;
}

.back-link {
  display: inline-block;
  margin-bottom: 0;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.logout-link {
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.logout-link:hover {
  color: var(--danger);
}

.page-login {
  max-width: 420px;
}

.login-card {
  padding: 22px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-btn {
  width: 100%;
  margin-top: 4px;
}

.login-error {
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: var(--danger);
  font-size: 13px;
}

.menu-section {
  margin-bottom: 28px;
}

.menu-title {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
}

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

.tool-card {
  display: block;
  padding: 18px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(11, 110, 79, 0.08);
  transform: translateY(-1px);
}

.tool-card-name {
  font-size: 16px;
  font-weight: 650;
  margin-bottom: 6px;
}

.tool-card-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

@media (max-width: 640px) {
  .tool-grid {
    grid-template-columns: 1fr;
  }
}

.header {
  margin-bottom: 28px;
}

.brand {
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 8px;
}

.header h1 {
  margin: 0 0 8px;
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.sub {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(26, 35, 50, 0.06);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--bg);
  border-radius: 10px;
}

.tab {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  color: var(--muted);
  cursor: pointer;
}

.tab.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.params {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.param-field,
.params label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 550;
}

.param-label {
  line-height: 1.3;
}

.params input,
.params .param-input,
.params select,
.params .param-select {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.params input:focus,
.params .param-input:focus,
.params select:focus,
.params .param-select:focus {
  outline: none;
  border-color: var(--brand, #1f7a4c);
  box-shadow: 0 0 0 3px rgba(31, 122, 76, 0.12);
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 8px;
  height: 8px;
  border-right: 2px solid #6b7c72;
  border-bottom: 2px solid #6b7c72;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.params select,
.params .param-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  background-image: none;
}

.param-field-select {
  max-width: 220px;
}

.column-picker {
  margin-top: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.column-picker .param-field-select {
  max-width: none;
}

.column-picker.hidden {
  display: none;
}

.field .label-row,
.log-panel .label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 550;
}

.hint {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 550;
}

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

input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 13px;
}

.dropzone {
  position: relative;
  border: 1.5px dashed #b7c4d0;
  border-radius: 12px;
  background: #f8fafb;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.dropzone:hover,
.dropzone:focus {
  border-color: var(--accent);
  background: #f3faf6;
  outline: none;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #e7f5ee;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.dropzone-sm {
  padding: 18px 16px;
}

.dropzone-input,
.dropzone-input-zip {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.dropzone-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
}

.dropzone-desc {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
}

.dropzone-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
  padding: 7px 14px;
  font-size: 13px;
}

.btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.file-summary {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 550;
  cursor: pointer;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn.success {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.log-panel {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.progress-wrap {
  margin-bottom: 12px;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}

.progress-pct {
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e4eaf0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b6e4f, #1a9b6f);
  transition: width 0.2s ease;
}

.progress-bar.indeterminate {
  width: 35% !important;
  animation: progress-pulse 1.2s ease-in-out infinite;
}

@keyframes progress-pulse {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e8edf2;
  color: var(--muted);
}

.pill.running {
  background: #e6f0ff;
  color: #175cd3;
}

.pill.done {
  background: #dcfae6;
  color: var(--ok);
}

.pill.failed,
.pill.cancelled {
  background: #fee4e2;
  color: var(--danger);
}

.log {
  margin: 0;
  min-height: 220px;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  background: #12181f;
  color: #d7e0ea;
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-all;
}

.footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.hidden {
  display: none !important;
}

@media (max-width: 600px) {
  .params {
    grid-template-columns: 1fr;
  }

  .header h1 {
    font-size: 24px;
  }
}
