/* O-Web 共享样式（A5）—— 三个页面共用的设计基线 */

:root {
  --bg: #111318;
  --bg-soft: #171a20;
  --bg-raised: #22262f;
  --line: #2b303b;
  --text: #e8eaf0;
  --text-dim: #9aa1af;
  --text-faint: #667081;
  --accent: #4f8cff;
  --accent-press: #3a6fd8;
  --danger: #e05d5d;
  --ok: #46b46f;
  --radius: 12px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

[hidden] { display: none !important; }

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

a { color: var(--accent); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* —— 按钮 —— */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--bg-raised);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background .15s, opacity .15s;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active:not(:disabled) { background: var(--accent-press); }

.btn-ghost { background: transparent; border-color: var(--line); color: var(--text-dim); }
.btn-ghost:active:not(:disabled) { background: var(--bg-raised); }

.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }

.btn-block { width: 100%; }

/* —— 输入框 —— */

.field {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font-size: 16px; /* ≥16px：避免 iOS 聚焦时自动放大页面 */
}
.field::placeholder { color: var(--text-faint); }
.field:focus { outline: none; border-color: var(--accent); }

/* —— toast（common.js 的 toast() 使用）—— */

#ow-toasts {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  pointer-events: none;
}

.ow-toast {
  max-width: 86%;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(32, 36, 44, .96);
  color: var(--text);
  font-size: 14px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s, transform .25s;
  word-break: break-word;
}
.ow-toast.show { opacity: 1; transform: none; }
