:root,
[data-theme="light"] {
  --bg: #f4f6f9;
  --bg-elevated: #ffffff;
  --bg-soft: #e8eef5;
  --border: #d5dde8;
  --text: #1a2332;
  --text-muted: #66758a;
  --accent: #2f8f72;
  --accent-hover: #267a60;
  --accent-soft: rgba(47, 143, 114, 0.14);
  --danger: #d64545;
  --warning: #c4920f;
  --success: #2f8f72;
  --info: #3a7fc0;
  --radius: 10px;
  --font: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --shadow: 0 8px 28px rgba(26, 35, 50, 0.08);
  --row-hover: rgba(26, 35, 50, 0.03);
  --auth-glow-1: rgba(47, 143, 114, 0.14);
  --auth-glow-2: rgba(58, 127, 192, 0.10);
  --home-glow: rgba(47, 143, 114, 0.08);
  --input-bg: #ffffff;
  --badge-ok-bg: rgba(47, 143, 114, 0.12);
  --badge-ok-fg: #1f7a5c;
  --badge-warn-bg: rgba(196, 146, 15, 0.14);
  --badge-warn-fg: #9a7008;
  --badge-err-bg: rgba(214, 69, 69, 0.12);
  --badge-err-fg: #c03939;
  --badge-info-bg: rgba(58, 127, 192, 0.12);
  --badge-info-fg: #2f6fa8;
  --badge-muted-bg: #e8eef5;
  --badge-muted-fg: #66758a;
  --alert-err-bg: rgba(214, 69, 69, 0.08);
  --alert-err-border: rgba(214, 69, 69, 0.28);
  --alert-ok-bg: rgba(47, 143, 114, 0.08);
  --alert-ok-border: rgba(47, 143, 114, 0.28);
  --tooltip-bg: #1a2332;
  --tooltip-fg: #f4f6f9;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-elevated: #1a2332;
  --bg-soft: #243044;
  --border: #2d3a4f;
  --text: #e8eef6;
  --text-muted: #8b9bb4;
  --accent: #3d9a7a;
  --accent-hover: #48b08c;
  --accent-soft: rgba(61, 154, 122, 0.2);
  --danger: #d64545;
  --warning: #d4a017;
  --success: #3d9a7a;
  --info: #4a8fd4;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --row-hover: rgba(255, 255, 255, 0.02);
  --auth-glow-1: rgba(61, 154, 122, 0.18);
  --auth-glow-2: rgba(74, 143, 212, 0.12);
  --home-glow: rgba(61, 154, 122, 0.12);
  --input-bg: #243044;
  --badge-ok-bg: rgba(61, 154, 122, 0.2);
  --badge-ok-fg: #6ec9a8;
  --badge-warn-bg: rgba(212, 160, 23, 0.2);
  --badge-warn-fg: #e8c04a;
  --badge-err-bg: rgba(214, 69, 69, 0.2);
  --badge-err-fg: #f08080;
  --badge-info-bg: rgba(74, 143, 212, 0.2);
  --badge-info-fg: #7eb3e8;
  --badge-muted-bg: #243044;
  --badge-muted-fg: #8b9bb4;
  --alert-err-bg: rgba(214, 69, 69, 0.15);
  --alert-err-border: rgba(214, 69, 69, 0.35);
  --alert-ok-bg: rgba(61, 154, 122, 0.15);
  --alert-ok-border: rgba(61, 154, 122, 0.35);
  --tooltip-bg: #0b1220;
  --tooltip-fg: #e8eef6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
}

/* 后台：整页不滚动，仅右侧主区域滚动 */
body:has(.app-shell) {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
}

.auth-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at 20% 20%, var(--auth-glow-1), transparent 50%),
    radial-gradient(ellipse at 80% 80%, var(--auth-glow-2), transparent 45%),
    var(--bg);
  padding: 24px;
  position: relative;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 36px 32px;
  box-shadow: var(--shadow);
}

.auth-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: contain;
  box-shadow: 0 6px 18px rgba(47, 143, 114, 0.22);
}

