/* ============================================================
   万能签 H5 样式
   适配深浅色, iOS Safari 16+, 桌面浏览器也能看
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --card: #ffffff;
  --card-soft: #eef1f6;
  --text: #1c1f24;
  --text-soft: #5b6573;
  --text-mute: #8a93a4;
  --primary: #2f6cff;
  --primary-soft: rgba(47, 108, 255, 0.12);
  --shadow: 0 2px 16px rgba(20, 32, 60, 0.06);
  --radius: 18px;
  --radius-lg: 22px;
}

[data-theme="dark"] {
  --bg: #0f1115;
  --card: #1a1d24;
  --card-soft: #232730;
  --text: #ecedf2;
  --text-soft: #b6bccb;
  --text-mute: #7c8294;
  --primary: #3b7bff;
  --primary-soft: rgba(59, 123, 255, 0.18);
  --shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  min-height: 100vh;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 32px;
  padding-top: env(safe-area-inset-top, 16px);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 32px);
}

/* ---------- 顶部 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.topbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.topbar-btn-icon {
  width: 36px; height: 36px; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Hero ---------- */
.hero {
  text-align: center;
  margin: 12px 0 24px;
}
.hero-icon {
  width: 88px; height: 88px;
  margin: 0 auto 12px;
  border-radius: 22px;
  background: linear-gradient(135deg, #6cb1ff 0%, #2f6cff 100%);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(47, 108, 255, 0.35);
}
.hero-icon img { width: 100%; height: 100%; object-fit: cover; }
.hero-title {
  margin: 0; font-size: 22px; font-weight: 700;
}
.hero-sub {
  margin: 8px 0 6px; color: var(--text-soft); font-size: 14px;
}
.hero-link {
  display: inline-block;
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

/* ---------- 卡片 ---------- */
.card {
  background: var(--card-soft);
  border-radius: var(--radius-lg);
  padding: 18px 16px 14px;
  box-shadow: var(--shadow);
  position: relative;
}

/* Tabs (胶囊样式) */
.tabs {
  display: flex;
  background: var(--card);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
}
.tab {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  font-weight: 600;
  font-size: 14px;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text-soft);
  transition: 0.18s;
}
.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 108, 255, 0.3);
}

.tab-hint {
  margin: 4px 4px 8px;
  color: var(--text-mute);
  font-size: 13px;
}

.dots {
  display: flex; justify-content: center; gap: 6px;
  margin: 4px 0 14px;
}
.dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--text-mute);
  opacity: 0.4;
}
.dot.on { opacity: 1; }

/* ---------- 行 ---------- */
.row {
  display: flex;
  align-items: center;
  background: var(--card);
  border-radius: 14px;
  padding: 4px 4px 4px 14px;
  margin-bottom: 10px;
  gap: 8px;
}
.row-input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
  color: var(--text);
  padding: 12px 0;
  min-width: 0;
}
.row-input::placeholder { color: var(--text-mute); }

.row-btn {
  flex-shrink: 0;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 12px;
  padding: 9px 16px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.row-btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.row-btn.primary { background: var(--primary); }

select.row-input { padding: 12px 0; }

/* 主操作按钮 */
.primary-btn {
  display: block;
  width: 100%;
  background: var(--primary);
  color: #fff;
  border: 0;
  border-radius: 14px;
  padding: 14px 0;
  font-size: 16px;
  font-weight: 700;
  margin: 6px 0 8px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(47, 108, 255, 0.28);
}
.primary-btn[disabled] { opacity: 0.6; cursor: not-allowed; }

.foot-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-mute);
  margin: 10px 0 4px;
}
.foot-hint a { color: var(--primary); text-decoration: none; }

/* ---------- 自签上传 ---------- */
.upload-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.upload-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: var(--card);
  border-radius: 14px;
  padding: 18px 12px;
  cursor: pointer;
  border: 1px dashed transparent;
  transition: 0.15s;
}
.upload-tile:hover { border-color: var(--primary); }
.upload-tile input[type="file"] { display: none; }
.upload-tile-title { font-weight: 700; font-size: 14px; }
.upload-tile-tip   { font-size: 12px; color: var(--text-mute); margin-top: 2px; }
.upload-tile-name  { font-size: 12px; color: var(--primary); margin-top: 6px; word-break: break-all; }
.upload-tile-wide { grid-column: 1 / -1; padding: 14px; }

/* ---------- 记录列表 ---------- */
.record-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}
.record-list li {
  background: var(--card);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.record-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 14px;
}
.record-install {
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
}
.record-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-mute);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.badge {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 600;
}
.badge-warn { background: rgba(255, 159, 67, 0.18); color: #e88c1d; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 24, 30, 0.92);
  color: #fff;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 14px;
  z-index: 1000;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  animation: toast-in 0.2s ease;
}
@keyframes toast-in {
  from { opacity: 0; transform: translate(-50%, 12px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* ---------- 底部 ---------- */
.page-foot {
  text-align: center;
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-mute);
}
.page-foot p { margin: 4px 0; }
