/* 高校学生党员发展纪实材料智能审校系统（原型）样式 */
:root {
  --red: #b71c1c;
  --red-dark: #8e1414;
  --gold: #c9a45c;
  --bg: #f4f1ec;
  --panel: #ffffff;
  --ink: #2b2b2b;
  --muted: #8a8a8a;
  --line: #e6e0d6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* 顶栏 */
.topbar {
  background: linear-gradient(135deg, var(--red-dark), var(--red));
  color: #fff;
  padding: 14px 26px 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 12px; }
.emblem {
  width: 34px; height: 34px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4d488, var(--gold) 60%, #9a7326);
  display: inline-block; box-shadow: 0 0 0 3px rgba(255,255,255,.25);
}
.title { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.subtitle { font-size: 12px; opacity: .85; margin-top: 2px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: #fff; padding: 7px 13px; border-radius: 4px; font-size: 14px;
}
.nav a:hover { background: rgba(255,255,255,.15); text-decoration: none; }
.nav a.active { background: rgba(255,255,255,.25); font-weight: 600; }
.nav-user { color: #fff; font-size: 13px; margin-left: auto; opacity: .9; }
.nav-user a { color: #f4d488; margin-left: 8px; }

.banner {
  display: none;
  background: #fff7e6; border-bottom: 1px solid #f0d9a8;
  color: #8a6116; padding: 10px 26px; font-size: 13px;
}

main { max-width: 1240px; margin: 22px auto; padding: 0 20px; min-height: 60vh; }
h2 { font-size: 20px; border-left: 5px solid var(--red); padding-left: 10px; margin: 6px 0 16px; }
h3 { font-size: 16px; margin: 0 0 12px; color: var(--red-dark); }
h4 { font-size: 14px; margin: 10px 0 8px; }
h5 { font-size: 13px; margin: 0 0 8px; color: var(--red-dark); }

/* 面板与卡片 */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.card {
  flex: 1; min-width: 150px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 8px; padding: 16px; text-align: center;
}
.card-num { font-size: 30px; font-weight: 700; color: var(--red); }
.card-label { color: var(--muted); margin-top: 4px; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 3fr 2fr; gap: 18px; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: 1fr; } }

/* 表格 */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.tbl th { background: #faf6ef; font-weight: 600; white-space: nowrap; }
.tbl.kv td.k { width: 150px; color: var(--muted); background: #faf8f4; }

/* 徽标 */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px;
  background: #eee; color: #555; white-space: nowrap;
}
.badge.lv-high { background: #fde3e3; color: #b71c1c; font-weight: 600; }
.badge.lv-mid { background: #fff3d6; color: #9a6b00; }
.badge.lv-low { background: #e8f0e4; color: #4a7a3a; }
.badge.cat { background: #f3e9f5; color: #7a4a8a; }
.badge.req { background: #e3edfd; color: #1d5bbf; }
.badge.missing { background: #fde3e3; color: #b71c1c; }
.badge.st-open { background: #fde3e3; color: #b71c1c; }
.badge.st-rect { background: #fff3d6; color: #9a6b00; }
.badge.st-wait { background: #e3edfd; color: #1d5bbf; }
.badge.st-closed { background: #e8f0e4; color: #4a7a3a; }
.badge.st-exp { background: #eee; color: #999; }

.num-warn { color: var(--red); font-weight: 700; }
.num-mid { color: #9a6b00; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ok { color: #4a7a3a; font-weight: 600; }

/* 按钮 */
.btn {
  display: inline-block; border: 1px solid #d8d2c6; background: #fff; color: var(--ink);
  padding: 7px 16px; border-radius: 5px; cursor: pointer; font-size: 13px;
}
.btn:hover { background: #faf7f1; text-decoration: none; }
.btn.primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn.primary:hover { background: var(--red-dark); }
.btn.danger { color: var(--red); border-color: #e5b8b8; }
.btn.danger:hover { background: #fdf2f2; }
.btn.small { padding: 4px 10px; font-size: 12px; }

/* 表单 */
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 10px 18px; margin-bottom: 10px; }
.f-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.f-item input, .f-item select, .f-item textarea, .form-row input, .form-row select, .inline-form input, .inline-form select, .arc-form textarea {
  border: 1px solid #d8d2c6; border-radius: 4px; padding: 7px 9px; font-size: 13px;
  font-family: inherit; width: 100%;
}
.form-row input, .form-row select { width: auto; }
.f-item .sug { font-size: 11px; color: #1d5bbf; min-height: 14px; display: block; }
.req-star { color: var(--red); }
.inline-form { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input { width: auto; }

/* 阶段时间线 */
.stage-line { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.stage-tab {
  padding: 6px 12px; border-radius: 14px; background: #eee; color: #999; font-size: 12px;
}
.stage-tab.on { background: #f6e2e2; color: var(--red); }
.stage-tab.cur { background: var(--red); color: #fff; font-weight: 600; }
.stage-arrow { color: #cbb; }

/* 材料卡片 */
.mat-type { border-top: 1px dashed var(--line); padding: 8px 0 12px; }
.mat-inst {
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; margin: 8px 0; background: #fdfcf9;
}
.mat-img img { max-width: 220px; max-height: 160px; border: 1px solid var(--line); border-radius: 4px; margin-bottom: 6px; }
.mat-form { background: #fbf8f2; border: 1px solid var(--gold); border-radius: 6px; padding: 14px; margin: 10px 0; }

/* OCR */
.ocr-panel { border: 1px dashed #c9a45c; border-radius: 6px; padding: 12px; margin: 10px 0; background: #fffdf7; }
.ocr-body { display: flex; gap: 12px; margin-top: 10px; }
.ocr-body textarea { flex: 1; }
#ocrPrevWrap img { max-width: 260px; max-height: 200px; border: 1px solid var(--line); border-radius: 4px; }
.f-item input.auto-filled, .f-item textarea.auto-filled { background: #fffbe6; border-color: #c9a45c; }
.fill-summary { font-size: 12px; line-height: 1.8; }
.fill-summary .badge { margin-right: 4px; }
.prog { height: 6px; background: #eee; border-radius: 3px; margin: 8px 0; overflow: hidden; }
.prog-bar { height: 100%; width: 0; background: var(--red); transition: width .3s; }

/* 归档表单 */
.arc-form { background: #fbf8f2; border: 1px solid var(--gold); border-radius: 6px; padding: 12px; margin-top: 8px; }
.arc-form label { display: inline-block; margin: 4px 0; }

/* 提示条 */
.toast {
  position: fixed; top: 70px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: #333; color: #fff; padding: 10px 22px; border-radius: 6px; font-size: 13px;
  opacity: 0; transition: all .3s; z-index: 99;
}
.toast.show { opacity: .95; transform: translateX(-50%) translateY(0); }

/* 页脚 */
.footer {
  text-align: center; color: var(--muted); font-size: 12px; padding: 18px 30px 26px;
  border-top: 1px solid var(--line); margin-top: 30px;
}

/* 弹窗与批量导入 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 100; display: flex; align-items: flex-start; justify-content: center; padding: 30px 20px; overflow-y: auto; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 920px; padding: 20px; margin-top: 20px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.modal h3 { margin-top: 0; }
.batch-item { border: 1px solid var(--line); border-radius: 6px; padding: 12px; margin: 10px 0; background: #fdfbf7; }
.batch-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.batch-head input[type=checkbox] { width: 18px; height: 18px; }
.batch-thumb { max-width: 80px; max-height: 80px; border: 1px solid var(--line); border-radius: 4px; }
.batch-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px 12px; margin: 8px 0; }
.batch-fields input, .batch-fields select { width: 100%; }
.batch-item details { margin-top: 8px; font-size: 12px; color: var(--muted); }
.batch-item details textarea { width: 100%; margin-top: 6px; }
.batch-item.batch-warn { border-left: 4px solid #e65100; }
.batch-head { align-items: flex-start; }
#ocrMeta { margin-top: 6px; }

/* 登录与完善信息 */
.login-wrap { min-height: 80vh; display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 32px; width: 100%; max-width: 460px; box-shadow: 0 6px 24px rgba(0,0,0,.08); }
.login-box h2 { text-align: center; border-left: none; padding-left: 0; color: var(--red-dark); }
.login-box .f-item { margin-bottom: 14px; }
.err-msg { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }

.org-tree ul {
  position: relative; padding-left: 26px; margin: 6px 0; list-style: none;
}
.org-tree > ul { padding-left: 0; margin: 0; }
.org-tree li { position: relative; margin: 4px 0; }
.org-tree li::before {
  content: ''; position: absolute; top: 14px; left: -18px; width: 14px; height: 1px; background: var(--line);
}
.org-tree li::after {
  content: ''; position: absolute; top: -10px; left: -18px; width: 1px; height: 26px; background: var(--line);
}
.org-tree > ul > li::after { display: none; }
.org-tree li:last-child::after { height: 15px; }
.org-tree .node {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 6px;
  background: #fff; border: 1px solid var(--line); cursor: default; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
.org-tree .node.root { background: var(--red); color: #fff; border-color: var(--red); font-weight: 700; }
.org-tree .node.group { background: #faf6ef; font-weight: 600; }
.org-tree .node.branch { background: #fff7e6; border-color: #f0d9a8; }
.org-tree .node.position { background: #f4f8fc; border-color: #d6e4f0; font-size: 12px; }
.org-tree .node.user { cursor: pointer; }
.org-tree .node.student { cursor: pointer; }
.org-tree .node:hover { border-color: var(--red); }
.org-tree .node .tag { font-size: 11px; color: var(--muted); background: #f0f0f0; padding: 1px 6px; border-radius: 8px; }
.org-detail { background: #fdfbf7; border: 1px solid var(--gold); border-radius: 6px; padding: 14px; margin-top: 14px; }
.org-detail h4 { margin-top: 0; color: var(--red-dark); }

@media print {
  .topbar, .nav, .footer, .no-print, .btn, .toast { display: none !important; }
  body { background: #fff; }
  .panel { border: none; box-shadow: none; }
}

/* 党员电子档案 */
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px 18px;
}
.profile-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-label {
  font-size: 12px;
  color: var(--muted);
}
.profile-value {
  font-size: 14px;
  color: #333;
  min-height: 22px;
}
.profile-field input {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 14px;
}

/* 政治面貌时间轴 */
.timeline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 0;
}
.timeline-item {
  position: relative;
  flex: 1;
  min-width: 120px;
  padding: 12px 12px 12px 28px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fafafa;
  opacity: 0.7;
}
.timeline-item.done {
  background: #f6ffed;
  border-color: #b7eb8f;
  opacity: 1;
}
.timeline-dot {
  position: absolute;
  left: 10px;
  top: 16px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9d9d9;
}
.timeline-item.done .timeline-dot { background: #52c41a; }
.timeline-title { font-size: 13px; font-weight: 600; }
.timeline-date { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* 封存印章 */
.seal-stamp {
  display: inline-block;
  color: var(--red);
  border: 2px solid var(--red);
  border-radius: 4px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 14px;
  transform: rotate(-3deg);
  margin: 6px 0;
}
.seal-stamp.inline { margin-left: 10px; }

/* 档案日志 */
#archiveLogPanel { margin-top: 18px; }