.auth-card h1 {
  font-size: 1.35rem;
  margin-bottom: 8px;
  font-weight: 600;
  text-align: center;
}

.auth-card .subtitle {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  text-align: center;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.theme-toggle:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: scale(1.06);
}

.theme-toggle:active {
  background: var(--bg-soft);
  transform: scale(0.94);
  box-shadow: inset 0 1px 3px rgba(26, 35, 50, 0.12);
}

.theme-toggle .theme-icon {
  display: none;
  flex-shrink: 0;
}

/* 明亮：显示月亮；黑暗：显示太阳 */
[data-theme="light"] .theme-toggle .theme-icon-moon,
:root:not([data-theme="dark"]) .theme-toggle .theme-icon-moon {
  display: block;
}

[data-theme="dark"] .theme-toggle .theme-icon-sun {
  display: block;
}

.theme-toggle-auth {
  position: absolute;
  top: 20px;
  right: 20px;
}

.theme-toggle-block {
  width: 100%;
  border-radius: 8px;
  height: 36px;
}

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  width: 100%;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  overflow: hidden;
}

.sidebar {
  background: var(--bg-elevated);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  color: var(--text);
}

.brand:hover .brand-text {
  color: var(--accent);
}

.brand img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 9px;
  flex-shrink: 0;
}

