/* 会员收银管理系统 · 共享界面样式
   视觉基准：腾讯云控制台 —— 白色面板、1px 分隔线、2px 圆角、品牌蓝 #0052D9，
   不使用渐变、玻璃拟态、发光阴影与大圆角。 */

:root {
  --brand: #0052d9;
  --brand-hover: #366ef4;
  --brand-active: #0034b5;
  --brand-light: #e3f0ff;
  --brand-border: #b5d3ff;

  --bg: #f5f7fa;
  --panel: #ffffff;
  --line: #e5e6eb;
  --line-2: #dcdde0;
  --line-soft: #f0f1f3;

  --text: #1d2129;
  --text-2: #4e5969;
  --text-3: #86909c;
  --text-4: #a9aeb8;

  --red: #d54941;
  --red-bg: #fff0f0;
  --red-border: #f5d0ce;

  --green: #2ba471;
  --green-bg: #e8f8f2;
  --green-border: #c6ebdd;

  --orange: #e37318;
  --orange-bg: #fff3e8;
  --orange-border: #f7ddc8;

  --yellow-bg: #fff8e8;
  --yellow-border: #f5dfb8;

  --radius: 2px;
  --radius-md: 4px;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--brand);
  text-decoration: none;
}

a:hover {
  color: var(--brand-hover);
}

h1,
h2,
h3,
h4,
h5,
p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background: #d9dce1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c2c7cf;
}

::-webkit-scrollbar-track {
  background: transparent;
}

/* ------------------------------ 布局 ------------------------------ */

.app {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  grid-template-rows: 56px minmax(0, 1fr);
  grid-template-areas:
    "top top"
    "side main";
  min-height: 100vh;
}

.topbar {
  grid-area: top;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.brand-sub {
  margin-left: 2px;
  padding-left: 10px;
  border-left: 1px solid var(--line-2);
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.env-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  font-size: 12px;
  color: var(--text-2);
  background: #f2f3f5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  white-space: nowrap;
}

.env-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.user-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
  white-space: nowrap;
}

.user-chip strong {
  font-weight: 500;
  color: var(--text);
}

.staff-no {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-light);
  border: 1px solid var(--brand-border);
  padding: 1px 6px;
  border-radius: var(--radius);
  white-space: nowrap;
}

.sidebar {
  grid-area: side;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 8px 0 20px;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  overflow-y: auto;
}

.nav-group {
  padding: 10px 12px 2px;
}

.nav-title {
  padding: 4px 12px 8px;
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: 0.4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 38px;
  margin-bottom: 2px;
  padding: 0 12px;
  border-left: 2px solid transparent;
  border-radius: var(--radius);
  color: var(--text-2);
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, color 0.15s;
}

.nav-item svg {
  flex: none;
  color: var(--text-3);
}

.nav-item:hover {
  background: #f2f5f9;
  color: var(--text);
}

.nav-item.active {
  background: var(--brand-light);
  border-left-color: var(--brand);
  color: var(--brand);
  font-weight: 500;
}

.nav-item.active svg {
  color: var(--brand);
}

.nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  font-weight: 400;
}

.main {
  grid-area: main;
  min-width: 0;
  padding: 20px 24px 40px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  line-height: 28px;
}

.page-desc {
  margin-top: 4px;
  max-width: 820px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 20px;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: none;
}

.mobile-nav {
  display: none;
}

/* ------------------------------ 卡片与网格 ------------------------------ */

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 50px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
}

.card-sub {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-3);
}

.card-body {
  padding: 20px;
}

