:root { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: #20201e; background: #f4f0e8; --ink: #20201e; --muted: #6e6a62; --paper: #fffdf8; --line: #ddd6ca; --accent: #d84a30; --accent-dark: #aa3525; }
* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 15% 15%, #fff8e8 0, #f4f0e8 42%, #ebe5da 100%); }
button, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.login-view { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-panel { width: min(430px, 100%); padding: 42px; border: 1px solid rgba(32,32,30,.1); border-radius: 28px; background: rgba(255,253,248,.94); box-shadow: 0 24px 80px rgba(67,48,24,.14); }
.brand-mark { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; color: #fff; background: var(--accent); font-size: 28px; font-weight: 800; }
.brand-mark.small { width: 40px; height: 40px; border-radius: 13px; font-size: 21px; }
.eyebrow { margin: 20px 0 6px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .18em; }
h1 { margin: 0; font-size: 30px; line-height: 1.2; }
.muted { color: var(--muted); }
.login-form { display: grid; gap: 18px; margin-top: 30px; }
label { display: grid; gap: 8px; color: #4d4a45; font-size: 14px; font-weight: 650; }
input { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 13px 14px; background: #fff; color: var(--ink); outline: none; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(216,74,48,.12); }
.button { border: 0; border-radius: 13px; padding: 12px 16px; font-weight: 750; }
.button-primary { color: #fff; background: var(--accent); }
.button-primary:hover { background: var(--accent-dark); }
.button-danger { color: #fff; background: #a8372b; }
.error { min-height: 20px; margin: 0; color: #b02b1e; font-size: 13px; }
.back-link { display: inline-block; margin-top: 24px; color: var(--muted); }
.console-view { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { display: flex; flex-direction: column; padding: 26px 18px; color: #f6f2ea; background: #252422; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 28px; }
.sidebar-brand small { display: block; margin-top: 2px; color: #aaa59c; }
#nav { display: grid; gap: 7px; }
.nav-item { border: 0; border-radius: 12px; padding: 12px 14px; text-align: left; color: #c8c3bb; background: transparent; }
.nav-item:hover, .nav-item.active { color: #fff; background: #383632; }
.nav-item.active { box-shadow: inset 3px 0 var(--accent); }
.sidebar-footer { display: grid; gap: 12px; margin-top: auto; padding: 20px 10px 0; font-size: 13px; }
.sidebar-footer a { color: #c8c3bb; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; }
.text-button { border: 0; padding: 0; text-align: left; color: #ee9a89; background: transparent; }
.main-content { min-width: 0; padding: 32px clamp(20px, 4vw, 56px) 60px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.topbar .eyebrow { margin-top: 0; }
.operator { min-width: 150px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.55); text-align: right; }
.operator small { display: block; margin-top: 4px; color: var(--muted); }
.notice { margin: -12px 0 22px; padding: 13px 16px; border: 1px solid #bfdccb; border-radius: 12px; color: #205c3d; background: #edf8f1; }
.notice.error { border-color: #e6b9b2; color: #8a281d; background: #fff0ed; }
.page-content { display: grid; gap: 22px; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.metric-card, .panel { border: 1px solid rgba(32,32,30,.1); border-radius: 20px; background: rgba(255,253,248,.92); box-shadow: 0 12px 36px rgba(67,48,24,.06); }
.metric-card { padding: 22px; }
.metric-label { color: var(--muted); font-size: 13px; }
.metric-value { margin-top: 10px; font-size: 34px; font-weight: 780; }
.panel { overflow: hidden; }
.panel-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.panel-header h2 { margin: 0; font-size: 18px; }
.panel-body { padding: 8px 20px 20px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 14px 10px; border-bottom: 1px solid #eee8dd; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.actions { display: flex; gap: 8px; }
.tag { display: inline-flex; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eee9df; color: #625b50; }
.tag.pending { color: #8c510c; background: #fff0d7; }
.tag.approved, .tag.resolved { color: #1d5e3d; background: #e6f5eb; }
.tag.rejected { color: #8a281d; background: #ffe7e2; }
.empty, .loading { padding: 38px 20px; color: var(--muted); text-align: center; }
@media (max-width: 900px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .console-view { grid-template-columns: 1fr; } .sidebar { position: sticky; top: 0; z-index: 2; padding: 12px; } .sidebar-brand { padding: 0 4px 12px; } #nav { display: flex; overflow-x: auto; } .nav-item { white-space: nowrap; } .sidebar-footer { display: flex; flex-wrap: wrap; padding: 12px 4px 0; } .main-content { padding: 24px 16px 42px; } }
@media (max-width: 580px) { .metric-grid { grid-template-columns: 1fr; } .topbar { align-items: flex-start; } .operator { min-width: auto; } .login-panel { padding: 28px 22px; } }

/* r25 后台框架：菜单分组、占位页与 Toast（提示与错误唯一承载，§6.4.1） */
.nav-group { display: grid; gap: 4px; margin-bottom: 10px; }
.nav-group-title { margin: 10px 10px 4px; color: #8d887f; font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.page-content .panel { padding: 26px 24px; }
.page-content .panel h2 { margin: 0 0 10px; font-size: 20px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 48px;
  z-index: 70; /* 必须高于 .modal-overlay／.confirm-dialog（z-index 60），否则表单校验 Toast 会被弹窗遮住 */
  max-width: min(420px, calc(100vw - 48px));
  padding: 13px 20px;
  border-radius: 999px;
  color: #fff;
  background: rgba(32, 32, 30, .92);
  font-size: 14px;
  text-align: center;
  transform: translateX(-50%);
  box-shadow: 0 12px 32px rgba(32, 32, 30, .28);
}

/* r25 角色与权限页（§5.19） */
.modal-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(32,32,30,.45); }
.modal { width: min(680px, 100%); max-height: 86vh; overflow: auto; padding: 28px; border-radius: 22px; background: var(--paper); box-shadow: 0 30px 90px rgba(20,16,10,.35); }
.modal h2 { margin: 0 0 18px; font-size: 20px; }
.role-form { display: grid; gap: 16px; }
#perm-groups { display: grid; gap: 14px; max-height: 42vh; overflow: auto; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: #fffdf8; }
.perm-group { margin: 0; padding: 0; border: 0; display: grid; gap: 8px; }
.perm-group legend { padding: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.perm-item { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500; }
.perm-item input { width: auto; }
.modal-actions { display: flex; justify-content: flex-end; gap: 16px; align-items: center; }

/* r25 审计日志页（§5.21） */
.audit-filters { display: flex; gap: 12px; align-items: center; padding: 16px 0 20px; flex-wrap: wrap; }
.audit-filters input { max-width: 280px; }
.audit-filters select { border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; background: #fff; }
.detail-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.detail-table th { width: 92px; color: var(--muted); text-align: left; }
.detail-table th, .detail-table td { padding: 8px 6px; border-bottom: 1px solid #eee8dd; vertical-align: top; }
.detail-table pre { margin: 0; white-space: pre-wrap; word-break: break-all; font-size: 12px; }

/* 系列/款式管理（§5.14 §5.15） */
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; display: inline-block; background: #eee9df; }
.thumb--empty { display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.upload-row { display: flex; align-items: center; gap: 12px; }
.upload-preview { max-width: 180px; max-height: 180px; border-radius: 12px; border: 1px solid var(--line); }
.upload-error { margin: 8px 0 0; color: #b02b1e; font-size: 13px; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; font: inherit; background: #fff; }
select { border: 1px solid var(--line); border-radius: 13px; padding: 12px 14px; background: #fff; font: inherit; }

/* 用户与收藏记录 / 注销任务（§5.16 §5.17） */
.photo-row { display: flex; flex-wrap: wrap; gap: 12px; }
.photo-row .upload-preview { max-width: 160px; max-height: 160px; border-radius: 10px; border: 1px solid var(--line); }

/* 数据看板（§5.13） */
.trend-block { margin-top: 22px; }
.trend-block h3 { margin: 0 0 10px; font-size: 15px; color: var(--muted); }
.bar-chart { display: flex; align-items: flex-end; gap: 6px; min-height: 110px; padding: 10px 4px 0; border-bottom: 1px solid var(--line); overflow-x: auto; }
.bar-item { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; min-width: 22px; }
.bar { width: 14px; border-radius: 4px 4px 0 0; background: var(--accent); opacity: .85; }
.bar-label { color: var(--muted); font-size: 10px; white-space: nowrap; }

/* 通用分页（§5.12 通用规则 3） */
.pager { display: flex; align-items: center; gap: 18px; padding: 16px 0 4px; }
.pager-info { color: var(--muted); font-size: 13px; }
.pager .text-button { color: var(--accent); }
.pager .text-button:disabled { color: #c9c2b6; cursor: default; }

/* 通用确认弹窗（PRD §5.5.1；与客户端同规格） */
.confirm-dialog { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.confirm-dialog__mask { position: absolute; inset: 0; background: rgba(36, 38, 58, .35); }
.confirm-dialog__card { position: relative; width: 295px; padding-bottom: 1px; background: #fff; border-radius: 22px; box-shadow: 0 16px 40px rgba(60, 70, 110, .14); overflow: hidden; }
.confirm-dialog__title-wrap { padding: 26px 20px 0; }
.confirm-dialog__title { margin: 0; text-align: center; color: #24263a; font-size: 17px; font-weight: 500; line-height: 26px; }
.confirm-dialog__body-wrap { padding: 10px 20px 2px; }
.confirm-dialog__body { margin: 0; text-align: center; color: #6a6e86; font-size: 13.5px; line-height: 20px; }
.confirm-dialog__hr { height: 1px; margin-top: 6px; background: #eef0f8; }
.confirm-dialog__actions { display: flex; align-items: center; height: 52px; }
.confirm-dialog__button { flex: 1; height: 52px; border: 0; background: transparent; cursor: pointer; font-family: inherit; font-size: 16px; font-weight: 500; }
.confirm-dialog__button--cancel { color: #6a6e86; font-weight: 400; }
.confirm-dialog__button--danger { color: #e0574c; }
.confirm-dialog__vline { width: 1px; height: 38px; background: #eef0f8; }
.confirm-dialog__field { display: flex; flex-direction: column; gap: 6px; padding: 12px 20px 0; }
.confirm-dialog__note { margin: 0; color: #8d92a9; font-size: 12px; line-height: 18px; }
.confirm-dialog__label { color: #6a6e86; font-size: 13px; line-height: 18px; }
.confirm-dialog__input { box-sizing: border-box; width: 100%; height: 40px; padding: 0 12px; color: #24263a; font-family: inherit; font-size: 14px; background: #f7f8fd; border: 1px solid transparent; border-radius: 12px; }
.confirm-dialog__input:focus { outline: none; background: #fff; border-color: #636be3; }