.brand-text {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: background 0.15s, color 0.15s, transform 0.12s, box-shadow 0.15s;
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.nav-link:hover {
  background: var(--bg-soft);
  color: var(--text);
}

.nav-link:active {
  transform: scale(0.98);
  box-shadow: inset 0 1px 3px rgba(26, 35, 50, 0.08);
}

.nav-link.active {
  background: var(--bg-soft);
  color: var(--accent);
}

.nav-link.active .nav-icon {
  opacity: 1;
}

.nav-link.active:hover {
  background: var(--bg-soft);
  color: var(--accent);
  filter: brightness(0.97);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 8px 4px;
  border-top: 1px solid var(--border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px 12px;
  min-width: 0;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 650;
  letter-spacing: 0;
}

.sidebar-user-meta {
  min-width: 0;
  flex: 1;
}

.sidebar-user-name {
  display: inline;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: currentColor;
  max-width: 100%;
}

a.sidebar-user-name {
  cursor: pointer;
}

a.sidebar-user-name:hover,
a.sidebar-user-name.active {
  color: var(--accent);
}

.sidebar-user-role {
  margin-top: 2px;
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.2;
}

.sidebar-footer-tools {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.sidebar-tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-muted);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
  padding: 0;
  box-sizing: border-box;
}

.sidebar-tool svg {
  width: 17px;
  height: 17px;
  display: block;
  flex-shrink: 0;
}

.sidebar-tool:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-tool:active {
  transform: scale(0.96);
}

.sidebar-tool.active {
  background: var(--bg-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.sidebar-tool.theme-toggle {
  width: auto;
  border-radius: 9px;
}

.sidebar-tool.theme-toggle:hover {
  transform: none;
}

.sidebar-tool.theme-toggle:active {
  transform: scale(0.96);
  box-shadow: none;
}

.sidebar-tool-logout:hover {
  border-color: var(--badge-err-fg);
  color: var(--badge-err-fg);
  background: var(--alert-err-bg);
}

.btn-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.main {
  min-width: 0;
  width: 100%;
  padding: 28px 32px;
  height: 100%;
  max-height: 100%;
  overflow-x: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.page-header h1 {
  font-size: 1.5rem;
  font-weight: 600;
}

.page-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 4px;
}

.page-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.page-header-actions > .btn,
.page-header-actions > .filter-select {
  flex: 0 0 auto;
}

.notify-help {
  margin: 0 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
}

.notify-help-summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  user-select: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.notify-help-summary::-webkit-details-marker {
  display: none;
}

.notify-help-summary::before {
  content: '';
  width: 0;
  height: 0;
  border-left: 5px solid var(--text-muted);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform 0.15s ease;
  flex-shrink: 0;
}

.notify-help[open] > .notify-help-summary::before {
  transform: rotate(90deg);
}

.notify-help-summary:hover {
  background: var(--row-hover);
}

.notify-help-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.notify-help-lead {
  margin: 14px 0 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.notify-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 20px;
}

.notify-help-grid section h3 {
  font-size: 0.88rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.notify-help-grid section ul {
  margin: 0;
  padding-left: 1.15em;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.notify-help-grid section li + li {
  margin-top: 6px;
}

.notify-help-grid section strong {
  color: var(--text);
  font-weight: 600;
}

.notify-help-foot {
  margin: 14px 0 0;
}

@media (max-width: 900px) {
  .notify-help-grid {
    grid-template-columns: 1fr;
  }
}

.admin-site-search {
  flex: 1 1 180px;
  min-width: 140px;
  max-width: 280px;
}

.admin-site-search input {
  width: 100%;
  min-width: 0;
  background: var(--input-bg, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
}

.admin-site-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.filter-select {
  background: var(--input-bg, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.92rem;
  min-width: 110px;
}

.filter-select:focus {
  outline: none;
  border-color: var(--accent);
}

.cell-ellipsis {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notify-icons {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.notify-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  color: var(--text-muted);
}

.notify-icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.notify-icon-wecom {
  color: #07c160;
}

[data-theme="dark"] .notify-icon-wecom {
  color: #2ad67a;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form label,
.form-group label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.form input,
.form select,
.form textarea,
.form-group input,
.form-group select,
.form-group textarea,
.modal input,
.modal select,
.modal textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.modal input:focus,
.modal select:focus,
.modal textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 143, 114, 0.12);
}

.form input:disabled,
.form select:disabled,
.form textarea:disabled,
.modal input:disabled,
.modal select:disabled,
.modal textarea:disabled {
  background: var(--bg-soft);
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.75;
}

.checkbox-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  padding: 4px 0;
}

.checkbox-row label {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
}

.checkbox-row label.is-disabled,
.checkbox-row label.is-disabled input {
  cursor: not-allowed;
  opacity: 0.55;
  color: var(--text-muted);
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.home-checked-label {
  display: none;
}

.home-checked-row {
  display: contents;
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 0.9rem;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, transform 0.12s, box-shadow 0.15s, filter 0.15s;
  background: var(--bg-soft);
  color: var(--text);
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.btn:hover:not(:disabled):not(.is-loading) {
  filter: brightness(0.96);
  border-color: var(--border);
}

.btn:active:not(:disabled):not(.is-loading) {
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.9);
  box-shadow: inset 0 1px 3px rgba(26, 35, 50, 0.1);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.is-loading {
  position: relative;
  pointer-events: none;
  opacity: 0.85;
  cursor: wait;
}

.btn.is-loading .btn-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.7s linear infinite;
  vertical-align: -2px;
  margin-right: 6px;
  flex-shrink: 0;
}

@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.btn-primary:hover:not(:disabled):not(.is-loading),
a.btn-primary:hover:not(:disabled):not(.is-loading) {
  background: var(--accent-hover);
  border-color: transparent;
  color: #fff;
  filter: none;
}

.btn-primary:active:not(:disabled):not(.is-loading),
a.btn-primary:active:not(:disabled):not(.is-loading) {
  background: var(--accent-hover);
  color: #fff;
  filter: brightness(0.9);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.18);
}

.btn-danger {
  background: var(--badge-err-bg);
  border-color: rgba(214, 69, 69, 0.28);
  color: var(--badge-err-fg);
}

.btn-danger:hover:not(:disabled):not(.is-loading) {
  background: rgba(214, 69, 69, 0.2);
  border-color: var(--danger);
  color: var(--danger);
  filter: none;
}

.btn-danger:active:not(:disabled):not(.is-loading) {
  background: rgba(214, 69, 69, 0.28);
  filter: none;
  box-shadow: inset 0 1px 3px rgba(214, 69, 69, 0.2);
}

.btn-ghost {
  background: var(--bg-soft);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover:not(:disabled):not(.is-loading) {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  filter: none;
}

.btn-ghost:active:not(:disabled):not(.is-loading) {
  background: var(--accent-soft);
  filter: brightness(0.96);
  box-shadow: inset 0 1px 3px rgba(26, 35, 50, 0.1);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 14px 4px 4px;
  margin-top: 4px;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.account-apply-actions {
  margin-top: -4px;
  margin-bottom: 4px;
}

.account-site-count {
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.account-site-count:hover {
  color: var(--accent-hover);
}

.home-table-card .pagination {
  padding: 12px 4px 4px;
}

.pagination-info {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pagination-btns {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination-btn.is-disabled {
  opacity: 0.45;
  pointer-events: none;
  cursor: default;
}

.pagination-btn.is-current {
  pointer-events: none;
}

.pagination-ellipsis {
  color: var(--text-muted);
  padding: 0 2px;
  font-size: 0.85rem;
}

.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  min-width: 0;
  width: 100%;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

/* 后台宽表：不足时横向滚动，避免列被压成竖排文字 */
.main .table-wrap > table {
  min-width: 640px;
}

.main .table-wrap > table.sites-table {
  min-width: 1080px;
}

.main .table-wrap > table.notify-logs-table {
  min-width: 960px;
}

.main .table-wrap > table td {
  white-space: nowrap;
}

.main .table-wrap > table td.empty-state,
.main .table-wrap > table td.cell-wrap,
.main .table-wrap > table .history-detail {
  white-space: normal;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

th {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

tr:hover td {
  background: var(--row-hover);
}

.col-id {
  width: 52px;
  min-width: 52px;
  white-space: nowrap;
}

.url-cell {
  min-width: 220px;
  max-width: 360px;
  width: 28%;
}

.url-cell a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent);
  text-decoration: none;
}

.url-cell a:hover {
  text-decoration: underline;
  color: var(--accent-hover);
}

.col-home,
.col-notify {
  width: 72px;
  min-width: 72px;
  white-space: nowrap;
}

.col-check-data {
  min-width: 220px;
  max-width: 360px;
}

.col-check-data .form-hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.col-time,
.col-user {
  min-width: 118px;
  white-space: nowrap;
}

.col-actions {
  width: 1%;
  min-width: 196px;
  white-space: nowrap;
}

.col-actions .btn-group {
  flex-wrap: nowrap;
  gap: 6px;
}

.table-link {
  color: var(--accent);
  text-decoration: none;
  cursor: pointer;
  font-size: 0.88rem;
}

.table-link:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

.site-cell-main {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.site-paused-badge {
  align-self: flex-start;
}

tr.is-paused-row td {
  opacity: 0.78;
}

.history-detail {
  max-width: 280px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.history-uptime {
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  background: var(--bg-muted, rgba(0, 0, 0, 0.03));
}

.history-uptime-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.9rem;
}

.history-uptime-stats strong {
  font-weight: 600;
}

.history-incidents {
  margin-top: 10px;
}

.history-incidents-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.history-incidents ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 140px;
  overflow: auto;
}

.history-incidents li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.82rem;
  padding: 6px 8px;
  border-left: 3px solid var(--danger, #c0392b);
  background: rgba(192, 57, 43, 0.06);
}

.history-incident-range {
  color: var(--text-muted);
}

.history-incident-summary {
  word-break: break-word;
}

.notify-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  font-size: 0.7rem;
  line-height: 1;
  border: 1px solid var(--border);
  border-radius: 3px;
  color: var(--text-muted);
}

.site-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-icon {
  width: 22px;
  height: 22px;
  border-radius: 0;
  object-fit: cover;
  flex-shrink: 0;
  background: transparent;
  border: none;
}

.site-icon.is-default {
  object-fit: contain;
  padding: 0;
  background: transparent;
  border: none;
}

.site-icon-input-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-icon-input-row input {
  flex: 1;
  min-width: 0;
  height: 40px;
  box-sizing: border-box;
  padding-top: 0;
  padding-bottom: 0;
}

.site-icon-input-row .site-icon-preview {
  width: 38px;
  height: 38px;
  box-sizing: border-box;
  flex-shrink: 0;
}

.site-icon-preview-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: -4px;
}

.site-icon-preview {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
  background: var(--bg);
  flex-shrink: 0;
}

.site-icon-preview.hidden {
  display: none;
}

.site-icon-preview:not(.hidden) {
  display: block;
}

.site-icon-preview.is-default {
  object-fit: contain;
  background: transparent;
  border-color: transparent;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: default;
  white-space: nowrap;
}

.badge-float-tip {
  position: fixed;
  z-index: 10000;
  box-sizing: border-box;
  min-width: 80px;
  max-width: min(360px, 70vw);
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--tooltip-bg, #1f2937);
  color: var(--tooltip-fg, #f9fafb);
  font-size: 0.75rem;
  font-weight: 400;
  line-height: 1.45;
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}

.badge-group {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.badge-group + .form-hint {
  margin-top: 5px;
}

.badge-ok {
  background: var(--badge-ok-bg);
  color: var(--badge-ok-fg);
}

.badge-warn {
  background: var(--badge-warn-bg);
  color: var(--badge-warn-fg);
}

.badge-err {
  background: var(--badge-err-bg);
  color: var(--badge-err-fg);
}

.badge-info {
  background: var(--badge-info-bg);
  color: var(--badge-info-fg);
}

.badge-muted {
  background: var(--badge-muted-bg);
  color: var(--badge-muted-fg);
}

.alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alert-error {
  background: var(--alert-err-bg);
  border: 1px solid var(--alert-err-border);
  color: var(--badge-err-fg);
}

.alert-success {
  background: var(--alert-ok-bg);
  border: 1px solid var(--alert-ok-border);
  color: var(--badge-ok-fg);
}

.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  right: auto;
  z-index: 9999;
  width: max-content;
  min-width: 0;
  max-width: min(400px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  transform: translateX(-50%);
}

.toast-icon {
  flex-shrink: 0;
  display: block;
  width: 18px;
  height: 18px;
}

.toast-text {
  flex: 0 1 auto;
  line-height: 1.4;
  word-break: break-word;
  white-space: normal;
}

.toast.success {
  border-color: var(--alert-ok-border);
  color: var(--badge-ok-fg);
}

.toast.error {
  border-color: var(--alert-err-border);
  color: var(--badge-err-fg);
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-backdrop.is-closing {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal-backdrop.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.modal-backdrop.is-closing .modal {
  opacity: 0;
  transform: translateY(10px) scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
  .modal-backdrop,
  .modal-backdrop .modal {
    transition: none;
  }
}

.modal.modal-site {
  max-width: 560px;
}

.modal.modal-wide {
  max-width: 860px;
}

.site-form-tabs {
  margin-bottom: 16px;
  width: 100%;
}

.site-form-tabs .settings-tab {
  flex: 1;
  text-align: center;
  white-space: nowrap;
}

.site-form-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 120px;
}

#statusCheckFields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-message {
  margin: 0 0 1rem;
  color: var(--text-muted, #64748b);
  line-height: 1.5;
  font-size: 0.95rem;
}

.modal h2 {
  font-size: 1.15rem;
  margin-bottom: 18px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.hidden {
  display: none !important;
}

.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}

.settings-grid {
  display: grid;
  gap: 20px;
}

.settings-section h2 {
  font-size: 1.05rem;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  padding: 4px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.site-form-tabs.settings-tabs {
  width: 100%;
  flex-wrap: nowrap;
  box-sizing: border-box;
}

.settings-tab {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.92rem;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s, filter 0.15s, box-shadow 0.15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.settings-tab:hover {
  color: var(--text);
  background: var(--bg-soft);
}

.settings-tab:active {
  transform: scale(0.97);
  box-shadow: inset 0 1px 3px rgba(26, 35, 50, 0.1);
}

.settings-tab.active {
  background: var(--accent);
  color: #fff;
}

.settings-tab.active:hover {
  background: var(--accent-hover);
  color: #fff;
}

.settings-tab.active:active {
  background: var(--accent-hover);
  filter: brightness(0.9);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.16);
}

.settings-panels .settings-panel {
  max-width: 720px;
}

.settings-subhead {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 4px 0 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.settings-subhead:not(:first-child) {
  margin-top: 18px;
}

.logo-preview {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.home-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse at top, var(--home-glow), transparent 55%),
    var(--bg);
}

html:has(body.home-page) {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html:has(body.home-page) {
    scroll-behavior: auto;
  }
}

.site-copyright {
  padding: 16px 24px 24px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  white-space: pre-line;
}

.site-copyright a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-copyright a:hover {
  color: var(--accent);
}

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1;
  font-size: 1.2rem;
  font-weight: 600;
}

.home-brand span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-brand img {
  height: 36px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  border-radius: 9px;
  flex-shrink: 0;
}

.home-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 28px;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.home-main-list {
  align-items: stretch;
  justify-content: flex-start;
}

.home-pitch {
  position: relative;
  padding: clamp(28px, 5vw, 48px) clamp(18px, 4vw, 36px);
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(47, 143, 114, 0.18), transparent 55%),
    radial-gradient(90% 70% at 100% 20%, rgba(58, 127, 192, 0.12), transparent 50%),
    linear-gradient(165deg, var(--bg-elevated) 0%, var(--bg-soft) 100%);
  border: 1px solid var(--border);
  animation: home-pitch-in 0.7s ease-out both;
}

[data-theme="dark"] .home-pitch {
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(61, 154, 122, 0.22), transparent 55%),
    radial-gradient(90% 70% at 100% 20%, rgba(74, 143, 212, 0.14), transparent 50%),
    linear-gradient(165deg, var(--bg-elevated) 0%, #15202e 100%);
}

.home-pitch::after {
  content: "";
  position: absolute;
  inset: auto -10% -40% 40%;
  height: 70%;
  background:
    repeating-linear-gradient(
      -18deg,
      transparent,
      transparent 10px,
      rgba(47, 143, 114, 0.045) 10px,
      rgba(47, 143, 114, 0.045) 11px
    );
  pointer-events: none;
  animation: home-pitch-grid 18s linear infinite;
}

.home-pitch-inner {
  position: relative;
  z-index: 1;
  max-width: none;
  width: 100%;
}

.home-pitch-brand {
  font-family: "Outfit", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--accent);
  margin: 0 0 14px;
  animation: home-pitch-rise 0.65s ease-out 0.05s both;
}

.home-pitch-title {
  font-family: "Noto Serif SC", "Songti SC", "SimSun", serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 4.2vw, 2.45rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
  margin: 0 0 14px;
  color: var(--text);
  animation: home-pitch-rise 0.65s ease-out 0.12s both;
}

.home-pitch-lead {
  margin: 0 0 22px;
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--text-muted);
  max-width: 38em;
  animation: home-pitch-rise 0.65s ease-out 0.2s both;
}

.home-pitch-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  animation: home-pitch-rise 0.65s ease-out 0.28s both;
}

.home-pitch-btn {
  min-width: 148px;
  font-weight: 600;
  transition: transform 0.2s ease, background 0.2s ease;
}

.home-pitch-btn:hover {
  transform: translateY(-1px);
}

.home-pitch-btn-secondary {
  font-weight: 500;
}

.home-pitch-features {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  animation: home-pitch-rise 0.65s ease-out 0.36s both;
}

.home-pitch-features li {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.home-pitch-features strong {
  font-family: "Outfit", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.home-pitch-features span {
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-muted);
}

@keyframes home-pitch-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

@keyframes home-pitch-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes home-pitch-grid {
  from { transform: translateX(0); }
  to { transform: translateX(-28px); }
}

@media (prefers-reduced-motion: reduce) {
  .home-pitch,
  .home-pitch-brand,
  .home-pitch-title,
  .home-pitch-lead,
  .home-pitch-cta,
  .home-pitch-features,
  .home-pitch::after {
    animation: none !important;
  }
}

.home-content {
  width: 100%;
  max-width: none;
  margin: 0;
  scroll-margin-top: 72px;
}

.home-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.home-list-title {
  font-size: 1.5rem;
  font-weight: 600;
}

.home-search {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.home-search input {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text);
  min-width: 220px;
  font-family: inherit;
  font-size: 0.95rem;
}

.home-search input:focus {
  outline: none;
  border-color: var(--accent);
}

.home-table-card {
  padding: 8px 12px 12px;
}

.home-sites-table th.home-col-checked,
.home-sites-table td.home-col-checked {
  text-align: right;
  white-space: nowrap;
}

.home-domain {
  font-weight: 500;
  color: var(--text);
  word-break: break-word;
  overflow-wrap: anywhere;
}

.home-domain:hover {
  color: var(--accent);
}

/* 状态页表格：域名不被挤成竖排，其余列单行，不够宽时横向滚动 */
.status-sites-table {
  width: 100%;
  min-width: 920px;
  table-layout: auto;
}

.status-sites-table th,
.status-sites-table td {
  vertical-align: middle;
}

.status-sites-table .home-col-domain {
  min-width: 180px;
  width: 22%;
  white-space: nowrap;
}

.status-sites-table .home-col-domain .site-cell {
  flex-wrap: nowrap;
}

.status-sites-table .home-col-domain .home-domain {
  word-break: normal;
  overflow-wrap: normal;
  white-space: nowrap;
}

.status-sites-table .status-col-state,
.status-sites-table .status-col-uptime,
.status-sites-table .status-col-events {
  white-space: nowrap;
}

.status-state-row,
.status-uptime-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.status-state-row .badge-group {
  flex-wrap: nowrap;
}

.status-state-row .form-hint,
.status-uptime-row .form-hint {
  margin: 0;
  display: inline;
  white-space: nowrap;
}

.uptime-badge {
  font-weight: 600;
}

.incident-list {
  margin: 0;
  padding-left: 1.1em;
  font-size: 0.88rem;
  color: var(--text-muted);
  max-width: 360px;
}

.incident-list li {
  margin: 4px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-table-card .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.home-title-cell,
.site-title-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-hero {
  text-align: center;
  max-width: 560px;
}

.home-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 12px;
  font-weight: 650;
}

.home-hero p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.home-lock {
  max-width: 400px;
  width: 100%;
  align-self: center;
  scroll-margin-top: 72px;
}

.home-lock-title {
  font-size: 1.15rem;
  margin: 0 0 6px;
  font-weight: 650;
}

@media (max-width: 768px) {
  .home-pitch-features {
    grid-template-columns: 1fr;
  }

  .home-pitch-cta {
    flex-direction: column;
    align-items: stretch;
  }

  .home-pitch-btn,
  .home-pitch-btn-secondary {
    width: 100%;
    text-align: center;
  }
}

.code-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.code-row input {
  flex: 1;
  min-width: 0;
}

.code-row .btn {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 首页移动端：卡片式列表，避免宽表横滑 */
@media (max-width: 768px) {
  .home-header {
    padding: 12px 14px;
  }

  .home-brand {
    font-size: 1rem;
    gap: 8px;
  }

  .home-brand img {
    height: 28px;
    max-width: 96px;
  }

  .home-header-actions .btn {
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .home-main {
    padding: 16px 12px 28px;
  }

  .home-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 14px;
  }

  .home-list-title {
    font-size: 1.25rem;
  }

  .home-search {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .home-search input {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
  }

  .home-search .btn {
    flex: 1 1 calc(50% - 4px);
  }

  .home-table-card {
    padding: 10px;
    border-radius: 12px;
  }

  .home-table-card .table-wrap {
    overflow: visible;
  }

  .home-sites-table,
  .home-sites-table thead,
  .home-sites-table tbody,
  .home-sites-table tr,
  .home-sites-table th,
  .home-sites-table td {
    display: block;
    width: 100%;
  }

  .home-sites-table thead {
    display: none;
  }

  .home-sites-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .home-sites-table tr.home-site-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--bg);
  }

  .home-sites-table tr.home-site-row:hover td {
    background: transparent;
  }

  .home-sites-table tr.home-site-row td {
    border: none;
    padding: 0;
    width: auto;
    vertical-align: top;
  }

  .home-sites-table tr.home-site-row td.home-col-domain,
  .home-sites-table tr.home-site-row td.home-col-status {
    grid-column: 1 / -1;
  }

  .home-sites-table tr.home-site-row td.home-col-status,
  .home-sites-table tr.home-site-row td.home-col-checked {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    grid-column: 1 / -1;
  }

  .home-sites-table tr.home-site-row td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
  }

  .home-sites-table tr.home-site-row td.home-col-domain::before,
  .home-sites-table tr.home-site-row td.home-col-checked::before {
    display: none !important;
    content: none !important;
  }

  /* 上次检测时间：标签与时间强制同一行 */
  .home-sites-table tr.home-site-row td.home-col-checked {
    display: block;
    width: 100%;
  }

  .home-sites-table tr.home-site-row .home-checked-row {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }

  .home-sites-table tr.home-site-row .home-checked-label,
  .home-sites-table tr.home-site-row .home-checked-value {
    display: inline;
    flex: 0 1 auto;
    min-width: 0;
    margin: 0;
    font-size: 0.8rem;
    font-weight: 400;
    letter-spacing: normal;
    text-transform: none;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .home-sites-table tr.home-site-row .home-checked-value {
    flex: 0 1 auto;
    text-align: right;
    white-space: nowrap;
  }

  .home-sites-table tr.home-empty-row {
    display: block;
    border: none;
    padding: 28px 12px;
    background: transparent;
  }

  .home-sites-table tr.home-empty-row td {
    border: none;
    text-align: center;
    padding: 0;
  }

  .home-title-cell {
    max-width: none;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    word-break: break-word;
  }

  .home-table-card .pagination {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-top: 14px;
  }

  .home-table-card .pagination-info {
    text-align: center;
  }

  .home-table-card .pagination-btns {
    justify-content: center;
    flex-wrap: wrap;
  }

  .site-copyright {
    padding: 12px 14px 20px;
    font-size: 0.8rem;
  }

  .home-lock {
    max-width: none;
  }
}

/* 中等宽度起改为顶栏，给宽表腾出横向空间（侧栏约 240px 会挤压表格） */
@media (max-width: 1100px) {
  body:has(.app-shell) {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    height: auto;
    max-height: none;
    overflow: visible;
  }

  .brand {
    width: 100%;
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 8px;
  }

  .nav-link {
    flex: 0 0 auto;
    padding: 8px 12px;
    font-size: 0.88rem;
  }

  .sidebar-footer {
    width: 100%;
    margin-top: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
  }

  .sidebar-user {
    padding: 0;
    flex: 1;
    min-width: 0;
  }

  .sidebar-footer-tools {
    width: auto;
    flex: 0 0 auto;
    grid-template-columns: repeat(2, 36px);
  }

  .main {
    height: auto;
    max-height: none;
    overflow: visible;
    padding: 20px 16px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .theme-toggle-auth {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 14px 10px;
  }

  .card {
    padding: 12px;
  }

  .page-header h1 {
    font-size: 1.25rem;
  }

  .page-header-actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .admin-site-search {
    flex: 1 1 100%;
    max-width: none;
  }

  .page-header-actions > .btn,
  .page-header-actions > .filter-select {
    flex: 1 1 auto;
  }

  .col-actions .btn-group {
    flex-direction: column;
    align-items: stretch;
  }

  .col-actions {
    min-width: 88px;
  }

  .main .table-wrap > table.sites-table {
    min-width: 960px;
  }
}
