/* ============================================================
   千百匠管理后台扩展样式
   基础样式直接复制自统一样式（style.css / readability.css / surfaces.css），
   本文件仅补充业务页面所需的组件样式，保持同一视觉语言。
   ============================================================ */

/* 侧栏模块面板切换 */
.module-panel[hidden] { display: none; }
.module-panel h2 { padding: 8px 9px 14px; }

/* 页面标题右侧操作 */
.title-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 提示条 */
.flash {
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 9px;
  border: 1px solid #cfe0f6;
  background: #eff5ff;
  color: #21436f;
  font-size: 14px;
}
.flash-success { border-color: #bfe3d2; background: #edf8f2; color: #14573c; }
.flash-error   { border-color: #f2c9cd; background: #fdf0f1; color: #8e2432; }
.flash-info    { border-color: #cfe0f6; background: #eff5ff; color: #21436f; }

/* 状态徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge:before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok   { background: #e8f5ee; color: #12684a; border-color: #c6e6d6; }
.badge-warn { background: #fff4e5; color: #92540a; border-color: #f4dcbb; }
.badge-bad  { background: #fdeef0; color: #96303c; border-color: #f3cdd2; }
.badge-info { background: #eaf1ff; color: #2350a8; border-color: #cfdffa; }

/* 键值信息块 */
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.kv > div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: var(--tint, #f8fafd); }
.kv span { display: block; font-size: 13px; color: var(--muted); }
.kv strong { display: block; margin-top: 3px; font-size: 15px; font-weight: 600; word-break: break-all; }

/* 表单网格 */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-grid label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.form-grid input[type=text],
.form-grid input[type=password],
.form-grid input[type=number],
.form-grid input[type=date],
.form-grid input[type=file],
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d8e0ed;
  border-radius: 6px;
  background: #fff;
  color: #172136;
  font: inherit;
}
.form-grid textarea { min-height: 90px; resize: vertical; }
.form-grid .hint { font-size: 13px; color: var(--muted); }
.form-actions { display: flex; gap: 8px; align-items: center; margin-top: 16px; }

/* 表格附件 */
.thumb { width: 42px; height: 42px; border-radius: 8px; object-fit: cover; background: #eef3fb; display: block; }
.cell-main { display: grid; gap: 2px; }
.cell-main small { color: var(--muted); }
.table-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-actions .button { min-height: 28px; padding: 3px 9px; font-size: 13px; }

/* 图表 */
.bar-chart { display: flex; align-items: flex-end; gap: 10px; height: 168px; padding-top: 8px; }
.bar-chart .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; height: 100%; }
.bar-chart .bar i { display: block; width: 100%; max-width: 42px; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, #4d84f0, #235bdf); }
.bar-chart .bar small { font-size: 12px; color: var(--muted); }

/* 空状态 */
.empty-state { padding: 34px 16px; text-align: center; color: var(--muted); }
.empty-state strong { display: block; margin-bottom: 6px; color: #33445e; }

/* 横向标签组 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 4px 11px;
  border-radius: 999px;
  background: #eef3fc;
  color: #33456a;
  font-size: 13px;
  border: 1px solid #dde6f4;
}

/* 详情页双栏 */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr); gap: 14px; align-items: start; }
.detail-list { display: grid; gap: 0; }
.detail-list > div { display: grid; grid-template-columns: 118px minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.detail-list > div:last-child { border-bottom: 0; }
.detail-list dt, .detail-list .k { color: var(--muted); }

/* 图片组 */
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery img { width: 108px; height: 108px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eef3fb; }

/* 登录页 */
.login-brand { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 18px; }
.login-brand .brand-mark { width: 40px; height: 40px; }
.login-page { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-panel h1 { font-size: 26px; }

/* 账号菜单链接 */
.account-item { display: block; width: 100%; padding: 8px 10px; border-radius: 6px; color: inherit; font-size: 15px; }
.account-item:hover { background: #eef3fc; }

/* ============================================================
   以下样式同步自统一样式模板（www1 v2）
   1) 页面背景装饰花纹（模板挂在 #app::before/::after，本项目无 #app，改挂 body）
   2) 顶栏面包屑当前项 / 快捷入口当前项
   3) 登录页新版双栏布局（Login.vue 的 scoped 样式）
   4) 首页（数据概览）新版视觉（Home.vue 的 scoped 样式）
   ============================================================ */

/* 1) 背景装饰花纹 */
body::before,
body::after {
  content: '';
  position: fixed;
  z-index: 0;
  pointer-events: none;
}
body::before {
  top: -238px;
  right: -148px;
  width: min(790px, 78vw);
  height: 690px;
  border-radius: 36%;
  transform: rotate(-28deg) skewX(-8deg);
  background: linear-gradient(104deg, transparent 15%, #dbe8ff 41%, #f8fbff 57%, #d9e7fb 74%, transparent 91%);
  mask-image: linear-gradient(#000 56%, transparent 91%);
  opacity: .74;
}
body::after {
  bottom: -260px;
  left: -180px;
  width: min(640px, 76vw);
  height: 520px;
  border-radius: 35%;
  transform: rotate(34deg);
  background: repeating-linear-gradient(110deg, #e9f2ff 0 60px, #dce9fc 60px 108px, #f8fbff 108px 155px);
  mask-image: radial-gradient(ellipse, #000 12%, transparent 72%);
  opacity: .65;
}
/* 内容层需高于花纹层（模板中 #app 自带隔离层，这里显式抬升） */
.frame,
.login-screen { position: relative; z-index: 1; }
@media (max-width: 700px) {
  body::before { top: -210px; right: -96px; opacity: .62; }
}

/* 2) 顶栏当前项（模板用 .router-link-exact-active，服务端渲染改用 aria-current） */
.header-shortcuts a[aria-current=page] { color: #46566e; background: rgb(255 255 255 / 58%); }


/* 2) 登录页 */
.login-screen { padding: 28px; min-height: 100dvh; }
.login-layout {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  width: min(100%, 880px);
  overflow: hidden;
  border: 1px solid #fff;
  border-radius: 18px;
  background: rgb(255 255 255 / 88%);
  box-shadow: 0 18px 50px rgb(40 71 125 / 10%);
  backdrop-filter: blur(12px);
}
.login-brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  padding: 36px;
  background: linear-gradient(145deg, #dce9fd, #edf4ff 67%, #e5eefb);
}
.login-orbits {
  position: absolute;
  z-index: -1;
  inset: -41% -37% 34% -10%;
  background: repeating-radial-gradient(ellipse at 55% 44%, transparent 0 35px, #759aee22 36px 52px, #ffffff8a 53px 55px, transparent 56px 74px);
  transform: rotate(-24deg);
  mask-image: linear-gradient(#000 66%, transparent);
}
.login-brand-copy h2 { font-size: 31px; }
.login-brand-copy p { margin-top: 8px; max-width: 24em; color: var(--muted); }
.login-features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.login-features span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgb(255 255 255 / 85%);
  border-radius: 6px;
  background: rgb(255 255 255 / 60%);
  font-size: 14px;
  color: #36517c;
}
.login-panel { width: 100%; padding: 42px 36px; min-width: 0; }
.login-intro { margin-top: 6px; color: var(--muted); }
.login-form { margin-top: 24px; }
.login-form input { min-height: 46px; background: #fbfcfe; }
.login-form input:focus { outline: none; border-color: #d8e0ed; background: #f2f6fc; }
.login-submit { position: relative; min-height: 44px; }
.login-submit svg { position: absolute; right: 14px; }
.login-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 20px;
  padding: 10px 12px;
  border-radius: 7px;
  background: #f2f5fa;
  color: var(--muted);
  font-size: 14px;
}
.login-demo strong { color: #30415d; }
@media (max-width: 720px) {
  .login-screen { padding: 16px; }
  .login-layout { grid-template-columns: minmax(0, 1fr); max-width: 460px; }
  .login-brand-panel { padding: 20px 22px; }
  .login-brand-copy h2 { font-size: 23px; }
  .login-brand-copy p { font-size: 14px; }
  .login-features { margin-top: 12px; }
  .login-panel { padding: 22px; }
  .login-panel h1 { font-size: 25px; }
}

/* 3) 首页（数据概览）：仅在 .home 容器内生效，与模板 scoped 作用域保持一致 */
.home .home-title { padding: 8px 2px 6px; }
.home .home-title p { margin-top: 6px; }
.home .home-title .button { background: rgb(255 255 255 / 74%); }
.home .blue-strip {
  gap: 1px;
  border: 1px solid #3262cd;
  background:
    repeating-radial-gradient(ellipse 145% 255% at 104% 160%, transparent 0 21px, rgb(255 255 255 / 8%) 22px 23px, transparent 24px 38px) right center / 52% 100% no-repeat,
    radial-gradient(ellipse at 98% 38%, rgb(148 187 255 / 17%), transparent 53%),
    linear-gradient(112deg, #2e58b9, #3c6acd);
}
.home .blue-strip a { min-width: 0; padding-block: 10px; }
.home .blue-strip a + a { border-left: 0; box-shadow: -1px 0 0 rgb(255 255 255 / 17%); }
.home .blue-strip a > svg:first-child {
  width: 36px;
  height: 36px;
  padding: 8px;
  border-radius: 9px;
  background: rgb(255 255 255 / 14%);
}
.home .blue-strip strong { line-height: 1.2; margin-top: 3px; }
.home .metrics {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 5px 0 14px;
  border-bottom: 1px solid var(--line);
}
.home .metrics > div { padding: 2px 12px; }
.home .metrics > div:first-child { padding-left: 0; }
.home .metrics strong { margin-block: 2px; font-size: clamp(19px, 2.1vw, 26px); }
.home .trend-head { margin-top: 18px; }
.home .trend-plot svg { background: repeating-linear-gradient(to bottom, #e7edf7 0 1px, transparent 1px 33%); }
.home .store-heading { gap: 11px; }
.home .store-panel .score { border: 0; background: rgb(231 239 253 / 63%); padding: 12px; }
.home .score strong { font-size: 26px; }
.home .score-grid > div { padding: 2px 8px; }
.home .score-grid > div:first-child { padding-left: 0; }
.home .score-grid > div + div { border-left: 1px solid var(--line); }
.home .quick-links a + a { border-top: 1px solid var(--line); border-radius: 0; }
@media (max-width: 700px) {
  .home .metrics > div:nth-child(odd) { padding-left: 0; }
}
@media (max-width: 420px) {
  .home .blue-strip a > svg:first-child { width: 28px; height: 28px; padding: 5px; }
}

/* 移动端 */
@media (max-width: 900px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .title-actions { width: 100%; }
  .kv { grid-template-columns: minmax(0, 1fr); }
}

/* 打印 */
@media print {
  .topbar, .sidebar, .title-actions, .pager { display: none !important; }
  .frame { display: block; }
}

/* ---------- 运营列表通用展示（列表可读性） ---------- */
.thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  background: #eef5f1;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #6b837a;
}
.thumb-round { border-radius: 50%; }
.thumb-text { font-weight: 600; color: #0d8a5c; background: #e6f7ef; }
.thumb-empty { border: 1px dashed #cfe0d8; }
.cell-flex { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.cell-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cell-title { font-weight: 600; color: #12352b; line-height: 1.35; }
.cell-sub { color: #6b837a; font-size: 12px; line-height: 1.4; }
.cell-link { color: #0d8a5c; text-decoration: none; font-weight: 600; }
.cell-link:hover { text-decoration: underline; }
.badge-muted { background: #eef2f0; color: #6b837a; }
.list-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; justify-content: space-between; }
.list-toolbar form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.list-toolbar .field { display: flex; flex-direction: column; gap: 4px; }
.list-toolbar .field label { font-size: 12px; color: #6b837a; }
.list-toolbar input, .list-toolbar select { height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #d7e6df; background: #fff; font-size: 13px; }
.list-toolbar .actions { display: flex; gap: 8px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.cell-money { font-variant-numeric: tabular-nums; font-weight: 600; color: #12352b; white-space: nowrap; }
.cell-muted { color: #8aa39a; }
.cell-strong { font-weight: 700; color: #12352b; }
/* ---------- 操作列固定右侧（列表横向滚动时保持可见） ---------- */
.table-scroll table th:last-child:has(+ th),
.table-scroll table td:last-child:has(> .row-actions),
.table-scroll table td:last-child:has(> .table-actions) {
  position: sticky;
  right: 0;
  background: #fff;
  z-index: 1;
  box-shadow: -6px 0 12px -8px rgba(18, 53, 43, 0.35);
}
/* 「操作」表头与操作列一起固定：横向滚动时表头不再被卷走
   （只在最后一列确实是操作按钮的表格生效，避免无操作列的表格把表头钉在右侧；
     z-index 高于单元格的 1，保证表头压住滚动经过的操作按钮；白底避免透出下层内容） */
.table-scroll table:has(tbody td:last-child > .row-actions) thead th:last-child,
.table-scroll table:has(tbody td:last-child > .table-actions) thead th:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  background-clip: padding-box;
  z-index: 2;
  box-shadow: -6px 0 12px -8px rgba(18, 53, 43, 0.35);
  white-space: nowrap;
}
