/* 简语 · 后台样式 */
:root { --bg: #f4f6fb; --surface: #fff; --border: #e6e9f0; --text: #262b36; --text-soft: #7a8290; --primary: #4f6ef7; --primary-soft: #eef1ff; --danger: #e5484d; --danger-soft: #fdecec; --success: #2fa46a; --warning: #b8860b; --radius: 10px; --shadow: 0 1px 3px rgba(20, 25, 45, .05); }
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
/* ---------- 布局 ---------- */ .admin-layout { display: flex; min-height: 100vh; }
.admin-side { width: 218px; background: #1d2433; color: #b6bfd0; flex-shrink: 0; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.admin-brand { display: block; padding: 20px 22px; font-size: 18px; font-weight: 700; color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.admin-brand:hover { color: #fff; }
.admin-brand span { background: linear-gradient(135deg, #6f8bff, #a78bfa); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.admin-menu { padding: 14px 10px; flex: 1; }
.admin-menu a { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 8px; margin-bottom: 4px; color: #aeb7c8; }
.admin-menu a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.admin-menu a.active { background: var(--primary); color: #fff; }
.admin-foot { padding: 14px 22px; border-top: 1px solid rgba(255, 255, 255, .08); font-size: 13px; }
.admin-foot form { display: inline; }
.admin-foot a { color: #8d97ab; }
.admin-main { flex: 1; min-width: 0; overflow-x: auto; }
.admin-top { background: var(--surface); border-bottom: 1px solid var(--border); padding: 0 26px; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.admin-top h1 { font-size: 17px; font-weight: 700; }
.admin-top-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.admin-top-left h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.admin-menu-btn { display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border: 1px solid var(--border); background: var(--surface); border-radius: 8px; cursor: pointer; color: var(--text); flex-shrink: 0; }
.admin-menu-btn:hover { color: var(--primary); border-color: var(--primary); }
.admin-mask { display: none; }
/* 抽屉遮罩（仅移动端显示） */
/* ---------- 右上角管理员下拉菜单 ---------- */ .user-menu { position: relative; }
.user-menu-btn { display: inline-flex; align-items: center; gap: 8px; background: none; border: none; cursor: pointer; padding: 6px 10px; border-radius: 9px; color: var(--text-soft); font-size: 13px; font-family: inherit; }
.user-menu-btn:hover { background: var(--bg); color: var(--text); }
.user-avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 14px; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.avatar-row { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.cur-avatar { width: 88px; height: 88px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); box-shadow: var(--shadow); }
.cur-avatar-empty { display: flex; align-items: center; justify-content: center; background: var(--primary-soft); color: var(--primary); font-size: 34px; font-weight: 700; }
.avatar-form { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; width: max-content; }
.avatar-form .btn-primary { width: 100%; justify-content: center; }
.avatar-upload-line { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.file-btn { position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: 1px solid var(--primary); color: var(--primary); background: linear-gradient(135deg, #ffffff, #f1f4ff); border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; overflow: hidden; box-shadow: 0 2px 6px rgba(79, 110, 247, .16); transition: all .2s ease; }
.file-btn svg { width: 14px; height: 14px; }
.file-btn:hover { background: var(--primary); color: #fff; transform: translateY(-1px); box-shadow: 0 6px 18px rgba(79, 110, 247, .32); }
.file-btn:active { transform: translateY(0); box-shadow: 0 2px 6px rgba(79, 110, 247, .2); }
.file-btn input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-name { font-size: 13px; color: var(--text-soft); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown { position: absolute; right: 0; top: calc(100% + 10px); background: #fff; border: 1px solid var(--border); border-radius: 11px; box-shadow: 0 14px 34px rgba(20, 25, 45, .14); min-width: 158px; padding: 6px; display: none; z-index: 100; }
.user-dropdown.open { display: block; }
.user-dropdown a, .user-dropdown button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: none; background: none; cursor: pointer; border-radius: 8px; font-size: 13.5px; color: var(--text); font-family: inherit; }
.user-dropdown a:hover, .user-dropdown button:hover { background: var(--bg); color: var(--primary); }
.user-dropdown .divider { height: 1px; background: var(--border); margin: 5px 0; }
.admin-body { padding: 26px; }
/* ---------- 卡片 / 统计 ---------- */ .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 26px; }
.cards-6 { grid-template-columns: repeat(3, 1fr); }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); display: flex; flex-direction: row; align-items: center; gap: 16px; }
.stat-icon { width: 46px; height: 46px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.stat-icon svg { width: 24px; height: 24px; }
.stat-card.green .stat-icon { background: #e6f6ed; color: var(--success); }
.stat-card.amber .stat-icon { background: #fff3d6; color: var(--warning); }
.stat-info { display: flex; flex-direction: column; min-width: 0; }
.stat-card .num { font-size: 26px; font-weight: 800; line-height: 1.1; margin-bottom: 3px; }
.stat-card .label { color: var(--text-soft); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-card.blue .num { color: var(--primary); }
.stat-card.green .num { color: var(--success); }
.stat-card.amber .num { color: var(--warning); }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 22px; }
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.panel-title.spaced { margin-top: 26px; }
/* ---------- 表格 ---------- */ .table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.table th, .table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--border); font-size: 13.5px; vertical-align: middle; overflow: hidden; }
.table th:last-child, .table td:last-child { text-align: right; white-space: nowrap; width: 240px; }
/* 最后一列（操作/时间）贴右 */
.table th { color: var(--text-soft); font-weight: 600; background: #fafbfe; }
.table tr:hover td { background: #fafbff; }
.table .nowrap { white-space: nowrap; }
.table .ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .ellipsis a { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cm-email { margin-left: 6px; color: var(--text-soft); font-size: 12px; white-space: nowrap; }
.table .title-col { font-weight: 600; }
.table .title-col a, .table .title-col .slug { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table .title-col .slug { color: var(--text-soft); font-size: 12px; font-weight: 400; }
.table .title-col a:hover { color: var(--primary); }
/* 表格列宽（配合 table-layout: fixed，用 width 而不是 max-width） */
.col-cat-name { width: 22%; }
.col-cat-slug { width: 24%; }
.col-cat-desc { width: 30%; color: var(--text-soft); }
.col-comment-author { width: 18%; }
.col-comment-content { width: 28%; }
.col-post-ref { width: 20%; }
.col-dash-cat { width: 14%; }
.col-dash-author { width: 14%; }
.col-dash-content { width: 36%; }
.col-link-name { width: 18%; }
.col-link-url { width: 26%; }
.col-link-url a { color: var(--primary); }
.col-link-desc { width: 26%; color: var(--text-soft); }
.col-post-info { width: 28%; }
th.col-th-title { width: 22%; }
/* ---------- 搜索与编辑表单 ---------- */ .search-form { display: flex; gap: 8px; flex: 1; max-width: 380px; }
.search-form input { flex: 1; padding: 8px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; outline: none; }
.form-edit { max-width: 560px; }
.form-profile { max-width: 460px; }
/* ---------- 通用工具样式 ---------- */ .empty-cell { text-align: center; color: var(--text-soft); padding: 30px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; gap: 12px; flex-wrap: wrap; }
.inline-label { margin: 0; }
.cm-meta { font-size: 13.5px; color: var(--text-soft); margin-bottom: 16px; }
.cm-meta strong { color: var(--text); }
.cm-meta a { color: var(--primary); }
.code-area { font-family: Consolas, Menlo, monospace; font-size: 13.5px; }
.meta-item { display: inline-block; margin-right: 14px; color: var(--text-soft); font-size: 12.5px; }
.meta-item:first-child { color: var(--text); font-weight: 600; }
/* ---------- 徽章 ---------- */ .badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.on { background: #e6f6ed; color: var(--success); }
.badge.off { background: var(--danger-soft); color: var(--danger); }
.badge.pending { background: #fff3d6; color: var(--warning); }
/* ---------- 按钮 ---------- */ .btn { display: inline-block; border: 1px solid var(--border); background: var(--surface); color: var(--text-soft); padding: 7px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { opacity: .9; color: #fff; }
.btn-danger { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.row-actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; justify-content: flex-end; }
/* ---------- 表单 ---------- */ .form { max-width: 100%; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 13.5px; }
.form-row input[type=text], .form-row input[type=url], .form-row input[type=number], .form-row input[type=password], .form-row input[type=email], .form-row textarea, .form-row select { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; font-family: inherit; outline: none; background: #fff; box-sizing: border-box; }
/* select 统一去掉原生外观，补自定义箭头，移动端宽度/颜色与 input 一致 */
.form-row select { appearance: none; -webkit-appearance: none; -moz-appearance: none; height: 42px; line-height: 1.4; color: var(--text); cursor: pointer; padding-right: 34px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='3'><polyline points='6 9 12 15 18 9'/></svg>"); background-repeat: no-repeat; background-position: right 12px center; }
.form-row select::-ms-expand { display: none; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--primary); }
.form-row textarea { resize: vertical; min-height: 90px; }
.form-row .hint { color: var(--text-soft); font-size: 12px; margin-top: 5px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.checkbox-line { display: flex; align-items: center; gap: 8px; }
.checkbox-line input { width: 16px; height: 16px; }
/* ---------- 提示 ---------- */ .alert { padding: 11px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; }
.alert.success { background: #e6f6ed; color: var(--success); }
.alert.error { background: var(--danger-soft); color: var(--danger); }
/* ---------- 登录页 ---------- */ .login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef1ff, #f6f7fb); }
.login-card { width: 360px; background: #fff; border-radius: 16px; box-shadow: 0 20px 60px rgba(30, 40, 80, .12); padding: 40px 36px; }
.login-card .logo { font-size: 26px; font-weight: 800; text-align: center; margin-bottom: 6px; background: linear-gradient(135deg, var(--primary), #8b5cf6); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.login-card .sub { text-align: center; color: var(--text-soft); font-size: 13px; margin-bottom: 26px; }
.login-card .field { margin-bottom: 16px; }
.login-card .field input { width: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; font-size: 14px; outline: none; }
.login-card .field input:focus { border-color: var(--primary); }
.login-card .captcha-field { display: flex; align-items: center; gap: 10px; }
.login-card .captcha-field input { flex: 1; }
.login-card .captcha-img { height: 46px; width: 128px; flex: 0 0 128px; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); background: #fff; }
.login-card .btn-primary { width: 100%; padding: 12px; font-size: 15px; }
.login-card .back { display: block; text-align: center; margin-top: 18px; color: var(--text-soft); font-size: 13px; }
.login-card .back:hover { color: var(--primary); }
/* ---------- 分页 ---------- */ .pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 16px; }
.pagination a { padding: 7px 16px; border: 1px solid var(--border); border-radius: 8px; font-size: 13.5px; color: var(--text); background: #fff; transition: .2s; }
.pagination a:hover { color: var(--primary); border-color: var(--primary); }
.pagination .page-info { color: var(--text-soft); font-size: 13.5px; }
/* ---------- 移动端适配 ---------- */ @media (max-width: 900px) { .admin-layout { display: block; width: 100%; min-width: 0; }
  .admin-side { /* 侧边栏折叠为左侧抽屉 */
    position: fixed; left: 0; top: 0; bottom: 0; width: 242px; transform: translateX(-100%); transition: transform .25s ease; z-index: 300; box-shadow: 0 0 40px rgba(20, 25, 45, .25); }
  .admin-side.open { transform: translateX(0); }
  .admin-menu-btn { display: inline-flex; }
  .admin-mask { display: block; position: fixed; inset: 0; background: rgba(20, 25, 45, .42); opacity: 0; pointer-events: none; transition: opacity .25s ease; z-index: 250; }
  .admin-mask.show { opacity: 1; pointer-events: auto; }
  .admin-top { padding: 0 14px; width: 960px; min-width: 0; }
  .admin-body { padding: 14px; width: 960px; min-width: 0; } }
/* ---------- 文章编辑器图片上传条 ---------- */ .img-upload-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.img-upload-bar input[type=text] { flex: 1; min-width: 120px; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; background: var(--bg); color: var(--text); outline: none; font-family: inherit; }
.img-upload-bar .btn { flex-shrink: 0; white-space: nowrap; }
.hidden-file { display: none; }
.img-hint { margin-bottom: 10px; }
/* ---------- 图片管理网格 ---------- */ .img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.img-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.img-thumb { aspect-ratio: 4 / 3; background: var(--bg); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.img-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.img-info { padding: 10px 12px; flex: 1; min-width: 0; }
.img-name { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.img-meta { color: var(--text-soft); font-size: 12px; margin: 4px 0 8px; }
.img-usage { font-size: 12px; color: var(--text-soft); line-height: 1.7; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.usage-link { color: var(--primary); }
.usage-link + .usage-link::before { content: "、"; color: var(--text-soft); }
.usage-none { color: var(--text-soft); }
.img-actions { display: flex; gap: 6px; padding: 0 12px 12px; align-items: center; }