/* 鹿城支行 · 线上考核管理系统（演示版）样式
   深海军蓝 + 琥珀金 · 现代商务风 · 全中文 */

:root {
  --navy-dark: #0b3a24;
  --navy: #00843d;
  --navy-2: #00a34e;
  --gold: #d9a441;
  --gold-lt: #f0e2c4;
  --ink: #222831;
  --gray: #6b7280;
  --line: #dfe9e2;
  --bg: #f4f8f5;
  --white: #ffffff;
  --red: #c0392b;
  --green: #1e8e5a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(20,38,58,.08), 0 4px 14px rgba(20,38,58,.06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px; color: var(--ink); background: var(--bg);
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border: none; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; line-height: 1;
  transition: all .15s;
}
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-2); }
.btn-gold { background: var(--gold); color: #3a2c0e; }
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost { background: transparent; color: var(--gray); border: 1px solid var(--line); }
.btn-ghost:hover { color: var(--navy); border-color: var(--navy); }
.btn-danger { background: #fdf0ee; color: var(--red); border: 1px solid #f2c9c4; }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 12px; font-size: 12.5px; border-radius: 6px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--navy-dark) 0%, var(--navy) 60%, #00a34e 100%);
  position: relative; overflow: hidden;
}
.login-wrap::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.09) 1px, transparent 1px);
  background-size: 26px 26px; opacity: .5;
}
.login-card {
  position: relative; width: 400px; background: #fff; border-radius: 14px;
  box-shadow: 0 18px 50px rgba(0,0,0,.35); padding: 36px 36px 28px;
}
.login-brand { display: flex; gap: 14px; align-items: center; margin-bottom: 26px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 12px; background: var(--gold);
  color: var(--navy-dark); font-size: 26px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.brand-mark.small { width: 34px; height: 34px; font-size: 18px; border-radius: 9px; }
.brand-name { font-size: 17px; font-weight: 700; color: var(--navy-dark); }
.brand-sub { font-size: 11.5px; color: var(--gray); margin-top: 3px; }
.login-card h2 { font-size: 18px; color: var(--navy-dark); margin-bottom: 6px; }
.login-tip { font-size: 12px; color: var(--gray); margin: 8px 0 14px; line-height: 1.6; }
.login-card input {
  width: 100%; padding: 11px 13px; margin-bottom: 12px;
  border: 1px solid var(--line); border-radius: var(--radius); outline: none;
}
.login-card input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(28,58,94,.12); }
.login-error {
  background: #fdf0ee; color: var(--red); font-size: 12.5px;
  padding: 8px 12px; border-radius: 6px; margin-bottom: 12px;
}
.login-sec { position: relative; color: rgba(255,255,255,.55); font-size: 12px; margin-top: 18px; text-align: center; }

/* ---------- 主界面骨架 ---------- */
#appView { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 228px; flex: none; background: var(--navy-dark); color: #fff;
  display: flex; flex-direction: column;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.side-brand-name { font-size: 13.5px; font-weight: 700; color: #e8edf3; }
.nav { flex: 1; padding: 12px 10px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 11px 14px; margin-bottom: 4px; border: none; border-radius: 8px;
  background: transparent; color: #c3cedb; font-size: 14px; text-align: left;
  transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--gold); color: var(--navy-dark); font-weight: 700; }
