/* 达人管理系统 - Gmail 风格 + 小红书配色 */
:root {
  --xhs-red: #FF2442;
  --xhs-red-dark: #e01e3a;
  --xhs-red-light: #ff4d6a;
  --bg-white: #FFFFFF;
  --bg-gray: #F7F7F7;
  --bg-sidebar: #FAFAFA;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #E8E8E8;
  --sidebar-width: 200px;
  --detail-width: 380px;
  --header-height: 48px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* 页面路径提示 - 固定在视口右下角，点击复制 */
.page-path-indicator {
  position: fixed;
  bottom: 6px;
  right: 8px;
  font-size: 10px;
  color: #bbb;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 4px;
  font-family: monospace;
  user-select: none;
  opacity: 0.5;
  transition: opacity 0.2s;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  z-index: 9999;
}
.page-path-indicator.in-list,
.page-path-indicator.in-dashboard,
.page-path-indicator.in-daily,
.page-path-indicator.in-settings,
.page-path-indicator.in-resources,
.page-path-indicator.in-settlements {
  right: calc(var(--detail-width, 380px) + 12px);
}
.page-path-indicator:hover {
  opacity: 1;
  color: #666;
}
.page-path-indicator.copied {
  color: #20a53a;
  opacity: 1;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-gray);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 顶部栏 */
.app-header {
  height: var(--header-height);
  background: var(--bg-white);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 14px;
  flex-shrink: 0;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 16px;
}

.app-logo-icon {
  width: 28px;
  height: 28px;
  background: var(--xhs-red);
  border-radius: 6px;
}

.app-logo-text {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.app-search {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.app-search input {
  width: 100%;
  height: 36px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  background: var(--bg-gray);
  transition: background 0.2s;
}

.app-search input:focus {
  outline: none;
  background: var(--bg-white);
  border-color: var(--xhs-red);
}

.app-search::before {
  content: "🔍";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
}

.app-search-with-history {
  position: relative;
}

.search-history-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  max-height: 240px;
  overflow: hidden;
}

.search-history-dropdown.show {
  display: block;
}

.search-history-header {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.search-history-list {
  max-height: 180px;
  overflow-y: auto;
}

.search-history-item {
  padding: 10px 12px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-history-item:hover {
  background: var(--bg-gray);
}

.search-history-empty {
  padding: 16px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.search-history-clear {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  border-top: 1px solid var(--border-color);
}

.search-history-clear:hover {
  color: var(--xhs-red);
}

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

/* 移动端仅保留「新增」按钮，桌面端显示全部 */

.btn {
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--xhs-red);
  color: white;
}

.btn-primary:hover {
  background: var(--xhs-red-dark);
}

.btn-secondary {
  background: var(--bg-gray);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

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

/* 主布局 */
.app-main {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* 左侧边栏 */
.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 10px 0;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.sidebar-item:hover {
  background: rgba(255, 36, 66, 0.06);
  color: var(--xhs-red);
}

.sidebar-item.active {
  background: rgba(255, 36, 66, 0.08);
  color: var(--xhs-red);
  font-weight: 500;
  border-left-color: var(--xhs-red);
}

/* 设置入口仅管理员可见 */
body.user-non-admin .sidebar-item-settings { display: none !important; }
body.user-non-admin .admin-only { display: none !important; }

.sidebar-item-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
}

.sidebar-item-count {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
}

/* 左侧菜单分组 */
.sidebar-group {
  padding: 0 0 6px 0;
}
.sidebar-group-main {
  padding-bottom: 8px;
}
.sidebar-group-divider {
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 14px 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-top: 1px solid var(--border-color);
  margin-top: 4px;
}

/* 中间列表区 */
.app-list {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--bg-white);
  position: relative;
}

/* 设置中心 - 内容过长时可滚动 */
.app-list > .settings-hub {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 14px;
  max-width: 900px;
  position: relative;
}
.settings-hub .settings-hub-header {
  flex-shrink: 0;
}
.settings-hub .settings-content-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
.settings-hub .settings-content {
  padding: 0;
}

.list-toolbar {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.list-toolbar-title {
  font-size: 13px;
  color: var(--text-secondary);
  margin-right: 4px;
}

.list-toolbar select {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 12px;
  background: var(--bg-white);
}

.list-recommend-bar {
  padding: 6px 14px;
  background: var(--bg-gray);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-recommend-label {
  font-size: 13px;
  color: var(--text-secondary);
}

.list-recommend-conditions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.list-recommend-conditions select,
.list-recommend-conditions input {
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}
.btn-danger {
  color: #b91c1c;
  border-color: #fca5a5;
  background: #fef2f2;
}
.btn-danger:hover {
  background: #fecaca;
  border-color: #b91c1c;
}

.list-table-wrap {
  flex: 1;
  overflow: auto;
}

.list-table {
  width: 100%;
  border-collapse: collapse;
}

.list-table th,
.list-table td {
  padding: 4px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.list-table th {
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--bg-gray);
  position: sticky;
  top: 0;
  z-index: 1;
}

.list-table tr {
  cursor: pointer;
  transition: background 0.15s;
}

.list-table tbody tr:hover {
  background: rgba(255, 36, 66, 0.04);
}

.list-table tbody tr.selected {
  background: rgba(255, 36, 66, 0.08);
}

/* 合作审核通过的博主行：整行高亮 */
.list-table tbody tr.row-coop-passed {
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid var(--xhs-red, #FF2442);
}
.list-table tbody tr.row-coop-passed:hover {
  background: rgba(34, 197, 94, 0.16);
}
.list-table tbody tr.row-coop-passed.selected {
  background: rgba(255, 36, 66, 0.12);
  border-left-color: var(--xhs-red, #FF2442);
}

/* 合作审核「是」徽标 */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}
.status-badge--pass {
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
}
.status-badge--reject {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
}

/* 达人(粉丝录入) 已录入标记 */
.entry-done-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
}
.list-table tbody tr.row-has-entry {
  background: rgba(34, 197, 94, 0.06);
}

/* 手工新增标记（列表昵称列） */
.source-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}
.source-badge--manual {
  background: rgba(255, 36, 66, 0.15);
  color: var(--xhs-red);
}
.col-nickname .nickname-text {
  vertical-align: middle;
}

.list-table .col-check {
  width: 40px;
}

.list-table .col-nickname {
  min-width: 140px;
}

.list-table .col-owner {
  min-width: 80px;
  font-size: 11px; /* 所属用户名缩小一倍（原约14px） */
}
/* 确保非管理员也能看到所属用户列 */
body.user-non-admin .list-table .col-owner {
  display: table-cell !important;
  visibility: visible !important;
}

.list-table .col-followers {
  width: 100px;
  text-align: right;
}

.list-table .col-growth7 {
  width: 90px;
  text-align: right;
}

.list-table .col-status {
  width: 90px;
}

.list-table .col-category {
  min-width: 80px;
}

.list-table .col-method {
  min-width: 100px;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.list-table .col-traffic {
  min-width: 70px;
}
.list-table .col-coop-product,
.list-table .col-coop-process,
.list-table .col-coop-stage,
.list-table .col-order-method,
.list-table .col-refund,
.list-table .col-fee,
.list-table .col-influencer-amount,
.list-table .col-pugongying-amount {
  min-width: 70px;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.list-table .col-actions .btn-edit-coop {
  padding: 4px 10px;
  font-size: 12px;
}

.list-table .col-date {
  min-width: 110px;
  white-space: nowrap;
}

.list-table .col-actions {
  width: 80px;
}

.list-table th.sortable {
  cursor: pointer;
  user-select: none;
}
.list-table th.sortable:hover {
  color: var(--xhs-red);
}

.link {
  color: var(--xhs-red);
  text-decoration: none;
}

.link:hover {
  text-decoration: underline;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state p {
  margin-top: 8px;
  font-size: 14px;
}

/* 右侧详情区 */
.app-detail {
  width: var(--detail-width);
  min-height: 0;
  background: var(--bg-white);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  align-self: stretch;
}

.detail-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 15px;
}

.detail-content {
  flex: 1;
  min-height: 0;
  max-height: calc(100vh - var(--header-height));
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 14px;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

.detail-content::-webkit-scrollbar {
  width: 8px;
}
.detail-content::-webkit-scrollbar-track {
  background: var(--bg-gray);
  border-radius: 4px;
}
.detail-content::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}
.detail-content::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}

.detail-title {
  font-size: 16px;
  font-weight: 600;
}

.detail-section {
  margin-bottom: 12px;
}

.detail-section-title {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.detail-row {
  display: flex;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  width: 100px;
  flex-shrink: 0;
  color: var(--text-secondary);
}

.detail-value {
  flex: 1;
  word-break: break-all;
}

/* 主页链接：一行显示、点击复制、跳转按钮 */
.detail-row-url .detail-label {
  align-self: flex-start;
}
.detail-url-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.detail-url-text {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  cursor: pointer;
  color: var(--xhs-red);
  font-size: 13px;
  padding: 2px 0;
  user-select: all;
}
.detail-url-text::-webkit-scrollbar {
  height: 4px;
}
.detail-url-text:hover {
  text-decoration: underline;
}
.detail-url-text.copied {
  color: #20a53a;
}
.detail-url-jump {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--xhs-red);
  color: white;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s;
}
.detail-url-jump:hover {
  background: var(--xhs-red-dark);
  color: white;
}

.detail-chart {
  height: 160px;
  min-height: 160px;
  margin-top: 8px;
  position: relative;
}
.detail-chart canvas {
  display: block;
  width: 100% !important;
  height: 160px !important;
}

.detail-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-attachment-item {
  position: relative;
}
.detail-attachment-item.img-err img {
  display: none;
}
.detail-attachment-item.img-err .img-err-placeholder {
  display: flex;
}
.detail-attachment-item .img-err-placeholder {
  display: none;
  width: 96px;
  height: 96px;
  background: #f0f0f0;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #999;
}

.detail-attachments img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s;
}
.detail-attachments img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.detail-section-attachments {
  border: 1px dashed var(--border-color);
  border-radius: 6px;
  padding: 8px;
  background: var(--bg-gray);
}

.detail-section-attachments .upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px 12px;
  margin-top: 8px;
}
.detail-section-attachments .upload-area-icon {
  font-size: 22px;
  margin-bottom: 4px;
  opacity: 0.7;
}
.detail-section-attachments .upload-area-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.detail-top-actions {
  padding: 0 0 8px;
  display: flex;
  gap: 8px;
}

.detail-actions {
  padding: 10px 0 0;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 粉丝历史变动 */
.detail-section-history {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}
.detail-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.detail-history-summary-item {
  padding: 6px 10px;
  background: var(--bg-gray);
  border-radius: 6px;
  font-size: 12px;
}
.detail-history-summary-item .label {
  color: var(--text-muted);
  margin-right: 4px;
}
.detail-history-summary-item .value.up {
  color: #20a53a;
}
.detail-history-summary-item .value.down {
  color: #e74c3c;
}
.detail-history-summary-item .value.flat {
  color: var(--text-secondary);
}
.detail-history-table-wrap {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: 6px;
}
.detail-history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.detail-history-table th,
.detail-history-table td {
  padding: 5px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.detail-history-table th {
  background: var(--bg-gray);
  color: var(--text-muted);
  font-weight: 500;
  position: sticky;
  top: 0;
}
.detail-history-table th:last-child,
.detail-history-table td:last-child {
  text-align: right;
}
.detail-history-table tbody tr:last-child td {
  border-bottom: none;
}
.detail-history-table .delta-up {
  color: #20a53a;
  font-weight: 500;
}
.detail-history-table .delta-down {
  color: #e74c3c;
  font-weight: 500;
}
.detail-history-table .delta-flat {
  color: var(--text-muted);
}
.detail-history-empty {
  display: none;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-gray);
  border-radius: 8px;
}
.detail-section-history.has-empty .detail-history-summary,
.detail-section-history.has-empty .detail-history-table-wrap {
  display: none;
}
.detail-section-history.has-empty .detail-history-empty {
  display: block;
}

/* 合作记录 */
.detail-section-cooperation {
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
}
.detail-cooperation-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
}
.detail-cooperation-card {
  background: var(--bg-gray);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color);
}
.detail-cooperation-card-header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.detail-cooperation-card-header span {
  color: var(--text-secondary);
}
.detail-cooperation-card-header strong {
  color: var(--text-primary);
  font-weight: 500;
}
.detail-cooperation-card-row {
  display: flex;
  padding: 4px 0;
  gap: 8px;
  word-break: break-all;
}
.detail-cooperation-card-row .label {
  flex-shrink: 0;
  width: 90px;
  color: var(--text-muted);
}
.detail-cooperation-card-row .value {
  flex: 1;
  min-width: 0;
}
.detail-cooperation-card-row .value a {
  color: var(--xhs-red);
  text-decoration: none;
}
.detail-cooperation-card-row .value a:hover {
  text-decoration: underline;
}
.detail-cooperation-status-row .coop-record-status-select {
  min-width: 100px;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.btn-order {
  padding: 2px 6px;
  font-size: 10px;
  line-height: 1;
  min-width: 24px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-white);
  cursor: pointer;
}
.btn-order:hover:not(:disabled) {
  background: var(--bg-gray);
}
.btn-order:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.detail-cooperation-empty {
  display: none;
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-gray);
  border-radius: 8px;
}
.detail-section-cooperation.has-empty .detail-cooperation-list {
  display: none;
}
.detail-section-cooperation.has-empty .detail-cooperation-empty {
  display: block;
}

/* 弹窗 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s;
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-white);
  border-radius: 12px;
  width: 90%;
  max-width: 560px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95);
  transition: transform 0.2s;
}

/* 编辑达人弹窗：更大、信息更集中 */
.modal-influencer-form .modal--influencer {
  max-width: 820px;
  max-height: 92vh;
}
.modal-influencer-form .modal-body {
  padding: 20px 24px;
}
.modal-influencer-form .form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.modal-influencer-form .form-row .form-group {
  flex: 1;
  min-width: 140px;
  margin-bottom: 16px;
}
.modal-influencer-form .form-row-4 .form-group {
  flex: 1;
  min-width: 160px;
}
.modal-influencer-form .form-section {
  margin-bottom: 20px;
}
.modal-influencer-form .form-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.modal-influencer-form .form-coop-section {
  margin-bottom: 20px;
}
.modal-influencer-form .form-coop-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.modal-influencer-form .form-hint {
  font-size: 12px;
  color: var(--text-muted);
}
.modal-influencer-form .form-group label {
  font-size: 13px;
}
.modal-influencer-form .form-group input,
.modal-influencer-form .form-group select,
.modal-influencer-form .form-group textarea {
  padding: 8px 12px;
}
.modal-influencer-form #formRemark {
  min-height: 72px;
}

.modal-overlay.show .modal {
  transform: scale(1);
}

.modal-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

.modal-body {
  padding: 14px 16px;
  overflow-y: auto;
  flex: 1;
}

.form-group {
  margin-bottom: 12px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--xhs-red);
}

