*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #e0e0e0;
  --text: #1a1a1a;
  --muted: #666666;
  --accent: #1a1a1a;
  --accent-hover: #333333;
  --danger: #c0392b;
  --radius: 8px;
  --max-w: 420px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header {
  width: 100%;
  padding: 20px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}

.logo {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--text);
}

main {
  width: 100%;
  max-width: var(--max-w);
  padding: 32px 16px;
  flex: 1;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
}

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}

/* 渠道/选项按钮组 */
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-opt {
  flex: 1;
  min-width: 80px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}

.btn-opt:hover { border-color: var(--accent); }

.btn-opt.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

/* 输入框 */
input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  margin-bottom: 20px;
  outline: none;
}

input[type="number"]:focus { border-color: var(--accent); }

/* 主按钮 */
.btn {
  display: block;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s;
}

.btn:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

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

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

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

.btn-danger:hover { background: #a93226; }

/* 帮助文本框 */
.help-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
  margin-bottom: 20px;
  color: var(--text);
}

/* 状态提示 */
.notice {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
  line-height: 1.6;
}

.notice.ok  { color: #27ae60; }
.notice.err { color: var(--danger); }

/* 分割线 */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* 绑定列表 */
.bind-list {
  list-style: none;
  margin-bottom: 20px;
}

.bind-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.bind-list li:last-child { border-bottom: none; }

.btn-del {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}

.btn-del:hover { color: var(--danger); background: #fdf0ef; }
.btn-del:disabled { opacity: 0.3; cursor: not-allowed; }

.bind-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
  margin-right: 10px;
}

.uid-badge {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}

.memail {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* 步骤指示 */
.step-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 20px;
}

@media (max-width: 480px) {
  main { padding: 20px 12px; }
  .card { padding: 20px 16px; }
}

/* ── 授权页 ─────────────────────────────────────────────── */
.app-info {
  margin-bottom: 4px;
}

.app-name {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.app-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-id {
  font-size: 12px;
  color: var(--muted);
  font-family: monospace;
}

.app-type {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 2px 7px;
  border-radius: 20px;
}

.app-official   { background: #e8f4fd; color: #1a6fa8; }
.app-verified   { background: #eafaf1; color: #1e8449; }
.app-unverified { background: #fef9e7; color: #9a7d0a; }

/* 有效期单选组 */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.radio-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s;
  user-select: none;
}

.radio-opt:hover { border-color: var(--accent); }

.radio-opt input[type="radio"] {
  accent-color: var(--accent);
  width: 14px;
  height: 14px;
  margin: 0;
}

.radio-opt:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.radio-opt:has(input:checked) input[type="radio"] {
  accent-color: #fff;
}