.card-body.pad-0 {
  padding: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.stack > * + * {
  margin-top: 16px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
  padding: 16px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.stat-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.stat-label svg {
  color: var(--text-4);
}

.stat-value {
  margin-top: 6px;
  font-size: 26px;
  font-weight: 600;
  line-height: 34px;
  letter-spacing: -0.3px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.stat-value small {
  margin-left: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-3);
}

.stat-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.trend-up {
  color: var(--green);
}

.trend-down {
  color: var(--red);
}

/* ------------------------------ 按钮 ------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  user-select: none;
}

.btn svg {
  flex: none;
}

.btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.18);
}

.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #fff;
}

.btn-primary:active {
  background: var(--brand-active);
  border-color: var(--brand-active);
}

.btn-danger {
  background: #fff;
  border-color: var(--red-border);
  color: var(--red);
}

.btn-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-danger-solid {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.btn-danger-solid:hover {
  background: #b83f38;
  border-color: #b83f38;
  color: #fff;
}

.btn-text {
  padding: 0 8px;
  border-color: transparent;
  background: transparent;
  color: var(--brand);
}

.btn-text:hover {
  background: var(--brand-light);
  border-color: transparent;
  color: var(--brand);
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: var(--text-2);
}

.btn-ghost:hover {
  background: #f2f3f5;
  border-color: transparent;
  color: var(--text);
}

.btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 13px;
}

.btn-lg {
  height: 40px;
  padding: 0 20px;
  font-size: 15px;
}

.btn-icon {
  width: 32px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 26px;
}

.btn[disabled],
.btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn.is-loading {
  cursor: progress;
  opacity: 0.75;
}

.link-btn {
  padding: 2px 5px;
  border: 0;
  border-radius: var(--radius);
  background: none;
  color: var(--brand);
  font-size: 13px;
  line-height: 20px;
  cursor: pointer;
  white-space: nowrap;
}

.link-btn:hover {
  background: var(--brand-light);
}

.link-btn.danger {
  color: var(--red);
}

.link-btn.danger:hover {
  background: var(--red-bg);
}

.link-btn.muted {
  color: var(--text-3);
}

.link-btn.muted:hover {
  background: #f2f3f5;
  color: var(--text-2);
}

.actions {
  display: flex;
  align-items: center;
  gap: 2px;
  flex-wrap: wrap;
}

/* ------------------------------ 表单 ------------------------------ */

.input,
.select,
.textarea {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--text-3);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #b8bcc4;
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.input[disabled],
.select[disabled],
.textarea[disabled] {
  background: #f7f8fa;
  color: var(--text-3);
  cursor: not-allowed;
}

.select {
  appearance: none;
  padding-right: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5 6 7.5 9 4.5' fill='none' stroke='%234e5969' stroke-width='1.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
}

.textarea {
  height: auto;
  min-height: 84px;
  padding: 8px 10px;
  line-height: 1.6;
  resize: vertical;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.form-grid .span-2 {
  grid-column: 1 / -1;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label {
  font-size: 13px;
  color: var(--text-2);
  line-height: 20px;
}

.field-label.req::after {
  content: "*";
  margin-left: 3px;
  color: var(--red);
}

.field-help {
  font-size: 12px;
  color: var(--text-3);
  line-height: 18px;
}

.field-error {
  display: none;
  font-size: 12px;
  color: var(--red);
  line-height: 18px;
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
  border-color: var(--red);
}

.field.has-error .field-error {
  display: block;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.check strong {
  font-weight: 500;
  color: var(--text);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group .input {
  flex: 1;
}

.input-suffix {
  font-size: 13px;
  color: var(--text-3);
  flex: none;
}

.char-count {
  font-size: 11px;
  color: var(--text-4);
  text-align: right;
}

/* ------------------------------ 表格 ------------------------------ */

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.tbl th {
  padding: 10px 14px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}

.tbl td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--text);
  vertical-align: middle;
}

.tbl tbody tr:hover {
  background: #fafbfc;
}

.tbl tbody tr:last-child td {
  border-bottom: 0;
}

.tbl .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.tbl .nowrap {
  white-space: nowrap;
}

.cell-main {
  font-weight: 500;
  color: var(--text);
  line-height: 20px;
}

.cell-sub {
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 18px;
}

.cell-flex {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.cell-flex .cell-body {
  min-width: 0;
}

.table-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--text-3);
}

/* ------------------------------ 徽标 / 标签 ------------------------------ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: 12px;
  white-space: nowrap;
  line-height: 1;
}

.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

.badge-blue {
  color: var(--brand);
  background: var(--brand-light);
  border-color: #cfe2ff;
}

.badge-green {
  color: var(--green);
  background: var(--green-bg);
  border-color: var(--green-border);
}

.badge-red {
  color: var(--red);
  background: var(--red-bg);
  border-color: var(--red-border);
}

.badge-gray {
  color: var(--text-2);
  background: #f2f3f5;
  border-color: var(--line);
}

.badge-orange {
  color: var(--orange);
  background: var(--orange-bg);
  border-color: var(--orange-border);
}

.tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 1px 6px;
  border: 1px solid #e8e9ec;
  border-radius: var(--radius);
  background: #f7f8fa;
  color: var(--text-2);
  font-size: 12px;
  line-height: 18px;
}

.tag-blue {
  color: var(--brand);
  background: var(--brand-light);
  border-color: #cfe2ff;
}

.tag-plan {
  color: var(--brand);
  background: var(--brand-light);
  border-color: var(--brand-border);
}

.avatar {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  background: #e8eef7;
  color: #4e6a8e;
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  overflow: hidden;
}

.avatar.sm {
  width: 26px;
  height: 26px;
  font-size: 12px;
}

.avatar.lg {
  width: 40px;
  height: 40px;
  font-size: 15px;
}

.avatar-blue {
  background: var(--brand-light);
  color: var(--brand);
}

/* ------------------------------ 工具栏 / 筛选 ------------------------------ */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.toolbar .grow {
  flex: 1;
}

.toolbar .input,
.toolbar .select {
  width: auto;
  min-width: 156px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  display: inline-flex;
}

.search-box .input {
  width: 230px;
  padding-left: 30px;
}

.search-box svg {
  position: absolute;
  top: 8px;
  left: 10px;
  color: var(--text-3);
  pointer-events: none;
}

/* ------------------------------ 弹窗 / 抽屉 ------------------------------ */

.modal-mask,
.drawer-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in 0.15s ease;
}

.modal-mask {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 64px 16px 32px;
  overflow: auto;
}

.modal {
  width: 520px;
  max-width: 100%;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16);
  animation: modal-in 0.15s ease;
}

.modal.modal-lg {
  width: 780px;
}

.modal.modal-sm {
  width: 420px;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 24px;
  color: var(--text);
}

.modal-desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 18px;
}

