/* ============================================================
 * 员工职场成熟度测评系统 —— 主样式
 * 招商银行红主题 · 响应式（PC / H5）
 * ============================================================ */
:root {
  --cbru: #c7000b;
  --cbru-dark: #9e0009;
  --cbru-light: #e60012;
  --cbru-bg: #fff5f5;
  --ink: #1f2430;
  --ink-2: #4a5261;
  --ink-3: #8a93a3;
  --line: #e8ebf0;
  --bg: #f4f6f9;
  --card: #ffffff;
  --ok: #2e9e6b;
  --warn: #e8a13a;
  --danger: #d9534f;
  --info: #5b8ff9;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(31,36,48,.06);
  --shadow-lg: 0 8px 32px rgba(31,36,48,.12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cbru); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }

/* ---------- 布局 ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 232px; flex-shrink: 0; background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 20;
}
.sidebar .brand {
  height: 68px; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  border-bottom: 1px solid var(--line); color: var(--cbru); font-weight: 700; font-size: 16px;
}
.sidebar .brand .logo {
  width: 34px; height: 34px; border-radius: 9px; background: var(--cbru); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0;
}
.sidebar .brand small { display: block; font-size: 10px; color: var(--ink-3); font-weight: 400; }
.nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.nav-group { margin-bottom: 6px; }
.nav-title { font-size: 11px; color: var(--ink-3); padding: 12px 12px 6px; letter-spacing: .5px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 8px;
  color: var(--ink-2); cursor: pointer; font-size: 13.5px; margin-bottom: 2px; transition: .15s;
}
.nav-item:hover { background: var(--cbru-bg); color: var(--cbru); }
.nav-item.active { background: var(--cbru); color: #fff; box-shadow: 0 4px 12px rgba(199,0,11,.25); }
.nav-item .ico { width: 18px; text-align: center; font-size: 16px; }
.sidebar .side-foot { padding: 14px 18px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-3); }

.main { flex: 1; margin-left: 232px; min-width: 0; }
.topbar {
  height: 68px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 28px; position: sticky; top: 0; z-index: 15;
}
.topbar .tb-title { font-size: 17px; font-weight: 700; }
.topbar .tb-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--cbru-light), var(--cbru-dark));
  color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px;
}
.content { padding: 26px 28px 60px; max-width: 1400px; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; }
.card-title { font-size: 16px; font-weight: 700; margin: 0 0 16px; display: flex; align-items: center; gap: 8px; }
.card-title .bar { width: 4px; height: 16px; background: var(--cbru); border-radius: 2px; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.row { display: flex; gap: 16px; }
.col { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: none;
  padding: 9px 18px; border-radius: 8px; font-size: 13.5px; font-weight: 600; transition: .15s; white-space: nowrap;
}
.btn-primary { background: var(--cbru); color: #fff; }
.btn-primary:hover { background: var(--cbru-dark); }
.btn-ghost { background: #fff; color: var(--ink-2); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--cbru); color: var(--cbru); }
.btn-soft { background: var(--cbru-bg); color: var(--cbru); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 13px 30px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.tag-green { background: #e7f6ef; color: var(--ok); }
.tag-blue { background: #eaf1ff; color: var(--info); }
.tag-orange { background: #fdf1e0; color: #c8871f; }
.tag-red { background: #fdeaea; color: var(--danger); }
.tag-gray { background: #eef0f3; color: var(--ink-3); }

input.field, select.field, textarea.field {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--ink); outline: none; transition: .15s;
}
input.field:focus, select.field:focus, textarea.field:focus { border-color: var(--cbru); box-shadow: 0 0 0 3px rgba(199,0,11,.08); }
label.fl { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.form-row { margin-bottom: 16px; }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; padding: 11px 12px; background: #fafbfc; color: var(--ink-2); font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fcfcfd; }
.tbl .actions button { border: none; background: none; color: var(--cbru); font-size: 12px; padding: 3px 6px; }
.tbl .actions button.del { color: var(--danger); }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty .big { font-size: 42px; opacity: .4; margin-bottom: 10px; }

/* ---------- 统计卡片 ---------- */
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat-card .label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; }
.stat-card .value { font-size: 30px; font-weight: 800; line-height: 1; }
.stat-card .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }
.stat-card .icobg { position: absolute; right: -6px; top: -6px; width: 76px; height: 76px; border-radius: 50%; opacity: .07; }

