/* ============================================================
   商业帝国 v0.0.1 · 基础样式 / 设计变量
   只放全局 reset、变量、通用组件；页面样式放到 pages.css / desktop.css / map.css
   ============================================================ */

:root {
  /* 品牌色：深夜蓝 + 香槟金 */
  --navy-950: #050a15;
  --navy-900: #081022;
  --navy-850: #0b1730;
  --navy-800: #0f1f3d;
  --navy-700: #16294d;
  --navy-600: #1e3763;
  --navy-500: #2a4a80;

  --gold-300: #f3dfa8;
  --gold-400: #e8c876;
  --gold-500: #d4af37;
  --gold-600: #b8952c;
  --gold-700: #8f6f1d;

  --text-0: #f7f9fc;
  --text-1: #d4ddeb;
  --text-2: #9fb0c9;
  --text-3: #6f81a0;

  --blue-500: #2b7fff;
  --blue-600: #1f66d6;
  --green-500: #22b573;
  --red-500: #e5534b;
  --amber-500: #f0a922;

  --line: rgba(255, 255, 255, 0.1);
  --line-strong: rgba(255, 255, 255, 0.18);

  --font-sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.28);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.42);
  --shadow-gold: 0 6px 22px rgba(212, 175, 55, 0.25);

  --ease-out: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--navy-900);
  color: var(--text-0);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

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

a:hover {
  color: var(--gold-300);
}

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

::selection {
  background: rgba(212, 175, 55, 0.35);
}

/* 滚动条 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-0);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s var(--ease-out), transform 0.12s var(--ease-out), box-shadow 0.18s var(--ease-out);
  user-select: none;
}

.btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

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

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

.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-600));
  color: #2a1f05;
  box-shadow: var(--shadow-gold);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-300), var(--gold-500));
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line-strong);
}

.btn-block {
  width: 100%;
}

/* ---------- 输入框 ---------- */
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 13px;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-0);
  font-size: 14px;
  outline: none;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.input::placeholder {
  color: var(--text-3);
}

.input:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

.input:focus {
  border-color: var(--gold-500);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.16);
}

.input.is-error {
  border-color: var(--red-500);
  box-shadow: 0 0 0 3px rgba(229, 83, 75, 0.14);
}

/* ---------- 卡片 ---------- */
.card {
  background: rgba(15, 31, 61, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(18px);
}

/* ---------- 轻提示 toast ---------- */
.toast-layer {
  position: fixed;
  left: 50%;
  top: 28px;
  transform: translateX(-50%);
  z-index: 100000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 220px;
  max-width: 420px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(8, 16, 34, 0.94);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-md);
  color: var(--text-0);
  font-size: 13.5px;
  text-align: center;
  animation: toast-in 0.22s var(--ease-out);
}

.toast.is-error {
  border-color: rgba(229, 83, 75, 0.55);
}

.toast.is-success {
  border-color: rgba(34, 181, 115, 0.55);
}

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

/* ---------- 遮罩 / 弹窗 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 90000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 7, 16, 0.72);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}

.modal {
  width: min(460px, calc(100vw - 48px));
  padding: 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(21, 38, 72, 0.98), rgba(11, 23, 48, 0.98));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.24s var(--ease-out);
}

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

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

.hidden {
  display: none !important;
}

/* ---------- 通用工具类 ---------- */
.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-center {
  justify-content: center;
}
.gap-8 {
  gap: 8px;
}
.gap-12 {
  gap: 12px;
}
.gap-16 {
  gap: 16px;
}
.grow {
  flex: 1;
}
.muted {
  color: var(--text-2);
}
.tiny {
  font-size: 12px;
}
.nowrap {
  white-space: nowrap;
}
.mono {
  font-family: var(--font-mono);
}
.center {
  text-align: center;
}
