/* ========== CSS 变量（颜色系统） ========== */
:root {
  /* 背景色 */
  --bg-body: #f6f7f9;
  --bg-card: #ffffff;
  --bg-topbar: #111827;
  --bg-input: #ffffff;
  --bg-table-header: #eef2ff;
  --bg-hover: #f8fafc;

  /* 文字颜色 */
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-page-title: #1f2937;
  --text-table-header: #1e293b;
  --text-table-cell: #1f2937;
  --text-code: #1f2937;
  --text-muted: #6b7280;
  --text-footer: #6b7280;
  /* --text-banner-title: #000000; */
  --text-banner-title: #ffffff;  /* 改为白色 */
  --text-banner-sub: #ffffff;

  /* 边框颜色 */
  --border-light: #e5e7eb;
  --border-divider: #f1f5f9;
  --border-table: #e5e7eb;
  --border-input: #d1d5db;

  /* 横幅渐变 */
  --banner-from: #ff7e05;
  --banner-to: #1e40af;

  /* 阴影 */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f6f7f9;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: #111827;
  color: white;
  position: sticky;   /* 新增 */
  top: 0;             /* 新增 */
  z-index: 1000;      /* 新增 */
}

.brand,
.topnav a {
  color: white;
  font-weight: 700;
  text-decoration: none;
}

.topnav {
  margin-left: auto;
}

.tag {
  color: #cbd5e1;
  font-size: 14px;
}

.container {
  width: min(1180px, calc(100% - 24px));
  margin: 20px auto;
}

.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 18px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

h1,
h2 {
  margin-top: 0;
}

.muted {
  color: #6b7280;
}

