/* ============================================================
   柔和暖色调 — 低压力友好界面
   ============================================================ */

:root {
  --primary: #7E9CB0;
  --primary-dark: #5E7D92;
  --primary-light: #E8F0F6;
  --accent: #C4908A;
  --bg: #F9F6F0;
  --card-bg: #FFFFFF;
  --text: #4A4540;
  --text-light: #8B8478;
  --border: #E5E0D8;
  --shadow: 0 2px 12px rgba(0,0,0,0.05);
  --radius: 12px;
  --success: #8DB88D;
  --warning: #D4B87A;
  --danger: #C4908A;
  --font: 'Segoe UI','微软雅黑','PingFang SC',sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font); background: var(--bg); color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
}

/* ========== 头部 ========== */
.app-header {
  background: linear-gradient(135deg, #7E9CB0 0%, #A3B8C8 100%);
  color: white; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.header-brand { font-size: 16px; font-weight: 500; letter-spacing: 0.5px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.header-user { font-size: 13px; opacity: 0.9; }
.header-progress { display: flex; align-items: center; gap: 10px; min-width: 260px; }
.progress-bar { flex: 1; height: 6px; background: rgba(255,255,255,0.3); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: white; border-radius: 3px; transition: width 0.4s ease; width: 0%; }
.progress-text { font-size: 12px; white-space: nowrap; opacity: 0.9; }

/* ========== 主内容区 ========== */
.app-main { flex: 1; max-width: 800px; width: 100%; margin: 0 auto; padding: 28px 20px 120px; }

/* ========== 导航按钮 (答题时内嵌) ========== */
.q-nav {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  margin-top: 28px; padding: 12px 0; gap: 16px;
}
.q-nav-btn {
  padding: 10px 22px; border: 2px solid var(--border);
  border-radius: 22px; font-size: 14px; cursor: pointer;
  transition: all 0.25s; font-family: var(--font);
  background: var(--card-bg); color: var(--text);
}
.q-nav-prev { justify-self: start; min-width: 110px; text-align: center; }
.q-nav-next { justify-self: end; min-width: 110px; text-align: center; }
.q-nav-btn:hover:not(:disabled) {
  border-color: var(--primary); color: var(--primary); background: var(--primary-light);
}
.q-nav-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.q-nav-center { display: flex; align-items: center; gap: 10px; justify-self: center; }
.q-nav-counter { font-size: 15px; color: #6B6560; font-weight: 500; white-space: nowrap; }
.q-nav-overview {
  min-width: auto !important; padding: 8px 14px !important;
  font-size: 16px !important; border-radius: 20px; border-color: #D8D0C4;
}
.q-nav-btn.primary-action {
  background: var(--primary); color: white; border-color: var(--primary); font-weight: 600;
}
.q-nav-btn.primary-action:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.q-nav-btn.submit-action {
  background: var(--success); color: white; border-color: var(--success); font-weight: 600;
}
.q-nav-btn.submit-action:hover { background: #6DA06D; border-color: #6DA06D; }

/* ========== 按钮基础 ========== */
.btn {
  padding: 10px 24px; border: none; border-radius: 25px; font-size: 14px;
  cursor: pointer; transition: all 0.2s; font-family: var(--font);
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: #E8E3DB; color: var(--text); }
.btn-secondary:hover { background: #D8D3CA; }
.btn-sm { padding: 6px 18px; font-size: 13px; border-radius: 20px; }
.btn-outline { background: transparent; border: 1px solid rgba(255,255,255,0.7); color: white; }
.btn-outline:hover { background: rgba(255,255,255,0.15); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ========== 登录页 ========== */
.login-container { max-width: 420px; margin: 40px auto; padding: 20px; }
.login-hero { text-align: center; margin-bottom: 32px; }
.login-hero h1 { font-size: 25px; color: #5E7D92; margin-bottom: 8px; font-weight: 500; letter-spacing: 1px; }
.login-subtitle { color: var(--text-light); font-size: 14px; line-height: 1.8; }
.login-tabs { display: flex; gap: 0; margin-bottom: 24px; border-radius: 28px; overflow: hidden; border: 2px solid var(--border); }
.login-tab { flex: 1; padding: 11px; border: none; background: white; cursor: pointer; font-size: 14px; font-family: var(--font); transition: all 0.2s; color: var(--text-light); }
.login-tab:hover { background: var(--primary-light); color: var(--primary); }
.login-tab.active { background: var(--primary); color: white; font-weight: 600; }
.login-form { background: var(--card-bg); padding: 28px; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-form .btn-full { margin-top: 8px; padding: 13px; font-size: 15px; border-radius: 25px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; color: #6B6560; }
.form-group input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 14px; font-family: var(--font);
  transition: border-color 0.2s; background: #FAFAF8;
}
.form-group input:focus { outline: none; border-color: var(--primary); background: white; }
.form-error { color: var(--danger); font-size: 13px; margin-bottom: 10px; padding: 8px 12px; background: #FDF4F4; border-radius: 8px; }

/* ========== 首页 ========== */
.landing-container { padding: 20px 0; }
.landing-hero {
  text-align: center; padding: 40px 24px; margin-bottom: 32px;
  background: linear-gradient(135deg, #E8F0F6 0%, #F0E8E4 100%);
  color: #4A4540; border-radius: 20px;
}
.landing-hero h1 { font-size: 26px; margin-bottom: 8px; font-weight: 500; color: #5E7D92; }
.landing-subtitle { opacity: 0.75; font-size: 15px; margin-bottom: 20px; }
.landing-auth { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.auth-greeting { font-size: 15px; color: #5E7D92; font-weight: 500; }
.auth-or { opacity: 0.6; font-size: 13px; }

.test-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.test-card {
  background: var(--card-bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.3s ease;
  border: 2px solid transparent;
}
.test-card:hover {
  transform: translateY(-4px); box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--primary);
}
.test-card-body { padding: 24px; }
.test-card-icon { font-size: 40px; margin-bottom: 12px; }
.test-card h3 { font-size: 18px; margin-bottom: 8px; color: var(--primary-dark); font-weight: 500; }
.test-card p { font-size: 13px; color: var(--text-light); line-height: 1.7; }
.test-card-meta { display: flex; gap: 16px; margin-top: 14px; font-size: 12px; color: var(--text-light); }
.test-card-loading { text-align: center; padding: 40px; color: var(--text-light); }
.landing-footer { text-align: center; margin-top: 40px; color: var(--text-light); font-size: 12px; }

/* ========== 导入页 ========== */
.intro-container { padding: 20px 0; }
.intro-header { text-align: center; margin-bottom: 30px; }
.intro-header h1 { font-size: 24px; color: var(--primary-dark); margin-bottom: 8px; font-weight: 500; }
.intro-subtitle { color: var(--text-light); font-size: 14px; }
.intro-card { background: var(--card-bg); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; box-shadow: var(--shadow); }
.intro-card h2 { font-size: 17px; margin-bottom: 12px; color: var(--primary-dark); font-weight: 500; }
.intro-card p { line-height: 1.9; font-size: 14px; color: #5A5550; }
.intro-point { display: flex; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.intro-point:last-child { border-bottom: none; }
.intro-icon { font-size: 28px; flex-shrink: 0; }
.intro-point strong { display: block; margin-bottom: 4px; font-size: 15px; color: var(--primary-dark); }
.intro-point p { font-size: 13px; color: #777; }
.tips-card { background: #F8F6F2; border: 1px solid #E5E0D8; }
.tips-card ul { padding-left: 20px; }
.tips-card li { margin: 6px 0; font-size: 13px; line-height: 1.6; }
.intro-quote { text-align: center; font-style: italic; color: var(--text-light); margin: 24px 0; font-size: 15px; }
.intro-start { text-align: center; margin-top: 24px; }
.intro-start p { margin-bottom: 16px; font-size: 14px; color: var(--text-light); }
.btn-start {
  padding: 14px 48px; background: var(--primary); color: white;
  border: none; border-radius: 30px; font-size: 17px; cursor: pointer;
  font-family: var(--font); transition: all 0.3s;
  box-shadow: 0 4px 14px rgba(126,156,176,0.3);
}
.btn-start:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(126,156,176,0.4); }

/* ========== 题目 ========== */
.question-container {
  padding: 10px 0;
  display: flex; flex-direction: column; align-items: center;
}
.question-card {
  width: 100%; max-width: 720px;
}
  background: #F0EDE8; padding: 12px 16px; border-radius: 10px;
  margin-bottom: 20px; font-size: 13px; color: #6B6560;
  font-weight: 500; text-align: center;
}
.question-card {
  background: #FDFBF7; border-radius: var(--radius);
  padding: 28px; margin-bottom: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.04);
  border: 1px solid #EDE8E0;
}
.question-card h3 { font-size: 15px; margin-bottom: 20px; line-height: 1.7; color: #4A4540; font-weight: 500; }
.question-number { color: var(--primary); font-weight: 600; margin-right: 8px; }
.question-type-tag {
  font-size: 11px; background: #EDE8E0; padding: 3px 10px;
  border-radius: 12px; color: #8B8478; margin-left: 6px;
}

/* Likert 量表 — 暖色版 */
.likert-options { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; }
.likert-item { flex: 1; text-align: center; }
.likert-item input[type="radio"] { display: none; }
.likert-item label {
  display: block; padding: 12px 4px; border: 2px solid #E5E0D8;
  border-radius: 12px; cursor: pointer; transition: all 0.2s;
  font-size: 13px; color: #8B8478; background: #FDFBF7;
}
.likert-item label:hover { border-color: #C4B8A8; background: #F5F1EA; color: #5A5040; }
.likert-item input[type="radio"]:checked + label {
  border-color: #A89880; background: #F0E8DB;
  color: #5A4530; font-weight: 600;
}
.likert-labels { display: flex; justify-content: space-between; font-size: 11px; color: #AAA090; margin-top: 8px; padding: 0 4px; }
.likert-labels span { text-align: center; flex: 1; }

/* 情景题选项 — 暖色版 */
.situational-options { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.situational-item input[type="radio"] { display: none; }
.situational-item label {
  display: flex; align-items: flex-start; gap: 14px; padding: 14px 18px;
  border: 2px solid #E5E0D8; border-radius: 12px; cursor: pointer;
  transition: all 0.2s; font-size: 14px; line-height: 1.7; background: #FDFBF7;
}
.situational-item label:hover { border-color: #C4B8A8; background: #F5F2EB; }
.situational-item input[type="radio"]:checked + label {
  border-color: #A89880; background: #F0E8DB;
}
.option-letter {
  width: 30px; height: 30px; background: #EDE8E0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px; flex-shrink: 0; color: #8B8478;
}
.situational-item input[type="radio"]:checked + label .option-letter {
  background: #A89880; color: white;
}

/* ========== 免责声明页 ========== */
.disclaimer-container { padding: 20px 0; }
.disclaimer-card { background: var(--card-bg); border-radius: var(--radius); padding: 28px; margin-bottom: 24px; box-shadow: var(--shadow); line-height: 2; font-size: 14px; color: #5A5550; }
.disclaimer-card h2 { font-size: 18px; color: var(--primary-dark); margin-bottom: 12px; }
.disclaimer-note { text-align: center; color: #C4908A; font-weight: 500; margin-top: 10px; }
.test-choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.test-choice-card {
  background: var(--card-bg); border-radius: var(--radius); padding: 28px; text-align: center;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.3s; border: 2px solid transparent;
}
.test-choice-card:hover { border-color: var(--primary); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,0.08); }
.test-choice-icon { font-size: 44px; margin-bottom: 12px; }
.test-choice-card h3 { font-size: 17px; color: var(--primary-dark); margin-bottom: 6px; }
.test-choice-card p { font-size: 13px; color: var(--text-light); }
.test-choice-features { font-size: 12px; color: var(--primary); margin-top: 8px; }

/* ========== 人口学页 ========== */
.demo-container { max-width: 560px; margin: 20px auto; }
.demo-container h2 { font-size: 18px; color: var(--primary-dark); text-align: center; margin-bottom: 8px; }
.demo-subtitle { text-align: center; color: var(--text-light); font-size: 13px; margin-bottom: 24px; }
.demo-form { background: var(--card-bg); border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow); }
.demo-options { display: flex; flex-wrap: wrap; gap: 10px; }
.demo-option { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; padding: 5px 10px; border-radius: 6px; }
.demo-option:hover { background: #F5F2ED; }
.demo-form select {
  width: 100%; padding: 10px 14px; border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: var(--font); background: #FAFAF8; appearance: auto;
}

/* ========== 结果页 ========== */
.result-container { padding: 20px 0; }
.result-header { text-align: center; margin-bottom: 20px; }
.result-header h1 { font-size: 22px; color: var(--primary-dark); }
.result-score-card { background: var(--card-bg); border-radius: var(--radius); padding: 32px; text-align: center; box-shadow: var(--shadow); margin-bottom: 20px; }
.score-circle { width: 110px; height: 110px; border-radius: 50%; border: 5px solid var(--primary); display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 0 auto 14px; }
.score-number { font-size: 34px; font-weight: 600; color: var(--primary-dark); }
.score-unit { font-size: 13px; color: var(--text-light); }
.score-type { display: inline-block; padding: 8px 24px; border-radius: 20px; font-weight: 600; font-size: 16px; margin: 10px 0; }
.rating-msg { font-size: 14px; color: #5A5550; line-height: 1.8; margin-top: 12px; }
/* 评级颜色 */
.type-伪人 { background: #F5E0E0; color: #8B4040; }
.type-非正常人 { background: #F0E6D8; color: #8B6A40; }
.type-正常人 { background: #DEE8F0; color: #4A6070; }
.type-优秀的正常人 { background: #D8E8DC; color: #4A6A50; }
.type-神 { background: #E0D8F0; color: #6A4A8B; }
.type-圣人 { background: #FFF0D8; color: #8B7010; }

/* 雷达图 */
.radar-wrapper { text-align: center; margin: 16px 0; }
.radar-wrapper canvas { max-width: 100%; height: auto; }
.dim-lvl { width: 36px; font-size: 11px; font-weight: 600; text-align: center; border-radius: 4px; padding: 2px 0; }
.lvl-极高 { background: #D8E8DC; color: #4A6A50; }
.lvl-高 { background: #DEE8F0; color: #4A6070; }
.lvl-中 { background: #F0EDE8; color: #6B6560; }
.lvl-低 { background: #F5E0E0; color: #8B4040; }

.result-interpretation { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.result-interpretation h3 { font-size: 15px; margin-bottom: 10px; color: var(--primary-dark); }
.result-interpretation p { font-size: 14px; line-height: 2; color: #5A5550; }
.result-dimensions { background: var(--card-bg); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 20px; }
.result-dimensions h3 { font-size: 15px; margin-bottom: 16px; color: var(--primary-dark); }
.dim-bar { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.dim-name { width: 95px; font-size: 12px; text-align: right; flex-shrink: 0; color: #6B6560; }
.dim-score { width: 38px; font-size: 13px; font-weight: 600; text-align: right; color: var(--primary-dark); }
.bar-track { flex: 1; height: 12px; background: #F0EDE8; border-radius: 6px; overflow: hidden; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #A3B8C8, #7E9CB0); border-radius: 6px; transition: width 0.8s ease; }
.result-footer { text-align: center; color: var(--text-light); font-size: 13px; line-height: 2; margin-top: 24px; padding: 16px; }
.result-thanks { margin-top: 10px; font-size: 14px; color: var(--primary-dark); }

/* ========== 手机端适配 ========== */
@media (max-width: 600px) {
  .app-main { padding: 8px 6px 140px; max-width: 100vw; }
  .app-header { padding: 6px 10px; }
  .header-brand { font-size: 13px; }
  .header-progress { min-width: 140px; }
  .progress-text { font-size: 10px; }

  /* 答题卡片居中 */
  .question-card { padding: 16px 12px; margin: 0 auto; max-width: 98vw; }
  .question-card h3 { font-size: 14px; margin-bottom: 14px; }

  /* Likert 量表 */
  .likert-options { gap: 3px; }
  .likert-item { flex: 0 0 18%; }
  .likert-item label { font-size: 10px; padding: 8px 1px; border-radius: 8px; }
  .likert-labels { font-size: 9px; }

  /* 情景题选项 */
  .situational-item label { padding: 10px 12px; font-size: 12px; }
  .option-letter { width: 26px; height: 26px; font-size: 12px; }

  /* 导航栏固定在底部 */
  .q-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 99;
    background: #FDFBF7; border-top: 1px solid #E5E0D8;
    padding: 6px 8px; margin: 0; gap: 4px;
    box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
  }
  .q-nav-btn { min-width: 50px; padding: 6px 10px; font-size: 11px; border-radius: 16px; }
  .q-nav-prev, .q-nav-next { min-width: 60px; }
  .q-nav-center { gap: 3px; }
  .q-nav-counter { font-size: 11px; }
  .q-nav-overview { padding: 4px 8px !important; font-size: 12px !important; }

  /* 总览面板 */
  .overlay-inner{width:96vw;max-width:96vw;max-height:75vh}
  .overlay-grid{grid-template-columns:repeat(auto-fill,38px);gap:4px;padding:8px 10px}
  .ov-item{width:38px;height:38px;font-size:11px;border-radius:6px}

  /* 首页 */
  .landing-hero { padding: 24px 14px; }
  .landing-hero h1 { font-size: 19px; }
  .test-grid { grid-template-columns: 1fr; }
  .login-container { margin: 12px auto; padding: 10px; }
  .login-hero h1 { font-size: 20px; }

  /* 结果页 */
  .score-circle { width: 90px; height: 90px; }
  .score-number { font-size: 28px; }
  .dim-name { width: 65px; font-size: 10px; }
  .dim-score { width: 30px; font-size: 11px; }
  .dim-lvl { width: 28px; font-size: 10px; }
  .radar-wrapper canvas { width: 100%; height: auto; }

  /* 免责页 */
  .disclaimer-card { padding: 16px; font-size: 13px; }
  .test-choice-grid { grid-template-columns: 1fr; }

  /* 弹出框 */
  .modal-box { margin: 8px; padding: 18px; max-width: 94vw; }
}

/* ========== 总览面板 ========== */
.overlay-panel{position:fixed;inset:0;background:rgba(0,0,0,0.4);z-index:300;display:flex;align-items:center;justify-content:center}
.overlay-inner{background:var(--card-bg);border-radius:16px;width:92vw;max-width:560px;max-height:80vh;display:flex;flex-direction:column;box-shadow:0 12px 40px rgba(0,0,0,0.15);overflow:hidden}
.overlay-header{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid var(--border);flex-shrink:0}
.overlay-header h3{font-size:16px;color:var(--primary-dark)}
.overlay-close{width:32px;height:32px;border-radius:50%;border:none;background:#F0EDE8;cursor:pointer;font-size:16px;color:#8B8478;display:flex;align-items:center;justify-content:center}
.overlay-close:hover{background:#E0D8CC;color:#5A5040}
.overlay-grid{overflow-y:auto;padding:14px 18px;display:grid;grid-template-columns:repeat(auto-fill,44px);gap:8px;justify-content:center}
.ov-item{width:44px;height:44px;border-radius:8px;cursor:pointer;transition:all .15s;border:2px solid #E5E0D8;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600;color:#8B8478;background:#FAFAF8}
.ov-item:hover{border-color:#A89880;transform:scale(1.08)}
.ov-done{background:#E0ECE0;border-color:#B0CCB0;color:#4A7040}
.ov-current{border-color:var(--primary)!important;background:var(--primary-light)!important;color:var(--primary-dark)!important}

/* ========== 历史记录 ========== */
.history-container { max-width: 620px; margin: 20px auto; }
.history-container h2 { font-size: 20px; color: var(--primary-dark); text-align: center; margin-bottom: 20px; }
.history-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; margin-bottom: 8px; background: var(--card-bg);
  border-radius: 12px; box-shadow: var(--shadow); transition: all 0.2s;
  border: 1px solid transparent;
}
.history-item:hover { border-color: var(--primary); }
.history-item-main { display: flex; justify-content: space-between; align-items: center; flex: 1; }
.history-del-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid #E5E0D8;
  background: #FAFAF8; cursor: pointer; font-size: 15px; transition: all 0.2s;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.history-del-btn:hover { background: #F5E0E0; border-color: #D0A0A0; }
.history-item-left { display: flex; flex-direction: column; }
.history-test { font-size: 14px; font-weight: 600; color: var(--text); }
.history-date { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.history-item-right { display: flex; align-items: center; gap: 10px; }
.history-score { font-size: 15px; font-weight: 600; color: var(--primary-dark); }
.history-rating { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 600; }
.history-label { font-size: 12px; color: var(--primary); cursor: pointer; margin: 0 12px; flex: 1; }
.history-label:hover { text-decoration: underline; }
