/* KT验证系统 设计系统 */
:root {
  --ink: #0b1424;
  --ink-2: #121e33;
  --ink-3: #1d2d47;
  --text: #172033;
  --muted: #667085;
  --muted-2: #8b95a7;
  --line: #e4e9f2;
  --line-strong: #d4dbe8;
  --canvas: #f5f7fb;
  --panel: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eef4ff;
  --cyan: #06b6d4;
  --cyan-soft: #ecfeff;
  --success: #0e9f6e;
  --success-soft: #e9fbf3;
  --warning: #d97706;
  --warning-soft: #fff7e8;
  --danger: #e02424;
  --danger-soft: #fff0f0;
  --violet: #7c3aed;
  --violet-soft: #f3edff;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 24px 70px rgba(9, 18, 38, 0.14);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 26px;
  --font: "Inter", "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
  --sidebar-width: 250px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--canvas);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

body.no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  color: var(--primary-dark);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

::selection {
  background: #c7ddff;
  color: #0b234d;
}

:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.3);
  outline-offset: 2px;
}

.container {
  width: min(1200px, calc(100% - 48px));
  margin: 0 auto;
}

.mono {
  font-family: var(--mono);
  letter-spacing: -0.01em;
}

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

.small {
  font-size: 13px;
}

.tiny {
  font-size: 12px;
}

.strong {
  font-weight: 700;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.copy-helper {
  position: fixed;
  left: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease,
    box-shadow 0.16s ease, color 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

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

.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.22);
}

.btn-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.btn-secondary {
  color: var(--ink);
  background: #fff;
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  color: var(--ink);
  border-color: #b8c4d8;
  background: #fbfcff;
}

.btn-soft {
  color: var(--primary-dark);
  background: var(--primary-soft);
  border-color: transparent;
}

.btn-soft:hover {
  color: var(--primary-dark);
  background: #e3edff;
}

.btn-danger {
  color: #fff;
  background: var(--danger);
}

.btn-danger:hover {
  color: #fff;
  background: #c81e1e;
}

.btn-danger-soft {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: transparent;
}

.btn-danger-soft:hover {
  color: #b91c1c;
  background: #ffe1e1;
}

.btn-ghost {
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(15, 23, 42, 0.05);
}

.btn-sm {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
}