.form-group textarea {
  min-height: 80px;
  resize: vertical;
}

/* 合作审核开关 */
.form-coop-switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.form-coop-switch-row .form-coop-switch-label {
  font-size: 13px;
  color: var(--text-secondary);
}
.form-coop-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border-color);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.form-coop-switch.on {
  background: var(--xhs-red);
}
.form-coop-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.form-coop-switch.on::after {
  transform: translateX(20px);
}
.form-coop-switch-status {
  font-size: 13px;
  color: var(--text-muted);
}
.form-coop-switch.on + .form-coop-switch-status {
  color: var(--xhs-red);
  font-weight: 500;
}

/* 所属用户多选：网格对齐，避免长短不一导致错乱 */
.form-owner-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 10px 16px;
  margin-top: 8px;
}
.form-owner-checkbox-item {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  min-width: 0;
  padding: 8px 10px;
  background: var(--bg-gray);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}
.form-owner-checkbox-item:hover {
  background: #eee;
}
.form-owner-checkbox-item input {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  vertical-align: middle;
}
.form-owner-checkbox-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.form-group-owner-checkboxes > label {
  margin-bottom: 8px;
}

/* 新增/编辑达人表单 - 图片区 */
.form-section-attachments {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}
.form-upload-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.form-attachments-wrap {
  margin-top: 8px;
}
.form-attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.form-attachments-list .form-attachment-item {
  width: 80px;
  height: 80px;
}
.form-attachments-list .form-attachment-item img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid var(--border-color);
}
.form-attachments-list .form-attachment-item .detail-attachment-tags {
  margin-top: 4px;
  font-size: 11px;
}
.form-upload-area {
  padding: 16px;
}
.form-attachments-loading {
  font-size: 13px;
  color: var(--text-muted);
}

