* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f0f4f8; color: #1f2937; line-height: 1.6;
}
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
.auth-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 50%, #3b82f6 100%);
}
.auth-card {
  background: #fff; border-radius: 20px; padding: 40px 44px; width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.auth-logo { font-size: 48px; text-align: center; }
.auth-card h1 { text-align: center; font-size: 26px; margin-top: 8px; }
.auth-sub { text-align: center; color: #6b7280; font-size: 15px; margin-bottom: 24px; }
.auth-tabs { display: flex; margin-bottom: 20px; background: #f3f4f6; border-radius: 10px; padding: 4px; }
.auth-tab { flex: 1; padding: 8px; border: none; background: none; cursor: pointer;
  border-radius: 8px; font-size: 17px; color: #6b7280; }
.auth-tab.active { background: #fff; color: #1d4ed8; font-weight: 600; box-shadow: 0 2px 6px rgba(0,0,0,.08); }
.auth-card label { display: block; font-size: 15px; color: #374151; margin: 12px 0 6px; }
.auth-card input {
  width: 100%; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px;
  font-size: 17px; outline: none;
}
.auth-card input:focus { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15); }
.auth-msg { margin-top: 14px; text-align: center; font-size: 16px; color: #dc2626; min-height: 20px; }
.auth-footer { text-align: center; margin-top: 14px; }
.link-btn { background: none; border: none; color: #6b7280; font-size: 15px; cursor: pointer; text-decoration: underline; }
.link-btn:hover { color: #1d4ed8; }

/* ---------- 主框架 ---------- */
.main-page { max-width: 860px; margin: 0 auto; padding: 16px 20px 60px; }
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 4px; margin-bottom: 16px;
}
.topbar-logo { font-size: 18px; font-weight: 700; color: #1d4ed8; }
.topbar-user { margin-left: 12px; color: #6b7280; font-size: 16px; }
.btn-ghost {
  background: none; border: 1px solid #d1d5db; color: #374151; padding: 8px 14px;
  border-radius: 8px; cursor: pointer; font-size: 16px;
}
.btn-ghost:hover { background: #f3f4f6; }

/* ---------- 步骤条 ---------- */
.steps {
  display: flex; justify-content: space-between; background: #fff;
  border-radius: 14px; padding: 14px 24px; margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
}
.step { display: flex; align-items: center; gap: 8px; color: #9ca3af; font-size: 16px; }
.step.active { color: #1d4ed8; font-weight: 600; }
.step.done { color: #059669; }
.step-num {
  width: 26px; height: 26px; border-radius: 50%; background: #e5e7eb; color: #6b7280;
  display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700;
}
.step.active .step-num { background: #1d4ed8; color: #fff; }
.step.done .step-num { background: #059669; color: #fff; }

/* ---------- 面板 ---------- */
.panel { background: #fff; border-radius: 16px; padding: 28px; box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.panel h2 { font-size: 20px; margin-bottom: 6px; }
.hint { color: #6b7280; font-size: 15px; margin-bottom: 18px; }
.card { margin-bottom: 22px; }
.card h3 { font-size: 17px; color: #374151; margin-bottom: 12px; }

/* 目的卡片 */
.purpose-cards { display: flex; gap: 12px; }
.purpose-card {
  flex: 1; border: 2px solid #e5e7eb; border-radius: 12px; padding: 16px; text-align: center;
  cursor: pointer; transition: all .15s;
}
.purpose-card:hover { border-color: #93c5fd; }
.purpose-card.selected { border-color: #1d4ed8; background: #eff6ff; }
.purpose-icon { font-size: 28px; }
.purpose-name { font-weight: 600; margin-top: 6px; }
.purpose-desc { font-size: 14px; color: #6b7280; }

/* 表单 */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid label, .item-field label { display: block; font-size: 15px; color: #374151; margin-bottom: 5px; }
.form-grid input, .form-grid select {
  width: 100%; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 16px; outline: none;
}
/* 自定义下拉框：隐藏系统的大箭头，换成统一风格的小箭头 */
.form-grid select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 32px;
  cursor: pointer;
}
.form-grid input:focus, .form-grid select:focus { border-color: #2563eb; }

/* 评估项表单 */
.item-field {
  border: 1px solid #e5e7eb; border-radius: 10px; padding: 14px; margin-bottom: 12px;
  background: #fafbfc;
}
.item-field-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 8px; }
.item-field-name { font-weight: 600; font-size: 16px; }
.item-field-tag { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #eef2ff; color: #4338ca; }
.item-field-tag.ds160-tag { background: #ecfdf5; color: #047857; }
.item-field-weight { color: #6b7280; font-size: 14px; }
.item-field textarea {
  width: 100%; min-height: 70px; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 16px; font-family: inherit; resize: vertical; outline: none;
}
.item-field textarea:focus { border-color: #2563eb; }
.item-skip { display: flex; align-items: center; gap: 6px; font-size: 15px; color: #6b7280; cursor: pointer; }
.item-skip input { accent-color: #1d4ed8; }

.btn-primary {
  background: #1d4ed8; color: #fff; border: none; padding: 12px 28px; border-radius: 10px;
  font-size: 17px; font-weight: 600; cursor: pointer; transition: background .15s;
}
.btn-primary:hover { background: #1e40af; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }
.btn-lg { padding: 14px 36px; font-size: 18px; }
.panel-actions { display: flex; gap: 12px; align-items: center; margin-top: 18px; flex-wrap: wrap; }

/* ---------- 步骤 2：评分结果 ---------- */
.score-hero {
  display: flex; align-items: center; gap: 24px; padding: 20px; border-radius: 12px;
  background: #f8fafc; margin-bottom: 18px;
}
.score-big { font-size: 52px; font-weight: 800; color: #1d4ed8; }
.score-label { color: #6b7280; font-size: 16px; }
.score-gauge { flex: 1; }
.score-gauge-bar { height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.score-gauge-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg,#f59e0b,#1d4ed8); }
.item-score-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid #f1f5f9;
}
.item-score-name { font-weight: 600; font-size: 16px; }
.item-score-val { font-size: 18px; font-weight: 700; color: #1d4ed8; }
.item-score-reason { font-size: 15px; color: #6b7280; margin-top: 4px; }
.score-group-title { font-size: 14px; font-weight: 600; color: #6b7280; margin: 4px 0 6px; }
.item-score-row.dim .item-score-name { color: #4b5563; }
.item-score-row.dim .item-score-val { color: #059669; font-size: 15px; }

/* ---------- 步骤 3：面签聊天 ---------- */
.chat-box {
  height: 380px; overflow-y: auto; background: #f8fafc; border-radius: 12px;
  padding: 16px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px;
}
.chat-msg { max-width: 78%; padding: 10px 14px; border-radius: 12px; font-size: 16px; white-space: pre-wrap; }
.chat-msg.ai { background: #fff; border: 1px solid #e5e7eb; align-self: flex-start; border-top-left-radius: 4px; }
.chat-msg.me { background: #1d4ed8; color: #fff; align-self: flex-end; border-top-right-radius: 4px; }
.chat-msg.sys { background: #fef3c7; color: #92400e; align-self: center; font-size: 15px; }
.chat-input-row { display: flex; gap: 10px; }
.chat-input-row input {
  flex: 1; padding: 12px 14px; border: 1px solid #d1d5db; border-radius: 10px; font-size: 17px; outline: none;
}
.chat-input-row input:focus { border-color: #2563eb; }

/* ---------- 步骤 4：最终报告 ---------- */
.final-hero { text-align: center; padding: 28px; border-radius: 14px; background: #f8fafc; margin-bottom: 20px; }
.final-score { font-size: 64px; font-weight: 800; color: #1d4ed8; }
.final-range { color: #6b7280; font-size: 16px; margin-top: 4px; }
.rating-badge { display: inline-block; padding: 6px 18px; border-radius: 20px; font-weight: 700; font-size: 16px; margin-top: 10px; }
.rating-high { background: #d1fae5; color: #065f46; }
.rating-medium { background: #fef3c7; color: #92400e; }
.rating-low { background: #fee2e2; color: #991b1b; }
.final-comment {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px;
  white-space: pre-wrap; font-size: 16px; line-height: 1.8;
}

/* ---------- 历史弹窗 ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex;
  align-items: center; justify-content: center; z-index: 50;
}
.modal-content { background: #fff; border-radius: 16px; width: 480px; max-height: 70vh; overflow-y: auto; padding: 20px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.history-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 8px;
}
.history-item:hover { background: #f8fafc; }
.history-item .btn-ghost { font-size: 15px; padding: 6px 12px; }
.btn-danger { color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fee2e2; }

.loading { color: #6b7280; font-size: 17px; padding: 20px 0; }
.error-text { color: #dc2626; }
