/* ===== SMS_KEYWORDS_MOBILE_FIX_V1_START ===== */

@media (max-width: 760px) {
  html.sms-keywords-mobile-page,
  html.sms-keywords-mobile-page body {
    max-width: 100%;
    overflow-x: hidden;
  }

  html.sms-keywords-mobile-page .compact-keywords,
  html.sms-keywords-mobile-page .compact-keywords .manager-page,
  html.sms-keywords-mobile-page .compact-keywords .table-shell {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .manager-toolbar {
    display: grid !important;
    grid-template-columns:
      minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 10px !important;
    align-items: stretch !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .action-btn {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 8px !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .action-menu {
    top: 52px !important;
    left: 0 !important;
    width: min(180px, 100%) !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .table-shell {
    max-height: none !important;
    overflow: visible !important;
    border: 0 !important;
    background: transparent !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .table-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    height: auto !important;
    padding: 14px !important;
    gap: 12px !important;
    align-items: stretch !important;
    border: 1px solid #e0e8f5 !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .page-size,
  html.sms-keywords-mobile-page .compact-keywords .search-box,
  html.sms-keywords-mobile-page
  .compact-keywords .search-box input {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .page-size,
  html.sms-keywords-mobile-page
  .compact-keywords .search-box input {
    height: 44px !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .search-box {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 8px !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords table.manager-table {
    --sms-keywords-mobile-fix-v1: 1;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-top: 10px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    table-layout: auto !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords table.manager-table thead {
    display: none !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords table.manager-table tbody {
    display: block !important;
    width: 100% !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords table.manager-table tbody tr {
    display: block !important;
    width: 100% !important;
    margin: 0 0 10px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    background: #fff !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody td:not(.empty-cell) {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: 44px !important;
    height: auto !important;
    padding: 10px 12px !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    gap: 14px !important;
    border: 0 !important;
    border-bottom: 1px solid #edf2f7 !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    text-align: right !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody td:not(.empty-cell)::before {
    content: attr(data-sms-label);
    flex: 0 0 38%;
    color: #64748b;
    font-weight: 800;
    text-align: left;
    overflow-wrap: anywhere;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody td:not(.empty-cell):last-child {
    border-bottom: 0 !important;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(1)::before {
    content: '选择 / Select';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(2)::before {
    content: '标题 / Title';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(3)::before {
    content: '关键字 / Keyword';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(4)::before {
    content: '价格 / Price';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(5)::before {
    content: '状态 / Status';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody
  td:not([data-sms-label]):not(.empty-cell):nth-child(6)::before {
    content: '操作 / Action';
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody td.empty-cell {
    display: block !important;
    width: 100% !important;
    min-height: 82px !important;
    height: auto !important;
    padding: 28px 12px !important;
    border: 0 !important;
    text-align: center !important;
    white-space: normal !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table tbody td.empty-cell::before {
    content: none !important;
  }

  html.sms-keywords-mobile-page .compact-keywords
  table.manager-table input[type='checkbox'] {
    width: 20px !important;
    height: 20px !important;
    flex: 0 0 20px !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords .row-actions {
    flex-wrap: wrap !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords .row-actions button {
    width: auto !important;
    max-width: 100% !important;
    min-height: 38px !important;
    height: auto !important;
    padding: 8px 12px !important;
    white-space: normal !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords .table-footer {
    display: flex !important;
    width: 100% !important;
    height: auto !important;
    min-height: 64px !important;
    padding: 12px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: center !important;
    gap: 10px !important;
    color: #64748b !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page
  .compact-keywords .table-footer > span {
    overflow-wrap: anywhere !important;
    text-align: center !important;
  }

  html.sms-keywords-mobile-page .compact-keywords .pager {
    align-self: center !important;
  }

  html.sms-keywords-mobile-page .modal-mask {
    padding: 12px !important;
    align-items: flex-start !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .modal-card {
    width: 100% !important;
    max-width: 420px !important;
    min-width: 0 !important;
    max-height: calc(100vh - 24px) !important;
    margin: 0 auto !important;
    padding: 18px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .modal-card .input,
  html.sms-keywords-mobile-page .modal-card .select {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page .modal-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 10px !important;
  }

  html.sms-keywords-mobile-page .modal-actions button {
    width: 100% !important;
    min-height: 44px !important;
    height: auto !important;
    margin: 0 !important;
    box-sizing: border-box !important;
  }

  html.sms-keywords-mobile-page
  :is(
    #chat-widget,
    #customer-service,
    .chat-widget,
    .chat-float,
    .float-chat,
    .customer-service,
    [class*='chat-widget'],
    [class*='chat-float'],
    [class*='customer-service']
  ) {
    display: none !important;
  }
}

/* ===== SMS_KEYWORDS_MOBILE_FIX_V1_END ===== */