.modal-close {
  flex: none;
  padding: 2px;
  border: 0;
  background: none;
  color: var(--text-3);
  line-height: 0;
  cursor: pointer;
}

.modal-close:hover {
  color: var(--text);
}

.modal-body {
  max-height: calc(100vh - 280px);
  padding: 20px;
  overflow: auto;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

.drawer-mask {
  display: flex;
  justify-content: flex-end;
}

.drawer {
  display: flex;
  flex-direction: column;
  width: 580px;
  max-width: 100%;
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
  animation: drawer-in 0.2s ease;
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow: auto;
}

.drawer-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
}

/* ------------------------------ 提示消息 ------------------------------ */

.toast-wrap {
  position: fixed;
  top: 20px;
  left: 50%;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 220px;
  max-width: 520px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--brand);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
  color: var(--text);
  font-size: 13px;
  line-height: 20px;
  animation: toast-in 0.16s ease;
}

.toast svg {
  flex: none;
  margin-top: 2px;
}

.toast.success {
  border-left-color: var(--green);
}

.toast.success svg {
  color: var(--green);
}

.toast.error {
  border-left-color: var(--red);
}

.toast.error svg {
  color: var(--red);
}

.toast.warning {
  border-left-color: var(--orange);
}

.toast.warning svg {
  color: var(--orange);
}

/* ------------------------------ 空状态 / 加载 ------------------------------ */

.empty {
  padding: 48px 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  line-height: 20px;
}

.empty svg {
  display: block;
  margin: 0 auto 8px;
  color: #c9cdd4;
}