.eyebrow {
  color: #2563eb;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.notice,
.success,
.error {
  padding: 10px 12px;
  border-radius: 8px;
}

.js-sms-flash {
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.js-sms-flash.is-hiding {
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
}

.notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.success {
  color: #065f46;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  margin-bottom: 12px;
}

.error {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
  margin-bottom: 12px;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb);
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid #e5e7eb;
  text-align: left;
  white-space: nowrap;
  vertical-align: middle;
}

th {
  color: #4b5563;
  font-weight: 600;
  background: #f9fafb;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #f3f4f6;
}

.state {
  display: inline-flex;
  align-items: center;
  min-width: 68px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
  background: #f3f4f6;
}

.state-on,
.state-closed {
  color: #065f46;
  background: #d1fae5;
}

.state-off,
.state-open {
  color: #92400e;
  background: #fef3c7;
}

.state-unknown {
  color: #374151;
  background: #e5e7eb;
}

.state-invalid {
  color: #991b1b;
  background: #fee2e2;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.status-grid > div {
  padding: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
}

.label {
  display: block;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 6px;
}

.command-form,
.stack-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

input {
  display: block;
  width: min(360px, 100%);
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 16px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.button-row.compact {
  gap: 6px;
}

button,
.button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  color: #111827;
  background: #e5e7eb;
}

button.primary {
  color: white;
  background: #2563eb;
}

button.danger {
  color: white;
  background: #dc2626;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

form + form {
  margin-top: 8px;
}

.auth-card {
  width: min(520px, 100%);
  margin: 48px auto;
}

.credential-box,
.request-status-box,
.public-state,
.empty-state {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  margin: 14px 0;
}

.credential-box small {
  color: #6b7280;
}

.public-card {
  width: min(680px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.public-state .state {
  width: fit-content;
  font-size: 20px;
  padding: 8px 14px;
}

.manage-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.request-list {
  display: grid;
  gap: 12px;
}

.request-card {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr) auto;
  gap: 16px;
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #f8fbff;
}

.request-action {
  margin: 8px 0;
  font-weight: 700;
}

.request-action-on {
  color: #065f46;
}

.request-action-off {
  color: #991b1b;
}

.request-runtime {
  display: grid;
  gap: 7px;
}

.control-hint {
  max-width: 260px;
  margin-top: 8px;
  white-space: normal;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-item {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  padding: 8px 0;
  border-bottom: 1px dashed #e5e7eb;
}

.footer {
  width: min(1180px, calc(100% - 24px));
  margin: 0 auto 20px;
  color: #6b7280;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .topbar,
  .manage-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .topnav {
    margin-left: 0;
  }

  .request-card {
    grid-template-columns: 1fr;
  }
}
textarea {
  width: 100%;
  min-height: 6rem;
  box-sizing: border-box;
  resize: vertical;
  padding: 0.75rem;
  font: inherit;
  line-height: 1.5;
}

.sms-recipient-cell {
  min-width: 220px;
  white-space: normal;
}

.sms-recipient-list {
  display: grid;
  gap: 5px;
  margin-bottom: 8px;
}

.sms-recipient-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  white-space: nowrap;
}

.sms-recipient-item form {
  display: inline;
  flex: 0 0 auto;
  margin: 0;
}

.sms-delete-link,
button.sms-delete-link {
  appearance: none;
  display: inline;
  width: auto;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #dc2626;
  background: transparent;
  font: inherit;
  font-weight: 400;
  line-height: inherit;
  text-decoration: underline;
  box-shadow: none;
}

.sms-delete-link:hover,
.sms-delete-link:focus-visible {
  color: #991b1b;
  text-decoration: underline;
}

.small-button {
  padding: 6px 10px;
  font-size: 13px;
}

.sms-dialog {
  width: min(440px, calc(100% - 32px));
  padding: 20px;
  border: 0;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(17, 24, 39, 0.25);
}

.sms-dialog::backdrop {
  background: rgba(17, 24, 39, 0.45);
}

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

.sms-dialog-header h3 {
  margin: 0;
}

.dialog-close {
  padding: 2px 8px;
  font-size: 24px;
  line-height: 1;
  background: transparent;
}

.sms-dialog-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

/* ========== 筛选按钮（白天模式） ========== */
.filter-btn {
  padding: 4px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-light, #e5e7eb);
  background: transparent;
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
  height: 32px;
  box-sizing: border-box;
}

/* ========== 管理员下拉菜单 ========== */
.admin-dropdown {
  position: relative;
  display: inline-block;
}

.admin-btn {
  background: transparent;
  color: #cbd5e1;
  border: none;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 14px;
  border-radius: 6px;
  transition: background 0.2s, color 0.2s;
}

.admin-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  min-width: 160px;
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid #e5e7eb;
  overflow: hidden;
  z-index: 1000;
  margin-top: 4px;
}

.dropdown-content a {
  display: block;
  padding: 10px 16px;
  text-decoration: none;
  color: #1f2937;
  font-size: 14px;
  transition: background 0.15s;
}

.dropdown-content a:hover {
  background: #f8fafc;
}

.dropdown-content hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 4px 8px;
}

.filter-btn:hover:not(.active) {
  background: var(--bg-hover, #f8fafc);
}

.filter-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}

/* ========== 主要按钮（用于 <a> 标签） ========== */
.btn-primary {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 6px;
  background: #2563eb;
  color: #ffffff !important;
  border: none;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 13px;
  line-height: 1.5;
}

.btn-primary:hover {
  background: #1d4ed8;
  color: #ffffff !important;
}

/* ========== 横幅渐变（白天模式） ========== */
/* .banner-gradient {
  background: linear-gradient(to right, #ff7e05, #1e40af) !important;
  border-color: none !important;
} */

/* ========== 横幅（纯蓝色） ========== */
.banner-gradient {
  background: #1e40af !important;
  border: none !important;
}

/* ========== 夜间模式变量 ========== */
html.dark-mode {
  /* 背景色 */
  --bg-body: #102343;
  --bg-card: #1a2d4a;
  --bg-topbar: #0a1a2e;
  --bg-input: #0a1a2e;
  --bg-table-header: #1a2d4a;
  --bg-hover: #1a2d4a;

  /* 文字颜色 */
  --text-primary: #c8dce8;
  --text-secondary: #8ab4d6;
  --text-page-title: #c8dce8;
  --text-table-header: #c8dce8;
  --text-table-cell: #c8dce8;
  --text-code: #8ab4d6;
  --text-muted: #7a9ab8;
  --text-footer: #5a7a9a;
  --text-banner-title: #f0d080;
  --text-banner-sub: #a8c8e8;

  /* 边框颜色 */
  --border-light: #2a3f5a;
  --border-divider: #2a3f5a;
  --border-table: #1a2d4a;
  --border-input: #2a3f5a;

  /* 横幅渐变 — 深色版本 */
  --banner-from: #8a4a0a;
  --banner-to: #1a3a7a;

  /* 阴影 */
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ========== 应用变量到现有元素（覆盖硬编码） ========== */
body {
  background: var(--bg-body);
  color: var(--text-primary);
}

.card {
  background: var(--bg-card);
  border-color: var(--border-light);
  box-shadow: var(--shadow-card);
}

.topbar {
  background: var(--bg-topbar);
}

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

.footer {
  color: var(--text-footer);
}

#slot-table thead th {
  background: var(--bg-table-header);
  color: var(--text-table-header);
  border-bottom: 2px solid var(--border-light);
}

/* ========== 夜间模式特殊元素覆盖（保持彩色） ========== */
html.dark-mode .state-unknown {
  background: #1a2d4a !important;
  color: #8ab4d6 !important;
}

html.dark-mode .state-on,
html.dark-mode .state-closed {
  background: #0d2818 !important;
  color: #3fb950 !important;
}

html.dark-mode .state-off,
html.dark-mode .state-open {
  background: #2d1b0a !important;
  color: #d29922 !important;
}

html.dark-mode .state-invalid {
  background: #2d0a0a !important;
  color: #f85149 !important;
}

html.dark-mode code {
  color: #e8f0f8 !important;
  background: #1a2d4a !important;
}

html.dark-mode .filter-btn {
  color: #8ab4d6 !important;
  border-color: #2a3f5a !important;
}

html.dark-mode .filter-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* ===== 夜间模式表格表头与悬停优化 ===== */
html.dark-mode #slot-table thead th {
  background: #2a3f5a !important;  /* 比卡片背景 #1a2d4a 亮一些，突出表头 */
}

