/* ============================================================
   fursona.io · 基础样式
   
   主题
   ----
   两套主题通过 <html data-theme="light|dark"> 切换。
   默认由 JS 根据 prefers-color-scheme 决定，用户手动切换后写 localStorage。
   
   配色
   ----
   深色：#0d1117 底（与 pay.descend.dev 衔接）
   浅色：#ffffff 底
   两者都用琥珀色作为强调色，最醒目也最容易建立"付费"语义。
   ============================================================ */

:root {
  /* ---- 尺寸 ---- */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 999px;

  --header-h: 60px;
  --drawer-w: 400px;

  /* ---- 过渡 ---- */
  --t-fast: 120ms;
  --t-med: 200ms;
  --t-slow: 320ms;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* ---- 字体 ---- */
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* ---- 语义色（两主题共有）---- */
  --accent: #f59e0b;
  --accent-hover: #d97706;
  --accent-soft: rgba(245, 158, 11, 0.12);

  --ok: #22c55e;
  --ok-soft: rgba(34, 197, 94, 0.12);

  --warn: #eab308;
  --warn-soft: rgba(234, 179, 8, 0.12);

  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
}

/* ---- 深色主题 ---- */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d1117;
  --bg-elevated: #161b22;
  --bg-inset: #010409;
  --bg-hover: #1c2129;

  --fg: #e6edf3;
  --fg-muted: #8b949e;
  --fg-dim: #6e7681;

  --border: #21262d;
  --border-strong: #30363d;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.7);
  --scrim: rgba(0, 0, 0, 0.65);
}

/* ---- 浅色主题 ---- */
:root[data-theme="light"] {
  color-scheme: light;

  --bg: #ffffff;
  --bg-elevated: #fafafa;
  --bg-inset: #f4f4f5;
  --bg-hover: #f4f4f5;

  --fg: #18181b;
  --fg-muted: #71717a;
  --fg-dim: #a1a1aa;

  --border: #e4e4e7;
  --border-strong: #d4d4d8;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.14);
  --scrim: rgba(0, 0, 0, 0.35);
}

/* ============================================================
   重置与基础
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.65 var(--font);
  transition: background-color var(--t-med) var(--ease),
              color var(--t-med) var(--ease);
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 0;
  background: none;
}

input {
  font: inherit;
  color: inherit;
}

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

/* 焦点可见性：键盘用户需要，鼠标用户不受打扰 */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

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

/* ---- 按钮 ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--fg);
  font-size: 14px;
  font-weight: 550;
  white-space: nowrap;
  transition: background var(--t-fast) var(--ease),
              border-color var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}

.btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a1206;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
}

.btn-ghost:hover:not(:disabled) {
  background: var(--bg-hover);
}

.btn-block {
  width: 100%;
}

/* ---- 输入框 ---- */
.input {
  width: 100%;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-inset);
  color: var(--fg);
  font-size: 15px;
  transition: border-color var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.input::placeholder {
  color: var(--fg-dim);
}

.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---- 徽章 ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 550;
  line-height: 1.6;
}

.badge-ok      { background: var(--ok-soft);     color: var(--ok); }
.badge-warn    { background: var(--warn-soft);   color: var(--warn); }
.badge-danger  { background: var(--danger-soft); color: var(--danger); }
.badge-muted   { background: var(--bg-inset);    color: var(--fg-muted); }

/* ---- 等宽文本（域名、金额、地址都用这个）---- */
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.2px;
}

/* ---- 通用容器 ---- */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---- 无障碍：仅屏幕阅读器可见 ---- */
.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;
}

/* ---- 减少动效偏好 ---- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
