/* 心理测评平台 - 自定义样式 */
body { font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif; }

/* 中度等级徽章 (Bootstrap 无 orange) */
.bg-orange { background-color: #e67e22 !important; color: #fff; }

/* 登录页 */
.login-page {
  background: linear-gradient(135deg, #1a1b2e 0%, #2c3e66 60%, #0f172a 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-box { width: 400px; max-width: 100%; }

/* 答题选项胶囊 (自适应宽度: 默认10字, 同题统一最长选项宽度) */
.opt-pill {
  cursor: pointer;
  display: inline-block;
  min-width: 10em;
  border: 1px solid #ced4da;
  border-radius: 8px;
  padding: 8px 12px;
  transition: all .15s ease;
  user-select: none;
}
.opt-pill:hover { border-color: #059669; background: #f0fdf4; }
.opt-pill input { display: none; }
.opt-pill input:checked + span {
  color: #fff;
  background: #059669;
  display: block;
  margin: -8px -12px;
  padding: 8px 12px;
  border-radius: 8px;
}
.opt-pill span { display: block; }

/* 小统计框图标 */
.small-box .icon > i { font-size: 60px; }

/* 后台侧边栏: 底部固定 返回前台/退出登录 (AdminLTE .sidebar 非 flex, 需自行纵向布局) */
.sidebar { display: flex; flex-direction: column; }
.sidebar-footer { margin-top: auto; padding: 0.4rem 0 0.6rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-footer .nav-link { color: #c2c7d0; }
.sidebar-footer .nav-link:hover { background: rgba(255,255,255,.1); color: #fff; }

/* 界面主题切换色点 */
.theme-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(255,255,255,.3); cursor: pointer; padding: 0; transition: transform .15s; display: inline-flex; align-items: center; justify-content: center; }
.theme-dot i { color: #fff; font-size: 11px; }
.theme-dot:hover { transform: scale(1.2); border-color: #fff; }
.theme-dot.active { border-color: #fff; box-shadow: 0 0 0 2px #059669; }

/* 橙色描边按钮 (停止等) */
.btn-outline-orange { color: #fd7e14; border-color: #fd7e14; }
.btn-outline-orange:hover { background: #fd7e14; color: #fff; }

/* ============ 手机端布局 (前台, <768px) ============ */
.m-top-bar { background: linear-gradient(135deg,#1a1b2e,#2c3e66); color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.m-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1050; background: #fff; border-top: 1px solid #e5e7eb; display: flex; padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 8px rgba(0,0,0,.05); }
.m-bottom-nav a { flex: 1; text-align: center; padding: 9px 0 7px; color: #6b7280; font-size: 12px; text-decoration: none; }
.m-bottom-nav a.active { color: #059669; font-weight: 600; }
.m-bottom-nav i { display: block; font-size: 20px; margin-bottom: 2px; }

/* 测评记录卡片式列表 (整行可点击) */
.rec-row { display: block; padding: 12px 16px; border-bottom: 1px solid #f1f3f8; text-decoration: none; color: inherit; transition: background .15s; }
.rec-row:last-child { border-bottom: 0; }
.rec-row:hover { background: #f6f8fb; }
.rec-no { color: #c0c4cc; font-size: 12px; width: 30px; flex-shrink: 0; }
.rec-name { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rec-score { font-weight: 700; color: #059669; flex-shrink: 0; }
.rec-time { font-size: 12px; color: #9ca3af; margin-top: 4px; padding-left: 30px; }

/* 测评计划平铺列表 (整块无 hover, 量表行单独 hover) */
.plan-block { display: block; padding: 12px 16px; border-bottom: 1px solid #dfe3ea; color: inherit; }
.plan-block:last-child { border-bottom: 0; }
.plan-block .rec-name { color: #6c757d; font-weight: 600; }
.plan-block .plan-time-inline { white-space: nowrap; }
/* 测评计划量表行 (与测评记录同列表风格) */
.plan-scale-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 0 2px 30px; border-bottom: 1px solid #dfe3ea; }
.plan-scale-row:hover { background: #edf0f5; }
.plan-scale-row:last-child { border-bottom: 0; }
.psr-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.psr-meta { font-size: 12px; color: #9ca3af; margin-left: 6px; }
.btn-compact { padding: 1px 10px !important; font-size: 13px; min-height: 0 !important; line-height: 1.6; }
@media (max-width: 767.98px) {
  body { padding-bottom: 62px; }
  .main-sidebar { display: none !important; }
  .content-wrapper { margin-left: 0 !important; }
  .content-header { padding: 10px 8px 0; }
  .content-header h1 { font-size: 18px; }
  .main-footer { display: none; }
  .card { border-radius: 12px; }
  .btn { min-height: 40px; }

  /* 手机端: 答题页 (逐题模式) 自适应屏幕高度 — 答题区撑满到导航栏, 不留空 */
  body.oobo-page { height: 100vh; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 124px; }
  body.oobo-page .wrapper { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
  /* 内容区 flex 撑满剩余 (视口-顶栏-底部导航), 卡片必不被遮 */
  body.oobo-page .content-wrapper { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
  body.oobo-page .content-header { flex-shrink: 0; }
  body.oobo-page section.content { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  body.oobo-page section.content > .container-fluid { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
  body.oobo-page .card { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; margin-bottom: 0; }
  body.oobo-page .card-body { flex: 1 1 auto; overflow-y: auto; min-height: 0; display: flex; flex-direction: column; padding-bottom: 8px; }
  body.oobo-page .card-body > form { flex: 1; display: flex; flex-direction: column; min-height: 0; }
  /* 导航按钮固定悬浮在答题区底部 */
  body.oobo-page .q-block .mt-3 { margin-top: auto !important; position: static; background: transparent; padding-top: 8px; display: flex; gap: 10px; }
  /* 上一题/下一题按钮: 均分整行不折行 */
  body.oobo-page .q-block .mt-3 .btn { flex: 1 1 0; min-width: 0; padding-left: 0 !important; padding-right: 0 !important; font-size: 15px; white-space: nowrap; }
  /* 开始页内容垂直居中, 内容多时可内部滚动 */
  body.oobo-page #ooboStart { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; justify-content: center; }
  body.oobo-page .plan-block { border-bottom-color: #f1f3f8; }
  .plan-block .plan-time-inline { display: block; width: 100%; margin: 2px 0 4px; white-space: normal; font-size: 12px; }
  .plan-block .plan-scale-row { border-bottom-color: #f1f3f8; }
  .plan-block .plan-scale-row > div.d-flex { display: block !important; }
  .plan-block .psr-name { display: block; }
  .plan-block .psr-meta { display: block; margin-left: 0; margin-top: 2px; }
}
