/* ==========================================================================
   槿海云 · iOS 页面层（Python 渲染页：卡密兑换 / Token 计算器 / 登录 / 手机号 / 卡密管理）
   与控制台主题共用同一套 iOS 视觉语言，但不依赖控制台的 token。
   ========================================================================== */

:root {
  --ios-bg: #f2f2f7;
  --ios-card: #ffffff;
  --ios-label: #1c1c1e;
  --ios-secondary: #8e8e93;
  --ios-blue: #007aff;
  --ios-green: #34c759;
  --ios-orange: #ff9f0a;
  --ios-red: #ff3b30;
  --ios-hairline: rgba(60, 60, 67, 0.14);
  --ios-fill: rgba(118, 118, 128, 0.12);
  --ios-fill-strong: rgba(118, 118, 128, 0.18);
  --ios-shadow: 0 0.5px 1px rgba(16, 24, 40, 0.04), 0 10px 30px -16px rgba(16, 24, 40, 0.24);
  --ios-shadow-raised: 0 1px 2px rgba(16, 24, 40, 0.06), 0 20px 48px -20px rgba(16, 24, 40, 0.30);
}

html {
  color-scheme: light;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif !important;
  color: var(--ios-label) !important;
  background: var(--ios-bg) !important;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.006em;
}

h1,
h2 {
  letter-spacing: -0.022em !important;
  line-height: 1.18;
}

h3,
h4 {
  letter-spacing: -0.014em;
  line-height: 1.3;
}

/* ---------- 卡片 ---------- */
.card,
.panel,
.bal-card {
  background: var(--ios-card) !important;
  border: 1px solid var(--ios-hairline) !important;
  border-radius: 20px !important;
  box-shadow: var(--ios-shadow) !important;
}

.panel,
.bal-card {
  border-radius: 18px !important;
}

.card {
  padding: 30px 28px 26px;
}

/* 主视觉区：去掉蓝紫渐变，回到 iOS 白卡 + 极淡蓝染 */
.hero {
  background: var(--ios-card) !important;
  border: 1px solid var(--ios-hairline) !important;
  border-radius: 20px !important;
  box-shadow: var(--ios-shadow) !important;
  padding: 30px !important;
}

.hero h1 {
  font-size: 34px !important;
  letter-spacing: -0.024em !important;
  font-weight: 700 !important;
  margin: 6px 0 8px !important;
}

.hero p {
  color: var(--ios-secondary) !important;
  font-size: 14px !important;
  line-height: 1.7 !important;
}

.eyebrow {
  color: var(--ios-blue) !important;
  letter-spacing: 0.16em !important;
  font-size: 11px !important;
}

/* 胶囊：iOS 描边 pill */
.chips span,
.tag,
.badge {
  background: var(--ios-card) !important;
  border: 1px solid var(--ios-hairline) !important;
  color: var(--ios-blue) !important;
  border-radius: 999px !important;
  padding: 4px 11px !important;
  font-weight: 500 !important;
  font-size: 12px !important;
}

.badge.on {
  background: rgba(52, 199, 89, 0.12) !important;
  border-color: rgba(52, 199, 89, 0.25) !important;
  color: #248a3d !important;
}

.badge.off {
  background: rgba(255, 159, 10, 0.14) !important;
  border-color: rgba(255, 159, 10, 0.28) !important;
  color: #b25f00 !important;
}

/* ---------- 按钮 ---------- */
.btn {
  background: var(--ios-blue) !important;
  border-radius: 12px !important;
  height: 46px !important;
  font-weight: 600 !important;
  letter-spacing: -0.005em;
  box-shadow: 0 1px 2px rgba(0, 122, 255, 0.28), 0 10px 24px -14px rgba(0, 122, 255, 0.6) !important;
  transition: transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1),
    filter 160ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.btn:hover:not(:disabled) {
  filter: brightness(1.04);
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
}

.btn:disabled {
  opacity: 0.5 !important;
}

.code-btn {
  background: var(--ios-fill) !important;
  border: 0 !important;
  border-radius: 10px !important;
  color: var(--ios-blue) !important;
  font-weight: 600 !important;
  min-height: 44px;
  transition: background-color 160ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 140ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.code-btn:active:not(:disabled) {
  transform: scale(0.97);
  background: var(--ios-fill-strong) !important;
}

/* ---------- 分段控件 ---------- */
.tabs {
  background: var(--ios-fill) !important;
  border-radius: 11px !important;
  padding: 3px !important;
  gap: 3px !important;
}

.tabs button {
  border-radius: 9px !important;
  color: var(--ios-secondary) !important;
  font-weight: 500 !important;
  transition: background-color 200ms cubic-bezier(0.2, 0.8, 0.2, 1),
    color 200ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

.tabs button.on {
  background: var(--ios-card) !important;
  color: var(--ios-label) !important;
  font-weight: 600 !important;
  box-shadow: 0 0.5px 1px rgba(16, 24, 40, 0.1), 0 3px 10px -6px rgba(16, 24, 40, 0.24) !important;
}

/* ---------- 表单 ---------- */
input,
textarea,
select {
  background: var(--ios-fill) !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  height: 44px;
  font-family: inherit !important;
  color: var(--ios-label) !important;
  transition: background-color 180ms cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 180ms cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}

textarea {
  height: auto;
  padding: 12px;
}

input::placeholder,
textarea::placeholder {
  color: var(--ios-secondary) !important;
}

input:focus,
textarea:focus,
select:focus {
  background: var(--ios-card) !important;
  border-color: rgba(0, 122, 255, 0.5) !important;
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.16) !important;
  outline: none !important;
}

label {
  color: var(--ios-secondary) !important;
  font-weight: 500 !important;
  letter-spacing: 0.005em;
}

/* ---------- 文本层级 ---------- */
.sub,
.hint,
.note,
.lab,
.meta {
  color: var(--ios-secondary) !important;
}

.foot {
  color: var(--ios-secondary) !important;
}

.foot a {
  color: var(--ios-blue) !important;
}

.phone-box {
  background: var(--ios-fill) !important;
  border: 0 !important;
  border-radius: 14px !important;
}

.phone-box .val {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.bal-card .big,
.big {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.024em !important;
}

/* ---------- 提示信息 ---------- */
.msg {
  border-radius: 12px !important;
  border: 1px solid transparent !important;
}

.msg.err {
  background: rgba(255, 59, 48, 0.1) !important;
  border-color: rgba(255, 59, 48, 0.2) !important;
  color: #d70015 !important;
}

.msg.ok {
  background: rgba(52, 199, 89, 0.12) !important;
  border-color: rgba(52, 199, 89, 0.22) !important;
  color: #248a3d !important;
}

/* ---------- 计算器结果区 ---------- */
.card.result {
  background: var(--ios-card) !important;
}

.card.result .big {
  color: var(--ios-blue) !important;
  font-weight: 700 !important;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: rgba(120, 120, 128, 0.32);
  border-radius: 999px;
  border: 3px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::selection {
  background: rgba(0, 122, 255, 0.22);
}

/* ---------- 可访问性 ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn,
  .code-btn,
  .tabs button {
    transition: opacity 180ms ease, background-color 180ms ease !important;
  }

  .btn:active,
  .code-btn:active {
    transform: none !important;
  }
}