:root {
  color-scheme: light;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  color: #17202a;
  background: #eef2f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(0, 121, 107, 0.12), transparent 34%),
    linear-gradient(225deg, rgba(43, 88, 118, 0.12), transparent 32%),
    #eef2f6;
}

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

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 440px) minmax(0, 1fr);
  min-height: calc(100vh - 56px);
  border: 1px solid #d5dde5;
  border-radius: 8px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 18px 48px rgba(23, 32, 42, 0.10);
}

.input-pane,
.preview-pane {
  padding: 24px;
}

.input-pane {
  border-right: 1px solid #e1e7ee;
  background: #fbfcfd;
}

.tool-header,
.preview-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 25px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
  line-height: 1.2;
}

p {
  margin-top: 7px;
  color: #5d6b78;
  font-size: 13px;
  line-height: 1.5;
}

.upload-area {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px dashed #98a8b8;
  border-radius: 8px;
  background: #f6f9fb;
  cursor: pointer;
}

.upload-area input {
  display: none;
}

.upload-title {
  color: #1d4d6f;
  font-size: 14px;
  font-weight: 700;
}

.upload-note,
.status-text {
  color: #62717f;
  font-size: 12px;
  line-height: 1.5;
}

.field {
  display: grid;
  gap: 8px;
}

.field label {
  font-size: 13px;
  font-weight: 700;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid #c9d3dc;
  border-radius: 7px;
  background: #ffffff;
  color: #17202a;
  font: 14px Arial, "Microsoft YaHei", sans-serif;
  outline: none;
}

textarea:focus,
input:focus,
select:focus {
  border-color: #00796b;
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.14);
}

textarea {
  min-height: 230px;
  resize: vertical;
  padding: 12px;
  font-family: Consolas, "Courier New", monospace;
  line-height: 1.5;
}

input,
select {
  height: 39px;
  padding: 0 10px;
}

.controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 39px;
  color: #27333f;
  font-size: 13px;
  font-weight: 700;
}

.toggle-row input {
  width: 16px;
  height: 16px;
  accent-color: #00796b;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr 88px;
  gap: 10px;
  margin-top: 18px;
}

button {
  height: 40px;
  border: 0;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-button {
  background: #00796b;
  color: #ffffff;
}

.dark-button {
  background: #17202a;
  color: #ffffff;
}

.light-button,
.ghost-button {
  background: #e8eef3;
  color: #17202a;
}

.ghost-button {
  width: 72px;
}

.status-text {
  min-height: 20px;
  margin-top: 12px;
}

.status-text.ok {
  color: #0f7b3f;
}

.status-text.error {
  color: #b42318;
}

#fileNameInput {
  max-width: 220px;
}

.table-wrap {
  height: calc(100vh - 176px);
  min-height: 420px;
  overflow: auto;
  border: 1px solid #d7e0e8;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: auto;
  background: #ffffff;
}

th,
td {
  max-width: 280px;
  min-width: 96px;
  padding: 10px 12px;
  border-right: 1px solid #e2e8ef;
  border-bottom: 1px solid #e2e8ef;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #17202a;
  font-size: 13px;
  text-align: left;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #edf7f4;
  font-weight: 800;
}

.empty-cell {
  height: 320px;
  color: #71808d;
  text-align: center;
  vertical-align: middle;
}

@media (max-width: 860px) {
  .app-shell {
    width: 100%;
    padding: 0;
  }

  .workspace {
    grid-template-columns: 1fr;
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .input-pane {
    border-right: 0;
    border-bottom: 1px solid #e1e7ee;
  }

  .controls,
  .actions {
    grid-template-columns: 1fr;
  }

  .preview-topbar,
  .tool-header {
    display: grid;
  }

  #fileNameInput {
    max-width: none;
  }

  .table-wrap {
    height: 430px;
    min-height: 430px;
  }
}