/* 合作确认信息区块 */
.form-coop-section {
  margin-bottom: 20px;
  padding: 16px;
  background: var(--bg-gray);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}
.form-coop-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-color);
}
.form-coop-section .form-row {
  grid-template-columns: 1fr 1fr;
}
.form-coop-section .form-row-3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.form-coop-section .form-row-4 {
  grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* 图片预览弹窗 */
.modal-image-preview {
  max-width: 90vw;
  max-height: 90vh;
}
.modal-image-body {
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  background: #f5f5f5;
}
.modal-image-body {
  flex-direction: column;
  align-items: stretch;
}
.modal-image-body img {
  max-width: 100%;
  max-height: 60vh;
  object-fit: contain;
  align-self: center;
}
.preview-tags-section {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  margin-top: 8px;
}
.preview-tags-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.preview-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.preview-tags-edit {
  margin-top: 8px;
}
.preview-tags-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* 标签样式 */
.tag-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}
.detail-attachment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.detail-attachment-item .tag-badge {
  font-size: 11px;
}
.resource-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.resource-info .tag-badge {
  font-size: 11px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 每日录入 */
.daily-panel {
  padding: 12px 16px;
}

.daily-date {
  margin-bottom: 10px;
}

.daily-date input {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
}

.daily-list {
  max-height: 320px;
  overflow-y: auto;
}

.daily-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.daily-item:last-child {
  border-bottom: none;
}

.daily-item-name {
  flex: 1;
  min-width: 0;
}

.daily-item-input {
  width: 120px;
  padding: 8px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 14px;
  text-align: right;
}

/* 分页 */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-top: 1px solid var(--border-color);
}

