/* AI Interview Questionnaire - Google Forms style sheet.
   Light theme only, by design: white cards on a light gray page. */

:root {
  --page-bg: #f1f3f4;
  --card: #ffffff;
  --border: #dadce0;
  --border-strong: #bdc1c6;
  --text: #202124;
  --text-muted: #5f6368;
  --accent: #1a73e8;
  --accent-soft: #e8f0fe;
  --required: #d93025;
  --radius: 8px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.page {
  max-width: 700px;
  margin: 0 auto;
  padding: 20px 14px 60px;
}

/* ------------------------------------------------------------------ cards */

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 12px;
}

.card-header {
  border-top: 10px solid var(--accent);
  padding-top: 24px;
}

.card-header h1 {
  margin: 0 0 4px;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.3;
}

.card-header .h1-en {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-muted);
  margin: 0 0 16px;
}

.card-header p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 14px;
}

.card-header .zh {
  color: var(--text);
}

.header-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.required-note {
  color: var(--required);
}

/* --------------------------------------------------------------- progress */

.progress-wrap {
  margin-bottom: 12px;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.progress-track {
  height: 6px;
  background: #dfe1e5;
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 3px;
}

/* -------------------------------------------------------------- section */

.section-title {
  border-left: 4px solid var(--accent);
}

.section-title h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 500;
}

.section-title .en {
  margin: 2px 0 0;
  font-size: 15px;
  color: var(--text-muted);
}

.section-note {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--accent-soft);
  border-radius: var(--radius);
  font-size: 14px;
}

.section-note .en {
  display: block;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ------------------------------------------------------------- questions */

.q .num {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.q .label-zh {
  font-size: 16px;
  line-height: 1.5;
}

.q .label-en {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 2px;
}

.q .star {
  color: var(--required);
  margin-left: 3px;
}

.q .hint {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.q .hint .en {
  display: block;
}

.q .answer {
  margin-top: 16px;
}

.card.q.invalid {
  border-color: var(--required);
}

.error-text {
  display: none;
  margin-top: 10px;
  color: var(--required);
  font-size: 13px;
}

.card.q.invalid .error-text {
  display: block;
}

/* ---------------------------------------------------------------- inputs */

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--border-strong);
  padding: 8px 2px;
  border-radius: 0;
}

input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 7px;
}

textarea {
  resize: vertical;
  min-height: 44px;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #9aa0a6;
}

/* Radio options - large, easy to click. */

.options {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 12px 12px 10px;
  border-radius: var(--radius);
  cursor: pointer;
}

.option:hover {
  background: #f8f9fa;
}

.option input[type="radio"] {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.option .opt-key {
  flex: none;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 16px;
}

.option .opt-zh {
  display: block;
}

.option .opt-en {
  display: block;
  font-size: 13.5px;
  color: var(--text-muted);
}

.option input[type="radio"]:checked ~ * .opt-zh,
.option input[type="radio"]:checked + .opt-key {
  color: var(--accent);
}

.follow-up {
  margin: 6px 0 0 42px;
  padding-top: 6px;
}

.follow-up label {
  display: block;
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* --------------------------------------------------------------- buttons */

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.nav .spacer {
  flex: 1;
}

.btn {
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 4px;
  border: 1px solid transparent;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  background: #1765cc;
}

.btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.btn-text {
  background: transparent;
  color: var(--accent);
  padding: 10px 14px;
}

.btn-text:hover:not(:disabled) {
  background: var(--accent-soft);
}

.btn-outline {
  background: transparent;
  color: var(--accent);
  border-color: var(--border);
}

.btn-outline:hover:not(:disabled) {
  background: var(--accent-soft);
}

/* ---------------------------------------------------------------- review */

.review-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.review-item:last-child {
  border-bottom: 0;
}

.review-item .rq {
  font-size: 14px;
  color: var(--text-muted);
}

.review-item .ra {
  margin-top: 4px;
  white-space: pre-wrap;
}

.review-item .ra.empty {
  color: #9aa0a6;
  font-style: italic;
}

.review-section-head {
  margin: 20px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
}

.review-section-head:first-child {
  margin-top: 0;
}

.notice {
  padding: 14px 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
  font-size: 14px;
}

.notice.error {
  background: #fce8e6;
  color: #a50e0e;
}

.notice .en {
  display: block;
  color: var(--text-muted);
  margin-top: 2px;
}

.notice.error .en {
  color: inherit;
  opacity: 0.85;
}

/* ------------------------------------------------------------------ done */

.done {
  text-align: center;
  padding: 48px 24px;
}

.done .check {
  width: 56px;
  height: 56px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 28px;
  line-height: 56px;
}

.done h2 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 500;
}

.done p {
  margin: 0 0 6px;
  color: var(--text-muted);
}

.done .zh {
  color: var(--text);
}

/* -------------------------------------------------------------- HR page */

.hr-page {
  max-width: 1100px;
}

.hr-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hr-bar h1 {
  flex: 1;
  margin: 0;
  font-size: 20px;
  font-weight: 500;
  min-width: 180px;
}

.hr-layout {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 12px;
  align-items: start;
}

.hr-list {
  padding: 8px;
  max-height: 78vh;
  overflow-y: auto;
}

.hr-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.hr-item:hover {
  background: #f8f9fa;
}

.hr-item[aria-current="true"] {
  background: var(--accent-soft);
}

.hr-item strong {
  display: block;
  font-size: 14px;
  font-weight: 500;
}

.hr-item small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}

.hr-detail {
  padding: 24px 28px;
  min-height: 300px;
}

.hr-detail h1 {
  margin: 0 0 2px;
  font-size: 22px;
  font-weight: 500;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 8px 0 20px;
  font-size: 13px;
  color: var(--text-muted);
}

.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 12px;
  background: #f1f3f4;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.tag.ok {
  background: #e6f4ea;
  color: #137333;
}
.tag.pending {
  background: #fef7e0;
  color: #8a6116;
}
.tag.failed {
  background: #fce8e6;
  color: #a50e0e;
}

/* A/B tendency tally */

.tendency {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 8px;
  background: #fafbfc;
}

.tendency-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
}

.tendency-head .tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: var(--accent-soft);
  color: var(--accent);
}

.axis {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 6px;
}

.axis-side {
  padding: 6px 10px;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.axis-side.win {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
}

.axis-side b {
  float: right;
  font-variant-numeric: tabular-nums;
}

.tendency-note {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Answer list */

.detail-head {
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
  margin: 28px 0 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.answer-section {
  margin: 22px 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.hr-detail .review-item .rq {
  font-weight: 500;
  color: var(--text);
}

.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

.spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 50px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.ring {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ring {
    animation: none;
  }
}

.footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  padding: 18px 8px 0;
}

/* ----------------------------------------------------------- responsive */

@media (max-width: 760px) {
  .page {
    padding: 12px 10px 48px;
  }
  .card {
    padding: 18px 16px;
  }
  .card-header h1 {
    font-size: 23px;
  }
  .card-header .h1-en {
    font-size: 17px;
  }
  .hr-layout {
    grid-template-columns: 1fr;
  }
  .hr-list {
    max-height: 240px;
  }
  .hr-detail {
    padding: 18px 16px;
  }
  .follow-up {
    margin-left: 10px;
  }
  .nav .btn {
    flex: 1;
    min-width: 120px;
  }
}

@media print {
  body {
    background: #fff;
  }
  .hr-bar,
  .hr-list,
  .btn,
  .footer-note {
    display: none !important;
  }
  .card {
    border: 0;
    padding: 0;
  }
  .hr-layout {
    display: block;
  }
}