.btn-lg {
  min-height: 50px;
  padding: 14px 24px;
  border-radius: 12px;
  font-size: 15px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 9px;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.btn.loading::after {
  content: "";
  width: 15px;
  height: 15px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* Forms */
.field {
  display: grid;
  gap: 7px;
}

.field + .field {
  margin-top: 16px;
}

.field label,
.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #344054;
  font-size: 13px;
  font-weight: 650;
}

.field-hint {
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.5;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.6;
}

.input::placeholder,
.textarea::placeholder {
  color: #a4adbd;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: #bcc7d9;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.select {
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}

.input-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.input-group .input {
  flex: 1;
  min-width: 0;
}

.input-wrap {
  position: relative;
}

.input-wrap .input {
  padding-right: 46px;
}

.input-action {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
}

.input-action:hover {
  color: var(--ink);
  background: #f0f3f8;
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 13px;
  line-height: 1.5;
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  accent-color: var(--primary);
}

/* Badges & dots */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.4;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge.no-dot::before {
  display: none;
}

.badge-success {
  color: #067a54;
  background: var(--success-soft);
}

.badge-warning {
  color: #a15c00;
  background: var(--warning-soft);
}

.badge-danger {
  color: #b91c1c;
  background: var(--danger-soft);
}

.badge-muted {
  color: #5f6b7e;
  background: #f0f3f8;
}

.badge-info {
  color: #1e50b5;
  background: var(--primary-soft);
}

.badge-violet {
  color: #6d28d9;
  background: var(--violet-soft);
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.pulse-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.pulse-dot::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid rgba(34, 197, 94, 0.55);
  animation: pulse-ring 2s ease-out infinite;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.card-head h3 {
  font-size: 16px;
}

.card-body {
  padding: 22px;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 13.5px;
}

.table th {
  padding: 11px 18px;
  color: var(--muted);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: 14px 18px;
  border-bottom: 1px solid #edf1f7;
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr {
  transition: background 0.12s ease;
}

.table tbody tr:hover {
  background: #fbfcff;
}

.table .td-actions {
  text-align: right;
  white-space: nowrap;
}

.cell-main {
  color: var(--ink);
  font-weight: 650;
}

.cell-sub {
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 12px;
}

.empty-state {
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 54px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state .empty-icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #97a3b7;
  background: #f1f4f9;
  border-radius: 15px;
}

.empty-state h3 {
  color: var(--ink);
  font-size: 15px;
}

.empty-state p {
  max-width: 360px;
  font-size: 13px;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 15, 30, 0.62);
  backdrop-filter: blur(5px);
  animation: fade-in 0.18s ease;
}

.modal {
  width: min(560px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.2s ease;
}

.modal-lg {
  width: min(820px, 100%);
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 0;
}

.modal-head h2 {
  font-size: 19px;
}

.modal-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #f4f6fa;
  border: 0;
  border-radius: 9px;
  flex: 0 0 auto;
}

.modal-close:hover {
  color: var(--ink);
  background: #e9edf4;
}

.modal-body {
  padding: 20px 24px 24px;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  background: #fbfcfe;
  border-top: 1px solid var(--line);
}

/* Toast */
.toast-stack {
  position: fixed;
  z-index: 120;
  right: 20px;
  bottom: 20px;
  display: grid;
  gap: 10px;
  width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  color: #fff;
  background: #111c30;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  box-shadow: 0 16px 40px rgba(5, 12, 26, 0.24);
  font-size: 13px;
  line-height: 1.5;
  animation: toast-in 0.22s ease;
  pointer-events: auto;
}

.toast.success {
  background: #075e45;
}

.toast.error {
  background: #8f1d1d;
}

.toast.warning {
  background: #7c4a03;
}

.toast .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.toast.leaving {
  animation: toast-out 0.2s ease forwards;
}

/* Misc */
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.skeleton {
  position: relative;
  overflow: hidden;
  background: #eef1f6;
  border-radius: 8px;
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
  animation: shimmer 1.35s infinite;
}

.kbd {
  display: inline-flex;
  padding: 2px 6px;
  color: #475467;
  background: #f8fafc;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-family: var(--mono);
  font-size: 11px;
}

.divider {
  height: 1px;
  background: var(--line);
  border: 0;
  margin: 0;
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 13px;
  line-height: 1.55;
}

.alert .icon {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.alert-warning {
  color: #7a4a00;
  background: #fff9ec;
  border-color: #f5d79a;
}

.alert-danger {
  color: #9f1c1c;
  background: #fff4f4;
  border-color: #f5c2c2;
}

.alert-info {
  color: #1d4d9c;
  background: #f3f8ff;
  border-color: #cfe0ff;
}

.alert-success {
  color: #05684a;
  background: #effcf6;
  border-color: #bcebd8;
}

/* Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: #cbd4e3 transparent;
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-thumb {
  background: #cbd4e3;
  border: 2px solid transparent;
  border-radius: 99px;
  background-clip: content-box;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

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

@keyframes pulse-ring {
  0% { transform: scale(0.8); opacity: 0.8; }
  80%, 100% { transform: scale(1.8); opacity: 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes toast-out {
  to { opacity: 0; transform: translateY(8px); }
}

@keyframes shimmer {
  100% { transform: translateX(100%); }
}

@media (max-width: 720px) {
  .container {
    width: min(100% - 32px, 1200px);
  }

  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal {
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
  }
}

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

/* KT验证系统 品牌头像（用户提供的 logo） */
.brand-mark {
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
