:root {
  --primary: #2f6fed;
  --primary-soft: #e8f0fe;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2733;
  --muted: #8794a3;
  --border: #e7ebf1;
  --green: #30a46c;
  --red: #e5484d;
  --orange: #f5a623;
  --blue: #0091ff;
  --shadow: 0 1px 3px rgba(20, 30, 50, .06), 0 8px 24px rgba(20, 30, 50, .05);
  --radius: 14px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.5;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.btn {
  border: none; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer;
  background: #eef1f6; color: var(--text); transition: .15s; font-weight: 500;
}
.btn:hover { filter: brightness(.97); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: #2a62d4; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn-danger { background: var(--red); color: #fff; }
/* 操作列中可点击的图标按钮（编辑 / 反馈 / 详情 / 上传 / 下载 等）统一显示为绿色，明确标识「可用操作」；
   删除等危险操作按钮（.btn-danger）保持红色，主操作按钮（.btn-primary）保持蓝色。
   同时为按钮内 SVG 约束尺寸，确保图标清晰可见且与文本对齐。 */
.btn svg { width: 16px; height: 16px; vertical-align: middle; }
.btn:not(.btn-primary):not(.btn-danger) svg { color: var(--green); }
.row-actions .btn:not(.btn-danger) svg { color: var(--green); }
.icon-btn {
  border: none; background: transparent; cursor: pointer; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--text);
}
.icon-btn:hover { background: #eef1f6; }

/* ---------- 登录页 ---------- */
.login-view { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
  background: linear-gradient(135deg, #eaf1ff 0%, #f5f7fb 60%); }
.login-card { width: 100%; max-width: 400px; background: var(--card); border-radius: 18px; padding: 32px; box-shadow: var(--shadow); }
.login-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; margin-bottom: 26px; }
.brand-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--primary); display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.brand-logo-img { max-width: 240px; width: 70%; max-height: 180px; height: auto; object-fit: contain; display: block; }
.login-brand h1 { font-size: 19px; margin: 0; }
.login-brand p { margin: 0; font-size: 13px; }
#login-form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
#login-form input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 16px; outline: none; background: #fbfcfe;
}
#login-form input:focus { border-color: var(--primary); background: #fff; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; margin: 10px 0 0; }
.login-hint { margin-top: 18px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; }

/* ---------- 顶栏 ---------- */
.topbar { height: 58px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center;
  padding: 0 16px; gap: 12px; position: sticky; top: 0; z-index: 30; }
.topbar-title { font-weight: 600; font-size: 16px; flex: 1; }
.menu-toggle { display: none; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.sync-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sync-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.sync-status.online .dot { background: var(--green); }
.sync-status.offline .dot { background: var(--red); }
.user-badge { font-size: 13px; background: var(--primary-soft); color: var(--primary); padding: 4px 10px; border-radius: 999px; font-weight: 600; }
.unread-badge { display: none; align-items: center; justify-content: center; min-width: 22px; height: 22px; padding: 0 7px; background: var(--red); color: #fff; border-radius: 999px; font-size: 12px; font-weight: 700; line-height: 1; box-shadow: 0 0 0 2px var(--card); animation: pulse 1.6s infinite; cursor: pointer; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px var(--card), 0 0 0 0 rgba(229,72,77,.55); } 50% { box-shadow: 0 0 0 2px var(--card), 0 0 0 6px rgba(229,72,77,0); } }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 58px); }
.sidebar { width: 220px; flex: 0 0 220px; background: var(--card); border-right: 1px solid var(--border); padding: 14px 10px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 10px; cursor: pointer; color: var(--text); font-size: 14px; font-weight: 500; }
.nav-item:hover { background: #f2f5fa; }
.nav-item.active { background: var(--primary-soft); color: var(--primary); }
.nav-item svg { width: 20px; height: 20px; flex: 0 0 auto; }
.content { flex: 1; padding: 22px; max-width: 1100px; width: 100%; }
.bottom-tab { display: none; }

/* ---------- 卡片/通用 ---------- */
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 10px; flex-wrap: wrap; }
.page-head h2 { font-size: 18px; margin: 0; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat-card .num { font-size: 28px; font-weight: 700; }
.stat-card .label { color: var(--muted); font-size: 13px; margin-top: 2px; }
.stat-card.green .num { color: var(--green); }
.stat-card.blue .num { color: var(--blue); }
.stat-card.orange .num { color: var(--orange); }
.stat-card.red .num { color: var(--red); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* ---------- 表格/列表 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; background: #fbfcfe; outline: none; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #fafbfd; color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
tbody tr:hover { background: #f8fafd; }
.status-pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.status-已就业 { background: #e6f7ee; color: var(--green); }
.status-待入职 { background: #fff4e0; color: var(--orange); }
.status-未入职 { background: #fdeaea; color: var(--red); }
.status-未知 { background: #eef1f6; color: var(--muted); }
.account-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600; margin-left: 4px; vertical-align: middle; }
.account-tag.master { background: #fff4e0; color: #7a5a00; border: 1px solid #f5d99a; }
.account-tag.teacher { background: var(--primary-soft); color: var(--primary); }
.account-tag.student { background: #eef1f6; color: var(--muted); }
.account-tag.protected { background: #e6f7ee; color: #137a4b; border: 1px solid #a7e3c4; }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; margin: 0 4px 4px 0; color: #fff; }
.row-actions { display: flex; gap: 6px; }

/* 移动端卡片列表 */
.m-list { display: none; flex-direction: column; gap: 12px; }
.m-card { background: var(--card); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.m-card .m-top { display: flex; justify-content: space-between; align-items: center; }
.m-card .m-name { font-weight: 600; font-size: 15px; }
.m-card .m-row { display: flex; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 6px; flex-wrap: wrap; }
.m-card .m-row b { color: var(--text); font-weight: 500; }

/* ---------- 弹窗 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,50,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
@media (min-width: 700px) { .modal-mask { align-items: center; } }
.modal { background: var(--card); width: 100%; max-width: 560px; border-radius: 18px 18px 0 0; max-height: 92vh; overflow: auto; padding: 22px; }
@media (min-width: 700px) { .modal { border-radius: 18px; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-head h3 { margin: 0; font-size: 17px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); }
.field input, .field select, .field textarea { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font-size: 15px; outline: none; background: #fbfcfe; font-family: inherit; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------- 企业多联系人编辑器 ---------- */
.contacts-editor { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.contact-row { display: grid; grid-template-columns: 1.1fr 1fr 1.1fr 1.3fr 1.4fr auto; gap: 6px; align-items: center; }
.contact-row input { padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; font-size: 13px; outline: none; background: #fbfcfe; font-family: inherit; width: 100%; }
.contact-row input:focus { border-color: var(--primary); }
.contact-row .c-del { width: 34px; padding: 8px 0; }
.contact-line { font-size: 13px; color: var(--text); line-height: 1.55; }
@media (max-width: 640px) {
  .contact-row { grid-template-columns: 1fr 1fr; }
  .contact-row .c-del { grid-column: 1 / -1; }
}

/* 标签选择 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; border: 1px dashed var(--border); border-radius: 10px; }
.tag-opt { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; border: 1px solid var(--border); }
.tag-opt.sel { color: #fff; border-color: transparent; }

/* 反馈时间线 */
.fb-list { display: flex; flex-direction: column; gap: 12px; }
.fb-item { background: #f8fafd; border-radius: 10px; padding: 12px 14px; }
.fb-item .fb-meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.fb-item .fb-text { margin-top: 6px; font-size: 14px; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }

/* toast */
.toast-root { position: fixed; left: 50%; bottom: 30px; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast { background: #1f2733; color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); animation: fade .2s; }
.toast.warn { background: var(--orange); }
.toast.err { background: var(--red); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* 实时更新高亮 */
.flash { animation: flash 1s; }
@keyframes flash { 0% { background: #fff7d6; } 100% { background: transparent; } }

/* SVG 图表 */
.chart-svg { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; font-size: 12px; }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ---------- 响应式：移动端 ---------- */
@media (max-width: 768px) {
  .menu-toggle { display: inline-flex; }
  .sidebar { position: fixed; left: 0; top: 58px; bottom: 0; transform: translateX(-100%); transition: .2s; z-index: 25; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 14px; }
  .table-wrap { display: none; }
  .m-list { display: flex; }
  .topbar-title { font-size: 15px; }
  .user-badge { display: none; }
  .bottom-tab { display: flex; position: fixed; bottom: 0; left: 0; right: 0; background: var(--card); border-top: 1px solid var(--border); z-index: 30; padding-bottom: env(safe-area-inset-bottom); }
  .bottom-tab .nav-item { flex: 1; flex-direction: column; gap: 3px; font-size: 11px; padding: 8px 4px; border-radius: 0; justify-content: center; }
  .bottom-tab .nav-item svg { width: 22px; height: 22px; }
  .content { padding-bottom: 78px; }
  .two-col { gap: 14px; }
}
