/* ============ Moment Expert 设计系统:简约扁平 ============ */
:root {
  --primary: #5457D6;
  --primary-dark: #4345B8;
  --primary-light: #EEEffB;
  --accent: #2BB5A0;
  --danger: #E15B64;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --text: #22263B;
  --muted: #8A8FA3;
  --border: #E4E6F0;
  --input-h: 40px;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 14px; -webkit-font-smoothing: antialiased; }
a { color: var(--primary); text-decoration: none; }

/* ---------- 表单控件:高度统一 40px ---------- */
.input, .select, textarea.input {
  width: 100%; height: var(--input-h); padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  font-size: 14px; font-family: var(--font); color: var(--text); outline: none;
  transition: border-color .15s;
}
textarea.input { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.6; }
.input:focus, .select:focus { border-color: var(--primary); }
.input::placeholder { color: #B9BDCF; }
.select { appearance: none; -webkit-appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A8FA3' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; }
label.f-label { display: block; font-size: 13px; color: var(--text); margin-bottom: 6px; font-weight: 500; }
/* 表单组统一间距 16px;栅格布局内由 gap 控制,不再叠加 */
.f-group { margin-bottom: 16px; }
.form-grid .f-group, .form-grid-3 .f-group { margin-bottom: 0; }
.f-hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

/* ---------- 按钮:扁平 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--input-h); padding: 0 18px; border-radius: 8px; border: 1px solid transparent;
  background: var(--primary); color: #fff; font-size: 14px; font-family: var(--font);
  cursor: pointer; transition: background .15s; white-space: nowrap; user-select: none;
}
.btn:hover { background: var(--primary-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn-ghost { background: transparent; color: var(--primary); }
.btn-ghost:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #C94A53; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-block { width: 100%; }

/* ---------- 图标:简约线条 ---------- */
.icon { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 评分星星 / 姓名链接 ---------- */
.stars { display: inline-flex; gap: 2px; }
.star { color: #D4D7E4; cursor: pointer; display: inline-flex; transition: color .12s; }
.star .icon { width: 16px; height: 16px; }
.star.big .icon { width: 22px; height: 22px; }
.star.on { color: #F2B84B; }
.star.on .icon { fill: #F2B84B; }
.star:hover { color: #F2B84B; }
.name-link { font-weight: 600; color: var(--text); }
.name-link:hover { color: var(--primary); text-decoration: underline; }

/* ---------- 勾选列表(任务/渠道) ---------- */
.task-check-list { max-height: 320px; overflow-y: auto; border: 1px solid var(--border);
  border-radius: 8px; padding: 6px; }
.task-check { display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 6px; cursor: pointer; font-size: 13px; }
.task-check:hover { background: var(--primary-light); }

/* ---------- 渠道多选筛选 ---------- */
.chan-filter { position: relative; min-width: 150px; }
.chan-filter > .select { width: 100%; text-align: left; cursor: pointer; display: flex; align-items: center; }
.chan-drop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 200px;
  max-height: 260px; overflow-y: auto; background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 8px 24px rgba(31, 35, 61, .12); padding: 6px; }

/* ---------- 布局骨架 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar { width: 216px; background: #fff; border-right: 1px solid var(--border); position: fixed; top: 0; bottom: 0; left: 0; z-index: 30; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.brand img { width: 34px; height: 34px; border-radius: 8px; }
.brand-name { font-size: 16px; font-weight: 700; color: var(--primary); letter-spacing: .2px; }
.nav { padding: 12px; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 42px; padding: 0 12px; border-radius: 8px; color: var(--text); margin-bottom: 4px; font-size: 14px; }
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.sidebar-foot { padding: 14px 16px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; flex: none; }
.main { flex: 1; margin-left: 216px; padding: 24px; min-width: 0; }
.page-title { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.page-sub { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

/* ---------- 卡片 ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }

/* ---------- 认证页 ---------- */
.auth-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 400px; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 36px 32px; }
.auth-logo { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; }
.auth-logo img { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 12px; }
.auth-logo h1 { font-size: 20px; color: var(--primary); }
.auth-logo p { color: var(--muted); font-size: 13px; margin-top: 4px; }
.auth-card .f-group { margin-bottom: 16px; }
.auth-link { text-align: center; margin-top: 16px; font-size: 13px; color: var(--muted); }
/* 登录/注册页:回到首页 扁平小按钮 */
.auth-home { text-align: center; margin-top: 18px; }
.auth-home a {
  display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 15px; background: #fff;
  color: var(--muted); font-size: 12px; transition: all .15s;
}
.auth-home a:hover { border-color: var(--primary); color: var(--primary); }
.auth-home .icon { width: 13px; height: 13px; }

/* ---------- 表单栅格 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px 20px; }
.form-grid .span2 { grid-column: span 2; }
.form-actions { display: flex; gap: 12px; margin-top: 20px; flex-wrap: wrap; }

/* ---------- 统计卡片 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; display: flex; align-items: center; gap: 14px; }
.stat-ico { width: 44px; height: 44px; border-radius: 10px; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; flex: none; }
.stat-ico.teal { background: #E2F5F2; color: var(--accent); }
.stat-num { font-size: 24px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid > .card { margin-top: 0; display: flex; flex-direction: column; }
.chart-grid .chart-box { flex: 1; min-height: 300px; height: auto; }
.chart-box { height: 300px; }

/* ---------- 工具栏 / 筛选 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .input, .toolbar .select { width: auto; min-width: 150px; }
.toolbar .grow { flex: 1; min-width: 180px; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; position: relative; }
table.tbl { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13px; }
.tbl th, .tbl td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; background: #fff; vertical-align: middle; }
.tbl th { background: #FAFBFD; font-weight: 600; color: var(--text); position: relative; }
.tbl tbody tr:hover td { background: #F8F9FE; }
.tbl td.long { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
/* 冻结列 */
.freeze-col { position: sticky !important; z-index: 2; box-shadow: 1px 0 0 var(--border); }
.freeze-col:last-of-type { box-shadow: 2px 0 4px rgba(0,0,0,.04); }
.tbl .freeze-col { background: #fff; }
.tbl th.freeze-col { background: #FAFBFD; z-index: 3; }
.freeze-btn { cursor: pointer; color: #C3C7D8; margin-left: 6px; vertical-align: middle; }
.freeze-btn.on { color: var(--primary); }
.sortable { cursor: pointer; user-select: none; }
.sortable:hover { color: var(--primary); }
.sort-arrow { color: var(--primary); font-size: 11px; margin-left: 3px; font-weight: 700; }
.tag-chip { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--primary-light); color: var(--primary); font-size: 12px; margin: 2px 4px 2px 0; }
.tag-chip .x { margin-left: 4px; cursor: pointer; opacity: .6; }

/* 状态下拉徽章:固定宽度+白色箭头,避免文字长短不一撑开列 */
.status-select { appearance: none; -webkit-appearance: none; width: 96px; height: 24px; padding: 0 20px 0 10px; border: none; border-radius: 999px; color: #fff; font-size: 12px; cursor: pointer; display: inline-block; vertical-align: middle;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 6px center; text-align: left; }
.status-select option { color: var(--text); background: #fff; }
.tag-chip .x:hover { opacity: 1; }

/* ---------- 协议签署 ---------- */
.agreement-view { white-space: pre-wrap; line-height: 1.9; font-size: 14px; padding: 14px;
  border: 1px solid var(--border); border-radius: 8px; background: #FAFBFE; overflow-y: auto; }
.agreement-view p { margin: 0 0 8px; white-space: normal; }
.agreement-view h1,.agreement-view h2,.agreement-view h3 { margin: 10px 0 8px; white-space: normal; line-height: 1.5; }
.agreement-view.html { white-space: normal; }
.rich-editor { background: #fff; outline: none; min-height: 120px; }
.rich-editor:focus { border-color: var(--primary); }
.rich-editor:empty::before { content: "在此输入或从 Word 粘贴协议正文…"; color: var(--muted); }

/* ---------- 公告板 ---------- */
.rte-toolbar { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; padding: 6px 8px;
  border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; background: #F7F8FB; }
.rte-btn { border: none; background: transparent; min-width: 30px; height: 28px; padding: 0 7px;
  border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text); }
.rte-btn:hover:not(:disabled) { background: #E8EBF3; }
.rte-btn:disabled { opacity: .5; cursor: default; }
.rte-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.ann-editor { min-height: 280px; max-height: 52vh; overflow-y: auto; padding: 14px;
  border: 1px solid var(--border); border-radius: 0 0 8px 8px; line-height: 1.8; font-size: 14px; }
.ann-editor-page { min-height: 380px; max-height: none; }
.ann-editor:empty::before { content: "在此输入公告内容,或从 Word / 网页直接粘贴…"; color: var(--muted); }
.ann-editor img, .ann-view img { max-width: 100%; border-radius: 6px; }
.ann-editor img { cursor: pointer; }
.ann-editor img.sel { outline: 2px solid var(--primary); outline-offset: 1px; }
.img-tools { position: absolute; z-index: 6; display: flex; gap: 2px; background: #fff;
  border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 6px 18px rgba(31,35,61,.16); padding: 3px; }
.img-tool-btn { height: 26px; padding: 0 9px; border: none; border-radius: 6px; background: transparent;
  font-size: 12px; color: var(--text); cursor: pointer; font-family: var(--font); }
.img-tool-btn:hover { background: var(--primary-light); color: var(--primary); }
.ann-view { line-height: 1.9; font-size: 14px; word-break: break-word; max-height: 62vh; overflow-y: auto; }
.ann-view-page { max-height: none; overflow-y: visible; }
.ann-view p { margin: 0 0 8px; }
.ann-view h1,.ann-view h2,.ann-view h3,.ann-view h4 { margin: 14px 0 8px; line-height: 1.5; }
.ann-view a, .ann-editor a { color: var(--primary); text-decoration: underline; }
.ann-view blockquote, .ann-editor blockquote { margin: 8px 0; padding: 8px 14px;
  border-left: 3px solid var(--primary); background: #F7F8FB; color: #4B5563; }
.ann-view table, .ann-editor table { border-collapse: collapse; width: 100%; }
.ann-view td, .ann-view th, .ann-editor td, .ann-editor th { border: 1px solid var(--border); padding: 6px 10px; }
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 18px; cursor: pointer; transition: box-shadow .15s; }
.ann-item:hover { box-shadow: 0 2px 10px rgba(24,26,43,.08); }
.ann-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ann-item-title { font-weight: 600; font-size: 15px; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ann-item-excerpt { font-size: 13px; color: #5A6079; line-height: 20px; height: 40px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; word-break: break-all; }
.ann-item-sub { font-size: 12px; color: var(--muted); line-height: 18px; }
.ann-item-arrow { color: var(--muted); font-size: 20px; flex: none; }
.ann-bulb { margin-left: auto; display: inline-flex; animation: bulbGlow 1.6s ease-in-out infinite; }
.ann-bulb .icon { width: 15px; height: 15px; }
@keyframes bulbGlow { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
.sign-pad { display: block; width: 100%; height: 180px; border: 1.5px dashed var(--border);
  border-radius: 8px; background: #fff; touch-action: none; cursor: crosshair; }
.pager { display: flex; align-items: center; gap: 10px; justify-content: flex-end; margin-top: 14px; color: var(--muted); font-size: 13px; flex-wrap: wrap; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(24,26,43,.4); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 440px; padding: 24px; max-height: 88vh; overflow-y: auto; }
.modal h3 { font-size: 16px; margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: none; cursor: pointer; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #D6D9E6; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ---------- 复选框 ---------- */
.chk { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.auth-agree { display: flex; align-items: flex-start; justify-content: center; gap: 6px;
  font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.6; }
.auth-agree a { cursor: pointer; }

/* ---------- 提示 ---------- */
.toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 200; background: #22263B; color: #fff; padding: 10px 20px; border-radius: 8px; font-size: 14px; }
.toast.err { background: var(--danger); }
.empty { text-align: center; color: var(--muted); padding: 40px 0; font-size: 13px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; margin-top: 10px; flex-wrap: wrap; }
.file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.upload-btn { position: relative; overflow: hidden; }
.upload-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.role-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; background: var(--primary-light); color: var(--primary); }
.role-badge.operator { background: #E2F5F2; color: var(--accent); }
/* 院校层次标签 */
.tier-badge { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 6px; vertical-align: 1px; }
.tier-badge.t985 { background: #7C3AED; color: #fff; }
.tier-badge.t211 { background: #EDE9FE; color: #6D28D9; }
.tier-badge.tsyl { background: #CCFBF1; color: #0F766E; }
.tier-badge.tnormal { background: #F3F4F6; color: #374151; }
.tier-badge.tvocational { background: #FEF3C7; color: #D97706; }
.tier-badge.tunknown { background: #F9FAFB; color: #9CA3AF; }
.tier-badge.tqs { background: #EFF6FF; color: #3B82F6; }
.tier-manual { color: #D97706; font-weight: 700; margin-left: 1px; cursor: help; }
.tier-auto-note { height: var(--input-h); display: flex; align-items: center; padding: 0 12px;
  border: 1px dashed var(--border); border-radius: 8px; color: var(--muted); font-size: 13px; }
.tier-auto-note b { color: var(--primary); margin-left: 4px; }

/* ---------- 移动端适配 ---------- */
.mobile-topbar { display: none; }
.sidebar-mask { display: none; }
@media (max-width: 768px) {
  .main { margin-left: 0; padding: 16px 14px 80px; }
  .sidebar { transform: translateX(-100%); transition: transform .2s; width: 240px; }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask.show { display: block; position: fixed; inset: 0; background: rgba(24,26,43,.4); z-index: 25; }
  .mobile-topbar { display: flex; position: sticky; top: 0; z-index: 20; background: #fff; border-bottom: 1px solid var(--border); padding: 10px 14px; align-items: center; gap: 12px; margin: -16px -14px 16px; }
  .mobile-topbar img { width: 28px; height: 28px; border-radius: 7px; }
  .mobile-topbar .brand-name { font-size: 15px; }
  .hamburger { background: none; border: none; padding: 6px; cursor: pointer; color: var(--text); }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span2 { grid-column: span 1; }
  .form-grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat-card { padding: 14px; gap: 10px; }
  .stat-num { font-size: 19px; }
  .stat-label { font-size: 12px; }
  .stat-ico { width: 36px; height: 36px; }
  .chart-grid { grid-template-columns: 1fr; }
  .chart-box { height: 260px; }
  .toolbar .input, .toolbar .select { min-width: 0; width: 100%; }
  .toolbar .grow .input, .toolbar .grow .select { width: auto; }
  .toolbar > * { flex: 1 1 45%; }
  .toolbar .grow { flex: 1 1 100%; }
  .toolbar .btn { flex: 1 1 auto; }
  .card { padding: 14px; }
  .file-row { gap: 6px; }
  .file-row .btn { padding: 0 8px; }
  .auth-card { padding: 28px 22px; }
  .modal { padding: 18px; }
  .page-title { font-size: 18px; }
}
