body {
  background: var(--bg);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}

.field select {
  width: 100%;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  outline: none;
  font: inherit;
  color: inherit;
}

.toolbar-select {
  height: 40px;
  min-width: 128px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 8px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12.5px;
}

.date-range input[type="date"] {
  height: 30px;
  max-width: 124px;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12.5px;
  outline: none;
}

.date-range input[type="date"]::-webkit-calendar-picker-indicator {
  opacity: 0.6;
  cursor: pointer;
}

.date-sep {
  color: var(--muted);
  white-space: nowrap;
}

.date-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.date-clear:hover {
  background: var(--line);
  color: inherit;
}

.feedback-modal {
  max-width: 680px;
}

.feedback-modal .modal-body {
  display: grid;
  gap: 14px;
  max-height: 68vh;
  overflow: auto;
}

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

.feedback-meta > div {
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
}

.feedback-meta span {
  display: block;
  margin-bottom: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

.feedback-meta b {
  font-size: 12.5px;
  font-weight: 600;
  word-break: break-all;
}

.feedback-section h4 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.feedback-comment {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  line-height: 1.7;
  white-space: pre-wrap;
  user-select: text;
}

.feedback-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.feedback-form .full {
  grid-column: 1 / -1;
}

.feedback-form select,
.feedback-form input,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: inherit;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.feedback-form select,
.feedback-form input {
  height: 36px;
  padding: 0 10px;
}

.feedback-form textarea {
  min-height: 60px;
  padding: 8px 10px;
  resize: vertical;
}

.followup-list {
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
}

.followup-item {
  padding: 8px 10px;
  border-left: 2px solid var(--brand);
  border-radius: 6px;
  background: var(--panel-2);
}

.followup-meta {
  margin-bottom: 4px;
  font-size: 10.5px;
  color: var(--muted);
}

.followup-item p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  user-select: text;
}

.field select:focus {
  border-color: var(--brand);
  background: var(--panel);
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.settings-card .field select {
  height: 38px;
  font-size: 12.5px;
}

.admin-login {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background-color: var(--bg);
  background-image: radial-gradient(var(--line) 0.8px, transparent 0.8px);
  background-size: 22px 22px;
}

.admin-login-card {
  width: min(400px, 100%);
  padding: 26px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(16, 24, 40, 0.07);
}

.admin-login h1 {
  margin: 20px 0 4px;
  font-size: 20px;
}

.admin-sub {
  margin: 0 0 18px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

.admin-login-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12.5px;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.admin-brand img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
}

.admin-brand b {
  display: block;
  font-size: 16px;
  letter-spacing: 0.05em;
}

.admin-brand p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--muted);
}

.admin-shell {
  --admin-side-w: 230px;
  display: grid;
  grid-template-columns: var(--admin-side-w) minmax(0, 1fr);
  min-height: 100vh;
  min-width: 0;
  background: linear-gradient(
    90deg,
    var(--panel) 0 calc(var(--admin-side-w) - 1px),
    var(--line) calc(var(--admin-side-w) - 1px),
    var(--line) var(--admin-side-w),
    var(--bg) var(--admin-side-w)
  );
}

.admin-side {
  position: sticky;
  top: 0;
  align-self: start;
  height: auto;
  max-height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  min-width: 0;
}

.admin-mobile-bar {
  display: none;
}

.admin-menu {
  display: contents;
}

.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  height: 39px;
  width: 100%;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  text-align: left;
  text-decoration: none;
}

.admin-nav-item:hover {
  background: var(--panel-2);
  color: var(--text);
}