.empty.sm {
  padding: 28px 12px;
}

.skeleton {
  background: #f2f3f5;
  border-radius: var(--radius);
  animation: pulse 1.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

/* ------------------------------ 标签页 ------------------------------ */

.tabs {
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}

.tab {
  padding: 10px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 14px;
  line-height: 20px;
  cursor: pointer;
}

.tab:hover {
  color: var(--brand);
}

.tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 500;
}

/* ------------------------------ 横幅 ------------------------------ */

.banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border: 1px solid;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 20px;
}

.banner svg {
  flex: none;
  margin-top: 1px;
}

.banner-info {
  background: var(--brand-light);
  border-color: #cfe2ff;
  color: #184b9b;
}

.banner-warning {
  background: var(--yellow-bg);
  border-color: var(--yellow-border);
  color: #8a5a00;
}

.banner-danger {
  background: var(--red-bg);
  border-color: var(--red-border);
  color: #a12a24;
}

.banner strong {
  font-weight: 600;
}

.banner .banner-action {
  margin-left: auto;
  flex: none;
}

/* ------------------------------ 进度条 ------------------------------ */

.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  font-size: 13px;
}

.bar-label {
  flex: none;
  width: 92px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bar-track {
  flex: 1;
  height: 6px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #eef0f3;
}

.bar-fill {
  height: 100%;
  border-radius: var(--radius);
  background: var(--brand);
}

.bar-value {
  flex: none;
  width: 48px;
  text-align: right;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------ 功能矩阵 ------------------------------ */

.feature-matrix {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.feature-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}

.feature-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  font-size: 13px;
  font-weight: 500;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13px;
}

.feature-item:last-child {
  border-bottom: 0;
}

.feature-item .feature-name {
  color: var(--text);
  line-height: 20px;
}

.feature-item .code {
  margin-top: 1px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-4);
}

.feature-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 12px;
  color: var(--text-3);
  margin-top: 1px;
}

.feature-state.on {
  color: var(--green);
}

.feature-picker {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: 320px;
  overflow: auto;
}

.feature-picker-group + .feature-picker-group {
  border-top: 1px solid var(--line);
}

.feature-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  background: #f7f8fa;
  border-bottom: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-2);
}

.feature-picker-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2px 12px;
  padding: 10px 12px;
}

.feature-picker-list .check {
  padding: 3px 0;
}

/* ------------------------------ 会员等级卡片 ------------------------------ */

.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.plan-card.current {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand);
}

.plan-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.plan-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.plan-card-price {
  display: flex;
  align-items: baseline;
  gap: 3px;
  color: var(--text);
}

.plan-card-price .amount {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.3px;
  font-variant-numeric: tabular-nums;
}

.plan-card-price .unit {
  font-size: 12px;
  color: var(--text-3);
}

.plan-card-desc {
  min-height: 38px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 19px;
}

.plan-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--text-3);
}

.plan-current-tag {
  position: absolute;
  top: -1px;
  right: 12px;
  transform: translateY(-50%);
  padding: 1px 8px;
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

/* ------------------------------ 聊天 ------------------------------ */

.chat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 340px;
  height: calc(100vh - 56px - 32px);
  min-height: 520px;
  border: 1px solid var(--line);
  background: #fff;
}

.support-page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.support-main {
  flex: 1;
  min-height: 0;
  padding: 16px;
}

.conv-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--line);
}

.conv-search {
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.conv-search .input {
  height: 30px;
  padding-left: 30px;
  font-size: 13px;
}

.conv-search {
  position: relative;
}

.conv-search svg {
  position: absolute;
  top: 20px;
  left: 22px;
  color: var(--text-3);
}

.conv-list {
  flex: 1;
  overflow-y: auto;
}

.conv-item {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  cursor: pointer;
}

.conv-item:hover {
  background: #fafbfc;
}

.conv-item.active {
  background: var(--brand-light);
}

.conv-main {
  flex: 1;
  min-width: 0;
}

.conv-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.conv-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-time {
  flex: none;
  font-size: 11px;
  color: var(--text-4);
}

.conv-preview {
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.conv-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  flex-wrap: wrap;
}

.conv-tags .badge {
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
}

.chat-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: #f7f8fa;
}

