/* MirrorSMS 设计系统
   基调：黑白灰为主，一个绿色强调色；大字号、大留白、细线条，阴影只在浮层上用。 */

:root {
  --bg: #ffffff;
  --bg-soft: #fafafa;
  --surface: #ffffff;
  --surface-2: #f4f4f5;
  --surface-3: #ececee;
  --border: #e9e9ec;
  --border-strong: #d8d8dd;
  --text: #0a0a0b;
  --text-2: #3f3f46;
  --muted: #6b6b74;
  --faint: #a0a0a8;

  --primary: #0a0a0b;          /* 主按钮：黑底白字 */
  --on-primary: #ffffff;
  --accent: #0b9b74;           /* 唯一的强调色 */
  --accent-strong: #087a5c;
  --accent-soft: #e8f6f1;

  --ok: #12804f;      --ok-soft: #e9f7ef;
  --warn: #a15c07;    --warn-soft: #fdf4e3;
  --danger: #d0342c;  --danger-soft: #fdeeed;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 1px 2px rgba(10, 10, 11, .04);
  --shadow: 0 1px 2px rgba(10, 10, 11, .04), 0 8px 24px -8px rgba(10, 10, 11, .08);
  --shadow-lg: 0 2px 4px rgba(10, 10, 11, .04), 0 24px 64px -16px rgba(10, 10, 11, .18);

  --font: "PingFang SC", -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #09090b;
    --bg-soft: #0c0c0e;
    --surface: #111113;
    --surface-2: #18181b;
    --surface-3: #222226;
    --border: #232327;
    --border-strong: #303036;
    --text: #f5f5f6;
    --text-2: #d4d4d8;
    --muted: #a1a1aa;
    --faint: #6b6b74;
    --primary: #f5f5f6;
    --on-primary: #09090b;
    --accent: #3ddc9f;
    --accent-strong: #6ae8b8;
    --accent-soft: rgba(61, 220, 159, .1);
    --ok: #4ade80;      --ok-soft: rgba(74, 222, 128, .1);
    --warn: #fbbf24;    --warn-soft: rgba(251, 191, 36, .1);
    --danger: #f87171;  --danger-soft: rgba(248, 113, 113, .1);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -8px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 4px rgba(0, 0, 0, .4), 0 24px 64px -16px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img, svg { display: block; }
code, .mono { font-family: var(--mono); font-size: .9em; }
:not(pre) > code { background: var(--surface-2); border: 1px solid var(--border); padding: 1px 6px; border-radius: 6px; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
::selection { background: var(--accent-soft); color: var(--text); }

.container { max-width: 1160px; margin: 0 auto; padding: 0 24px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 550; font-size: 14px; letter-spacing: -.005em;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s, transform .1s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.98); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft), 0 0 0 1px var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { opacity: .88; background: var(--primary); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { background: var(--danger-soft); border-color: transparent; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.ghost.danger { color: var(--danger); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 48px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn.xl { height: 54px; padding: 0 28px; font-size: 16px; border-radius: 14px; }
.btn .arrow { transition: transform .2s var(--ease); }
.btn:hover .arrow { transform: translateX(3px); }

/* ---------- 表单 ---------- */
label.field { display: block; margin-bottom: 16px; }
label.field > span { display: block; font-size: 13px; font-weight: 550; margin-bottom: 7px; color: var(--text-2); }
label.field small { display: block; color: var(--faint); font-size: 12.5px; margin-top: 6px; line-height: 1.5; }
input[type=text], input[type=email], input[type=password], input[type=tel], textarea, select {
  width: 100%; height: 42px; padding: 0 13px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font: inherit; font-size: 15px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { height: auto; min-height: 80px; padding: 10px 13px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--text); box-shadow: 0 0 0 3px var(--surface-3); }
input:disabled { background: var(--surface-2); color: var(--muted); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--surface-3); border-radius: 99px; cursor: pointer; transition: background .2s var(--ease); }
.switch span::before { content: ""; position: absolute; width: 18px; height: 18px; left: 2px; top: 2px; background: #fff; border-radius: 50%; transition: transform .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::before { transform: translateX(16px); }

/* ---------- 标签、提示 ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 1px 9px; height: 22px; border-radius: 99px; font-size: 12px; font-weight: 550; background: var(--surface-2); color: var(--muted); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.fail { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.brand { background: var(--accent-soft); color: var(--accent-strong); }
.badge.plain::before { display: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.notice { padding: 12px 14px; border-radius: var(--radius); font-size: 14px; line-height: 1.6; background: var(--surface-2); color: var(--text-2); }
.notice b { font-weight: 600; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }
.notice.fail { background: var(--danger-soft); color: var(--danger); }
.notice.ok { background: var(--ok-soft); color: var(--ok); }
.notice.brand { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- 品牌 ---------- */
.logo { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--text); letter-spacing: -.02em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.logo small { font-weight: 500; color: var(--muted); font-size: 14px; letter-spacing: 0; }

/* ---------- 浮层 ---------- */
#toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%) translateY(16px); opacity: 0; pointer-events: none; z-index: 100;
  background: var(--primary); color: var(--on-primary); padding: 10px 18px; border-radius: 99px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: all .25s var(--ease); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); color: #fff; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(9, 9, 11, .45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px; z-index: 50; overflow-y: auto; animation: fade .2s var(--ease); }
.modal { width: 100%; max-width: 540px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-xl); box-shadow: var(--shadow-lg); animation: rise .25s var(--ease); }
.modal.wide { max-width: 720px; }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px 6px; }
.modal header h3 { font-size: 18px; }
.modal .body { padding: 14px 24px 22px; }
.modal footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.98); } }

.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row code { flex: 1; min-width: 0; padding: 9px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; overflow-x: auto; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }

.empty { text-align: center; padding: 64px 24px; color: var(--muted); }
.empty h3 { color: var(--text); font-size: 17px; margin-bottom: 6px; }
.empty .btn { margin-top: 20px; }

.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

@media (max-width: 520px) {
  .logo small { display: none; }
  .container { padding: 0 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