.admin-nav-item.active {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.admin-nav-item svg {
  width: 18px;
  height: 18px;
}

.admin-nav-group {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.admin-nav-parent {
  width: 100%;
}

.admin-nav-parent .chevron {
  width: 13px;
  height: 13px;
  margin-left: auto;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

.admin-nav-group.closed .chevron {
  transform: rotate(-90deg);
}

.admin-nav-group.closed .admin-subnav {
  display: none;
}

.admin-subnav {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 20px;
}

.admin-subnav .admin-nav-item {
  height: 34px;
  padding-left: 10px;
  font-size: 12.5px;
}

.admin-subnav .admin-nav-item.active {
  background: transparent;
  color: var(--brand);
}

.admin-nav-group.has-active .admin-nav-parent {
  color: var(--text);
}

.admin-side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 6px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.admin-main {
  min-width: 0;
  padding: 24px 32px 60px;
}

.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-top h1 {
  margin: 0;
  font-size: 22px;
}

.admin-top p {
  margin: 3px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.admin-view {
  display: none;
  animation: fade-in 0.18s ease;
}

.admin-view.active {
  display: block;
}

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

/* 会员运营统计：3 张卡片等分铺满整行 */
#member-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  overflow: hidden;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  color: #fff;
  isolation: isolate;
  background: linear-gradient(135deg, #6a5cff 0%, #3aa7ff 52%, #22d3ee 100%);
  box-shadow: 0 14px 26px -18px rgba(58, 90, 255, 0.85);
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(120% 150% at 100% 0%, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0) 62%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 46%);
}

.stat-card:nth-child(1) {
  background: linear-gradient(135deg, #7a5cff 0%, #4f7cff 58%, #4cc9f0 100%);
}

.stat-card:nth-child(2) {
  background: linear-gradient(135deg, #4361ee 0%, #22a7f0 55%, #2ee6d6 100%);
}

.stat-card:nth-child(3) {
  background: linear-gradient(135deg, #12b886 0%, #2ad4a5 48%, #6ee7f9 100%);
}

.stat-card:nth-child(4) {
  background: linear-gradient(135deg, #f0568c 0%, #f78c3c 52%, #f9c74f 100%);
}

.stat-card span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.stat-card b {
  display: block;
  margin-top: 6px;
  color: #fff;
  font-size: 25px;
  letter-spacing: -0.02em;
  text-shadow: 0 1px 8px rgba(23, 32, 84, 0.22);
}

.panel {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel-head h3 {
  margin: 0;
  font-size: 15px;
}

.muted {
  font-size: 12px;
  color: var(--muted);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

.table th {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
  vertical-align: middle;
}

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

.table .right {
  text-align: right;
}

.cell-user {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.cell-user b {
  font-weight: 600;
}

.cell-user span {
  font-size: 11px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.badge.admin {
  background: var(--brand-soft);
  border-color: transparent;
  color: var(--brand);
}

.badge.on {
  color: var(--ok);
  border-color: transparent;
  background: rgba(5, 150, 105, 0.1);
}

.badge.off {
  color: var(--danger);
  border-color: transparent;
  background: var(--danger-soft);
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 2px;
  white-space: nowrap;
}

.row-actions .btn {
  height: 30px;
  padding: 0 9px;
  font-size: 11.5px;
  font-weight: 500;
}

.row-actions .icon-btn {
  width: 30px;
  height: 30px;
}

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

.search-input {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.search-input svg {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.search-input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 12.5px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  font-size: 12px;
  color: var(--muted);
}

.pager > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .btn {
  height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.section-note {
  margin: 0 0 16px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

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

.settings-grid.single {
  grid-template-columns: minmax(0, 720px);
}

.settings-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  overflow-x: auto;
}

.settings-tab {
  height: 34px;
  padding: 0 16px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}

.settings-tab.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-soft);
}

.settings-panel {
  display: none;
}

.settings-panel.active {
  display: block;
}

.settings-panel .settings-grid {
  grid-template-columns: minmax(0, 760px);
}

.provider-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.provider-tab {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.provider-tab.active {
  border-color: transparent;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

.settings-card.hidden {
  display: none;
}

.settings-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-card form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.settings-card-head h3 {
  margin: 0;
  font-size: 14.5px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  font-size: 10.5px;
  color: var(--muted);
}

.status-pill.on {
  background: rgba(5, 150, 105, 0.1);
  border-color: transparent;
  color: var(--ok);
}

.status-pill i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.settings-card .field {
  gap: 5px;
}

.settings-card .field input,
.settings-card .field textarea {
  height: 38px;
  font-size: 12.5px;
}

.settings-card .field textarea {
  height: 90px;
  padding: 9px 11px;
  resize: vertical;
  line-height: 1.5;
}

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

.switch-row span {
  font-size: 12.5px;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 38px;
  height: 22px;
  flex: none;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 2;
}

.switch em {
  position: absolute;
  inset: 0;
  border-radius: 22px;
  background: var(--line-strong);
  transition: background 0.16s;
}

.switch em::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.16s;
}

.switch input:checked + em {
  background: var(--brand);
}

.switch input:checked + em::after {
  transform: translateX(16px);
}

.settings-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
  padding-top: 6px;
}

.settings-actions .btn {
  height: 36px;
  font-size: 12.5px;
}

.test-row {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.test-row input {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  outline: 0;
  font-size: 12.5px;
}

.test-row .btn {
  height: 36px;
  font-size: 12px;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ---------- iPad / 平板 ---------- */
@media (min-width: 901px) and (max-width: 1180px) {
  .admin-shell {
    --admin-side-w: 200px;
    grid-template-columns: var(--admin-side-w) minmax(0, 1fr);
  }

  .admin-side {
    padding: 18px 12px;
  }

  .admin-nav-item {
    height: 42px;
  }

  .admin-main {
    padding: 20px 22px 50px;
  }

  .admin-top h1 {
    font-size: 20px;
  }
}

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

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

@media (max-width: 900px) {
  .admin-shell {
    --admin-side-w: 0px;
    grid-template-columns: minmax(0, 1fr);
    background: var(--bg);
  }

  /* 手机端：顶栏面包屑固定在顶部，不再占用 main 之前的高度 */
  .admin-side {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    display: block;
    height: auto;
    max-height: none;
    overflow: visible;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
    backdrop-filter: blur(14px);
  }

  .admin-mobile-bar {
    display: block;
  }

  .mobile-menu-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    color: var(--text);
    font-size: 13px;
    text-align: left;
  }

  .mobile-menu-badge {
    flex: none;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
  }

  .mobile-menu-badge svg {
    width: 16px;
    height: 16px;
  }

  .mobile-crumb {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-weight: 600;
    letter-spacing: 0.01em;
  }

  .mobile-chevron {
    flex: none;
    width: 16px;
    height: 16px;
    color: var(--muted);
    transition: transform 0.2s ease;
  }

  .admin-side.menu-open .mobile-chevron {
    transform: rotate(180deg);
  }

  .admin-menu {
    position: absolute;
    left: 10px;
    right: 10px;
    top: calc(100% + 8px);
    display: none;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
    max-height: calc(100dvh - 110px);
    overflow-y: auto;
  }

  .admin-side.menu-open .admin-menu {
    display: block;
    animation: menu-drop 0.18s ease;
  }

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

  .admin-menu .admin-brand {
    display: none;
  }

  .admin-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
    overflow: visible;
  }

  .admin-nav-group,
  .admin-subnav {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-left: 0;
  }

  .admin-nav-group::before {
    content: "设置";
    grid-column: 1 / -1;
    padding: 6px 4px 0;
    font-size: 11px;
    color: var(--muted);
  }

  #membership-group::before {
    content: "会员运营";
  }

  .admin-nav-parent {
    display: none;
  }

  .admin-nav-item {
    width: 100%;
    height: auto;
    min-height: 74px;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    padding: 10px 6px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-2);
    font-size: 11.5px;
    text-align: center;
    white-space: normal;
  }

  .admin-nav-item svg {
    width: 21px;
    height: 21px;
  }

  .admin-nav > .admin-nav-item[data-panel="overview"] {
    grid-column: 1 / -1;
    min-height: 68px;
  }

  .admin-subnav .admin-nav-item {
    height: auto;
    min-height: 74px;
    padding: 10px 6px;
    border-radius: 12px;
    font-size: 11.5px;
  }

  .admin-nav-item.active,
  .admin-subnav .admin-nav-item.active {
    border-color: var(--brand);
    background: var(--brand-soft);
    color: var(--brand);
  }

  .admin-side-foot {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
  }

  .admin-side-foot .admin-nav-item {
    width: auto;
    min-height: 34px;
    height: 34px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 12px;
  }

  .admin-user {
    margin: 0 auto 0 0;
    border: 0;
    padding: 2px;
  }

  .admin-main {
    padding: calc(75px + env(safe-area-inset-top)) 16px calc(50px + env(safe-area-inset-bottom));
  }

  .admin-top {
    margin-bottom: 14px;
  }
}

@media (max-width: 560px) {
  .admin-login-card {
    padding: 22px;
    border-radius: 20px;
  }

  .admin-top h1 {
    font-size: 19px;
  }

  .settings-tabs {
    border-radius: 10px;
  }

  .settings-tab {
    height: 36px;
    padding: 0 12px;
  }

  .feedback-modal {
    max-width: none;
  }

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

  .feedback-form {
    grid-template-columns: 1fr;
  }

  .modal-overlay {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    width: 100%;
    max-width: none;
    max-height: 100dvh;
    height: 100dvh;
    border-radius: 0;
  }

  .feedback-modal .modal-body {
    max-height: none;
  }

  .toolbar-select {
    flex: 1;
  }

  .pager {
    flex-wrap: wrap;
    gap: 8px;
  }

  .stat-grid {
    gap: 10px;
  }

  .stat-card {
    padding: 13px 14px;
  }

  .stat-card b {
    font-size: 21px;
  }

  .toolbar {
    flex-wrap: wrap;
  }

  .search-input {
    flex-basis: 100%;
  }
}

@media (pointer: coarse) {
  .admin-nav-item {
    min-height: 44px;
  }

  .admin-subnav .admin-nav-item {
    min-height: 38px;
  }

  .settings-tab,
  .provider-tab {
    min-height: 38px;
  }

  .btn {
    min-height: 42px;
  }
}

/* ---------- 会员运营 ---------- */
.member-admin-grid {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.member-form {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.member-form h3 {
  margin: 0;
  font-size: 15px;
}

.member-form .field-row2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-form .field {
  min-width: 0;
}

.member-form textarea {
  min-height: 76px;
  resize: vertical;
}

.member-table {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.member-table table {
  min-width: 560px;
}

.member-row-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

@media (max-width: 1100px) {
  .member-admin-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .member-form .field-row2 {
    grid-template-columns: minmax(0, 1fr);
  }
}


.member-warning {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 10px;
  background: rgba(245, 158, 11, 0.08);
  font-size: 11.5px;
  line-height: 1.6;
  color: #b45309;
}


/* 窄屏：反馈与会员表格改为两列卡片，避免横向滚动 */
@media (max-width: 900px) {
  .stack-table,
  .member-table table {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .stack-table thead,
  .member-table thead {
    display: none;
  }

  .stack-table tbody,
  .member-table tbody {
    display: block;
  }

  .stack-table tr,
  .member-table tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
  }

  .stack-table tr:last-child,
  .member-table tr:last-child {
    border-bottom: 0;
  }

  .stack-table td,
  .member-table td {
    display: block;
    width: auto;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  .stack-table td::before,
  .member-table td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    font-size: 10.5px;
    color: var(--muted);
  }

  .stack-table td.right,
  .member-table td.right {
    grid-column: 1 / -1;
    text-align: left;
  }

  .stack-table td[colspan],
  .member-table td[colspan] {
    grid-column: 1 / -1;
  }

  .stack-table .member-row-actions,
  .member-table .member-row-actions {
    justify-content: flex-start;
  }

  .table-wrap:has(.stack-table),
  .member-table {
    overflow-x: visible;
  }
}


/* 操作日志详情列：宽屏省略，窄屏换行 */
.log-detail {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .member-table .log-detail {
    max-width: none;
    white-space: normal;
    grid-column: 1 / -1;
  }
}

.member-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.member-toolbar h3 {
  margin: 0;
  font-size: 15px;
}

.member-toolbar p {
  margin: 4px 0 0;
  font-size: 11.5px;
}

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

.plan-form-grid .field-full {
  grid-column: 1 / -1;
}

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

/* 窄屏：时间筛选独占一行，避免横向溢出 */
@media (max-width: 900px) {
  .toolbar {
    flex-wrap: wrap;
  }

  .toolbar .search-input {
    flex-basis: 100%;
  }

  .toolbar .date-range {
    flex: 1 1 auto;
  }
}

@media (max-width: 560px) {
  .toolbar .date-range {
    flex: 1 1 100%;
    justify-content: space-between;
  }

  .date-range input[type="date"] {
    flex: 1;
    max-width: none;
  }
}


/* 插件包：按插件归类折叠 */
.pkg-groups {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pkg-group {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-2);
  overflow: hidden;
}

.pkg-group[open] {
  background: var(--panel);
}

.pkg-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.pkg-group-head::-webkit-details-marker {
  display: none;
}

.pkg-caret {
  flex: none;
  width: 8px;
  height: 8px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}

.pkg-group[open] .pkg-caret {
  transform: rotate(45deg);
}

.pkg-group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
}

.pkg-group-title b {
  font-size: 13.5px;
}

.pkg-group-title code {
  font-size: 11px;
  color: var(--muted);
}

.pkg-group-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
  font-size: 11.5px;
}

.pkg-version-chip {
  padding: 1px 8px;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--brand, #6366f1);
  font-size: 11px;
  font-weight: 600;
}

.pkg-group-body {
  border-top: 1px solid var(--line);
  padding: 12px 14px 4px;
}

.pkg-update-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--line-strong, var(--line));
  border-radius: 10px;
  background: var(--panel-2);
}

.pkg-update-label {
  font-size: 12.5px;
  font-weight: 600;
}

.pkg-update-form em {
  flex-basis: 100%;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.pkg-version-table {
  min-width: 0;
}

.pkg-version-table th {
  font-size: 10.5px;
}

.pkg-version-table td {
  padding: 8px 10px;
  font-size: 11.5px;
}

.pkg-version-table td b {
  font-size: 12px;
}

.pkg-version-table .tag {
  margin-left: 6px;
}