.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.chat-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
}

.chat-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 3px;
  font-size: 12px;
  color: var(--text-3);
}

.chat-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.msg-list {
  flex: 1;
  min-height: 0;
  padding: 20px 20px 8px;
  overflow-y: auto;
}

.msg-day {
  margin: 6px 0 16px;
  text-align: center;
  font-size: 11px;
  color: var(--text-4);
}

.msg-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 16px;
}

.msg-row.mine {
  flex-direction: row-reverse;
}

.msg-body {
  min-width: 0;
  max-width: min(72%, 560px);
}

.msg-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  font-size: 11px;
  color: var(--text-4);
}

.msg-meta .staff-no {
  padding: 0 4px;
  font-size: 10px;
  line-height: 16px;
}

.msg-row.mine .msg-meta {
  justify-content: flex-end;
}

.msg-bubble {
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
  word-break: break-word;
  white-space: pre-wrap;
}

.msg-row.mine .msg-bubble {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.msg-bubble.image-bubble,
.msg-bubble.video-bubble {
  padding: 4px;
  background: #fff;
  border-color: var(--line);
}

.msg-row.mine .msg-bubble.image-bubble,
.msg-row.mine .msg-bubble.video-bubble {
  background: var(--brand-light);
  border-color: var(--brand-border);
}

.msg-bubble img {
  display: block;
  max-width: 240px;
  max-height: 240px;
  border-radius: 1px;
  cursor: zoom-in;
}

.msg-bubble video {
  display: block;
  max-width: 280px;
  border-radius: 1px;
}

.order-card-msg {
  width: 280px;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.msg-row.mine .order-card-msg {
  border-color: var(--brand-border);
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7f8fa;
  font-size: 12px;
  color: var(--text-2);
}

.order-card-body {
  padding: 10px 12px;
}

.order-card-no {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  word-break: break-all;
}

.order-card-amount {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.order-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-3);
}

.composer {
  padding: 10px 14px 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.composer-tools {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-bottom: 8px;
  position: relative;
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 28px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: none;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
}

.tool-btn:hover {
  background: #f2f3f5;
  color: var(--brand);
}

.composer-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.composer textarea {
  flex: 1;
  height: 38px;
  min-height: 38px;
  max-height: 110px;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 20px;
  resize: none;
}

.composer textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.1);
}

.composer-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-4);
}

.order-pop {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  z-index: 20;
  width: 340px;
  max-width: calc(100vw - 60px);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.order-pop-title {
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.order-pop-row {
  display: flex;
  gap: 8px;
}

.order-pop-results {
  max-height: 220px;
  margin-top: 8px;
  overflow-y: auto;
}

.order-result {
  padding: 8px 10px;
  margin-bottom: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.order-result:hover {
  border-color: var(--brand);
  background: #fafcff;
}

.order-result.no-hover {
  cursor: default;
}

.order-result-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.order-result-no {
  font-family: var(--mono);
  color: var(--text);
  word-break: break-all;
}

.order-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-3);
}

.chat-side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line);
  background: #fff;
}

.side-tabs {
  display: flex;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.side-tab {
  flex: 1;
  padding: 12px 0;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}

.side-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 500;
}

.side-panel {
  flex: 1;
  min-height: 0;
  padding: 16px;
  overflow-y: auto;
}

.side-section + .side-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.info-list {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 9px 8px;
  margin: 0;
  font-size: 13px;
}

.info-list dt {
  color: var(--text-3);
}

.info-list dd {
  margin: 0;
  color: var(--text);
  word-break: break-all;
}

.side-empty {
  padding: 20px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
}

.quick-order {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafbfc;
}

.quick-order + .quick-order {
  margin-top: 8px;
}

.merchant-chat-card {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 56px - 140px);
  min-height: 460px;
  border: 1px solid var(--line);
  background: #fff;
}

