/* 审计资料在线管理系统 —— 全局样式（深蓝 #002244 + 亮青 #11A7D9） */
:root {
  --brand-900: #001a33;
  --brand-800: #002244;
  --brand-700: #0a3a63;
  --brand-100: #cfe0ee;
  --brand-50: #eef4fa;
  --accent: #11a7d9;
  --accent-dark: #0d86b0;
  --panel: #f4f7fb;
  --hair: #e4eaf1;
  --muted: #6b7a8d;
  --ok: #10b981;
  --ok-bg: #ecfdf5;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --red: #dc2626;
  --red-bg: #fef2f2;
  --sky-bg: #eff6ff;
  --text: #1e2a37;
  --accent-teal: #00af98;
  --accent-amber2: #f0b03a;
  --accent-coral: #eb7b62;
  --accent-orchid: #a875d9;
}

/* ---- 登录页装饰动画 ---- */
@keyframes drift {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -14px, 0); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); }
  50% { transform: translateY(-12px) rotate(var(--rot, 0deg)); }
}
@keyframes twinkle {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}
.animate-drift { animation: drift 9s ease-in-out infinite; }
.animate-floaty { animation: floaty 6s ease-in-out infinite; }
.animate-twinkle { animation: twinkle 2.6s ease-in-out infinite; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--panel);
  font-size: 14px;
}
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Consolas", monospace; }

/* ---- 布局 ---- */
.shell { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 236px; flex-shrink: 0; background: var(--brand-800); color: #fff;
  display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; height: 64px; padding: 0 22px; }
