:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --line: #d8dee6;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --risk-bg: #fff1f2;
  --risk: #be123c;
  --good-bg: #ecfdf5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.login-logo {
  width: 168px;
  height: auto;
  display: block;
  margin-bottom: 18px;
}

.login-card h1 {
  margin-bottom: 20px;
  font-size: 22px;
}

.login-status {
  min-height: 20px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.login-status.error {
  color: var(--risk);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 18px 24px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.brand-logo {
  width: 168px;
  height: auto;
  display: block;
  flex: 0 0 auto;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 17px;
}

h3 {
  margin-top: 18px;
  font-size: 14px;
}

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

.status {
  min-width: 180px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  font-size: 13px;
  text-align: center;
}

.mode-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
}

.mode-button {
  min-width: 128px;
}

.mode-button.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.interview-status {
  margin-left: auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 340px minmax(520px, 1fr) 320px;
  grid-template-rows: auto auto;
  gap: 16px;
  padding: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
}

.candidate-panel {
  grid-row: span 2;
}

.chat-panel {
  display: flex;
  flex-direction: column;
  min-height: 560px;
}

.report-panel {
  grid-column: 2 / 4;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

summary.panel-title {
  cursor: pointer;
  list-style: none;
}

summary.panel-title::-webkit-details-marker {
  display: none;
}

summary.panel-title span {
  color: var(--muted);
  font-size: 12px;
}

.eval-content {
  padding-top: 2px;
}

.actions {
  display: flex;
  gap: 8px;
}

.hidden {
  display: none !important;
}

label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  color: #374151;
  font-size: 13px;
}

.resume-upload {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
  color: #374151;
  font-size: 13px;
}

.resume-upload input[type="file"] {
  padding: 8px;
  background: #f9fafb;
}

.file-name,
.upload-status {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.upload-status.loading {
  color: #1d4ed8;
}

.upload-status.success {
  color: #047857;
}

.upload-status.error {
  color: var(--risk);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  font: inherit;
  line-height: 1.5;
  resize: vertical;
}

.inline-check {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.inline-check input {
  width: auto;
}

button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--text);
  padding: 9px 12px;
  font: inherit;
  cursor: pointer;
}

button:hover {
  border-color: var(--primary);
}

button.primary {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

button.primary:hover {
  background: var(--primary-dark);
}

.chat-log {
  height: 390px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #f9fafb;
}

.voice-notice {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #fde68a;
  border-radius: 6px;
  background: #fffbeb;
  line-height: 1.5;
}

.voice-notice p {
  margin-bottom: 10px;
}

.voice-controls {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
}

.voice-settings {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 120px;
  gap: 12px;
  align-items: end;
  margin-bottom: 8px;
}

.current-question {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  background: #f0f9ff;
}

.current-question span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.current-question strong {
  display: block;
  line-height: 1.55;
}

.dictation-hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.message {
  max-width: 92%;
  margin-bottom: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.interviewer {
  background: #eef6ff;
  border: 1px solid #c7ddf8;
}

.message::before {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.interviewer::before {
  content: "面试官";
}

.candidate {
  margin-left: auto;
  background: var(--good-bg);
  border: 1px solid #b7ead4;
}

.candidate::before {
  content: "候选人";
}

.message.current {
  outline: 2px solid var(--primary);
}

.answer-box {
  position: sticky;
  bottom: 0;
  margin-top: 12px;
  display: grid;
  gap: 10px;
  padding-top: 10px;
  background: var(--panel);
}

ul {
  min-height: 32px;
  margin: 8px 0 0;
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
  line-height: 1.45;
}

.risk-list li {
  color: var(--risk);
  background: var(--risk-bg);
  border: 1px solid #fecdd3;
  border-radius: 6px;
  padding: 8px;
  list-style-position: inside;
}

.score-box {
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f9fafb;
  line-height: 1.6;
}

#reportText {
  min-height: 420px;
  font-family: "Menlo", "Monaco", monospace;
}

.export-result {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

  .candidate-panel,
  .report-panel {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 760px) {
  .topbar,
  .mode-switch,
  .panel-title,
  .voice-settings {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .interview-status {
    margin-left: 0;
  }

  .brand-block {
    gap: 12px;
  }

  .brand-logo {
    width: 140px;
  }
}