.merchant-chat-card .chat-head {
  min-height: 64px;
}

.merchant-chat-card .msg-list {
  padding: 20px 24px 8px;
}

.merchant-chat-card .composer {
  padding: 12px 20px 14px;
}

/* ------------------------------ 商品 ------------------------------ */

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(218px, 1fr));
  gap: 12px;
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.product-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f2f5f9;
}

.product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-thumb .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #c2c9d3;
}

.product-status {
  position: absolute;
  top: 8px;
  left: 8px;
}

.product-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 5px;
  padding: 12px 14px;
}

.product-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.product-price .rmb {
  margin-right: 1px;
  font-size: 12px;
  font-weight: 500;
}

.product-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-3);
}

.product-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 6px 8px;
  border-top: 1px solid var(--line-soft);
  background: #fff;
}

.product-actions .link-btn {
  flex: 1;
  padding: 5px 4px;
  text-align: center;
}

.uploader {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  overflow: hidden;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: #fafbfc;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.uploader:hover {
  border-color: var(--brand);
  background: #f5f9ff;
}

.uploader img {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.uploader-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  line-height: 18px;
}

.uploader-empty svg {
  display: block;
  margin: 0 auto 6px;
  color: #a9aeb8;
}

.uploader-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

.uploader-remove:hover {
  background: rgba(0, 0, 0, 0.72);
}

.upload-progress {
  margin-top: 6px;
  font-size: 12px;
  color: var(--brand);
}

/* ------------------------------ 登录 ------------------------------ */

.login-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
}

.login-header {
  display: flex;
  align-items: center;
  height: 56px;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.login-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

.login-card {
  width: 400px;
  max-width: 100%;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}

.login-logo .brand-mark {
  width: 32px;
  height: 32px;
  font-size: 17px;
}

.login-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  line-height: 30px;
}

.login-desc {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 20px;
}

.login-card .field {
  margin-bottom: 16px;
}

.login-btn {
  width: 100%;
  height: 40px;
  margin-top: 6px;
  font-size: 15px;
}

.login-error {
  display: none;
  align-items: flex-start;
  gap: 6px;
  margin-bottom: 14px;
  padding: 8px 10px;
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  background: var(--red-bg);
  color: #a12a24;
  font-size: 12px;
  line-height: 18px;
}

.login-error.show {
  display: flex;
}

.login-hint {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: 12px;
  color: var(--text-3);
  line-height: 1.9;
}

.login-hint code {
  padding: 1px 5px;
  border-radius: 2px;
  background: #f2f3f5;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-2);
}

.login-foot {
  padding: 16px;
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
}

/* ------------------------------ 数据入口页 ------------------------------ */

.portal-head {
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.portal-head-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  height: 56px;
  margin: 0 auto;
  padding: 0 24px;
}

.portal-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.portal-hero {
  margin-bottom: 24px;
}

.portal-title {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.3px;
  color: var(--text);
  line-height: 36px;
}

.portal-desc {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-3);
  line-height: 21px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.entry-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: inherit;
  transition: border-color 0.15s;
}

.entry-card:hover {
  border-color: var(--brand);
  color: inherit;
}

.entry-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--brand-border);
  border-radius: var(--radius);
  background: var(--brand-light);
  color: var(--brand);
}

.entry-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

.entry-desc {
  font-size: 12px;
  color: var(--text-3);
  line-height: 19px;
}

.entry-link {
  margin-top: 4px;
  font-size: 12px;
  color: var(--brand);
}

.portal-foot {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-3);
  line-height: 20px;
}

/* ------------------------------ 通用工具 ------------------------------ */

.row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.wrap {
  flex-wrap: wrap;
}

.muted {
  color: var(--text-3);
}

.text-sm {
  font-size: 12px;
}

.mono {
  font-family: var(--mono);
}

.nowrap {
  white-space: nowrap;
}

.mt-4 {
  margin-top: 4px;
}

.mt-8 {
  margin-top: 8px;
}

