﻿@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Noto+Sans+SC:wght@400;500;600;700&display=swap");

:root {
  --bg-top: #edf5ff;
  --bg-mid: #f8fbff;
  --bg-bottom: #ebfff8;
  --surface: rgba(255, 255, 255, 0.8);
  --surface-strong: rgba(255, 255, 255, 0.94);
  --surface-quiet: rgba(245, 251, 255, 0.88);
  --text: #1a2d41;
  --text-soft: #556a80;
  --line: rgba(79, 124, 170, 0.27);
  --line-strong: rgba(59, 111, 169, 0.4);
  --primary: #1967d2;
  --primary-strong: #0f4ea9;
  --accent: #0f9c8d;
  --danger: #cb3247;
  --warning: #c16f1e;
  --success: #0f8a66;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --shadow-soft: 0 16px 42px rgba(46, 84, 129, 0.13);
  --shadow-strong: 0 28px 74px rgba(46, 84, 129, 0.2);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "Noto Sans SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  position: relative;
  background:
    radial-gradient(circle at 14% 10%, rgba(118, 182, 255, 0.32) 0%, transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(92, 218, 200, 0.24) 0%, transparent 36%),
    radial-gradient(circle at 86% 90%, rgba(138, 192, 255, 0.24) 0%, transparent 34%),
    linear-gradient(138deg, var(--bg-top) 0%, var(--bg-mid) 48%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
}

body::before {
  inset: 0;
  opacity: 0.18;
  background: repeating-linear-gradient(
    128deg,
    rgba(255, 255, 255, 0.65) 0,
    rgba(255, 255, 255, 0.65) 1px,
    transparent 1px,
    transparent 17px
  );
}

body::after {
  width: 58vmin;
  height: 58vmin;
  right: -18vmin;
  bottom: -20vmin;
  border-radius: 57% 43% 60% 40% / 48% 36% 64% 52%;
  background: radial-gradient(circle at 50% 50%, rgba(102, 177, 255, 0.24), rgba(102, 177, 255, 0));
  filter: blur(7px);
}

a {
  color: inherit;
  text-decoration: none;
}

.layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 282px 1fr;
  gap: 14px;
  padding: 12px;
}

.sidebar {
  position: sticky;
  top: 12px;
  height: calc(100vh - 24px);
  overflow-y: auto;
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(170deg, var(--surface-strong), var(--surface));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-soft);
  padding: 16px 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(76, 128, 183, 0.3);
  background: linear-gradient(145deg, rgba(196, 225, 255, 0.62), rgba(219, 248, 244, 0.64));
}

.brand-badge {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(24, 94, 173, 0.3);
}

.brand-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.brand-text strong {
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #163a63;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  color: #50708f;
  font-size: 0.76rem;
  line-height: 1.3;
}

.nav-title {
  margin: 0 8px 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.74rem;
  letter-spacing: 0.19em;
  text-transform: uppercase;
  color: #5d7995;
}

.nav-link {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  color: #27496d;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.nav-link:hover {
  transform: translateX(1px);
  border-color: rgba(69, 125, 183, 0.32);
  background: rgba(232, 244, 255, 0.82);
}

.nav-link.active {
  border-color: rgba(28, 103, 200, 0.38);
  background: linear-gradient(120deg, rgba(197, 227, 255, 0.85), rgba(206, 246, 239, 0.82));
  color: #124c8f;
  box-shadow: 0 10px 22px rgba(64, 120, 181, 0.18);
}

.main {
  min-width: 0;
  padding: 0;
}