.pagination button {
  padding: 5px 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-white);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.pagination button.active {
  background: var(--xhs-red);
  color: white;
  border-color: var(--xhs-red);
}

.pagination-info {
  margin-left: auto;
  font-size: 13px;
  color: var(--text-muted);
}

/* 看板 */
.dashboard-panel {
  padding: 12px 14px;
}

.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.dashboard-card {
  background: var(--bg-white);
  border-radius: 8px;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
}

.dashboard-card-value {
  font-size: 22px;
  font-weight: 600;
  color: var(--xhs-red);
}

.dashboard-card-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* 文件上传 */
.upload-area {
  border: 2px dashed var(--border-color);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-area:hover {
  border-color: var(--xhs-red);
  background: rgba(255, 36, 66, 0.04);
}

.upload-area input {
  display: none;
}

/* 加载 */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 导入预览 */
.import-preview-wrap {
  max-height: 400px;
  overflow: auto;
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.import-preview-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.import-preview-table th,
.import-preview-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.import-preview-table th {
  background: var(--bg-gray);
  position: sticky;
  top: 0;
  z-index: 1;
}

.import-preview-table td {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.import-preview-table tr.import-row-duplicate td {
  background: rgba(255, 36, 66, 0.08);
  color: #999;
}

.import-preview-table tr.import-row-duplicate-file td {
  background: rgba(255, 149, 0, 0.08);
}

/* 进度条 */
.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--xhs-red);
  border-radius: 4px;
  transition: width 0.2s;
}

.progress-bar-indeterminate {
  width: 30%;
  animation: progress-indeterminate 1.2s ease-in-out infinite;
}

@keyframes progress-indeterminate {
  0% { margin-left: 0; }
  50% { margin-left: 70%; }
  100% { margin-left: 0; }
}

/* 资源管理 */
.resources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.resource-card {
  position: relative;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}

.resource-card:hover {
  border-color: var(--xhs-red);
  box-shadow: 0 1px 8px rgba(255, 36, 66, 0.15);
}

.resource-card:hover .resource-delete {
  opacity: 1;
}

.resource-thumb {
  aspect-ratio: 1;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.resource-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.resource-thumb.thumb-err img {
  display: none;
}

.resource-video-thumb,
.resource-file-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: var(--text-muted);
}

.resource-info {
  padding: 10px 12px;
}

.resource-name {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

.resource-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s;
}

.resource-delete:hover {
  background: var(--xhs-red);
}

/* ========== 移动端适配 ========== */
/* 汉堡菜单按钮（默认隐藏，小屏显示） */
.app-header-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: 0 -8px 0 0;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-primary);
  font-size: 22px;
  border-radius: 8px;
  flex-shrink: 0;
}
.app-header-toggle:hover {
  background: var(--bg-gray);
}
.app-header-toggle:focus {
  outline: none;
}

