:root {
  --bg: #f5f7fb;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #d1d5db;
  --accent: #0f766e;
  --accent-hover: #115e59;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  color: var(--text);
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.container {
  max-width: 1200px;
  margin: 24px auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.hint {
  margin: 0 0 16px;
  color: var(--muted);
}

textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
}

.controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  margin-top: 14px;
}

.controls label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

input[type="number"] {
  width: 120px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

button {
  height: 40px;
  padding: 0 16px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

#normalizeBtn {
  background: #0f4c81;
}

#normalizeBtn:hover {
  background: #0c3f6b;
}

button:hover {
  background: var(--accent-hover);
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.status-panel {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}

.llm-settings {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fbfcfe;
}

.llm-settings summary {
  cursor: pointer;
  color: var(--muted);
}

.llm-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.llm-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--muted);
}

.llm-grid input[type="text"],
.llm-grid input[type="password"] {
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
}

table {
  width: 100%;
  margin-top: 16px;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px;
  vertical-align: top;
}

th {
  background: #f3f4f6;
}

td a {
  color: #0369a1;
  text-decoration: none;
}

td a:hover {
  text-decoration: underline;
}

.status-downloaded {
  color: #15803d;
  font-weight: 600;
}

.status-failed,
.status-not_found {
  color: #b91c1c;
  font-weight: 600;
}

@media (max-width: 900px) {
  .container {
    margin: 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .controls {
    flex-wrap: wrap;
  }

  table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}
