/* ============================================================
   创智源消息推送 - 管理后台样式（工业风绿色主题）
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #eef1f4; color: #2b2f33; font-size: 14px;
}
.hidden { display: none !important; }
.muted { color: #8a9299; font-size: 12px; line-height: 1.6; }

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f4c3a 0%, #167a55 60%, #1f9d6b 100%);
}
.login-box {
  width: 360px; background: #fff; border-radius: 10px; padding: 36px 32px 28px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-logo {
  font-size: 26px; font-weight: 700; color: #0f4c3a; text-align: center; letter-spacing: 2px;
}
.login-title { text-align: center; color: #5a6268; margin: 6px 0 22px; }
.login-tip { color: #c0392b; font-size: 13px; margin: 6px 0; min-height: 20px; }

/* ---------- 布局 ---------- */
.app { display: flex; height: 100vh; overflow: hidden; }
.sidebar {
  width: 208px; background: #0f4c3a; color: #dcebe4; display: flex; flex-direction: column;
  flex-shrink: 0;
}
.brand { padding: 22px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; color: #fff; }
.brand-sub { font-size: 12px; color: #9cc9b4; margin-top: 4px; }
.nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item {
  display: block; padding: 11px 20px; color: #b8d4c8; cursor: pointer;
  border-left: 3px solid transparent; transition: all .15s;
}
.nav-item:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-item.active {
  background: rgba(255,255,255,.14); color: #fff; border-left-color: #4fd18f;
  font-weight: 600;
}
.sidebar-foot {
  padding: 14px 20px; border-top: 1px solid rgba(255,255,255,.12);
  font-size: 12px; color: #9cc9b4; display: flex; justify-content: space-between;
}
.logout { color: #ffd6a8; cursor: pointer; }
.main { flex: 1; overflow-y: auto; padding: 22px 28px; }

/* ---------- 页面与卡片 ---------- */
.page-title { font-size: 20px; margin-bottom: 16px; color: #15352a; }
.card {
  background: #fff; border-radius: 8px; padding: 20px 22px; margin-bottom: 18px;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.card-title { font-size: 15px; color: #15352a; margin-bottom: 14px; }
.bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; gap: 8px; flex-wrap: wrap; }
.tip-block {
  background: #f2f8f5; border: 1px solid #cfe6da; color: #315f4c;
  border-radius: 6px; padding: 10px 14px; font-size: 13px; line-height: 1.7;
}
code { background: #e9f0ec; padding: 1px 5px; border-radius: 3px; color: #0f6b48; }

/* ---------- 表单 ---------- */
.form-row { margin-bottom: 14px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; color: #3a4147; }
.input {
  width: 100%; max-width: 560px; padding: 8px 12px; border: 1px solid #c9d2d9;
  border-radius: 5px; font-size: 14px; outline: none; transition: border-color .15s;
}
.input:focus { border-color: #1f9d6b; box-shadow: 0 0 0 2px rgba(31,157,107,.15); }
.input-sm { max-width: 220px; padding: 6px 10px; font-size: 13px; }
.textarea { min-height: 120px; resize: vertical; font-family: inherit; }
.radio-group label { margin-right: 18px; font-weight: 400; cursor: pointer; }
.check { font-weight: 400; cursor: pointer; color: #3a4147; }
.day-checks { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.target-row { margin-top: 10px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.template-quick { margin-bottom: 8px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block; padding: 8px 18px; border: none; border-radius: 5px;
  font-size: 14px; cursor: pointer; transition: all .15s; text-align: center;
}
.btn-primary { background: #167a55; color: #fff; }
.btn-primary:hover { background: #0f6b48; }
.btn-ghost { background: #fff; border: 1px solid #c9d2d9; color: #3a4147; }
.btn-ghost:hover { border-color: #167a55; color: #167a55; }
.btn-sm { padding: 5px 12px; font-size: 13px; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-danger-ghost { background: #fff; border: 1px solid #e0b4b4; color: #b44343; }
.btn-danger-ghost:hover { background: #fdf0f0; }
.result-tip { margin-left: 12px; font-size: 13px; color: #167a55; }

/* ---------- 表格 ---------- */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  padding: 9px 10px; border-bottom: 1px solid #e8ecef; text-align: left;
  font-size: 13px; vertical-align: middle;
}
.table th { background: #f5f8f6; color: #3f5a4e; font-weight: 600; white-space: nowrap; }
.table tr:hover td { background: #fafcfa; }
.badge {
  display: inline-block; padding: 2px 9px; border-radius: 10px; font-size: 12px;
}
.badge-success { background: #e3f5ec; color: #0f6b48; }
.badge-fail { background: #fdeaea; color: #b44343; }
.badge-running { background: #e3f5ec; color: #0f6b48; }
.badge-disabled { background: #eceff1; color: #6c757d; }
.badge-finished { background: #e9edf5; color: #3f5a8f; }
.badge-error { background: #fdeaea; color: #b44343; }
.op-link { color: #167a55; cursor: pointer; margin-right: 10px; }
.op-link.danger { color: #b44343; }
.op-link.gray { color: #8a9299; }

/* ---------- 分页 ---------- */
.pager { margin-top: 14px; display: flex; align-items: center; gap: 6px; }
.pager button {
  padding: 4px 10px; border: 1px solid #c9d2d9; background: #fff; border-radius: 4px;
  cursor: pointer; font-size: 13px; color: #3a4147;
}
.pager button:disabled { color: #c2c9cf; cursor: not-allowed; }
.pager button.current { background: #167a55; color: #fff; border-color: #167a55; }
.pager .page-info { margin-left: 8px; color: #8a9299; font-size: 12px; }

/* ---------- 富文本编辑器 ---------- */
.editor-toolbar { border: 1px solid #c9d2d9; border-bottom: none; border-radius: 5px 5px 0 0; }
.editor-container {
  border: 1px solid #c9d2d9; border-radius: 0 0 5px 5px; min-height: 260px;
  max-width: 860px;
}
.editor-container .w-e-text-container { min-height: 260px; }
/* 弹窗内富文本编辑器 */
#tf-editor-toolbar { border: 1px solid #c9d2d9; border-bottom: none; border-radius: 5px 5px 0 0; }
#tf-editor-container { border: 1px solid #c9d2d9; border-radius: 0 0 5px 5px; min-height: 200px; }
#tf-editor-container .w-e-text-container { min-height: 200px; }

/* ---------- 模态框 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,40,30,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: 8px; width: 100%; max-width: 640px;
  max-height: 88vh; overflow-y: auto; padding: 22px 24px;
  box-shadow: 0 16px 50px rgba(0,0,0,.3);
}
.modal h3 { margin-bottom: 14px; color: #15352a; }
.modal .form-row { margin-bottom: 12px; }
.modal-foot { margin-top: 18px; display: flex; gap: 10px; justify-content: flex-end; }
.detail-html { border: 1px solid #e8ecef; border-radius: 5px; padding: 14px; line-height: 1.8; word-break: break-word; }
.detail-html img { max-width: 100%; }
.mono { font-family: Consolas, monospace; font-size: 12px; }
.secret-box { background: #f5f8f6; border: 1px dashed #9cc9b4; border-radius: 5px; padding: 10px 14px; margin: 10px 0; word-break: break-all; }

/* 通讯录选择弹层 */
.contact-picker { display: flex; gap: 12px; }
.contact-picker .picker-panel { flex: 1; border: 1px solid #e0e5e8; border-radius: 6px; padding: 10px; max-height: 320px; overflow-y: auto; }
.picker-panel .picker-title { font-weight: 600; margin-bottom: 8px; color: #3a4147; font-size: 13px; }
.picker-user { padding: 5px 4px; cursor: pointer; border-radius: 4px; display: flex; align-items: center; gap: 6px; }
.picker-user:hover { background: #f0f7f3; }
.picker-user.selected { background: #e3f5ec; }

@media (max-width: 768px) {
  .sidebar { width: 64px; }
  .brand-name, .brand-sub, .nav-item, .sidebar-foot span { display: none; }
  .nav-item { text-align: center; padding: 14px 0; }
  .main { padding: 14px; }
}
