* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    sans-serif;
  background: #fff;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
  height: 100vh;
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.page {
  height: 100vh;
  overflow: hidden;
}

.layout {
  display: flex;
  height: 100vh;
}

.sidebar {
  width: 300px;
  min-width: 300px;
  border-right: 1px solid #f0f0f0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: #fafafa;
}

.main-content {
  flex: 1;
  min-width: 0;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sidebar-header {
  margin-bottom: 22px;
}

.sidebar-header h1,
.main-header h2 {
  font-size: 22px;
  font-weight: 650;
  color: #1f1f1f;
  margin-bottom: 8px;
}

.sidebar-header p:last-child {
  font-size: 13px;
  line-height: 1.6;
  color: #777;
}

.eyebrow,
section h2 {
  font-size: 11px;
  font-weight: 600;
  color: #bbb;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}

section {
  margin-bottom: 20px;
}

.section-header,
.main-header,
.button-row {
  display: flex;
  align-items: center;
}

.section-header,
.main-header {
  justify-content: space-between;
  gap: 12px;
}

.main-header {
  flex: none;
  margin-bottom: 16px;
}

.button-row {
  gap: 8px;
}

.converter-form {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.mode-switch {
  border: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mode-switch legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mode-chip {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-chip:hover,
.mode-chip:has(input:checked) {
  border-color: #d0d0d0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.mode-chip:has(input:checked) {
  background: #f8fbff;
  border-color: #91caff;
}

.mode-chip input {
  margin-top: 2px;
}

.mode-chip-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mode-chip strong {
  font-size: 13px;
  color: #333;
}

.mode-chip small {
  font-size: 12px;
  line-height: 1.5;
  color: #888;
}

.file-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px dashed #d9d9d9;
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.file-field:hover,
.file-field:focus-within {
  border-color: #1890ff;
  background: #f8fbff;
}

.file-field input {
  width: 100%;
  font-size: 13px;
  color: #555;
}

.file-field-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.file-field-desc {
  font-size: 12px;
  line-height: 1.5;
  color: #888;
}

.selected-count {
  font-size: 12px;
  color: #999;
}

.selected-file-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.selected-file-item {
  padding: 8px 10px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
}

.selected-file-name {
  display: block;
  font-size: 13px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.selected-file-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #999;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: #333;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn:hover:not(:disabled) {
  background: #f5f5f5;
  border-color: #d0d0d0;
}

.btn-primary {
  background: #1890ff;
  color: #fff;
  border-color: #1890ff;
}

.btn-primary:hover:not(:disabled) {
  background: #40a9ff;
  border-color: #40a9ff;
}

.btn:disabled {
  background: #f5f5f5;
  color: #bbb;
  border-color: #e8e8e8;
  cursor: not-allowed;
}

.btn-primary:disabled {
  background: #ccc;
  color: #fff;
  border-color: #ccc;
}

.result-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.result-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.status-panel {
  flex: none;
  padding: 14px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
}

.status-panel[data-state="success"] {
  border-color: #b7eb8f;
  background: #f6ffed;
}

.status-panel[data-state="error"] {
  border-color: #ffccc7;
  background: #fff2f0;
}

.status-title {
  font-size: 15px;
  font-weight: 650;
  color: #333;
  margin-bottom: 6px;
}

.status-message {
  font-size: 13px;
  line-height: 1.6;
  color: #777;
}

.status-meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.status-meta div {
  min-width: 0;
}

.status-meta dt {
  font-size: 11px;
  color: #999;
  margin-bottom: 4px;
}

.status-meta dd {
  font-size: 13px;
  color: #333;
  word-break: break-all;
}

.converter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.converter-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid #e8e8e8;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  color: #555;
}

.converter-pill strong {
  color: #222;
  font-weight: 650;
}

.warning-box {
  flex: none;
  padding: 12px 14px;
  border: 1px solid #ffe58f;
  border-radius: 10px;
  background: #fffbe6;
}

.warning-title {
  font-size: 13px;
  font-weight: 650;
  color: #614700;
  margin-bottom: 6px;
}

.warning-list {
  margin-left: 18px;
  color: #614700;
  font-size: 12px;
  line-height: 1.7;
}

.preview-field {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.preview-field > span {
  font-size: 12px;
  color: #999;
}

.output-preview {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border: 1px solid #e8e8e8;
  border-radius: 10px;
  background: #fafafa;
  color: #333;
  font-family:
    ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
    monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre;
}

@media (max-width: 900px) {
  body {
    overflow: auto;
  }

  .page,
  .layout {
    height: auto;
    min-height: 100vh;
  }

  .layout {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid #f0f0f0;
  }

  .main-content {
    min-height: 620px;
  }

  .status-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