.main > section + section,
.security-page > section + section {
  margin-top: 14px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 90;
  margin-bottom: 14px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(9px);
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.title-group h1 {
  margin: 0;
  font-family: "Fraunces", "Noto Sans SC", serif;
  font-size: clamp(1.25rem, 2.2vw, 1.82rem);
  color: #16385c;
}

.title-group p {
  margin: 7px 0 0;
  color: var(--text-soft);
  font-size: 0.9rem;
}

.user-box {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.card {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(172deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(8px);
}

.section {
  padding: 16px;
}

.card h3 {
  margin: 0 0 12px;
  font-family: "Fraunces", "Noto Sans SC", serif;
  font-size: 1.04rem;
  color: #17395f;
}

.grid {
  display: grid;
  gap: 12px;
}

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

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

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

.kv {
  display: grid;
  gap: 6px;
}

.kv .k {
  color: var(--text-soft);
  font-size: 0.83rem;
}

.kv .v {
  font-size: clamp(1.14rem, 2.8vw, 1.48rem);
  font-family: "Space Grotesk", "Noto Sans SC", sans-serif;
  font-weight: 700;
  color: #18416e;
  letter-spacing: 0.01em;
  word-break: break-word;
}

.btn {
  appearance: none;
  border: 1px solid rgba(73, 124, 177, 0.34);
  background: linear-gradient(180deg, #ffffff, #eef6ff);
  color: #21486e;
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(34, 102, 178, 0.42);
  box-shadow: 0 10px 20px rgba(53, 98, 151, 0.16);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  border-color: rgba(19, 84, 160, 0.72);
  background: linear-gradient(132deg, var(--primary), var(--primary-strong));
  color: #f4f9ff;
}

.btn.primary:hover {
  filter: brightness(1.03);
}

.btn.success {
  border-color: rgba(18, 130, 97, 0.68);
  background: linear-gradient(132deg, var(--success), #0c7053);
  color: #f4fffb;
}

.btn.warning {
  border-color: rgba(170, 101, 34, 0.66);
  background: linear-gradient(132deg, var(--warning), #9e5713);
  color: #fff9f3;
}

.btn.danger {
  border-color: rgba(170, 45, 68, 0.7);
  background: linear-gradient(132deg, var(--danger), #aa263b);
  color: #fff5f6;
}

.btn.small {
  min-height: 30px;
  padding: 6px 11px;
  font-size: 0.82rem;
}

.input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(89, 131, 175, 0.34);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: var(--text);
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.input:hover,
select:hover,
textarea:hover {
  border-color: rgba(37, 104, 181, 0.52);
}

.input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(25, 103, 210, 0.15);
  background: #fff;
}

label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #2d4f72;
}

.table-wrap {
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}

th,
td {
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(88, 131, 176, 0.2);
  font-size: 0.88rem;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #32577f;
  font-weight: 700;
  background: linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(239, 247, 255, 0.97));
}

tr:last-child td {
  border-bottom: none;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1.2;
}

.status.success {
  color: #0f6d52;
  background: rgba(15, 138, 102, 0.15);
}

.status.warning {
  color: #8d4f12;
  background: rgba(193, 111, 30, 0.16);
}

.status.danger {
  color: #8c2333;
  background: rgba(203, 50, 71, 0.16);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(49, 114, 188, 0.31);
  background: linear-gradient(130deg, rgba(225, 241, 255, 0.92), rgba(225, 253, 247, 0.9));
  color: #1f568e;
  padding: 5px 11px;
  font-size: 0.79rem;
  font-weight: 600;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.section-title {
  margin: 0 0 10px;
}

.u-mt-12 {
  margin-top: 12px;
}

.u-mb-10 {
  margin-bottom: 10px;
}

.u-mt-6 {
  margin-top: 6px;
}

.u-maxw-130 {
  max-width: 130px;
}

.u-maxw-180 {
  max-width: 180px;
}

.u-grid-full {
  grid-column: 1 / -1;
}

.u-flex-1 {
  flex: 1;
}

.u-w-180 {
  width: 180px;
}

.is-hidden {
  display: none;
}

.col-w-48 { width: 48px; }
.col-w-72 { width: 72px; }
.col-w-80 { width: 80px; }
.col-w-86 { width: 86px; }
.col-w-92 { width: 92px; }
.col-w-100 { width: 100px; }
.col-w-110 { width: 110px; }
.col-w-120 { width: 120px; }
.col-w-130 { width: 130px; }
.col-w-140 { width: 140px; }
.col-w-160 { width: 160px; }
.col-w-170 { width: 170px; }
.col-w-180 { width: 180px; }
.col-w-220 { width: 220px; }
.col-w-280 { width: 280px; }

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

.template-vars,
.schedule-helper {
  border: 1px dashed rgba(80, 129, 177, 0.42);
  border-radius: var(--radius-md);
  background: rgba(244, 251, 255, 0.88);
  padding: 11px;
  display: grid;
  gap: 10px;
}

.template-vars-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.template-var-warning {
  border: 1px solid rgba(203, 50, 71, 0.36);
  border-radius: var(--radius-xs);
  background: rgba(255, 236, 239, 0.92);
  color: #9c2335;
  padding: 8px 10px;
  font-size: 0.84rem;
}

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

.template-var-chip {
  border: 1px solid rgba(80, 128, 175, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  text-align: left;
  cursor: pointer;
  padding: 8px 10px;
  display: grid;
  gap: 4px;
  color: var(--text);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.template-var-chip:hover {
  border-color: rgba(26, 104, 187, 0.42);
  background: #fff;
  box-shadow: 0 10px 18px rgba(55, 98, 149, 0.12);
}

.template-var-chip code {
  font-weight: 700;
  color: #1a5f9f;
}

.template-var-label {
  font-size: 0.86rem;
  color: #2b4d74;
}

.template-var-example {
  font-size: 0.8rem;
  color: var(--text-soft);
}

.notification-layout {
  align-items: start;
}

.notification-template-card {
  grid-column: 1 / -1;
}

.notification-preview-html {
  border: 1px solid rgba(83, 129, 175, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.96);
  padding: 10px;
  max-height: 320px;
  overflow: auto;
  line-height: 1.5;
}

.notification-preview-html table {
  min-width: 0;
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
}

.notification-preview-html th,
.notification-preview-html td {
  position: static;
  border: 1px solid rgba(83, 129, 175, 0.26);
  padding: 6px 8px;
  font-size: 0.87rem;
  background: #fff;
}

.channel-panel.hidden {
  display: none;
}

.monitor-table {
  min-width: 1180px;
  table-layout: fixed;
}

.monitor-url-cell {
  min-width: 0;
}

.monitor-url-text {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.interval-row {
  flex-wrap: nowrap;
}

.monitor-mobile-section {
  display: none;
}

.monitor-mobile-list {
  display: grid;
  gap: 11px;
}

.monitor-mobile-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(86, 130, 174, 0.34);
  background: rgba(255, 255, 255, 0.92);
}

.monitor-mobile-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.monitor-mobile-name {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  max-width: calc(100% - 86px);
}

.monitor-mobile-name strong {
  word-break: break-word;
}

.monitor-mobile-grid {
  display: grid;
  gap: 8px;
}

.monitor-mobile-item {
  display: grid;
  gap: 2px;
}

.monitor-mobile-k {
  color: var(--text-soft);
  font-size: 0.81rem;
}

.monitor-mobile-v {
  font-size: 0.9rem;
}

.monitor-mobile-url {
  word-break: break-all;
}

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

.monitor-mobile-actions .btn {
  width: 100%;
}

.schedule-preview {
  border: 1px solid rgba(82, 129, 175, 0.32);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.95);
  padding: 9px 10px;
  line-height: 1.6;
  word-break: break-word;
}

.schedule-preview ol {
  margin: 7px 0 0 18px;
  padding: 0;
}

.log-detail-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 10px;
}

.log-detail-textarea {
  width: 100%;
  resize: vertical;
  white-space: pre;
  line-height: 1.45;
  font-family: "Consolas", "Courier New", monospace;
}

.modal {
  width: min(920px, 94vw);
  max-height: 90vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 0;
  background: linear-gradient(170deg, var(--surface-strong), var(--surface));
  box-shadow: var(--shadow-strong);
}

.modal::backdrop {
  background: rgba(34, 63, 95, 0.34);
  backdrop-filter: blur(4px);
}

.modal-header,
.modal-footer {
  padding: 14px 16px;
}

.modal-header {
  border-bottom: 1px solid var(--line);
}

.modal-footer {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.modal-body {
  padding: 16px;
  max-height: calc(90vh - 122px);
  overflow: auto;
}

.account-modal {
  width: min(580px, 94vw);
}

.account-helper {
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.account-footer {
  justify-content: space-between;
}

.global-loading {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(227, 241, 255, 0.62);
  display: none;
  align-items: center;
  justify-content: center;
}

.global-loading.show {
  display: flex;
}

.global-loading-inner {
  min-width: 240px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: linear-gradient(165deg, #ffffff, #edf6ff);
  box-shadow: var(--shadow-soft);
  padding: 13px 16px;
  color: #2a5a8b;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.loading-spinner {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 2px solid rgba(89, 131, 175, 0.4);
  border-top-color: var(--primary);
  animation: spin 0.74s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.toast-stack {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 999;
  display: grid;
  gap: 9px;
}

.toast {
  min-width: 250px;
  max-width: 380px;
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 124, 170, 0.3);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
  padding: 10px 12px;
  font-size: 0.88rem;
}

.toast.success {
  border-left-color: var(--success);
}

.toast.warning {
  border-left-color: var(--warning);
}

.toast.danger {
  border-left-color: var(--danger);
}

.mobile-nav-toggle {
  display: none;
}

.security-page > * {
  min-width: 0;
}

.security-page .card,
.security-page .section,
.security-page .table-wrap {
  min-width: 0;
  max-width: 100%;
}

.security-table {
  table-layout: fixed;
}

.security-table th,
.security-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.security-cell {
  display: block;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.security-cell.clamp-2,
.security-cell.clamp-3 {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
}

.security-cell.clamp-2 {
  -webkit-line-clamp: 2;
}

.security-cell.clamp-3 {
  -webkit-line-clamp: 3;
}

.security-filter-row .input {
  flex: 1 1 260px;
  min-width: 0;
}

.security-filter-row select {
  flex: 0 0 auto;
}

.security-pagination {
  margin-top: 10px;
  justify-content: flex-end;
  align-items: center;
  gap: 8px;
}

.security-pagination .btn[disabled] {
  opacity: 0.54;
  cursor: not-allowed;
}

.settings-item {
  padding: 12px;
}

.settings-item-desc {
  margin-top: 6px;
}

.settings-group-title {
  margin: 0 0 8px;
}

.settings-group-desc {
  margin: 0 0 10px;
}

.portal-page {
  min-height: 100vh;
  margin: 0;
  padding: 18px;
  color: var(--text);
}

.portal-shell {
  min-height: calc(100vh - 36px);
  display: grid;
  align-items: center;
  justify-items: center;
  position: relative;
  z-index: 1;
}

.portal-hero {
  width: min(900px, 100%);
  padding: clamp(26px, 4vw, 44px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--surface-strong), var(--surface));
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-strong);
  animation: section-in 0.68s ease both;
  text-align: center;
}

.portal-kicker {
  margin: 0 0 10px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.21em;
  color: #4a7aac;
}

.portal-hero h1 {
  margin: 0;
  font-family: "Fraunces", "Noto Sans SC", serif;
  font-size: clamp(1.9rem, 4.5vw, 3.1rem);
  line-height: 1.2;
  color: #17395f;
}

.portal-desc {
  margin: 14px auto 0;
  max-width: 620px;
  color: var(--text-soft);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.7;
}

.portal-actions {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.portal-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  text-align: center;
}

.beian-footer {
  position: fixed;
  left: 50%;
  bottom: 14px;
  transform: translateX(-50%);
  z-index: 50;
}

.beian-footer a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(77, 126, 174, 0.32);
  background: rgba(255, 255, 255, 0.9);
  color: #356796;
  font-size: 0.8rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(59, 104, 155, 0.16);
}

.beian-footer a:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 112, 182, 0.42);
  box-shadow: 0 14px 24px rgba(59, 104, 155, 0.18);
}

.main > section,
.security-page > section {
  animation: section-in 0.5s ease both;
}

.main > section:nth-of-type(1),
.security-page > section:nth-of-type(1) {
  animation-delay: 0.04s;
}

.main > section:nth-of-type(2),
.security-page > section:nth-of-type(2) {
  animation-delay: 0.08s;
}

.main > section:nth-of-type(3),
.security-page > section:nth-of-type(3) {
  animation-delay: 0.12s;
}

.main > section:nth-of-type(4),
.security-page > section:nth-of-type(4) {
  animation-delay: 0.16s;
}

@keyframes section-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1200px) {
  .layout {
    grid-template-columns: 252px 1fr;
    gap: 12px;
    padding: 10px;
  }

  .sidebar {
    border-radius: 26px;
  }

  .section {
    padding: 14px;
  }

  .topbar {
    padding: 13px 14px;
  }
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
  }

  .sidebar {
    position: fixed;
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(304px, calc(100vw - 20px));
    height: auto;
    margin: 0;
    z-index: 1001;
    transform: translateX(-118%);
    transition: transform 0.26s ease;
  }

  .sidebar.show {
    transform: translateX(0);
  }

  .main {
    padding: 0;
  }

  .mobile-nav-toggle {
    display: inline-flex;
  }

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

  .security-table {
    min-width: 0;
  }
}

@media (max-width: 820px) {
  .monitor-table-section {
    display: none;
  }

  .monitor-mobile-section {
    display: block;
  }

  .template-var-chip {
    padding: 8px;
  }
}

@media (max-width: 640px) {
  .grid-4,
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-box {
    width: 100%;
    justify-content: flex-start;
  }

  .title-group h1 {
    font-size: 1.2rem;
  }

  .portal-page {
    padding: 12px;
  }

  .portal-shell {
    min-height: calc(100vh - 24px);
    align-items: start;
    padding-top: 18vh;
  }

  .portal-hero {
    border-radius: 24px;
    padding: 20px;
  }

  .portal-kicker {
    letter-spacing: 0.14em;
  }

  .toast-stack {
    left: 10px;
    right: 10px;
    top: 10px;
  }

  .toast {
    max-width: 100%;
    min-width: 0;
  }

  .interval-row {
    flex-wrap: wrap;
  }

  .monitor-mobile-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .account-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .account-footer .row {
    width: 100%;
  }

  .account-footer .row .btn,
  .account-footer .btn.danger {
    width: 100%;
  }

  .log-detail-grid {
    grid-template-columns: 1fr;
  }

  .security-page .section {
    padding: 12px;
  }

  .security-filter-row .input,
  .security-filter-row .btn,
  .security-filter-row select {
    width: 100%;
    max-width: 100% !important;
    flex: 1 1 100%;
  }

  .security-pagination {
    justify-content: flex-start;
  }

  .security-table {
    min-width: 0;
    width: 100%;
  }

  .security-table th,
  .security-table td {
    width: auto !important;
    max-width: 0;
    padding: 8px;
    font-size: 0.83rem;
  }

  .beian-footer {
    bottom: 10px;
    width: calc(100% - 20px);
    display: flex;
    justify-content: center;
  }

  .beian-footer a {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