.mt-12 {
  margin-top: 12px;
}

.mt-16 {
  margin-top: 16px;
}

.mb-8 {
  margin-bottom: 8px;
}

.mb-12 {
  margin-bottom: 12px;
}

.mb-16 {
  margin-bottom: 16px;
}

.hidden {
  display: none !important;
}

.divider {
  height: 1px;
  margin: 16px 0;
  background: var(--line);
}

.empty-line {
  padding: 30px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-4);
}

/* ------------------------------ 动画 ------------------------------ */

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes drawer-in {
  from {
    opacity: 0.6;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ------------------------------ 响应式 ------------------------------ */

@media (max-width: 1280px) {
  .chat-layout {
    grid-template-columns: 238px minmax(0, 1fr) 310px;
  }
  .chat-layout.hide-side {
    grid-template-columns: 238px minmax(0, 1fr);
  }
  .chat-layout.hide-side .chat-side {
    display: none;
  }
}

@media (max-width: 1100px) {
  .chat-layout {
    grid-template-columns: 238px minmax(0, 1fr);
  }
  .chat-layout .chat-side {
    display: none;
  }
  .chat-layout.show-side .chat-side {
    display: flex;
    position: absolute;
    top: 56px;
    right: 0;
    bottom: 0;
    z-index: 25;
    width: 340px;
    box-shadow: -6px 0 24px rgba(0, 0, 0, 0.1);
  }
  .chat-layout {
    position: relative;
  }
  .side-toggle {
    display: inline-flex !important;
  }
}

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
  .entry-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "top"
      "main";
  }

  .sidebar {
    display: none;
  }

  .main {
    padding: 16px 14px 84px;
    background: var(--bg);
  }

  .topbar {
    padding: 0 14px;
  }

  .brand-sub,
  .env-badge,
  .hide-sm {
    display: none !important;
  }

  .page-head {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    min-height: 92px;
    padding: 14px;
  }

  .stat-value {
    font-size: 22px;
    line-height: 30px;
  }

  .grid-2,
  .grid-3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2 {
    grid-column: auto;
  }

  .modal-mask {
    padding: 20px 10px;
  }

  .modal,
  .modal.modal-lg {
    width: 100%;
  }

  .modal-body {
    max-height: calc(100vh - 220px);
  }

  .drawer {
    width: 100%;
  }

  .feature-picker-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-layout {
    height: calc(100vh - 56px - 16px);
    grid-template-columns: minmax(0, 1fr);
  }

  .chat-layout .conv-panel {
    display: none;
  }

  .chat-layout.show-side .chat-side {
    width: 100%;
  }

  .merchant-chat-card {
    height: calc(100vh - 56px - 84px);
    border-left: 0;
    border-right: 0;
    margin: 0 -14px;
  }

  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 40;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    height: 54px;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid var(--line);
    background: #fff;
  }

  .mnav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: none;
    color: var(--text-3);
    font-size: 10px;
    cursor: pointer;
  }

  .mnav-item svg {
    width: 19px;
    height: 19px;
  }

  .mnav-item.active {
    color: var(--brand);
  }

  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .product-info {
    padding: 10px;
  }

  .product-name {
    font-size: 13px;
  }

  .product-price {
    font-size: 15px;
  }

  .table-foot {
    padding: 10px 12px;
  }

  .toolbar .input,
  .toolbar .select {
    min-width: 0;
  }

  .search-box,
  .search-box .input {
    width: 100%;
  }

  .toolbar .search-box {
    flex: 1;
  }

  .login-card {
    padding: 24px 20px;
  }

  .portal-title {
    font-size: 22px;
    line-height: 30px;
  }
}

@media (max-width: 560px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-actions {
    gap: 8px;
  }

  .user-chip .user-name-full {
    display: none;
  }

  .product-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .msg-body {
    max-width: calc(100% - 44px);
  }

  .msg-bubble img {
    max-width: 190px;
    max-height: 190px;
  }

  .order-pop {
    width: calc(100vw - 60px);
  }
}