.nav-ico { width: 18px; text-align: center; font-size: 15px; }
.side-user { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); }
.side-user-name { font-size: 14px; font-weight: 700; color: #fff; }
.side-user-role { font-size: 12px; color: #9fb0c4; margin: 3px 0 10px; }

.main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: 56px; flex: none; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 26px;
}
.topbar-title { font-size: 17px; font-weight: 700; color: var(--navy-dark); }
.topbar-right { display: flex; gap: 18px; align-items: center; font-size: 12.5px; color: var(--gray); }
.content { flex: 1; overflow-y: auto; padding: 24px 26px 40px; }

/* ---------- 通用组件 ---------- */
.card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 18px;
}
.card-title { font-size: 15px; font-weight: 700; color: var(--navy-dark); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.card-title .lt { display: flex; align-items: center; gap: 8px; }
.card-title .lt::before { content: ""; width: 4px; height: 16px; background: var(--gold); border-radius: 2px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; color: var(--navy-dark); }
.page-head .sub { color: var(--gray); font-size: 13px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 10px; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th {
  text-align: left; background: var(--navy); color: #fff; font-weight: 600;
  padding: 10px 12px; white-space: nowrap;
}
td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:nth-child(even) td { background: #f8fafc; }
tr:hover td { background: #eef3f8; }
.tbl-wrap { overflow-x: auto; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-red { background: #fdecea; color: var(--red); }
.badge-black { background: #eef0f3; color: #4b5563; }
.badge-gold { background: #faf3e0; color: #8a6d1f; }
.badge-green { background: #e6f4ec; color: var(--green); }
.badge-blue { background: #e4f1ea; color: var(--navy); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: 1fr 1fr; } }

.kpi { display: flex; align-items: center; gap: 14px; }
.kpi .ico {
  width: 46px; height: 46px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.kpi .num { font-size: 24px; font-weight: 800; color: var(--navy-dark); line-height: 1.1; }
.kpi .lab { font-size: 12.5px; color: var(--gray); margin-top: 3px; }
.kpi .num .unit { font-size: 13px; color: var(--gray); font-weight: 500; }

.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13px; color: var(--gray); margin-bottom: 6px; font-weight: 600; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 6px; outline: none; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus {
  border-color: var(--navy); box-shadow: 0 0 0 3px rgba(28,58,94,.1);
}
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }

/* 红黑榜 */
.rank-list { display: flex; flex-direction: column; gap: 10px; }
.rank-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.rank-no { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; flex: none; }
.rank-no.r1 { background: var(--gold); color: #3a2c0e; }
.rank-no.r2 { background: #dfe4ea; color: #4b5563; }
.rank-no.r3 { background: #d9b48a; color: #6b4423; }
.rank-no.rn { background: #eef0f3; color: #8a8f98; }
.rank-no.red { background: #fdecea; color: var(--red); }
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-weight: 700; color: var(--navy-dark); }
.rank-org { font-size: 12px; color: var(--gray); }
.rank-score { font-size: 18px; font-weight: 800; color: var(--navy); }
.rank-bar-wrap { width: 120px; height: 8px; background: #eef0f3; border-radius: 4px; overflow: hidden; }
.rank-bar { height: 100%; background: var(--gold); border-radius: 4px; }

/* 组织架构树 */
.org-tree { display: flex; flex-direction: column; gap: 8px; }
.org-node { border: 1px solid var(--line); border-radius: 8px; background: #fff; overflow: hidden; }
.org-node-head {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer;
  font-weight: 700; color: var(--navy-dark);
}
.org-node-head .arrow { transition: transform .15s; font-size: 12px; color: var(--gray); }
.org-node-head.open .arrow { transform: rotate(90deg); }
.org-node-head .org-type { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: #eef0f3; color: var(--gray); font-weight: 600; }
.org-node-body { display: none; border-top: 1px solid var(--line); padding: 10px 14px; background: #fafbfc; }
.org-node-head.open + .org-node-body { display: block; }
.org-members { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.org-person {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
}
.org-person .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--navy); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.org-person .pn { font-weight: 700; font-size: 13px; }
.org-person .pr { font-size: 11.5px; color: var(--gray); }

/* 看板柱状图 */
.bars { display: flex; align-items: flex-end; gap: 14px; height: 220px; padding: 10px 6px 0; border-bottom: 2px solid var(--line); }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 6px; }
.bar-val { font-size: 12px; font-weight: 700; color: var(--navy); }
.bar-body { width: 60%; max-width: 46px; background: linear-gradient(180deg, var(--navy-2), var(--navy)); border-radius: 4px 4px 0 0; min-height: 4px; transition: height .4s; }
.bar-col.gold .bar-body { background: linear-gradient(180deg, #e8bc6a, var(--gold)); }
.bar-lab { font-size: 12px; color: var(--gray); white-space: nowrap; }

/* 任务卡片 */
.task-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; background: #fff; }
.task-title { font-weight: 700; color: var(--navy-dark); font-size: 14.5px; }
.task-meta { font-size: 12px; color: var(--gray); margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; }
.task-actions { margin-top: 10px; display: flex; gap: 8px; }
.task-overdue { border-left: 4px solid var(--red); }

/* 文件上传 */
.upload-zone {
  border: 2px dashed #c3cedb; border-radius: 10px; padding: 34px; text-align: center;
  color: var(--gray); cursor: pointer; transition: all .15s; background: #fafbfc;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--gold); background: #fdf9ee; }
.upload-zone .big { font-size: 26px; margin-bottom: 8px; }

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

/* Toast */
#toastRoot { position: fixed; top: 18px; right: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy-dark); color: #fff; padding: 11px 18px; border-radius: 8px;
  font-size: 13.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); animation: slideIn .25s ease;
  max-width: 380px;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }

.empty { text-align: center; color: var(--gray); padding: 40px 0; font-size: 13.5px; }
.mono { font-family: Menlo, Consolas, monospace; font-size: 12.5px; }
.log-line { font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed #eef0f3; color: #444; }
.log-line .t { color: var(--gray); margin-right: 8px; }
.log-line .a { color: var(--navy); font-weight: 600; }
.tip-box {
  background: #f4faf7; border: 1px solid #d0e6da; border-left: 4px solid var(--navy);
  padding: 12px 14px; border-radius: 6px; font-size: 13px; color: #44506a; line-height: 1.7;
}
.warn-box {
  background: #fdf9ee; border: 1px solid #ecd9b4; border-left: 4px solid var(--gold);
  padding: 12px 14px; border-radius: 6px; font-size: 13px; color: #6b5320; line-height: 1.7;
}
.flex { display: flex; gap: 10px; align-items: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.mt8 { margin-top: 8px; } .mt16 { margin-top: 16px; } .mb16 { margin-bottom: 16px; }

/* ---------- 版本标记 ---------- */
.edition-banner {
  background: #fdf3e0; color: #8a6d1f; border: 1px solid #ecd9b4;
  font-size: 12.5px; font-weight: 600; padding: 9px 12px; border-radius: 6px; margin-bottom: 16px;
}
.edition-badge {
  margin: 0 10px 8px; padding: 6px 10px; border-radius: 6px;
  background: rgba(217,164,65,.16); color: var(--gold-lt);
  font-size: 11.5px; font-weight: 700; text-align: center;
}
.edition-top { background: #fdf3e0; color: #8a6d1f; font-size: 11.5px; font-weight: 700; padding: 3px 10px; border-radius: 12px; }

/* ---------- 使用教程 ---------- */
#modalRoot .modal { width: 620px; }
.tut-step { text-align: center; padding: 18px 8px 6px; }
.tut-icon { font-size: 52px; margin-bottom: 12px; }
.tut-title { font-size: 19px; font-weight: 800; color: var(--navy-dark); margin-bottom: 12px; }
.tut-body { font-size: 14px; color: #44506a; line-height: 1.95; text-align: left; max-width: 520px; margin: 0 auto; }
.tut-body b { color: var(--navy); }
.tut-nav { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.tut-dots { display: flex; gap: 6px; }
.tut-dot { width: 8px; height: 8px; border-radius: 50%; background: #d5dce5; transition: all .2s; }
.tut-dot.on { background: var(--gold); transform: scale(1.35); }
.tut-dot.done { background: var(--navy); }
.tut-foot { display: flex; align-items: center; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); margin-top: 16px; }
.tut-foot .tut-nav { flex: 1; margin-top: 0; }

/* ---------- AI 助手（右下角对话式 Agent） ---------- */
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 90;
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #00a34e, #00843d);
  color: #fff; font-size: 26px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 22px rgba(0,132,61,.4); cursor: pointer;
  transition: transform .15s;
}
.ai-fab:hover { transform: scale(1.08); }
.ai-fab.fab-active { transform: rotate(45deg) scale(1.05); }
.ai-fab .ai-fab-dot {
  position: absolute; top: 2px; right: 2px; width: 12px; height: 12px;
  background: #ff5d4d; border-radius: 50%; border: 2px solid #fff;
}
.ai-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 95;
  width: 380px; height: 560px; max-height: calc(100vh - 130px);
  background: #fff; border-radius: 14px; box-shadow: 0 14px 46px rgba(8,40,24,.28);
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--line);
}
.ai-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; background: linear-gradient(135deg, #0b3a24, #00843d); color: #fff; flex: none;
}
.ai-head b { font-size: 15px; }
.ai-sub { display: block; font-size: 11px; color: rgba(255,255,255,.72); margin-top: 2px; }
.ai-keybar {
  flex: none; padding: 9px 14px; background: #fdf9ee; border-bottom: 1px solid #ecd9b4;
  display: flex; flex-direction: column; gap: 6px;
}
.ai-keyrow { display: flex; gap: 6px; align-items: center; }
.ai-msgs { flex: 1; overflow-y: auto; padding: 14px; background: #f7faf8; }
.ai-msg {
  max-width: 88%; padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.7;
  margin-bottom: 10px; word-break: break-word;
}
.ai-msg.user { background: #00843d; color: #fff; margin-left: auto; border-bottom-right-radius: 4px; }
.ai-msg.bot { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; color: var(--ink); }
.ai-msg.bot a { color: var(--navy); }
.ai-msg.action { border: 1px dashed var(--gold); background: #fdfaf2; }
.ai-msg.thinking { color: var(--gray); }
.ai-chips {
  flex: none; display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 12px;
  border-top: 1px solid var(--line); background: #fff;
}
.ai-chip {
  font-size: 12px; padding: 5px 11px; border-radius: 16px; border: 1px solid var(--line);
  background: #f2f7f4; color: var(--navy-dark); cursor: pointer; transition: all .15s;
}
.ai-chip:hover { border-color: var(--navy); background: #e4f1ea; }
.ai-input { flex: none; display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); background: #fff; }
.ai-input input { flex: 1; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; outline: none; font-size: 13px; }
.ai-input input:focus { border-color: var(--navy); }

/* ---------- KPI 使用引导 ---------- */
.kpi-guide { display: flex; gap: 6px; flex-wrap: wrap; }
.kg-step {
  flex: 1; min-width: 118px; border: 1px solid var(--line); border-radius: 8px;
  padding: 10px 12px; background: #fff; position: relative;
}
.kg-step.done { border-color: #b9e0c8; background: #f2faf5; }
.kg-step.cur { border-color: var(--gold); background: #fdf9ee; box-shadow: 0 0 0 3px rgba(217,164,65,.15); }
.kg-step.cur::after { content: "当前"; position: absolute; top: -8px; right: 8px; background: var(--gold); color: #3a2c0e; font-size: 10px; font-weight: 700; padding: 1px 8px; border-radius: 8px; }
.kg-dot {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; margin-bottom: 6px;
}
.kg-step.done .kg-dot { background: var(--green); color: #fff; }
.kg-step.cur .kg-dot { background: var(--gold); color: #3a2c0e; }
.kg-step.pending .kg-dot { background: #eef0f3; color: #8a8f98; }
.kg-name { font-size: 13px; font-weight: 700; color: var(--navy-dark); }
.kg-tip { font-size: 11px; color: var(--gray); margin-top: 2px; line-height: 1.5; }

/* ---------- KPI 填写状态提醒 ---------- */
.kpi-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.kpi-status .st { padding: 5px 12px; border-radius: 16px; font-weight: 600; }
.kpi-status .st.ok { background: #e2f5e9; color: var(--green); }
.kpi-status .st.no { background: #fdecea; color: var(--red); }
.kpi-status .st.wait { background: #fdf3e0; color: #8a6d1f; }
.kpi-status .arr { color: var(--gray); }
