/* ============================================================
   QooboJob 后台样式（简单、信息密度高）
   ============================================================ */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
    font-size: 14px;
    color: #222;
    background: #f4f5f7;
}

a {
    color: #1565c0;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ---------- 布局 ---------- */
.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 100px;
    flex: 0 0 100px;
    background: #1f2733;
    color: #cfd6e0;
}

.brand {
    padding: 16px 18px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid #2c3644;
}

.nav {
    padding: 8px 0;
}

.nav-item {
    display: block;
    padding: 10px 18px;
    color: #cfd6e0;
}

.nav-item:hover {
    background: #2a3442;
    text-decoration: none;
}

.nav-item.active {
    background: #2f6fd0;
    color: #fff;
}

.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: #fff;
    border-bottom: 1px solid #e2e5ea;
}

.topbar-title {
    font-weight: 600;
}

.topbar-admin {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-name {
    color: #444;
}

.content {
    padding: 20px;
}

.inline-form {
    display: inline;
}

.link-button {
    border: 0;
    background: none;
    padding: 0;
    color: #1565c0;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.link-button:hover {
    text-decoration: underline;
}

/* ---------- 通用 ---------- */
h1 {
    font-size: 18px;
    margin: 0 0 14px;
}

.muted {
    color: #777;
}

.btn {
    display: inline-block;
    padding: 5px 12px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    background: #fff;
    color: #333;
}

.btn:hover {
    background: #f0f2f5;
    text-decoration: none;
}

.alert {
    padding: 8px 12px;
    margin-bottom: 14px;
    border: 1px solid #f0c0c0;
    background: #fdf0f0;
    color: #b03030;
    border-radius: 3px;
}

/* ---------- 统计卡片 ---------- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.card {
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 4px;
    padding: 14px 16px;
}

.card .card-value {
    font-size: 24px;
    font-weight: 600;
}

.card .card-label {
    color: #666;
    margin-top: 4px;
}

.card-link {
    display: block;
}

.card-link:hover {
    text-decoration: none;
    border-color: #2f6fd0;
}

/* ---------- 表格 ---------- */
.toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.toolbar input[type="text"],
.toolbar select {
    height: 30px;
    padding: 0 8px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
}

.toolbar input[type="text"] {
    width: 260px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #e2e5ea;
}

th,
td {
    padding: 7px 10px;
    border-bottom: 1px solid #eceff3;
    text-align: left;
    vertical-align: top;
    word-break: break-all;
}

th {
    background: #f7f8fa;
    font-weight: 600;
    white-space: nowrap;
}

tbody tr:hover {
    background: #f6f9ff;
}

tr[data-href] {
    cursor: pointer;
}

td.num,
th.num {
    text-align: center;
    white-space: nowrap;
}

td.nowrap {
    white-space: nowrap;
}

.empty {
    padding: 16px;
    color: #777;
}

/* ---------- 分页 ---------- */
.pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 4px 10px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    background: #fff;
}

.pagination .current {
    background: #2f6fd0;
    border-color: #2f6fd0;
    color: #fff;
}

.pagination .disabled {
    color: #b0b6bf;
}

.pagination .page-total {
    border: 0;
}

/* 共 x 页 / y 条 */

/* ---------- 详情 ---------- */
.detail-table {
    width: auto;
    min-width: 60%;
}

.detail-table th {
    width: 160px;
    white-space: nowrap;
}

.field-block {
    margin-top: 18px;
}

.field-block h2 {
    font-size: 15px;
    margin: 0 0 6px;
}

/* ---------- Markdown 正文（自然撑开高度，不做内容区内部滚动） ---------- */
.md-body {
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 4px;
    padding: 14px 18px;
    line-height: 1.7;
    word-break: break-word;
}

.md-body>*:first-child {
    margin-top: 0;
}

.md-body>*:last-child {
    margin-bottom: 0;
}

.md-body h1,
.md-body h2,
.md-body h3,
.md-body h4,
.md-body h5,
.md-body h6 {
    margin: 18px 0 8px;
    line-height: 1.4;
}

.md-body h1 {
    font-size: 20px;
}

.md-body h2 {
    font-size: 17px;
}

.md-body h3 {
    font-size: 15px;
}

.md-body h4,
.md-body h5,
.md-body h6 {
    font-size: 14px;
}

.md-body p {
    margin: 10px 0;
}

.md-body ul,
.md-body ol {
    margin: 10px 0;
    padding-left: 24px;
}

.md-body li {
    margin: 4px 0;
}

.md-body code {
    padding: 1px 4px;
    border-radius: 3px;
    background: #f2f4f7;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
}

.md-body pre {
    margin: 10px 0;
    padding: 10px 12px;
    border: 1px solid #eceff3;
    border-radius: 4px;
    background: #f7f8fa;
    white-space: pre-wrap;
    word-break: break-word;
}

.md-body pre code {
    padding: 0;
    background: none;
}

/* 折叠起来的原始 Markdown */
.md-raw-wrap {
    margin-top: 8px;
}

.md-raw-wrap>summary {
    cursor: pointer;
    color: #1565c0;
    font-size: 13px;
}

