:root {
  color-scheme: light;
  --bg: #f4f7f5;
  --surface: #ffffff;
  --surface-soft: #eef5f2;
  --ink: #17221d;
  --muted: #66756e;
  --line: #d8e3dd;
  --accent: #127a62;
  --accent-dark: #0d604e;
  --accent-soft: #dff3ec;
  --warn: #b45309;
  --danger: #b42318;
  --shadow: 0 18px 45px rgba(24, 45, 38, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 8px 0 22px;
}

.topbar h1,
.section-heading h2,
.action-band h3,
.split-head h3 {
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(30px, 5vw, 50px);
  font-weight: 760;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(330px, 0.88fr) minmax(460px, 1.12fr);
  gap: 18px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.import-panel,
.result-panel {
  padding: 20px;
}

.section-heading,
.split-head,
.action-band,
.utility-row,
.button-row,
.progress-copy,
.mini-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  margin-bottom: 16px;
}

.section-heading h2 {
  font-size: 21px;
}

.drop-zone {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 26px;
  border: 1.5px dashed #a7bbb2;
  border-radius: 8px;
  background: linear-gradient(180deg, #f9fbfa 0%, #edf6f2 100%);
  color: var(--muted);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.drop-zone:hover,
.drop-zone.is-dragover {
  border-color: var(--accent);
  background: #e7f5ef;
  transform: translateY(-1px);
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.drop-zone strong {
  color: var(--ink);
  font-size: 18px;
}

.drop-zone span:last-child {
  max-width: 280px;
  line-height: 1.5;
}

.drop-icon {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.drop-icon svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.progress-wrap {
  margin-top: 16px;
  padding: 13px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.progress-copy {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 9px;
}

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

.progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.16s ease;
}

.file-list-wrap {
  margin-top: 18px;
}

.mini-heading {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.file-list {
  display: grid;
  gap: 7px;
  max-height: 236px;
  overflow: auto;
  padding: 0;
  margin: 0;
  list-style: none;
}

.file-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.file-list .file-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 650;
}

.file-list .file-meta,
.empty-row {
  color: var(--muted);
  font-size: 12px;
}

.file-list .empty-row {
  grid-template-columns: 1fr;
  justify-items: center;
  min-height: 62px;
  background: #f8faf9;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.stat {
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 13px;
}

.stat strong {
  display: block;
  font-size: clamp(22px, 3vw, 32px);
  line-height: 1;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.action-band,
.split-tool {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfc;
}

.action-band {
  min-height: 92px;
  padding: 16px;
  margin-bottom: 14px;
}

.action-band h3,
.split-head h3 {
  font-size: 18px;
}

.split-tool {
  padding: 16px;
}

.split-summary {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.number-field {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.number-field span {
  color: var(--muted);
  font-size: 13px;
}

.number-field input {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  border: 1px solid #b9c8c1;
  border-radius: 8px;
  color: var(--ink);
  outline: none;
}

.number-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(18, 122, 98, 0.14);
}

.button-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.primary-button,
.secondary-button,
.ghost-button {
  min-height: 40px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-button {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 9px 18px rgba(18, 122, 98, 0.18);
}

.secondary-button {
  background: #e7f1ed;
  color: var(--accent-dark);
}

.ghost-button {
  background: transparent;
  color: var(--accent-dark);
  border: 1px solid var(--line);
}

.primary-button:hover:not(:disabled),
.secondary-button:hover:not(:disabled),
.ghost-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  cursor: not-allowed;
  opacity: 1;
  box-shadow: none;
}

.primary-button:disabled,
.secondary-button:disabled,
.ghost-button:disabled {
  border: 1px solid var(--line);
  background: #f3f7f5;
  color: #9aa8a2;
}

.utility-row {
  align-items: center;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}

#messageLine {
  text-align: right;
  line-height: 1.45;
}

.status-pill.is-ready {
  border-color: rgba(18, 122, 98, 0.35);
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.status-pill.is-busy {
  border-color: rgba(180, 83, 9, 0.3);
  background: #fff4df;
  color: var(--warn);
}

.status-pill.is-error {
  border-color: rgba(180, 35, 24, 0.28);
  background: #ffe7e4;
  color: var(--danger);
}

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

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 22px, 1180px);
    padding-top: 18px;
  }

  .topbar,
  .section-heading,
  .action-band,
  .split-head,
  .utility-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-meta {
    justify-content: flex-start;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .drop-zone {
    min-height: 190px;
  }

  #messageLine,
  .split-summary {
    text-align: left;
  }
}