/* 管理端表格表头夜间模式 */
html.dark-mode #manage-slot-table thead th {
  background: #2a3f5a !important;
  color: #c8dce8 !important;
  border-bottom: 2px solid #2a3f5a !important;  /* 表头下方边框改为灰色，去掉白色线 */
}

html.dark-mode #slot-table tbody tr:hover {
  background: #2a4a6a !important;  /* 悬停时更亮，产生明显反馈 */
}

html.dark-mode #searchInput {
  background: #0a1a2e !important;
  border-color: #2a3f5a !important;
  color: #c8dce8 !important;
}

html.dark-mode .pagination-btn {
  color: #8ab4d6 !important;
  border-color: #2a3f5a !important;
}

html.dark-mode .btn-primary {
  background: #1f6feb !important;
}

html.dark-mode .btn-primary:hover {
  background: #388bfd !important;
}

/* ===== 管理员下拉菜单 - 夜间模式 ===== */
html.dark-mode .dropdown-content {
  background: #1a2d4a !important;
  border-color: #2a3f5a !important;
}

html.dark-mode .dropdown-content a {
  color: #c8dce8 !important;
}

html.dark-mode .dropdown-content a:hover {
  background: #2a3f5a !important;
}

html.dark-mode .dropdown-content hr {
  border-top-color: #2a3f5a !important;
}

html.dark-mode .admin-btn {
  color: #8ab4d6;
}

html.dark-mode .admin-btn:hover {
  color: #c8dce8;
  background: rgba(255, 255, 255, 0.05);
}

/* ========== 横幅渐变深色适配 ========== */
/* html.dark-mode .banner-gradient {
  background: linear-gradient(to right, var(--banner-from), var(--banner-to)) !important;
  border: none !important;
} */
/* ========== 横幅深色适配 ========== */
html.dark-mode .banner-gradient {
  background: #1a3a7a !important;
  border: none !important;
}


html.dark-mode .banner-gradient span:first-child {
  color: var(--text-banner-title) !important;
}

html.dark-mode .banner-gradient span:last-child {
  color: var(--text-banner-sub) !important;
}

/* ===== 心跳时间着色 ===== */
.heartbeat-online {
  color: #22c55e !important;
  font-weight: 600;
}

.heartbeat-warning {
  color: #eab308 !important;
  font-weight: 600;
}

.heartbeat-offline {
  color: #ef4444 !important;
  font-weight: 600;
}

.heartbeat-unknown {
  color: #9ca3af !important;
}

/* ===== 表格行悬停效果 ===== */
#slot-table tbody tr:hover {
  background: #eef2ff !important;
}

/* ===== 手机端卡片视图 ===== */
.slot-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.slot-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card, 0 1px 2px rgba(0,0,0,0.04));
  /* transition: background 0.2s; */
  transition: none;
}

.slot-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-divider, #f1f5f9);
}

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

.slot-card-label {
  font-size: 12px;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
  flex-shrink: 0;
}

