/* TxtAI 管理后台样式 */
:root {
  --red: #ed5565;
  --yellow: #f8ac59;
  --green: #1ab394;
  --blue: #1054ff;
  --text: #34495e;
  --muted: #9aabb8;
  --line: #dde6eb;
  --bg: #f7faff;
  --side-bg: #101d3c;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  font-size: 14px;
}
a { text-decoration: none; color: inherit; }
.iconpark { vertical-align: -3px; }

/* 布局 */
.admin-body { display: flex; min-height: 100vh; }
.admin-side {
  width: 220px; min-width: 220px; background: #fff;
  display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 50;border-right: 1px solid #dde6eb;
}
.admin-main { margin-left: 220px; flex: 1; min-width: 0; }

/* 侧栏 */
.admin-logo {
  display: flex; align-items: center; gap: 8px; color: #fff;
  font-weight: 700; font-size: 17px; padding: 20px 18px;
}
.admin-logo em { color: #4d7cff; font-style: normal; }
.admin-nav { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.admin-nav a, .admin-side-foot a {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; color: #9aabb8; font-size: 14px;
}
.admin-nav a:hover, .admin-side-foot a:hover { color: #1054ff; background: rgba(255, 255, 255, .06); }
.admin-nav a.active { color: #fff; background:#7a94ff }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-group > a:first-child { font-weight: 600; }
.nav-sub { padding-left: 38px !important; font-size: 13px !important; color: #7c8ea0 !important; }
.admin-side-foot { margin-top: auto; padding: 14px 12px; border-top: 1px solid rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 4px; }
.admin-side-foot a { font-size: 13px; }

/* 顶栏 */
.admin-topbar {
  height: 60px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 40;
}
.admin-topbar h1 { font-size: 17px; }
.admin-user { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 5px; }
.admin-content { padding: 24px; }

/* 概览 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  padding: 18px; display: flex; align-items: center; gap: 14px;
}
.stat-ic { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.stat-card b { font-size: 22px; display: block; }
.stat-card div span { color: var(--muted); font-size: 12px; }
.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.admin-panel { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.panel-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 15px; display: flex; gap: 6px; align-items: center; }
.panel-more { color: var(--muted); font-size: 12px; display: flex; align-items: center; }
.panel-more:hover { color: var(--blue); }
.panel-row { display: flex; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px dashed var(--line); }
.panel-row:last-child { border-bottom: none; }
.panel-row:hover { background: #f7f9fc; }
.panel-row-info { flex: 1; min-width: 0; }
.panel-row-info h4 { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-row-info p { color: var(--muted); font-size: 12px; margin-top: 2px; }
.panel-row-end { color: var(--muted); font-size: 12px; white-space: nowrap; }
.news-mini-ic {
  width: 40px; height: 40px; min-width: 40px; border-radius: 10px;
  background: #f2f6fa; display: flex; align-items: center; justify-content: center;
}

/* 表格 */
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.table-toolbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.table-count { color: var(--muted); font-size: 13px; }
.table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.admin-table th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 500;
  padding: 10px 18px; background: #f7f9fc; white-space: nowrap;
}
.admin-table td { padding: 10px 18px; border-top: 1px solid var(--line); font-size: 13px; vertical-align: middle; }
.admin-table tbody tr:hover { background: #f7f9fc; }
.cell-product { display: flex; align-items: center; gap: 10px; }
.cell-product b { display: block; font-size: 13px; }
.cell-product span { color: var(--muted); font-size: 11px; }
.cell-title { max-width: 360px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.cell-actions { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.cell-actions form { display: inline; }
.p-icon { border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.p-icon.sm { width: 36px; height: 36px; min-width: 36px; }
.tag-green { color: var(--green); background: rgba(26, 179, 148, .12); padding: 2px 8px; border-radius: 999px; font-size: 12px; }
.tag-muted { color: var(--muted); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 8px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; border: 1px solid transparent;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: #0d43d6; }
.btn-ghost { background: #fff; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--blue); color: var(--blue); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #d94352; }
.btn-xs { padding: 5px 10px; font-size: 12px; background: #fff; border-color: var(--line); color: var(--text); }
.btn-xs:hover { border-color: var(--blue); color: var(--blue); }
.btn-xs.btn-danger { color: var(--red); border-color: rgba(237, 85, 101, .4); }
.btn-xs.btn-danger:hover { background: var(--red); color: #fff; border-color: var(--red); }
.btn-block { width: 100%; justify-content: center; padding: 11px; }

/* 表单 */
.form-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; max-width: 980px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-item { display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.form-full { grid-column: 1 / -1; }
.form-item input[type=text], .form-item input[type=number], .form-item input[type=date],
.form-item input[type=password], .form-item select, .form-item textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; color: var(--text); outline: none; font-family: inherit;
  background: #fff; width: 100%;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(16, 84, 255, .1);
}
.form-item input[type=color] {
  width: 64px; height: 36px; padding: 2px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; cursor: pointer;
}
.form-check { flex-direction: row; align-items: center; gap: 8px; }
.form-check input { width: 16px; height: 16px; accent-color: var(--blue); }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }

/* 登录页 */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef4ff 0%, #fdeef0 55%, #fdf6ec 100%);
}
.login-card {
  width: 380px; background: #fff; border-radius: 16px; padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(16, 24, 40, .12);
}
.login-logo {
  width: 60px; height: 60px; border-radius: 16px; background: rgba(16, 84, 255, .08);
  display: flex; align-items: center; justify-content: center; margin: 0 auto 14px;
}
.login-card h1 { text-align: center; font-size: 20px; }
.login-card h1 em { color: var(--blue); font-style: normal; }
.login-sub { text-align: center; color: var(--muted); font-size: 13px; margin: 6px 0 20px; }
.login-error {
  background: rgba(237, 85, 101, .1); color: var(--red);
  border: 1px solid rgba(237, 85, 101, .3); padding: 9px 12px;
  border-radius: 8px; font-size: 13px; margin-bottom: 14px;
  display: flex; gap: 6px; align-items: center;
}
.login-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; margin-bottom: 14px; }
.login-card input {
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; outline: none;
}
.login-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(16, 84, 255, .1); }
.login-hint { text-align: center; color: var(--muted); font-size: 12px; margin-top: 14px; }

/* 响应式 */
@media (max-width: 1024px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .panel-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .admin-side { display: none; }
  .admin-main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
}

/* ===== LOGO ===== */
.admin-logo { padding: 12px 18px; }
.admin-logo-img { height: 34px; width: auto; background: #fff; border-radius: 8px; padding: 5px 10px; display: block; }
.p-icon img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; padding: 6px; }

/* ===== 统计卡片与面板扩展 ===== */
.stat-grid { grid-template-columns: repeat(5, 1fr); }
.panel-grid { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1280px) { .stat-grid { grid-template-columns: repeat(3, 1fr); } .panel-grid { grid-template-columns: 1fr; } }
@media (max-width: 1024px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== 表单分区 ===== */
.form-section-title {
  font-size: 14px; font-weight: 600; color: var(--text);
  margin: 22px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 6px;
}
.form-grid + .form-section-title { margin-top: 24px; }

/* 图标上传 */
.icon-upload-row { flex-direction: row; align-items: center; gap: 16px; }
.icon-preview { width: 64px; height: 64px; min-width: 64px; border: 1px solid var(--line); }
.icon-preview img { padding: 8px; }
.icon-upload-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.preview-upload-row { display: flex; align-items: center; gap: 16px; }
.preview-thumb { width: 160px; height: 90px; min-width: 160px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  border: 1px dashed var(--blue); color: var(--blue); background: rgba(16,84,255,.05);
  border-radius: 8px; padding: 10px 16px; font-size: 13px; width: fit-content;
}
.upload-btn:hover { background: rgba(16,84,255,.1); }
.upload-btn input[type=file] { display: none; }
.form-hint { color: var(--muted); font-size: 12px; }

/* 上传已选文件反馈：按钮变色 + 文件名提示 */
.upload-btn.has-file { border-style: solid; border-color: var(--green); color: var(--green); background: rgba(26,179,148,.08); }
.upload-file-name { display: block; width: 100%; font-size: 12px; color: var(--green); word-break: break-all; }
.upload-btn:not(.has-file) .upload-file-name { display: none; }

/* 上传预览 wrap + 删除按钮 */
.upload-preview-wrap { display: flex; align-items: center; gap: 8px; position: relative; }
.upload-preview-wrap .preview-thumb + .preview-thumb { margin-left: 0; }
.btn-del-upload {
  border: 1px solid #ed5565; color: #ed5565; background: rgba(237,85,101,.06);
  border-radius: 6px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  transition: all .15s ease; white-space: nowrap;
}
.btn-del-upload:hover { background: #ed5565; color: #fff; }

/* 官网自动查询状态提示 */
.domain-query-status { display: block; margin-top: 6px; font-size: 12px; min-height: 16px; color: var(--muted); }
.domain-query-status.loading { color: var(--warn, #f8ac59); }
.domain-query-status.ok { color: var(--green); }
.domain-query-status.fail { color: #e5534b; }

/* 自动填充字段高亮闪动 */
input.auto-filled { animation: autoFillFlash 1.5s ease; }
@keyframes autoFillFlash {
  0% { background: rgba(26,179,148,.22); border-color: var(--green); }
  100% { background: transparent; }
}

/* Quill 富文本编辑器 */
.ql-toolbar.ql-snow { border: 1px solid var(--line); border-radius: 8px 8px 0 0; }
.ql-container.ql-snow { border: 1px solid var(--line); border-radius: 0 0 8px 8px; background: #fff; }
.ql-editor { min-height: 300px; font-size: 14px; line-height: 1.8; }
.ql-editor img { max-width: 100%; }

/* 登录页算术验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input { flex: 1; }
.captcha-q {
  display: flex; align-items: center; justify-content: center;
  min-width: 92px; padding: 0 12px;
  font-size: 16px; font-weight: 700; letter-spacing: 2px; user-select: none;
  color: var(--blue); background: rgba(16,84,255,.08);
  border: 1px solid var(--line); border-radius: 8px; white-space: nowrap;
}

/* 投稿审核待办角标 */
.nav-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; margin-left: 6px;
  font-style: normal; font-size: 11px; font-weight: 700; line-height: 18px;
  color: #fff; background: #ed5565; border-radius: 9px;
}
/* 审核状态徽标 */
.status-tag { display: inline-block; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-style: normal; white-space: nowrap; }
.status-pending { color: #b8830d; background: rgba(248,172,89,.14); }
.status-approved { color: #0c8a6a; background: rgba(26,179,148,.14); }
.status-rejected { color: #d13f37; background: rgba(237,85,101,.12); }
.review-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; margin-bottom: 16px; }
.review-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.review-head h3 { margin: 0; font-size: 16px; }
.review-meta { color: var(--muted); font-size: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.review-content { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; font-size: 13px; line-height: 1.8; color: var(--text); overflow-x: auto; }
.review-content img { max-width: 100%; border-radius: 8px; }
.review-content p { margin: 0 0 8px; }
.review-content h1, .review-content h2, .review-content h3 { margin: 14px 0 8px; }
.review-cover img { max-height: 240px; width: 100%; object-fit: cover; }
.review-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.review-actions input[name=note] { flex: 1; min-width: 220px; }
.empty-state { text-align: center; color: var(--muted); padding: 60px 20px; background: #fff; border: 1px dashed var(--line); border-radius: 12px; }
.empty-state p { margin-top: 10px; font-size: 13px; }