.md-raw {
    margin: 8px 0 0;
    padding: 10px 12px;
    border: 1px solid #e2e5ea;
    border-radius: 4px;
    background: #fbfbfc;
    white-space: pre-wrap;
    word-break: break-word;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
}

.md-preview {
    flex: 1;
    min-width: 0;
}

/* ---------- 管理员列表：添加管理员与删除操作 ---------- */
.add-admin {
    margin-bottom: 14px;
}

.add-admin > summary {
    cursor: pointer;
    color: #1565c0;
    margin-bottom: 10px;
}

.link-danger {
    color: #c0392b;
    margin-left: 10px;
}

/* ---------- 职位列表：列宽分配与职能映射 ---------- */
.jobs-table {
    table-layout: fixed;
    width: 100%;
    min-width: 1080px;
}

/* 列宽：sn 5% / title 20% / location 12% / work mode 7% / education 15% / language 15% / job function 16% / last seen 10% */
.jobs-table .col-sn {
    width: 3%;
}

.jobs-table .col-title {}

.jobs-table .col-location {
    width: 12%;
}

.jobs-table .col-work-mode {
    width: 7%;
}

.jobs-table .col-education {
    width: 15%;
}

.jobs-table .col-language {
    width: 8%;
}

.jobs-table .col-function {
    width: 16%;
}

.jobs-table .col-last-seen {
    width: 10%;
}

/* 这个表列多，单元格左右内边距收窄一点 */
.jobs-table th,
.jobs-table td {}

/* 列表里除 title 外都尽量单行显示，超出列宽的部分省略，悬停可看完整内容；
   详情页不受这条限制，长内容正常换行显示 */
.jobs-table .cell-one-line,
.jobs-table .cell-chip,
.jobs-table .fn-parent,
.jobs-table .fn-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* title 固定列宽，允许换行，完整显示 */
.job-title-cell {
    white-space: normal;
    word-break: break-word;
}

.fn-group {
    margin-bottom: 8px;
}

.fn-group:last-child {
    margin-bottom: 0;
}

/* 方框样式：job function 的大类、education / language 的每个值共用同一种边框 */
.fn-parent,
.cell-chip {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #d5dae1;
    border-radius: 3px;
    /*background: #f7f8fa;*/
    font-weight: 400;
    max-width: 100%;
}

/* education / language 的多个值：竖排显示，每个值一个方框 */
.value-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
}

/* 二级职能：竖排显示，不加边框 */
.fn-children {
    margin-top: 3px;
    padding-left: 2px;
}

.fn-child {
    display: block;
    padding: 1px 0;
    color: #555;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid #d5dae1;
    border-radius: 10px;
    background: #f7f8fa;
    font-size: 13px;
}

.tag .tag-category {
    color: #888;
    margin-left: 4px;
    font-size: 12px;
}

/* ---------- 登录页 ---------- */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: #f4f5f7;
}

.login-box {
    width: 320px;
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 4px;
    padding: 24px;
}

.login-brand {
    font-size: 20px;
    font-weight: 600;
}

.login-sub {
    color: #777;
    margin-bottom: 18px;
}

.login-box label {
    display: block;
    margin-bottom: 4px;
    color: #444;
}

.login-box input[type="text"],
.login-box input[type="password"] {
    width: 100%;
    height: 34px;
    padding: 0 10px;
    margin-bottom: 14px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
}

.btn-primary {
    width: 100%;
    height: 34px;
    border: 0;
    border-radius: 3px;
    background: #2f6fd0;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
}

.btn-primary:hover {
    background: #2a62b8;
}

/* ---------- 编辑表单（用户详情等） ---------- */
.alert-ok {
    border-color: #b6dcc0;
    background: #f0f9f2;
    color: #26733c;
}

.alert-info {
    border-color: #c9d9f0;
    background: #f2f7fd;
    color: #2a5a94;
}

.edit-form {
    background: #fff;
    border: 1px solid #e2e5ea;
    border-radius: 4px;
    padding: 16px 18px;
    max-width: 900px;
}

.form-meta {
    color: #888;
    margin-bottom: 14px;
}

.form-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.form-row>label {
    flex: 0 0 130px;
    color: #444;
}

.form-row input[type="text"],
.form-row select {
    width: 320px;
    height: 30px;
    padding: 0 8px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    font-size: 14px;
    font-family: inherit;
}

.form-row-top {
    align-items: flex-start;
}

.md-input {
    flex: 1;
    width: 100%;
    min-height: 320px;
    padding: 8px 10px;
    border: 1px solid #c9ced6;
    border-radius: 3px;
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}

.tag-picker {
    flex: 1;
}

.tag-group {
    margin-bottom: 8px;
}

.tag-group-title {
    color: #888;
    font-size: 12px;
    margin-bottom: 4px;
}

.tag-check {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border: 1px solid #d5dae1;
    border-radius: 10px;
    background: #f7f8fa;
    font-size: 13px;
    cursor: pointer;
}

.tag-check:hover {
    background: #eef2f8;
}

.form-actions {
    padding-left: 142px;
}

.btn-inline {
    width: auto;
    padding: 0 22px;
}