/* ---------- 答题界面 ---------- */
.assess-wrap { max-width: 820px; margin: 0 auto; }
.assess-head { background: linear-gradient(135deg, var(--cbru), var(--cbru-dark)); color: #fff; border-radius: var(--radius); padding: 24px 28px; margin-bottom: 20px; }
.assess-head h1 { margin: 0 0 6px; font-size: 22px; }
.assess-head p { margin: 0; opacity: .85; font-size: 13px; }
.progress-outer { margin-top: 18px; }
.progress-label { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; opacity: .9; }
.progress-track { height: 7px; background: rgba(255,255,255,.25); border-radius: 10px; overflow: hidden; }
.progress-fill { height: 100%; background: #fff; border-radius: 10px; transition: width .3s; }

.section-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.section-tab { flex: 1; min-width: 150px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; font-size: 12.5px; cursor: pointer; transition: .15s; }
.section-tab .st-name { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.section-tab .st-num { color: var(--ink-3); font-size: 11px; }
.section-tab.active { border-color: var(--cbru); background: var(--cbru-bg); }
.section-tab.done { border-color: var(--ok); }
.section-tab.done .st-num { color: var(--ok); }

.question-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; margin-bottom: 16px; }
.q-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.q-num { background: var(--cbru-bg); color: var(--cbru); font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 6px; }
.q-dim { font-size: 11px; color: var(--ink-3); }
.q-text { font-size: 16px; font-weight: 600; line-height: 1.7; margin-bottom: 20px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 10px; cursor: pointer; transition: .15s; font-size: 14px; line-height: 1.6;
}
.option:hover { border-color: var(--cbru); background: #fffafa; }
.option.selected { border-color: var(--cbru); background: var(--cbru-bg); }
.opt-key {
  width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--ink-3);
}
.option.selected .opt-key { background: var(--cbru); border-color: var(--cbru); color: #fff; }

.assess-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; }
.q-jump { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.qjump-btn { width: 30px; height: 30px; border-radius: 6px; border: 1px solid var(--line); background: #fff; font-size: 11px; color: var(--ink-2); }
.qjump-btn.answered { background: var(--cbru); color: #fff; border-color: var(--cbru); }
.qjump-btn.current { outline: 2px solid var(--cbru); outline-offset: 1px; }

/* ---------- 登录 ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #7a0007 0%, var(--cbru) 45%, #e60012 100%); padding: 20px; }
.login-box { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); overflow: hidden; }
.login-head { padding: 30px 32px 20px; text-align: center; }
.login-head .lg-logo { width: 62px; height: 62px; border-radius: 16px; background: var(--cbru); color: #fff; font-size: 30px; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.login-head h1 { margin: 0; font-size: 20px; }
.login-head p { margin: 6px 0 0; color: var(--ink-3); font-size: 12.5px; }
.login-body { padding: 0 32px 30px; }
.demo-tip { background: var(--cbru-bg); border-radius: 8px; padding: 10px 12px; font-size: 11.5px; color: var(--ink-2); margin-top: 16px; line-height: 1.7; }

/* ---------- 首页/门户 ---------- */
.portal-hero { background: linear-gradient(120deg, #7a0007, var(--cbru) 50%, #e60012); color: #fff; border-radius: 16px; padding: 40px; margin-bottom: 22px; position: relative; overflow: hidden; }
.portal-hero h1 { font-size: 28px; margin: 0 0 10px; }
.portal-hero p { margin: 0 0 22px; opacity: .88; max-width: 620px; }
.portal-hero .deco { position: absolute; right: -30px; top: -40px; width: 260px; height: 260px; border: 40px solid rgba(255,255,255,.06); border-radius: 50%; }
.feature-card { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); text-align: center; transition: .2s; }
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card .fi { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 14px; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.feature-card h3 { margin: 0 0 8px; font-size: 15px; }
.feature-card p { margin: 0; color: var(--ink-3); font-size: 12.5px; }

/* ---------- 报告 ---------- */
.report-page { background: #fff; }
.report-cover { background: linear-gradient(135deg, #7a0007, var(--cbru) 50%, #e60012); color: #fff; border-radius: 14px; padding: 36px; text-align: center; margin-bottom: 22px; }
.report-cover h1 { margin: 0 0 8px; font-size: 26px; letter-spacing: 2px; }
.report-cover .sub { opacity: .85; font-size: 13px; }
.report-cover .meta { display: flex; justify-content: center; gap: 28px; margin-top: 22px; flex-wrap: wrap; font-size: 12.5px; opacity: .92; }

.score-hero { display: flex; align-items: center; gap: 24px; }
.score-ring { position: relative; width: 130px; height: 130px; flex-shrink: 0; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .score-val { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-ring .score-val b { font-size: 32px; line-height: 1; }
.score-ring .score-val span { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.level-badge { display: inline-block; padding: 6px 18px; border-radius: 24px; color: #fff; font-weight: 700; font-size: 15px; }

.bar-row { margin-bottom: 14px; }
.bar-label { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 6px; }
.bar-track { height: 9px; background: #eef0f3; border-radius: 8px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 8px; transition: width .6s; }
.dim-item { margin-bottom: 16px; }
.dim-item .dh { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; font-weight: 600; }

.risk-item { display: flex; align-items: center; gap: 14px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.risk-item:last-child { border-bottom: none; }
.risk-name { width: 90px; font-weight: 600; font-size: 13px; flex-shrink: 0; }
.risk-dots { display: flex; gap: 5px; flex: 1; }
.rdot { width: 22px; height: 8px; border-radius: 4px; background: #e8ebf0; }
.rdot.on { background: var(--cbru); }
.risk-lv { width: 60px; text-align: right; font-size: 12px; font-weight: 600; }

.insight { background: #fafbfc; border-left: 3px solid var(--cbru); padding: 12px 16px; border-radius: 0 8px 8px 0; font-size: 13px; color: var(--ink-2); margin-top: 12px; line-height: 1.75; }

/* 雷达图容器 */
.radar-wrap { display: flex; align-items: center; justify-content: center; min-height: 240px; }

/* ---------- 模态框 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,24,32,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 22px; color: var(--ink-3); line-height: 1; }
.modal-body { padding: 22px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-80px); background: var(--ink); color: #fff; padding: 11px 22px; border-radius: 8px; font-size: 13px; z-index: 200; opacity: 0; transition: .3s; box-shadow: var(--shadow-lg); }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.ok { background: var(--ok); }
.toast.err { background: var(--danger); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tab { padding: 10px 18px; cursor: pointer; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tab.active { color: var(--cbru); border-bottom-color: var(--cbru); font-weight: 700; }

.qr-box { text-align: center; padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.qr-box svg { max-width: 100%; height: auto; }
.link-box { display: flex; gap: 8px; margin-top: 12px; }
.link-box input { flex: 1; font-size: 12px; }

/* ---------- H5 优化 ---------- */
body.h5 { background: #f4f6f9; }
body.h5 .assess-wrap { max-width: 100%; }
body.h5 .assess-head { border-radius: 0; padding: 20px 18px; }
body.h5 .assess-head h1 { font-size: 19px; }
body.h5 .question-card { border-radius: 12px; padding: 20px 16px; margin-bottom: 12px; }
body.h5 .q-text { font-size: 15px; }
body.h5 .option { padding: 12px; font-size: 13.5px; }
body.h5 .section-tab { min-width: 110px; }
body.h5 .report-cover { padding: 28px 18px; }
body.h5 .report-cover h1 { font-size: 21px; }
body.h5 .grid-2, body.h5 .grid-3, body.h5 .grid-4 { grid-template-columns: 1fr; }
body.h5 .content { padding: 16px 14px 50px; }
body.h5 .topbar { padding: 0 16px; }

@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .menu-toggle { display: inline-flex !important; }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .row { flex-direction: column; }
  .score-hero { flex-direction: column; text-align: center; }
}
.menu-toggle { display: none; background: none; border: none; font-size: 20px; margin-right: 10px; }

/* 打印 */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .card { box-shadow: none; border: 1px solid #ddd; break-inside: avoid; }
  body { background: #fff; }
}
