/* 客户管理系统 样式 */
<style>
  * { margin: 0; padding: 0; box-sizing: border-box; }
  body { font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: #f5f6fa; color: #333; font-size: 14px; }

  /* ---------- 登录页 ---------- */
  #loginPage { display: flex; align-items: center; justify-content: center; height: 100vh; background: linear-gradient(135deg, #4a7cf7, #6a5af9); }
  .login-card { background: #fff; border-radius: 12px; padding: 40px 36px; width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
  .login-card h1 { font-size: 22px; text-align: center; margin-bottom: 6px; }
  .login-card .sub { text-align: center; color: #999; margin-bottom: 26px; font-size: 13px; }
  .login-card input { width: 100%; padding: 11px 12px; border: 1px solid #dcdfe6; border-radius: 6px; margin-bottom: 16px; font-size: 14px; outline: none; }
  .login-card input:focus { border-color: #4a7cf7; }
  .login-card .tip { color: #e64340; font-size: 13px; min-height: 18px; margin-bottom: 8px; }
  .btn { display: inline-block; padding: 9px 18px; border: none; border-radius: 6px; cursor: pointer; font-size: 14px; background: #4a7cf7; color: #fff; }
  .btn:hover { background: #3d6de8; }
  .btn-block { width: 100%; padding: 12px; font-size: 15px; }
  .btn-danger { background: #e64340; }
  .btn-danger:hover { background: #d13b38; }
  .btn-ghost { background: #fff; color: #4a7cf7; border: 1px solid #4a7cf7; }
  .btn-ghost:hover { background: #ecf2ff; }
  .btn-success { background: #19be6b; }
  .btn-success:hover { background: #16a35f; }
  .btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 4px; }
  .btn-warn { background: #f0a020; }
  .btn-warn:hover { background: #d98f1a; }

  /* ---------- 主框架 ---------- */
  #appPage { display: none; height: 100vh; }
  .layout { display: flex; height: 100vh; }
  .sidebar { width: 200px; background: #24303e; color: #c8cfd8; flex-shrink: 0; display: flex; flex-direction: column; }
  .sidebar .logo { padding: 22px 20px; font-size: 17px; font-weight: bold; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
  .menu { flex: 1; padding: 12px 0; }
  .menu-item { padding: 13px 24px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
  .menu-item:hover { background: rgba(255,255,255,.06); color: #fff; }
  .menu-item.active { background: #4a7cf7; color: #fff; }
  .sidebar .footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
  .sidebar .footer .user-info { margin-bottom: 10px; color: #fff; }
  .sidebar .footer .user-info span { color: #9db4f5; }
  .sidebar .footer button { background: none; border: 1px solid #5a6a7d; color: #c8cfd8; padding: 5px 12px; border-radius: 5px; cursor: pointer; font-size: 12px; }
  .sidebar .footer button:hover { border-color: #fff; color: #fff; }

  .main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
  .topbar { background: #fff; padding: 16px 28px; border-bottom: 1px solid #e8eaf0; font-size: 17px; font-weight: bold; }
  .content { flex: 1; overflow: auto; padding: 24px 28px; }
  .page { display: none; }
  .page.active { display: block; }

  /* ---------- 通用组件 ---------- */
  .toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 10px; }
  .toolbar .left, .toolbar .right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
  .search-input { padding: 8px 12px; border: 1px solid #dcdfe6; border-radius: 6px; outline: none; width: 220px; }
  .search-input:focus { border-color: #4a7cf7; }
  .card { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
  .card + .card { margin-top: 16px; }
  .filter-input { padding: 8px 10px; border: 1px solid #dcdfe6; border-radius: 6px; outline: none; font-size: 13px; background: #fff; max-width: 180px; }
  .filter-input:focus { border-color: #4a7cf7; }
  .mini-hint { color: #999; font-size: 12px; }
  .note { background: #f2f7ff; border: 1px solid #d8e6ff; color: #4a6b9a; padding: 10px 14px; border-radius: 6px; font-size: 12.5px; line-height: 1.8; margin-bottom: 14px; }
  .note b { color: #2f5ca8; }
  .table-wrap { overflow-x: auto; }
  .filter-label { display: inline-flex; flex-direction: column; gap: 3px; font-size: 11px; color: #999; }

  table { width: 100%; border-collapse: collapse; }
  th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid #eef0f4; font-size: 13px; }
  th { background: #f7f8fb; color: #666; font-weight: 600; white-space: nowrap; }
  tr:hover td { background: #fafbfd; }
  .empty { text-align: center; color: #aaa; padding: 40px 0 !important; }
  .tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
  .tag-full { background: #e8f4ff; color: #1a73e8; }
  .tag-part { background: #fff4e5; color: #e67e22; }
  .tag-admin { background: #efe6ff; color: #7c4dff; }
  .tag-staff { background: #eef1f5; color: #5a6a7d; }
  .tag-leader { background: #fff4e5; color: #e67e22; }
  .tag-minister { background: #efe6ff; color: #7c4dff; }
  .tag-cat { background: #e6f7f1; color: #18a874; }
  .tag-cat2 { background: #f2edff; color: #7c4dff; }
  td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
  tr.total-row td { background: #eef4ff; font-weight: bold; border-top: 2px solid #4a7cf7; }
  tr.total-row:hover td { background: #eef4ff; }
  input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; vertical-align: middle; }

  /* ---------- 组织架构 ---------- */
  .org-layout { display: flex; gap: 20px; align-items: flex-start; }
  .dept-panel { width: 300px; flex-shrink: 0; }
  .dept-panel h3, .emp-panel h3 { font-size: 15px; margin-bottom: 14px; }
  .emp-panel { flex: 1; min-width: 0; }
  .dept-tree { list-style: none; }
  .dept-node { padding: 7px 8px; border-radius: 6px; display: flex; align-items: center; gap: 6px; cursor: pointer; }
  .dept-node:hover { background: #f2f6ff; }
  .dept-node.selected { background: #e3ecff; }
  .dept-node .name { flex: 1; }
  .dept-node .count { color: #999; font-size: 12px; }
  .dept-node .ops { display: none; gap: 4px; }
  .dept-node:hover .ops { display: flex; }
  .dept-children { list-style: none; padding-left: 22px; }
  .caret { width: 16px; text-align: center; color: #999; font-size: 10px; cursor: pointer; user-select: none; }
  .link-btn { background: none; border: none; cursor: pointer; color: #4a7cf7; font-size: 12px; padding: 2px 4px; }
  .link-btn:hover { text-decoration: underline; }
  .link-btn.danger { color: #e64340; }

  /* ---------- 客户下发任务 ---------- */
  .tab-bar { display: flex; gap: 8px; margin-bottom: 16px; border-bottom: 1px solid #e8eaf0; }
  .tab-bar button { border: none; background: transparent; padding: 10px 18px; cursor: pointer; font-size: 14px; color: #888; border-bottom: 2px solid transparent; }
  .tab-bar button.active { color: #4a7cf7; font-weight: bold; border-bottom-color: #4a7cf7; }
  .tab-badge { display: inline-block; background: #e64340; color: #fff; border-radius: 9px; padding: 0 6px; font-size: 11px; margin-left: 4px; }
  .tag-status-pending { background: #fff4e5; color: #e67e22; }
  .tag-status-review { background: #e8f4ff; color: #1a73e8; }
  .tag-status-approved { background: #e6f7f1; color: #18a874; }
  .task-log { max-height: 220px; overflow: auto; border: 1px solid #eef0f4; border-radius: 6px; padding: 10px 12px; background: #fafbfd; }
  .task-log .log-item { font-size: 12px; color: #666; padding: 6px 0; border-bottom: 1px dashed #e8eaf0; line-height: 1.6; }
  .task-log .log-item:last-child { border-bottom: none; }
  .task-log .log-item b { color: #333; }
  .readonly-box { background: #f7f8fb; border: 1px solid #e8eaf0; border-radius: 6px; padding: 9px 11px; font-size: 14px; color: #555; }

  /* ---------- 层级管理 ---------- */
  .tier-table input { width: 100%; padding: 7px 9px; border: 1px solid #dcdfe6; border-radius: 6px; font-size: 13px; outline: none; font-family: inherit; }
  .tier-table input:focus { border-color: #4a7cf7; }
  .tier-table input:disabled { background: #f7f8fb; color: #666; }
  .tier-table input[type="number"] { max-width: 160px; }
  .cat-switch { display: inline-flex; gap: 6px; background: #eef2f8; padding: 4px; border-radius: 8px; }
  .cat-switch button { border: none; background: transparent; padding: 7px 16px; border-radius: 6px; cursor: pointer; font-size: 13px; color: #667; }
  .cat-switch button.active { background: #fff; color: #4a7cf7; font-weight: bold; box-shadow: 0 1px 4px rgba(0,0,0,.08); }

  /* ---------- 数据统计卡片 ---------- */
  .stat-cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
  .stat-card { background: #fff; border-radius: 10px; padding: 16px 20px; min-width: 165px; flex: 1; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
  .stat-card .label { color: #888; font-size: 12px; margin-bottom: 8px; }
  .stat-card .value { font-size: 21px; font-weight: bold; color: #24303e; }
  .stat-card.hl .value { color: #4a7cf7; }

  /* ---------- 弹窗 ---------- */
  .modal-mask { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 100; align-items: center; justify-content: center; }
  .modal-mask.show { display: flex; }
  .modal { background: #fff; border-radius: 10px; width: 460px; max-width: 94vw; padding: 26px 28px; max-height: 90vh; overflow: auto; }
  .modal h3 { margin-bottom: 20px; font-size: 16px; }
  .form-item { margin-bottom: 14px; }
  .form-item label { display: block; margin-bottom: 6px; color: #666; font-size: 13px; }
  .form-item label .req { color: #e64340; margin-left: 2px; }
  .form-item input, .form-item select, .form-item textarea { width: 100%; padding: 9px 11px; border: 1px solid #dcdfe6; border-radius: 6px; font-size: 14px; outline: none; font-family: inherit; }
  .form-item input:focus, .form-item select:focus, .form-item textarea:focus { border-color: #4a7cf7; }
  .form-item textarea { resize: vertical; min-height: 60px; }
  .modal .modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
  .form-tip { color: #999; font-size: 12px; margin-top: 4px; line-height: 1.6; }
  .form-error { color: #e64340; font-size: 13px; min-height: 18px; margin-bottom: 6px; }

  .toast { position: fixed; top: 24px; left: 50%; transform: translateX(-50%); background: #24303e; color: #fff; padding: 10px 22px; border-radius: 6px; z-index: 200; opacity: 0; transition: opacity .25s; pointer-events: none; }
  .toast.show { opacity: 1; }
  .toast.error { background: #e64340; }
</style>
