/* ============================================================
   卡序 KAXU · 基础样式
   ============================================================ */

:root {
  --bg: #06090d;
  --bg-soft: #090e14;
  --panel: #0d131b;
  --panel-2: #111924;
  --panel-3: #16202c;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f1f6f8;
  --text-soft: #c5d0d8;
  --muted: #8593a1;
  --muted-2: #647180;
  --mint: #6ff2bf;
  --mint-strong: #2ee6a1;
  --mint-dim: rgba(111, 242, 191, 0.12);
  --violet: #b49cff;
  --amber: #ffc56e;
  --blue: #79b8ff;
  --rose: #ff9db0;
  --cyan: #74e6f2;
  --danger: #ff7a85;
  --warning: #ffc56e;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-xl: 30px;
  --container: 1180px;
  --font-sans: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", "JetBrains Mono", "Roboto Mono", Consolas,
    monospace;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.no-scroll {
  overflow: hidden;
}

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

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

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

button {
  border: 0;
  background: none;
  cursor: pointer;
}

img,
svg {
  display: block;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

code {
  font-family: var(--font-mono);
}

::selection {
  background: rgba(111, 242, 191, 0.25);
  color: #fff;
}

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #25303b;
  border: 3px solid var(--bg);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #344251;
}

/* ============================== 布局 ============================== */

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

.container-wide {
  width: min(1420px, calc(100% - 48px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 104px 0;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 44px;
}

.section-head > div {
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 16px;
  color: var(--mint);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}

.section-title {
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 650;
  letter-spacing: -0.045em;
  line-height: 1.14;
}

.section-desc {
  margin-top: 14px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.8;
}

.grad-text {
  background: linear-gradient(96deg, #ffffff 8%, #9dfbdc 46%, #4fe6ae 88%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.mono {
  font-family: var(--font-mono);
}

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

/* ============================== 品牌 ============================== */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(150deg, #c8ffe9 0%, var(--mint) 44%, #1ecf91 100%);
  box-shadow: 0 8px 26px rgba(46, 230, 161, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: #04110c;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand-name strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.brand-name span {
  margin-top: 4px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.3em;
}

/* ============================== 按钮 ============================== */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s, box-shadow 0.2s,
    opacity 0.2s;
}

.btn:active {
  transform: translateY(1px) scale(0.995);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.btn svg {
  width: 17px;
  height: 17px;
}

.btn-primary {
  background: linear-gradient(180deg, #9affdb, var(--mint) 60%, #4ce5ac);
  color: #03140d;
  box-shadow: 0 10px 28px rgba(46, 230, 161, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.btn-primary:hover {
  box-shadow: 0 14px 36px rgba(46, 230, 161, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  transform: translateY(-1px);
}

.btn-ghost {
  border-color: var(--line-strong);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
}

.btn-ghost:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
}

.btn-dark {
  background: var(--panel-3);
  border-color: var(--line);
  color: var(--text);
}

.btn-dark:hover {
  background: #1c2937;
}

.btn-danger {
  background: rgba(255, 90, 101, 0.12);
  border-color: rgba(255, 90, 101, 0.25);
  color: #ff9ca4;
}

.btn-danger:hover {
  background: rgba(255, 90, 101, 0.18);
}

.btn-sm {
  height: 36px;
  padding: 0 14px;
  border-radius: 9px;
  font-size: 12.5px;
}

.btn-lg {
  height: 52px;
  padding: 0 28px;
  border-radius: 14px;
  font-size: 15px;
}

.btn-block {
  width: 100%;
}

.btn .spinner {
  width: 15px;
  height: 15px;
}

.text-link {
  color: var(--mint);
  font-weight: 550;
  transition: opacity 0.2s;
}

.text-link:hover {
  opacity: 0.75;
}

/* ============================== 表单 ============================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-soft);
  font-size: 12.5px;
  font-weight: 550;
}

.field-label small {
  color: var(--muted-2);
  font-size: 11px;
  font-weight: 400;
}

.input,
.select,
.textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.input,
.select {
  height: 44px;
  padding: 0 14px;
}

.textarea {
  min-height: 120px;
  padding: 12px 14px;
  line-height: 1.7;
  resize: vertical;
}

.input::placeholder,
.textarea::placeholder {
  color: var(--muted-2);
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: rgba(111, 242, 191, 0.45);
  background: rgba(111, 242, 191, 0.035);
  box-shadow: 0 0 0 3px rgba(111, 242, 191, 0.07);
}

.select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 52%, calc(100% - 12px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}

.select option {
  background: var(--panel-2);
  color: var(--text);
}

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text-soft);
  font-size: 13px;
  cursor: pointer;
}

.checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--mint-strong);
}

/* ============================== 通用组件 ============================== */

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.tag-mint {
  border-color: rgba(111, 242, 191, 0.25);
  background: var(--mint-dim);
  color: var(--mint);
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--mint);
  box-shadow: 0 0 0 4px rgba(111, 242, 191, 0.1);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  transition: 0.2s;
}

.icon-btn:hover {
  border-color: var(--line-strong);
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

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

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--mint);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner-dark {
  border-color: rgba(0, 0, 0, 0.18);
  border-top-color: #04110c;
}

/* 骨架屏 */
.skeleton {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.065), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.5s infinite;
}

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

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

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

/* ============================== 弹层 ============================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(2, 5, 8, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease both;
}

.modal-card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #121a23 0%, #0c1219 100%);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: pop-in 0.28s var(--ease) both;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.2);
  color: var(--muted);
  transition: 0.2s;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  transform: rotate(90deg);
}

.modal-close svg {
  width: 15px;
  height: 15px;
}

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

/* ============================== Toast ============================== */

#toast-root {
  position: fixed;
  top: 22px;
  left: 50%;
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(18, 26, 36, 0.96);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.45);
  color: var(--text-soft);
  font-size: 13px;
  backdrop-filter: blur(16px);
  animation: toast-in 0.3s var(--ease) both;
  pointer-events: auto;
}

.toast svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.toast-success svg {
  color: var(--mint);
}
.toast-error svg {
  color: var(--danger);
}
.toast-info svg {
  color: var(--blue);
}

.toast.is-out {
  animation: toast-out 0.25s ease forwards;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-12px) scale(0.97);
  }
}

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

/* ============================== 杂项 ============================== */

.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;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 64px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 38px;
  height: 38px;
  margin-bottom: 6px;
  opacity: 0.45;
}

.empty-state strong {
  color: var(--text-soft);
  font-size: 15px;
  font-weight: 600;
}

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

.error-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
  text-align: center;
}

.error-page > div {
  max-width: 420px;
}

.error-page h1 {
  margin: 8px 0 12px;
  font-size: 30px;
  letter-spacing: -0.03em;
}

.error-page p {
  margin-bottom: 26px;
  color: var(--muted);
}

.error-code {
  color: var(--mint);
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.3em;
}

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

  .section {
    padding: 72px 0;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 30px;
  }

  .modal-backdrop {
    padding: 12px;
    align-items: end;
  }

  .modal-card {
    max-height: calc(100vh - 24px);
    border-radius: 20px;
  }
}

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