.brand .logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700;
}
.brand .t1 { font-weight: 700; font-size: 15px; }
.brand .t2 { font-size: 10px; letter-spacing: 1px; color: #7fbfe0; }
.nav { padding: 12px; flex: 1; }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px;
  color: #c8d6e5; font-size: 14px; margin-bottom: 4px;
}
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(255,255,255,.12); color: #fff; font-weight: 600; }
.sidebar .foot { padding: 16px; }
.sidebar .role-box {
  background: rgba(255,255,255,.06); border-radius: 8px; padding: 10px 14px;
  font-size: 11px; color: #a9bed3;
}
.sidebar .role-box b { display: block; color: #fff; font-size: 14px; margin-top: 2px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: 64px; flex-shrink: 0; background: #fff; border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: space-between; padding: 0 24px;
}
.topbar .who { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; background: var(--brand-800); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.content { flex: 1; min-height: 0; overflow-y: auto; padding: 24px 28px; }

/* ---- 通用组件 ---- */
.card {
  background: #fff; border: 1px solid var(--hair); border-radius: 10px;
  box-shadow: 0 1px 2px rgba(16,32,48,.04); margin-bottom: 20px;
}
.card > .card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--hair);
  display: flex; align-items: center; justify-content: space-between; font-weight: 600;
}
.card > .card-body { padding: 18px; }
.page-title { font-size: 24px; font-weight: 700; color: var(--brand-800); margin: 0 0 4px; }
.page-sub { color: var(--muted); margin: 0 0 18px; }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 7px;
  font-size: 13px; font-weight: 600; border: 1px solid transparent; cursor: pointer;
  background: var(--brand-800); color: #fff;
}
.btn:hover { background: var(--brand-700); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.btn.accent { background: var(--accent); }
.btn.accent:hover { filter: brightness(1.05); }
.btn.outline { background: #fff; color: var(--brand-800); border-color: var(--brand-100); }
.btn.outline:hover { border-color: var(--brand-800); background: var(--panel); }
.btn.danger { background: var(--red); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid;
}
.badge.green { background: var(--ok-bg); color: #047857; border-color: #a7f3d0; }
.badge.amber { background: var(--amber-bg); color: var(--amber); border-color: #fde68a; }
.badge.slate { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.badge.sky { background: var(--sky-bg); color: #0369a1; border-color: #bae6fd; }
.badge.navy { background: var(--brand-50); color: var(--brand-800); border-color: var(--brand-100); }
.badge.red { background: var(--red-bg); color: var(--red); border-color: #fecaca; }

input, select, textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--hair); border-radius: 7px;
  font-size: 14px; font-family: inherit; outline: none; background: #fff;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px #d6eefb; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13px; }
.req-star { color: var(--red); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--muted);
  padding: 10px 8px; border-bottom: 1px solid var(--hair); white-space: nowrap;
}
tbody td { padding: 11px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
tbody tr:hover { background: #fafcfe; }
th:first-child, td:first-child { padding-left: 14px; }
th:last-child, td:last-child { padding-right: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stats.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat {
  background: #fff; border: 1px solid var(--hair); border-left: 4px solid var(--accent);
  border-radius: 9px; padding: 13px 16px; min-width: 0; overflow: hidden; white-space: nowrap;
}
.stat.clickable { cursor: pointer; transition: .12s; }
.stat.clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(16,32,48,.08); }
.stat.active { border-color: var(--accent); box-shadow: 0 0 0 2px #bfe6f7; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.stat .h { font-size: 11px; color: #94a3b8; margin-top: 2px; }
.stat.amber { border-left-color: var(--amber); } .stat.amber .v { color: var(--amber); }
.stat.green { border-left-color: var(--ok); } .stat.green .v { color: #047857; }
.stat.red { border-left-color: var(--red); } .stat.red .v { color: var(--red); }
.stat.navy { border-left-color: var(--brand-800); } .stat.navy .v { color: var(--brand-800); }
.stat.slate { border-left-color: #94a3b8; } .stat.slate .v { color: #475569; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input[type=text] { width: 260px; }
.spacer { margin-left: auto; }

.row-flex { display: flex; align-items: center; gap: 10px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid #eef2f7; border-radius: 9px; margin-bottom: 8px;
}
.list-item:hover { border-color: var(--brand-100); background: #fafcfe; }
.ellipsis { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* flash */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.flash.ok { background: var(--ok-bg); color: #047857; border: 1px solid #a7f3d0; }
.flash.error { background: var(--red-bg); color: var(--red); border: 1px solid #fecaca; }

.banner { padding: 9px 14px; border-radius: 8px; font-size: 12px; margin-bottom: 14px; }
.banner.green { background: var(--ok-bg); color: #047857; border: 1px solid #a7f3d0; }
.banner.amber { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }

/* modal */
.modal-back {
  position: fixed; inset: 0; background: rgba(15,23,42,.42); display: none;
  align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal-back.open { display: flex; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 520px;
  max-height: 88vh; display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal > form {
  display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden;
}
.modal.wide { max-width: 760px; }
.modal-head { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--hair); }
.modal-head h3 { margin: 0; font-size: 17px; color: var(--brand-800); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; }
.modal-foot { flex-shrink: 0; padding: 14px 20px; border-top: 1px solid var(--hair); display: flex; justify-content: flex-end; gap: 8px; }
.x-btn { background: none; border: none; font-size: 20px; color: #94a3b8; cursor: pointer; width: auto; padding: 0 6px; }

.user-dropdown {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; border: 1px solid var(--hair); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(16,32,48,.12); min-width: 140px; z-index: 60;
  overflow: hidden;
}
.user-dropdown.open { display: block; }
.user-dropdown a {
  display: block; padding: 10px 16px; font-size: 13px; color: var(--brand-800);
  text-decoration: none; border: none; border-bottom: 1px solid #f1f5f9;
}
.user-dropdown a:last-child { border-bottom: none; }
.user-dropdown a:hover { background: var(--panel); }

.checklist { max-height: 320px; overflow-y: auto; border: 1px solid var(--hair); border-radius: 8px; }
.checklist label { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer; }
.checklist label:hover { background: var(--panel); }
.checklist input[type=checkbox] { width: auto; }

#selectedAssignees { margin-bottom: 12px; }
#selectedList {
  min-height: 36px; max-height: 80px; overflow-y: auto;
  padding: 6px; border: 1px solid var(--hair); border-radius: 8px; background: #f8fafc;
}
.assignee-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 8px; background: #e0f2fe; color: #0369a1;
  border-radius: 6px; font-size: 12px;
}
.assignee-tag .remove { cursor: pointer; font-weight: bold; opacity: .7; }
.assignee-tag .remove:hover { opacity: 1; }

.dropzone {
  display: block;
  border: 2px dashed #cbd5e1; border-radius: 12px; padding: 26px; text-align: center;
  color: var(--muted); cursor: pointer; margin: 0;
}
.dropzone:hover { border-color: var(--accent); background: #f8fbfe; }
.dropzone-box { overflow: hidden; }

/* 审计详情：左侧公司列表（上下滚动的主从布局） */
.comp-row {
  display: block; padding: 10px 12px; border-radius: 8px; border: 1px solid transparent;
  cursor: pointer; margin-bottom: 4px; color: inherit;
}
.comp-row:hover { background: var(--panel); }
.comp-row.active { background: #f7fcff; border-color: var(--accent); }
.detail-section { margin-bottom: 22px; }
.detail-section > h4 { margin: 0 0 10px; font-size: 14px; color: var(--brand-800); }

.tag-year {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; border: 1px solid var(--hair); background: #fff; cursor: pointer;
}
.tag-year.history { border-color: #fde68a; background: var(--amber-bg); color: var(--amber); }
.inline-form { display: inline; }
.pill { padding: 2px 8px; border-radius: 6px; background: var(--panel); font-size: 11px; color: var(--brand-700); }
