:root {
  color-scheme: dark;
  --bg: #09090a;
  --bg-soft: #0f0f11;
  --panel: #141416;
  --panel-2: #1b1b1e;
  --panel-3: #232327;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f1e8;
  --text-soft: #d8d3c8;
  --muted: #9b9891;
  --muted-2: #6f6d68;
  --amber: #ffb23e;
  --amber-2: #ff8a3d;
  --amber-soft: rgba(255, 178, 62, 0.12);
  --mint: #9be8c6;
  --red: #ff5d5d;
  --green: #6ee7a8;
  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius: 18px;
  --radius-lg: 26px;
  --radius-xl: 34px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif,
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", Georgia, serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  overflow-x: clip;
}

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

body.modal-open {
  overflow: hidden;
}

::selection {
  background: var(--amber);
  color: #17120a;
}

img,
svg {
  display: block;
  max-width: 100%;
}

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

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

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

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

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

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

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 8px 22px rgba(255, 138, 61, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  gap: 3px;
}

.brand-name {
  font-size: 16px;
  font-weight: 760;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.brand-en {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--muted-2);
  text-transform: uppercase;
}

.btn {
  --btn-bg: transparent;
  --btn-fg: var(--text);
  --btn-line: var(--line-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14px;
  font-weight: 650;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease,
    box-shadow 0.18s ease, opacity 0.18s ease;
  user-select: none;
}

.btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 255, 255, 0.26);
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  --btn-bg: var(--amber);
  --btn-fg: #191208;
  --btn-line: var(--amber);
  box-shadow: 0 8px 30px rgba(255, 178, 62, 0.22);
}

.btn-primary:hover {
  --btn-bg: #ffc05c;
  --btn-line: #ffc05c;
  box-shadow: 0 12px 38px rgba(255, 178, 62, 0.3);
}

.btn-ghost {
  --btn-bg: rgba(255, 255, 255, 0.035);
  --btn-line: var(--line);
}

.btn-ghost:hover {
  --btn-bg: rgba(255, 255, 255, 0.07);
}

.btn-dark {
  --btn-bg: #111113;
  --btn-line: rgba(255, 255, 255, 0.12);
}

.btn-danger {
  --btn-bg: rgba(255, 93, 93, 0.08);
  --btn-fg: #ff9a9a;
  --btn-line: rgba(255, 93, 93, 0.3);
}

.btn-sm {
  min-height: 34px;
  padding: 0 13px;
  font-size: 12.5px;
}

.btn-lg {
  min-height: 52px;
  padding: 0 24px;
  font-size: 15.5px;
}

.btn-icon {
  width: 42px;
  min-width: 42px;
  padding: 0;
  border-radius: 50%;
}

.btn-block {
  width: 100%;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px var(--amber-soft);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--text-soft);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.chip.amber {
  border-color: rgba(255, 178, 62, 0.25);
  background: var(--amber-soft);
  color: var(--amber);
}

.chip.mint {
  border-color: rgba(155, 232, 198, 0.22);
  background: rgba(155, 232, 198, 0.08);
  color: var(--mint);
}

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

.field label,
.label {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

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

.textarea {
  padding: 14px;
  resize: vertical;
  line-height: 1.75;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: rgba(255, 178, 62, 0.55);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: 0 0 0 4px rgba(255, 178, 62, 0.08);
}

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

.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% - 18px) calc(50% + 1px), calc(100% - 13px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}

.range {
  width: 100%;
  height: 24px;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.range::-webkit-slider-runnable-track {
  height: 4px;
  border-radius: 99px;
  background: linear-gradient(
    to right,
    var(--amber) 0%,
    var(--amber) var(--fill, 50%),
    rgba(255, 255, 255, 0.11) var(--fill, 50%),
    rgba(255, 255, 255, 0.11) 100%
  );
}

.range::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff5e4;
  border: 2px solid var(--amber);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45);
}

.range::-moz-range-track {
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.11);
}

.range::-moz-range-progress {
  height: 4px;
  border-radius: 99px;
  background: var(--amber);
}

.range::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff5e4;
  border: 2px solid var(--amber);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch::after {
  content: "";
  position: absolute;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c9c6be;
  transition: transform 0.2s ease, background 0.2s ease;
}

.switch[aria-checked="true"] {
  background: var(--amber);
  border-color: var(--amber);
}

.switch[aria-checked="true"]::after {
  transform: translateX(18px);
  background: #1a1308;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: fade-in 0.2s ease both;
}

.modal-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #1b1b1e, #121214);
  box-shadow: var(--shadow);
  animation: modal-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.modal-dialog.wide {
  width: min(860px, 100%);
}

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

.modal-head h2,
.modal-head h3 {
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.02em;
}

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

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

.modal-foot {
  display: flex;
  gap: 10px;
  padding: 0 24px 24px;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  transition: background 0.18s ease, color 0.18s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
}

.toast-stack {
  position: fixed;
  left: 50%;
  bottom: calc(24px + var(--safe-bottom));
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
  width: min(92vw, 440px);
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  padding: 11px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: rgba(28, 28, 31, 0.94);
  color: var(--text);
  font-size: 13px;
  font-weight: 550;
  box-shadow: 0 14px 50px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(14px);
  animation: toast-in 0.22s ease both;
}

.toast.success {
  border-color: rgba(110, 231, 168, 0.3);
}
.toast.error {
  border-color: rgba(255, 93, 93, 0.35);
}
.toast .icon {
  width: 17px;
  height: 17px;
}
.toast.success .icon {
  color: var(--green);
}
.toast.error .icon {
  color: var(--red);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--amber);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex: 0 0 auto;
}

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

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

.muted {
  color: var(--muted);
}
.amber {
  color: var(--amber);
}
.mint {
  color: var(--mint);
}
.nowrap {
  white-space: nowrap;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 24px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--amber-2));
  color: #1a1308;
  font-size: 13px;
  font-weight: 800;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 640px) {
  .modal {
    padding: 0;
    align-items: end;
  }
  .modal-dialog,
  .modal-dialog.wide {
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    border-bottom: 0;
    animation: sheet-in 0.26s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  }
  .modal-head {
    padding: 20px 20px 0;
  }
  .modal-body {
    padding: 18px 20px;
  }
  .modal-foot {
    padding: 0 20px calc(20px + var(--safe-bottom));
  }
  .toast-stack {
    bottom: calc(92px + var(--safe-bottom));
  }
  @keyframes sheet-in {
    from {
      opacity: 0;
      transform: translateY(24px);
    }
  }
}

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