.slot-card-value {
  font-size: 14px;
  color: var(--text-primary, #1f2937);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
  max-width: 60%;
}

.slot-card-value code {
  font-size: 13px;
  background: var(--bg-hover, #f3f4f6);
  padding: 1px 8px;
  border-radius: 4px;
}

.slot-card .btn-primary {
  font-size: 14px;
  padding: 8px 16px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  display: block;
}

/* ===== 首页卡片夜间模式背景（同时变暗） ===== */
html.dark-mode .slot-card {
    background: #1a2d4a !important;
}

/* ===== 手机端响应式 ===== */
@media (max-width: 768px) {
  #slot-table {
    display: none;
  }
  .slot-card-list {
    display: flex !important;
  }
  .filter-tabs {
    flex-wrap: wrap !important;
  }
  .filter-buttons {
    flex-wrap: wrap !important;
  }
  .filter-buttons .filter-btn {
    font-size: 12px;
    padding: 4px 12px;
  }
  .filter-tabs > div:last-child {
    width: 100%;
    justify-content: flex-end;
  }
  #searchInput {
    width: 140px !important;
    font-size: 14px !important;
  }
  .pagination-divider {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .slot-card .state {
    font-size: 12px !important;
    min-width: 56px !important;
    padding: 2px 10px !important;
  }
  /* 心跳颜色在卡片中保持一致 */
  .slot-card .heartbeat-online { color: #22c55e !important; }
  .slot-card .heartbeat-warning { color: #eab308 !important; }
  .slot-card .heartbeat-offline { color: #ef4444 !important; }
  .slot-card .heartbeat-unknown { color: #9ca3af !important; }

    /* ===== 手机端标题横幅适配 ===== */
  .banner-gradient h2 {
    flex-wrap: wrap !important;
    gap: 4px !important;
  }
  .banner-gradient h2 span:first-child {
    font-size: 17px !important;
  }
  .banner-gradient h2 span:last-child {
    font-size: 11px !important;
  }

  /* ===== 卡片头部：坑位（蓝色）+ 编号（灰色） ===== */
  .slot-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-divider, #f1f5f9);
    margin-bottom: 6px;
  }

  .slot-card-header .slot-name {
    display: inline-block;
    background: #dbeafe;
    color: #1e40af;
    font-size: 15px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 6px;
  }

  .slot-card-header .slot-code {
    display: inline-block;
    background: #f3f4f6;
    color: #4b5563;
    font-size: 14px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 6px;
  }

  /* ===== 夜间模式适配 ===== */
  html.dark-mode .slot-card-header .slot-name {
    background: #1a3a7a;
    color: #93bbfc;
  }

  html.dark-mode .slot-card-header .slot-code {
    background: #2a3f5a;
    color: #94a3b8;
  }

  /* ===== 卡片样式优化 ===== */
  .slot-card {
    padding: 12px 14px;
    border-radius: 10px;
  }

  .slot-card-row {
    padding: 3px 0;
  }

  .slot-card-label {
    font-size: 14px;
    color: var(--text-muted, #6b7280);
  }

  .slot-card-value {
    font-size: 14px;
    color: var(--text-primary, #1f2937);
    max-width: 60%;
  }

  .slot-card-row.status-row .slot-card-value {
    font-size: 18px !important;
    font-weight: 700 !important;
  }

  .slot-card .btn-primary {
    font-size: 16px !important;
    padding: 12px 16px !important;
    border-radius: 10px !important;
    margin-top: 10px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 8px;
  }
  .card {
    padding: 12px;
  }
  .slot-card {
    padding: 12px;
  }
  #searchInput {
    width: 130px !important;
    font-size: 13px !important;
  }
  .filter-buttons .filter-btn {
    font-size: 11px;
    padding: 3px 10px;
  }
  .slot-card-value {
    font-size: 13px;
    max-width: 55%;
  }
}

/* ===== 管理后台表格行悬停效果 ===== */
#manage-slot-table tbody tr:hover td {
  background: #eef2ff !important;
}

/* ===== 夜间模式适配 ===== */
html.dark-mode #manage-slot-table tbody tr:hover td {
  background: #2a4a6a !important;
}

/* ===== 管理后台手机端卡片视图 ===== */
.manage-card-list {
  display: none;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.manage-card {
  background: var(--bg-card, #ffffff);
  border: 1px solid var(--border-light, #e5e7eb);
  border-radius: 10px;
  padding: 14px 16px;
  box-shadow: var(--shadow-card, 0 1px 2px rgba(0,0,0,0.04));
}

.manage-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-divider, #f1f5f9);
  margin-bottom: 8px;
}

.manage-card-slot {
  display: inline-block;
  background: #dbeafe;
  color: #1e40af;
  font-size: 15px;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 6px;
}

.manage-card-code {
  display: inline-block;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 6px;
}

.manage-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border-divider, #f1f5f9);
}
.manage-card-row:last-child {
  border-bottom: none;
}

.manage-card-label {
  font-size: 13px;
  color: var(--text-muted, #6b7280);
  font-weight: 500;
  flex-shrink: 0;
}

.manage-card-value {
  font-size: 14px;
  color: var(--text-primary, #1f2937);
  text-align: right;
  max-width: 60%;
  word-break: break-word;
}

.manage-card .btn-primary {
  font-size: 14px;
  padding: 8px 16px;
  width: 100%;
  text-align: center;
  box-sizing: border-box;
  display: block;
}

/* ===== 手机端响应式 ===== */
@media (max-width: 768px) {
  html.dark-mode .slot-card {
        background: #1a2d4a !important;
    }
  #manage-slot-table {
    display: none !important;
  }
  .manage-card-list {
    display: flex !important;
  }
}

/* ===== 夜间模式适配 ===== */
html.dark-mode .manage-card {
  background: #1a2d4a;
  border-color: #2a3f5a;
}

html.dark-mode .manage-card-header {
  border-bottom-color: #2a3f5a;
}

html.dark-mode .manage-card-row {
  border-bottom-color: #2a3f5a;
}

html.dark-mode .manage-card-code {
  background: #2a3f5a;
  color: #94a3b8;
}

html.dark-mode .manage-card-label {
  color: #7a9ab8;
}

html.dark-mode .manage-card-value {
  color: #c8dce8;
}

/* 管理端卡片头部夜间模式 */
html.dark-mode .manage-card-slot {
  background: #1a3a7a;
  color: #93bbfc;
}

html.dark-mode .manage-card-code {
  background: #2a3f5a;
  color: #94a3b8;
}

/* ===== 放大远程控制和短信通知中的按钮 ===== */
.manage-card .manage-card-value .primary,
.manage-card .manage-card-value .primary.small-button {
  padding: 4px 12px !important;
  font-size: 14px !important;
  border-radius: 6px !important;
  min-width: 50px;
}

/* ===== 管理后台卡片管理员操作按钮左对齐 ===== */
.manage-card-admin-buttons {
  justify-content: flex-start !important;
}

/* ===== 管理后台卡片管理员操作按钮样式 ===== */
.manage-card-admin-buttons .primary,
.manage-card-admin-buttons .danger {
  padding: 4px 14px !important;
  font-size: 14px !important;
  border-radius: 6px !important;
  min-width: 50px;
}

/* ===== 管理后台卡片管理员操作提示文字 ===== */
.manage-card-admin-reason {
  font-size: 10px !important;
  color: var(--text-muted, #6b7280) !important;
  text-align: left;
  margin-top: 4px;
  line-height: 1.4;
  width: 100%;
}

/* ===== 夜间模式适配 ===== */
html.dark-mode .manage-card-admin-reason {
  color: #7a9ab8 !important;
}

/* ===== 短信红点徽标 ===== */
.sms-badge {
  display: none !important;
  position: absolute;
  top: -6px;
  right: -6px;
  background: #ef4444;
  color: #ffffff;
  border-radius: 50%;
  font-size: 10px;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
}

.sms-badge.show {
  display: flex !important;
}

/* ===== 修复手机端添加按钮文字换行 ===== */
.js-manage-sms-btn {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    min-width: fit-content !important;
}

/* ===== 夜间模式表格分隔线统一灰色 ===== */
html.dark-mode th,
html.dark-mode td {
    border-bottom-color: #2a3f5a !important;   /* 表格行之间的水平线 */
}

html.dark-mode table,
html.dark-mode .table-wrap {
    border-color: #2a3f5a !important;          /* 表格外边框 */
}

/* 若表格内部还有额外的边框（如某些表头或单元格） */
html.dark-mode th,
html.dark-mode td {
    border-color: #2a3f5a !important;
}

html.dark-mode .sms-recipient-item span {
    color: #000000 !important;
}

html.dark-mode #sms-manage-title {
    color: #000000 !important;
}

/* ===== 管理弹窗中的删除按钮 ===== */
.sms-delete-btn {
    appearance: none;
    border: none;
    background: #bfdbfe;        /* 淡蓝色背景 */
    color: #1f2937;              /* 深色文字 */
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.sms-delete-btn:hover {
    background: #93c5fd;         /* 悬停时加深 */
}

/* 夜间模式下的删除按钮 */
html.dark-mode .sms-delete-btn {
    background: #1a3a7a;         /* 深蓝色背景 */
    color: #c8dce8;              /* 亮色文字 */
}

html.dark-mode .sms-delete-btn:hover {
    background: #2a4a7a;
}

/* ===== 修复手机端卡片“远程控制”行垂直居中 ===== */
.manage-card-row .manage-card-value {
    display: flex;
    align-items: center !important;
    flex-wrap: wrap;
    gap: 4px;
}

.manage-card-row .manage-card-value span,
.manage-card-row .manage-card-value form {
    display: inline-flex;
    align-items: center;
}