/* 详情区「返回列表」按钮（默认隐藏，小屏显示） */
.detail-back-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-right: 8px;
  padding: 0;
  border: none;
  background: var(--bg-gray);
  border-radius: 8px;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  flex-shrink: 0;
}
.detail-back-btn:hover {
  background: var(--border-color);
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 180px;
    --detail-width: 340px;
  }
  /* 中屏也采用两行顶栏，确保搜索与新增达人按钮可见 */
  .app-header {
    flex-wrap: wrap;
    height: auto;
    min-height: var(--header-height);
  }
  .app-search {
    max-width: 400px;
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    margin-top: 6px;
  }
  .list-table .col-nickname { min-width: 120px; }
  .list-table .col-date { min-width: 100px; }
}

@media (max-width: 768px) {
  :root {
    --sidebar-width: 0;
    --detail-width: 100%;
  }

  body {
    overflow: auto;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-overflow-scrolling: touch;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }

  /* 顶部栏：紧凑布局，显示汉堡菜单；两行布局保证搜索框与新增达人按钮均可见 */
  .app-header {
    padding: 0 8px 8px;
    padding-left: max(8px, env(safe-area-inset-left));
    padding-right: max(8px, env(safe-area-inset-right));
    min-height: 42px;
    height: auto;
    flex-wrap: wrap;
    align-content: flex-start;
    overflow: visible;
  }
  .app-header-toggle {
    display: flex;
  }
  .app-logo {
    margin-right: 4px;
    flex-shrink: 0;
  }
  .app-logo-icon {
    width: 22px;
    height: 22px;
  }
  .app-logo-text {
    font-size: 14px;
  }
  /* 搜索框占第二行整行，保证移动端可见 */
  .app-search {
    order: 3;
    flex: 1 1 100%;
    width: 100%;
    max-width: none;
    margin: 6px 0 0 0;
    padding-left: 0;
    display: flex !important;
    visibility: visible !important;
    min-height: 36px;
  }
  .app-search input {
    height: 32px;
    font-size: 16px; /* 防止 iOS 缩放 */
    width: 100%;
    padding-left: 30px;
  }
  .app-search::before {
    left: 8px;
    font-size: 12px;
  }
  .app-actions {
    gap: 4px;
    flex-shrink: 0;
    display: flex !important;
    visibility: visible !important;
  }
  .app-actions .btn {
    padding: 5px 8px;
    font-size: 12px;
  }
  .app-actions .btn-import-desktop {
    display: none;
  }
  .import-mobile-wrap {
    position: relative;
    display: inline-block !important;
  }
  .import-mobile-wrap .btn-import-mobile {
    display: inline-flex !important;
    min-width: 4.5em;
  }
  .import-mobile-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 200;
    min-width: 140px;
    padding: 4px 0;
  }
  .import-mobile-dropdown.show {
    display: block;
  }
  .import-mobile-item {
    display: block;
    width: 100%;
    padding: 10px 14px;
    text-align: left;
    border: none;
    background: none;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-primary);
  }
  .import-mobile-item:hover {
    background: var(--bg-gray);
  }
  .import-mobile-item[style*="display: none"] {
    display: none !important;
  }
  .app-actions .btn-add-mobile {
    display: inline-flex !important;
    visibility: visible !important;
    min-width: 5.5em;
    white-space: nowrap;
  }

  /* 侧栏：抽屉形态 */
  .app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    z-index: 800;
    transform: translateX(-100%);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: none;
    padding-top: 50px;
  }
  .app-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 20px rgba(0,0,0,0.15);
  }
  .app-sidebar {
    padding-left: env(safe-area-inset-left);
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 799;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
  }
  .sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
  }
  .sidebar-item {
    padding: 8px 12px;
    min-height: 36px;
  }

  /* 主内容区：列表与详情二选一显示 */
  .app-main {
    flex-direction: column;
    overflow: visible;
  }
  .app-list {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  .app-list.mobile-hide {
    display: none !important;
  }
  .app-detail {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
    z-index: 100;
    transform: translateX(100%);
    transition: transform 0.25s ease;
    overflow: hidden;
    border-left: none;
  }
  .app-detail.mobile-show {
    transform: translateX(0);
  }
  .detail-content {
    max-height: none;
    height: 100%;
    padding: 10px 12px;
    padding-top: max(48px, calc(42px + env(safe-area-inset-top)));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .detail-back-btn {
    display: flex;
  }
  .detail-header {
    margin-bottom: 8px;
  }
  .detail-title {
    font-size: 15px;
  }
  .detail-section {
    margin-bottom: 10px;
  }
  .detail-chart {
    height: 140px;
    min-height: 140px;
  }
  .detail-chart canvas {
    height: 140px !important;
  }
  .detail-attachments img {
    width: 80px;
    height: 80px;
  }
  .detail-attachment-item .img-err-placeholder,
  .detail-attachments .img-err-placeholder {
    width: 80px;
    height: 80px;
  }
  .detail-section-title {
    font-size: 10px;
    margin-bottom: 4px;
  }
  .detail-section-history {
    padding-top: 8px;
  }
  .detail-section-cooperation {
    padding-top: 8px;
  }
  .detail-cooperation-list {
    max-height: 200px;
  }
  .detail-history-table-wrap {
    max-height: 140px;
  }
  .page-path-indicator.in-list,
  .page-path-indicator.in-dashboard,
  .page-path-indicator.in-daily,
  .page-path-indicator.in-settings,
  .page-path-indicator.in-resources,
  .page-path-indicator.in-settlements {
    right: 12px;
  }

  /* 列表工具栏：换行、缩小 */
  .list-toolbar {
    padding: 6px 10px;
    gap: 6px;
  }
  .list-toolbar select {
    padding: 6px 8px;
    font-size: 12px;
    min-height: 34px;
  }
  .list-toolbar .admin-only {
    flex: 1 1 auto;
  }
  .list-recommend-bar {
    padding: 4px 10px;
    gap: 6px;
  }
  .list-recommend-label {
    font-size: 11px;
  }

  /* 表格：横向滚动 + 固定首列（昵称） */
  .list-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .list-table {
    min-width: 720px;
  }
  .list-table th,
  .list-table td {
    padding: 6px 6px;
    font-size: 12px;
  }
  .list-table .col-check {
    position: sticky;
    left: 0;
    background: var(--bg-white);
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.06);
  }
  .list-table tbody tr .col-check {
    background: var(--bg-white);
  }
  .list-table tbody tr.selected .col-check {
    background: rgba(255, 36, 66, 0.08);
  }
  .list-table .col-nickname {
    position: sticky;
    left: 40px;
    background: var(--bg-white);
    z-index: 2;
    box-shadow: 2px 0 4px rgba(0,0,0,0.06);
    min-width: 100px;
  }
  .list-table th.col-nickname {
    background: var(--bg-gray);
  }
  .list-table tbody tr .col-nickname {
    background: var(--bg-white);
    font-weight: 500;
  }
  .list-table tbody tr.selected .col-nickname {
    background: rgba(255, 36, 66, 0.08);
  }
  .list-table tbody tr:hover .col-nickname {
    background: rgba(255, 36, 66, 0.04);
  }
  .list-table tbody tr.row-coop-passed .col-check {
    background: rgba(34, 197, 94, 0.1);
  }
  .list-table tbody tr.row-coop-passed .col-nickname {
    background: rgba(34, 197, 94, 0.1);
  }
  .list-table tbody tr.row-coop-passed:hover .col-check,
  .list-table tbody tr.row-coop-passed:hover .col-nickname {
    background: rgba(34, 197, 94, 0.16);
  }
  .list-table tbody tr.row-coop-passed.selected .col-check,
  .list-table tbody tr.row-coop-passed.selected .col-nickname {
    background: rgba(255, 36, 66, 0.12);
  }

  .pagination {
    padding: 6px 10px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .pagination-info {
    width: 100%;
    margin-left: 0;
    margin-top: 2px;
  }

  /* 弹窗：接近全屏 */
  .modal-overlay {
    padding: 12px;
    align-items: flex-end;
  }
  .modal {
    width: 100%;
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
    border-radius: 16px 16px 0 0;
  }
  .modal-influencer-form .modal--influencer {
    max-width: none;
    max-height: 90vh;
    max-height: 90dvh;
  }
  .modal-header {
    padding: 12px 14px;
  }
  .modal-title {
    font-size: 15px;
  }
  .modal-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -6px -6px 0 0;
  }
  .modal-body {
    padding: 12px 14px;
  }
  .modal-influencer-form .modal-body {
    padding: 12px 14px;
  }
  .modal-influencer-form .form-row .form-group {
    min-width: 100%;
  }
  .modal-influencer-form .form-row-4 .form-group {
    min-width: 100%;
  }
  .modal-footer {
    padding: 10px 14px;
  }
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 40px;
    padding: 10px 12px;
  }
  .btn {
    min-height: 40px;
    padding: 8px 14px;
  }
  .btn-sm {
    min-height: 32px;
  }
  .upload-area {
    padding: 16px 12px;
    min-height: 64px;
  }
  .daily-item-input {
    width: 90px;
  }
  .dashboard-cards {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .dashboard-card {
    padding: 12px;
  }
  .dashboard-card-value {
    font-size: 20px;
  }
  .resources-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .import-preview-wrap {
    max-height: 50vh;
  }

  .app-list > .settings-hub {
    padding: 10px 12px;
  }
  .settings-content .list-table,
  .user-management-panel table,
  .roles-panel .role-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .user-management-panel table,
  .roles-panel {
    width: 100%;
  }
  .dashboard-panel {
    padding: 10px 12px;
  }

  /* 所属用户多选：移动端每行一项或两列，文字可换行不截断 */
  .form-owner-checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    margin-top: 8px;
  }
  .form-owner-checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 10px 12px;
    background: var(--bg-gray);
    border-radius: 8px;
    border: 1px solid var(--border-color);
  }
  .form-owner-checkbox-item input {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
  }
  .form-owner-checkbox-label {
    min-width: 0;
    flex: 1;
    max-width: none;
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    font-size: 14px;
  }
}

/* 超小屏（仅保留核心操作） */
@media (max-width: 480px) {
  .app-logo-text {
    font-size: 14px;
  }
  .app-actions .btn-add-mobile {
    padding: 8px 10px;
    font-size: 12px;
  }
  .list-table {
    min-width: 640px;
  }
  .dashboard-cards {
    grid-template-columns: 1fr;
  }
  .resources-grid {
    grid-template-columns: 1fr;
  }
}
