/* ============ 分分秒秒 管理后台通用样式 ============ */
:root {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #1d1f24;
  --ink-2: #5b606b;
  --ink-3: #9aa0ab;
  --line: #e6e8ed;
  --gold: #b78a3f;
  --gold-deep: #9a6f2c;
  --gold-soft: #f7f1e6;
  --dark: #141519;
  --dark-2: #1e2027;
  --red: #d04848;
  --green: #2f9e63;
  --blue: #3367d6;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(20, 21, 25, 0.08);
  font-size: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 8px;
  padding: 9px 12px; width: 100%; background: #fff; color: var(--ink);
  outline: none; transition: border-color .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--gold); }
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
label { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 8px;
  padding: 8px 16px; font-size: 13.5px; font-weight: 500;
  transition: all .15s; white-space: nowrap; background: #fff;
}
.btn-primary { background: var(--dark); color: #fff; border-color: var(--dark); }
.btn-primary:hover { background: #000; }
.btn-gold { background: linear-gradient(135deg, #c39a4d, #a6792e); color: #fff; }
.btn-gold:hover { filter: brightness(1.06); }
.btn-ghost { border-color: var(--line); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-deep); }
.btn-danger { border-color: #f0caca; color: var(--red); }
.btn-danger:hover { background: #fdf1f1; }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ---------- 登录页 ---------- */
.login-page {
  min-height: 100vh; display: grid; place-items: center;
  background: radial-gradient(ellipse at 70% -10%, #2a2c36 0%, #141519 55%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: #fff; border-radius: 16px; padding: 40px 34px 30px;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  text-align: center;
}
.login-logo { height: 46px; margin-bottom: 22px; }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card .sub { color: var(--ink-3); font-size: 13px; margin-bottom: 28px; }
.login-feishu {
  width: 100%; padding: 12px; border-radius: 10px; border: none;
  background: linear-gradient(135deg, #3370ff, #245bdb); color: #fff;
  font-size: 15px; font-weight: 600;
}
.login-feishu:hover { filter: brightness(1.05); }
.login-dev { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.login-dev .dev-label { font-size: 12px; color: var(--ink-3); margin-bottom: 10px; }
.login-dev .btns { display: flex; gap: 8px; }
.login-dev .btn { flex: 1; }
.login-error {
  margin-top: 16px; padding: 10px 12px; border-radius: 8px;
  background: #fdf1f1; color: var(--red); font-size: 13px; display: none;
}
.login-note { margin-top: 20px; font-size: 12px; color: var(--ink-3); line-height: 1.7; }

/* ---------- 后台布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--dark); color: #c7cad3;
  display: flex; flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; height: 100vh;
}
.sidebar .brand {
  padding: 18px 14px; display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap;
}
.sidebar .brand .brand-lockup { height: 26px; width: auto; display: block; flex-shrink: 0; }
.sidebar .brand .brand-mark { display: none; height: 30px; width: auto; }
.sidebar .brand b { color: #fff; font-size: 13px; letter-spacing: .3px; font-weight: 600; white-space: nowrap; }
.side-nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.side-nav .group { font-size: 11px; color: #6b6f7c; padding: 14px 10px 6px; letter-spacing: 1px; }
.side-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; font-size: 13.5px;
  color: #c7cad3; margin-bottom: 2px; transition: all .15s;
}
.side-nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-nav a.active { background: linear-gradient(135deg, rgba(195,154,77,.25), rgba(166,121,46,.15)); color: #e6c98c; }
.side-nav .badge {
  margin-left: auto; background: var(--red); color: #fff;
  font-size: 11px; border-radius: 9px; padding: 1px 7px; font-weight: 600;
}
.side-foot { padding: 14px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
.side-foot .u-name { color: #fff; font-weight: 600; margin-bottom: 3px; }
.side-foot .u-role { color: #8b8f9b; margin-bottom: 10px; }
.side-foot .logout { color: #8b8f9b; font-size: 12.5px; background: none; border: none; padding: 0; }
.side-foot .logout:hover { color: #e6c98c; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px; position: sticky; top: 0; z-index: 20; gap: 14px;
}
.topbar h2 { font-size: 17px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .right { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.content { padding: 24px 26px 48px; }

/* 手机端菜单按钮 + 遮罩（窄屏以下生效） */
.nav-toggle-admin {
  display: none;
  width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--line); border-radius: 8px; background: #fff;
  flex-direction: column; align-items: center; justify-content: center; gap: 4px;
}
.nav-toggle-admin span { display: block; width: 18px; height: 2px; border-radius: 2px; background: var(--ink); }
.side-mask {
  display: none; position: fixed; inset: 0; z-index: 90;
  background: rgba(13,13,15,.5);
}
.side-mask.open { display: block; }

/* ---------- 卡片/表格 ---------- */
.panel { background: var(--panel); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.panel-head h3 { font-size: 15.5px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.toolbar input, .toolbar select { width: auto; min-width: 150px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; }
.stat-card .k { color: var(--ink-3); font-size: 12.5px; margin-bottom: 8px; }
.stat-card .v { font-size: 28px; font-weight: 700; font-family: "DIN Alternate", Arial, sans-serif; }
.stat-card .v small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.stat-card.gold .v { color: var(--gold-deep); }

table { width: 100%; border-collapse: collapse; }
.tbl-wrap { overflow-x: auto; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
th { color: var(--ink-3); font-weight: 500; font-size: 12px; white-space: nowrap; background: #fafafb; }
tr:hover td { background: #fcfcfa; }
td .sub { color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.empty { text-align: center; color: var(--ink-3); padding: 44px 0; font-size: 13px; }

.tag { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; margin: 1px 3px 1px 0; background: var(--gold-soft); color: var(--gold-deep); }
.status { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 500; }
.st-new { background: #eef4ff; color: #3367d6; }
.st-contacted { background: #f3f0ff; color: #6c4bd8; }
.st-interview { background: #fff4e5; color: #d08020; }
.st-offer { background: #e8f7ef; color: var(--green); }
.st-rejected, .st-invalid { background: #f2f3f5; color: #8a8f97; }
.st-done { background: #e8f7ef; color: var(--green); }
.st-published, .st-open, .st-active { background: #e8f7ef; color: var(--green); }
.st-draft, .st-closed, .st-disabled { background: #f2f3f5; color: #8a8f97; }
.ok-dot { color: var(--green); font-weight: 700; }
.fail-dot { color: var(--red); font-weight: 700; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,21,25,.5);
  display: none; align-items: flex-start; justify-content: center;
  z-index: 100; padding: 40px 16px; overflow-y: auto;
}
.modal-mask.open { display: flex; }
.modal {
  background: #fff; border-radius: 14px; width: 100%; max-width: 680px;
  padding: 24px 26px; box-shadow: 0 24px 60px rgba(0,0,0,.25);
}
.modal.wide { max-width: 820px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.modal-head h3 { font-size: 16.5px; }
.modal-close { background: none; border: none; font-size: 22px; color: var(--ink-3); line-height: 1; }
.modal-close:hover { color: var(--ink); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* 详情描述列表 */
.dl { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; font-size: 13.5px; }
.dl dt { color: var(--ink-3); }
.dl dd { word-break: break-all; }
.dl dd a { color: var(--blue); }

/* 图片上传 */
.upload-row { display: flex; align-items: center; gap: 14px; }
.upload-preview {
  width: 84px; height: 84px; border-radius: 10px; object-fit: cover;
  border: 1px solid var(--line); background: #fafafa;
}
.avatar-preview { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }

/* Toast */
.toast {
  position: fixed; top: 22px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--dark); color: #fff; padding: 11px 22px; border-radius: 10px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 300;
  box-shadow: 0 10px 30px rgba(0,0,0,.25);
}

/* 英文内容分区 */
.lang-divider {
  grid-column: 1 / -1;
  margin: 6px 0 -2px;
  padding: 8px 12px;
  border-left: 3px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 0 6px 6px 0;
  font-weight: 600;
  font-size: 13px;
  color: var(--gold-deep);
}
.lang-divider .hint { font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.tag-en {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 600; border-radius: 4px;
  background: #eef3ff; color: var(--blue); border: 1px solid #d6e1fb;
}

/* ---------- 最高管理员保护标识 ---------- */
.root-badge {
  display: inline-block; margin-left: 8px; padding: 1px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; border-radius: 4px;
  background: var(--gold-soft); color: var(--gold-deep); border: 1px solid var(--gold);
  vertical-align: 1px;
}
tr.root-row td { background: #fdfaf3; }
.imp-protected-note { font-size: 12px; color: var(--gold-deep); white-space: normal; line-height: 1.5; }

/* ---------- 飞书按部门导入器 ---------- */
.imp-wrap { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
.imp-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px;
  margin-bottom: 10px; font-size: 13px;
}
.imp-switch { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-2); white-space: nowrap; }
.imp-depts { border: 1px solid var(--line); border-radius: 10px; padding: 10px; min-width: 0; }
.dept-tree { max-height: 420px; overflow-y: auto; margin-top: 6px; }
.dept-item {
  display: flex; align-items: center; gap: 6px;
  padding: 4px 8px; font-size: 13px; color: var(--ink);
  border-radius: 6px; cursor: pointer; line-height: 1.35;
}
.dept-item:hover { background: var(--gold-soft); }
.dept-item { white-space: nowrap; }
/* 覆盖全局 input(width:100%/边框/内边距)，复选框复位 */
.imp-wrap input[type="checkbox"] {
  width: auto; flex: none; margin: 0;
  padding: 0; border: none; border-radius: 0;
  background: none; accent-color: var(--gold);
}
.imp-main { min-width: 0; }
.imp-table-wrap { max-height: 380px; overflow-y: auto; }
.imp-summary { color: var(--gold-deep); font-weight: 600; font-size: 12.5px; }
.imp-exists-tag {
  display: inline-block; margin-left: 8px; padding: 0 7px;
  font-size: 11px; font-weight: 600; border-radius: 4px;
  background: #f2f3f5; color: #8a8f97; vertical-align: 1px;
}
tr.imp-row-exists { color: var(--ink-3); background: #fafafa; }
tr.imp-row-exists b { color: var(--ink-3); font-weight: 600; }
@media (max-width: 760px) {
  .imp-wrap { grid-template-columns: 1fr; }
  .dept-tree { max-height: 220px; }
}
.tag-en.miss { background: #f4f5f7; color: var(--ink-3); border-color: var(--line); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red); }

@media (max-width: 860px) {
  .nav-toggle-admin { display: inline-flex; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 100;
    width: 248px;
    transform: translateX(-100%);
    transition: transform .25s ease;
  }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .sidebar .brand { justify-content: flex-start; padding: 18px 16px; gap: 8px; }
  .sidebar .brand .brand-lockup { display: block; }
  .sidebar .brand .brand-mark { display: none; }
  .sidebar .brand b, .side-nav a span.txt, .side-nav .group, .side-foot { display: revert; }
  .side-nav a { justify-content: flex-start; padding: 10px 12px; }
  .side-nav .badge { display: inline-block; }
  .topbar { padding: 0 14px; gap: 10px; }
  .content { padding: 14px 14px 40px; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar { gap: 8px; }
  .toolbar input, .toolbar select { width: 100%; min-width: 0; flex: 1 1 140px; }
  .panel { padding: 16px 14px; }
  .modal-mask { padding: 0; }
  .modal { border-radius: 0; min-height: 100vh; max-width: 100%; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 14px 16px; }
}
@media (max-width: 480px) {
  .topbar .right span { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  th, td { padding: 10px 9px; }
}
