/* =============================================================
   华芯科技企业CMS — 后台设计系统 (admin.css)
   后台壳: 1280 宽, 侧栏 240px, 内容区浅底 #F1F5FA
   ============================================================= */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.admin {
  font-family: "Noto Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, "Microsoft YaHei", sans-serif;
  background: #F1F5FA; color: #1E293B; font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

/* ---------------- 登录页 ---------------- */
.login-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr;
  background: #F1F5FA;
}
@media (max-width: 860px){ .login-wrap { grid-template-columns: 1fr; } .login-aside { display: none; } }
.login-aside {
  background: radial-gradient(900px 500px at 20% 0%, rgba(56,189,248,.3), transparent),
              linear-gradient(135deg, #0B1220, #0F172A 60%, #1E293B);
  color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
}
.login-aside .brand-lg { font-size: 26px; font-weight: 800; display: flex; gap: 12px; align-items: center; }
.login-aside .mark { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #2563EB, #38BDF8); display: grid; place-items: center; font-weight: 800; }
.login-aside h1 { font-size: 34px; color: #fff; margin: 0 0 16px; }
.login-aside p { color: #94A3B8; max-width: 420px; }
.login-aside .feat { display: flex; gap: 12px; margin-top: 28px; color: #CBD5E1; }
.login-form-side { display: grid; place-items: center; padding: 32px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; color: #0F172A; margin: 0 0 6px; }
.login-card .sub { color: #64748B; margin-bottom: 28px; }
.login-card .field input { height: 46px; }
.login-foot { text-align: center; color: #94A3B8; font-size: 13px; margin-top: 24px; }

/* ---------------- 后台主框架 ---------------- */
.admin-shell { display: flex; min-height: 100vh; }

/* 侧边栏 240px */
.admin-side {
  width: 240px; flex: 0 0 240px; background: #0F172A; color: #CBD5E1;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.admin-side .side-brand {
  height: 64px; display: flex; align-items: center; gap: 10px; padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.08); color: #fff; font-weight: 800; font-size: 17px;
}
.admin-side .side-brand .mark { width: 32px; height: 32px; border-radius: 9px; background: linear-gradient(135deg, #2563EB, #38BDF8); display: grid; place-items: center; color: #fff; font-weight: 800; }
.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.side-group { margin-bottom: 18px; }
.side-group > .g-title { color: #64748B; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; padding: 0 12px 8px; text-transform: uppercase; }
.side-link {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  color: #CBD5E1; font-weight: 500; font-size: 14px; margin-bottom: 2px; transition: .15s;
}
.side-link .ico { width: 20px; text-align: center; opacity: .85; }
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; }
.side-link.active { background: #2563EB; color: #fff; box-shadow: 0 6px 16px rgba(37,99,235,.35); }
.side-foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.side-foot a { display: flex; align-items: center; gap: 10px; color: #94A3B8; font-size: 13px; padding: 8px 12px; border-radius: 8px; }
.side-foot a:hover { background: rgba(255,255,255,.06); color: #fff; }

/* 内容区 */
.admin-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.admin-topbar {
  height: 64px; background: #fff; border-bottom: 1px solid #E2E8F0; display: flex;
  align-items: center; padding: 0 28px; gap: 16px; position: sticky; top: 0; z-index: 20;
}
.admin-topbar .page-title { font-size: 18px; font-weight: 700; color: #0F172A; }
.admin-topbar .crumb { color: #94A3B8; font-size: 13px; margin-top: 2px; }
.admin-topbar .spacer { flex: 1; }
.admin-user { display: flex; align-items: center; gap: 10px; cursor: pointer; position: relative; }
.admin-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: #2563EB; color: #fff; display: grid; place-items: center; font-weight: 700; }
.admin-user .uname { font-weight: 600; color: #1E293B; font-size: 14px; }
.admin-user .role { font-size: 12px; color: #94A3B8; }
.admin-user .menu {
  position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid #E2E8F0;
  border-radius: 10px; box-shadow: 0 10px 30px rgba(15,23,42,.12); min-width: 160px; padding: 6px; display: none;
}
.admin-user:hover .menu { display: block; }
.admin-user .menu a { display: flex; gap: 10px; padding: 9px 12px; border-radius: 8px; color: #475569; font-size: 14px; }
.admin-user .menu a:hover { background: #F1F5FA; color: #2563EB; }

.admin-content { padding: 28px; }
@media (max-width: 720px){ .admin-content { padding: 16px; } }

/* 页头操作行 */
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; gap: 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; color: #0F172A; margin: 0; }
.page-head .desc { color: #64748B; font-size: 13px; margin-top: 4px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* 统计卡片 */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
@media (max-width: 980px){ .stat-grid { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 520px){ .stat-grid { grid-template-columns: 1fr; } }
.stat-card { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; padding: 20px; box-shadow: 0 1px 3px rgba(15,23,42,.06); }
.stat-card .s-top { display: flex; align-items: center; justify-content: space-between; }
.stat-card .s-ico { width: 42px; height: 42px; border-radius: 11px; background: #EFF4FF; color: #2563EB; display: grid; place-items: center; font-size: 20px; }
.stat-card .s-num { font-size: 30px; font-weight: 800; color: #0F172A; margin-top: 12px; }
.stat-card .s-lbl { color: #64748B; font-size: 13px; }
.stat-card .s-trend { font-size: 12px; font-weight: 600; }
.trend-up { color: #16A34A; } .trend-down { color: #DC2626; }

/* 面板 */
.panel { background: #fff; border: 1px solid #E2E8F0; border-radius: 12px; box-shadow: 0 1px 3px rgba(15,23,42,.06); overflow: hidden; margin-bottom: 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid #EEF2F7; }
.panel-head h3 { font-size: 16px; color: #0F172A; margin: 0; }
.panel-head .ph-actions { display: flex; gap: 8px; }
.panel-body { padding: 20px; }

/* 表格 */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th { text-align: left; color: #64748B; font-weight: 600; font-size: 13px; padding: 12px 16px; border-bottom: 1px solid #EEF2F7; background: #F8FAFC; white-space: nowrap; }
table.data td { padding: 13px 16px; border-bottom: 1px solid #EEF2F7; color: #334155; vertical-align: middle; }
table.data tbody tr:hover { background: #F8FAFC; }
table.data .thumb-sm { width: 56px; height: 38px; border-radius: 6px; background: linear-gradient(135deg,#EFF4FF,#E0F2FE); display: grid; place-items: center; color: #2563EB; }
.row-actions { display: flex; gap: 8px; }
.link-btn { color: #2563EB; font-weight: 600; font-size: 13px; cursor: pointer; }
.link-btn.danger { color: #DC2626; }
.link-btn.muted { color: #64748B; }

/* 状态点 */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 6px; }
.dot-on { background: #16A34A; } .dot-off { background: #CBD5E1; } .dot-wait { background: #F59E0B; }

/* 表单（后台） */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 22px; }
.form-grid .col-2 { grid-column: span 2; }
@media (max-width: 720px){ .form-grid { grid-template-columns: 1fr; } .form-grid .col-2 { grid-column: span 1; } }
.admin-form .field label { font-weight: 600; color: #334155; }
.admin-form .input, .admin-form .textarea, .admin-form .select {
  border: 1px solid #E2E8F0; border-radius: 8px; padding: 10px 12px; font-size: 14px; font-family: inherit; width: 100%; background: #fff; color: #1E293B;
}
.admin-form .input:focus, .admin-form .textarea:focus, .admin-form .select:focus { outline: none; border-color: #2563EB; box-shadow: 0 0 0 3px #DBEAFE; }
.admin-form .textarea { min-height: 160px; resize: vertical; }

/* 搜索栏 */
.toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; flex-wrap: wrap; }
.toolbar .input { max-width: 280px; height: 40px; }
.toolbar .select { height: 40px; max-width: 180px; }
.toolbar .spacer { flex: 1; }

/* 头像/缩略图上传占位 */
.upload-box { border: 1.5px dashed #CBD5E1; border-radius: 10px; padding: 24px; text-align: center; color: #64748B; background: #F8FAFC; cursor: pointer; }
.upload-box:hover { border-color: #2563EB; color: #2563EB; }

/* 模态 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-mask.show { display: flex; }
.modal { background: #fff; border-radius: 14px; width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; box-shadow: 0 20px 60px rgba(15,23,42,.3); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid #EEF2F7; display: flex; justify-content: space-between; align-items: center; }
.modal-head h3 { margin: 0; font-size: 17px; color: #0F172A; }
.modal-body { padding: 22px; }
.modal-foot { padding: 16px 22px; border-top: 1px solid #EEF2F7; display: flex; justify-content: flex-end; gap: 10px; }
.modal-close { cursor: pointer; border: none; background: #F1F5F9; width: 32px; height: 32px; border-radius: 8px; font-size: 18px; color: #64748B; }

/* 富文本简易工具条 */
.editor-bar { display: flex; gap: 4px; padding: 8px; border: 1px solid #E2E8F0; border-bottom: 0; border-radius: 8px 8px 0 0; background: #F8FAFC; }
.editor-bar button { border: 1px solid #E2E8F0; background: #fff; border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 13px; color: #475569; }
.editor-bar button:hover { border-color: #2563EB; color: #2563EB; }
.editor-area { border-radius: 0 0 8px 8px; min-height: 220px; }

/* 登录错误 */
.login-error { background: #FEE2E2; color: #B91C1C; padding: 10px 14px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }

/* 权限矩阵 */
.perm-table th:first-child, .perm-table td:first-child { position: sticky; left: 0; background: #fff; }
.perm-group { font-weight: 700; color: #0F172A; padding: 10px 16px; background: #F8FAFC; }

/* 小工具 */
.tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EFF4FF; color: #2563EB; }
.muted { color: #94A3B8; } .text-2 { color: #475569; } .ink { color: #0F172A; }
.flex { display: flex; } .items-center { align-items: center; } .justify-between { justify-content: space-between; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.empty { text-align: center; color: #94A3B8; padding: 50px 0; }
