:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --border: #e5e7eb;
  --chip-bg: #eff6ff;
  --chip-text: #1e40af;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.app-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.app-header-text {
  min-width: 0;
  flex: 1;
}

.app-header h1 {
  margin: 0;
  font-size: 28px;
}

.app-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--panel);
  flex-shrink: 0;
}

.lang-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  cursor: pointer;
  font-family: inherit;
}

.lang-btn:hover {
  color: var(--text);
  background: var(--bg);
}

.lang-btn[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.lang-btn[aria-pressed="true"]:hover {
  background: var(--primary-hover);
  color: #fff;
}

.layout {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  min-height: 78vh;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}

label {
  font-weight: 600;
  margin-bottom: 8px;
}

textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  resize: vertical;
  min-height: 300px;
  line-height: 1.5;
}

.resume-textarea {
  min-height: 220px;
}

textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.2);
  border-color: var(--primary);
}

.analyze-btn {
  border: 0;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.analyze-btn:hover {
  background: var(--primary-hover);
}

.analyze-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.status-text {
  color: var(--muted);
  font-size: 13px;
}

.result-panel h2 {
  margin-top: 0;
}

.cards {
  display: grid;
  gap: 12px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.card h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 18px;
}

.card ul {
  margin: 0;
  padding-left: 18px;
}

.card li {
  margin-bottom: 6px;
}

.subtitle {
  margin-top: 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 999px;
}

.gap-title {
  margin-top: 10px;
  font-weight: 700;
}

.gap-item {
  background: var(--danger-bg);
  color: var(--danger-text);
  padding: 6px 8px;
  border-radius: 8px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 220px;
  }
}
