/* ============================================================
   签到中心 - 样式（移动优先，多账户列表版，参考 DailyHub 风格）
   白底清爽 / 紧凑 / 字体偏大
   ============================================================ */

:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --line: #eaecef;
  --text: #23272e;
  --text-2: #6b7280;
  --text-3: #9ca3af;
  --primary: #2b6de8;
  --primary-deep: #1f5ad1;
  --ok: #10b981;
  --ok-bg: #e8f9f1;
  --ok-deep: #0a9d6e;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(30, 40, 60, .06);
}

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

/* 全局隐藏工具类（JS 动态显隐依赖此类） */
.hidden { display: none !important; }

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 12px calc(20px + env(safe-area-inset-bottom));
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 2px 12px;
}

.brand { display: flex; align-items: center; gap: 10px; }

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2b6de8, #10b981);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: .5px;
}

.topbar-title { font-size: 20px; font-weight: 800; line-height: 1.2; }

.brand-sub {
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot-ok {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ok);
  display: inline-block;
}

.dot-ok.off { background: #d1d5db; }

.topbar-actions { display: flex; gap: 8px; }

.icon-btn {
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--card);
  color: var(--text-2);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.icon-btn.spin { animation: spin 1s linear infinite; }

@keyframes spin { to { transform: rotate(360deg); } }

.add-btn { color: var(--primary); font-weight: 700; }

/* ---------- 卡片通用 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 12px;
}

/* ---------- 连接错误提示条 ---------- */
.conn-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: #fff4e5;
  color: #9a5b00;
  font-size: 12px;
  border-radius: 9px;
  padding: 9px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.conn-bar.hidden { display: none; }

.conn-link {
  color: var(--primary);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

/* ---------- 平台总卡 ---------- */
.platform-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px;
}

.plat-icon {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: #eef3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.plat-text { flex: 1; min-width: 0; }

.plat-name { font-size: 17px; font-weight: 700; }

.plat-count {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  padding: 1px 6px;
  vertical-align: 2px;
  margin-left: 4px;
}

.plat-sub { font-size: 12px; color: var(--text-3); }

.checkall-btn {
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
  transition: transform .1s;
}

.checkall-btn:active { transform: scale(.97); }

.checkall-btn:disabled { opacity: .6; }

/* ---------- 账户卡 ---------- */
.acc-card { position: relative; }

.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.acc-avatar {
  width: 42px; height: 42px;
  border-radius: 11px;
  background: linear-gradient(135deg, #eef3ff, #e8f9f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.acc-title { flex: 1; min-width: 0; }

.acc-name-line { font-size: 16px; display: flex; align-items: baseline; gap: 6px; }

.acc-no {
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 5px;
  padding: 1px 5px;
  font-weight: 600;
}

.acc-sub { font-size: 12px; color: var(--text-3); }

.acc-state {
  flex-shrink: 0;
  font-size: 12px;
  font-weight: 600;
  border-radius: 999px;
  padding: 4px 10px;
  background: #f3f4f6;
  color: var(--text-2);
}

.acc-state.done { background: var(--ok-bg); color: var(--ok-deep); }

.acc-del {
  position: absolute;
  top: 8px; right: 10px;
  border: none;
  background: none;
  color: #c3c9d3;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}

.acc-del:hover { color: #d92d20; }

/* 统计卡：一行 4 个（今日积分/签到后积分/连续/签到日志） */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.stat-cal { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.stat-cal:hover { opacity: .85; }
.stat-cal b { font-size: 13px; }

/* 账号 ID 复制按钮 */
.copy-btn {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  cursor: pointer;
  margin-left: 4px;
  vertical-align: 1px;
}

/* ---------- 签到日历（卡片内切换视图） ---------- */
.cal-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.cal-month { flex: 1; text-align: center; font-size: 15px; font-weight: 800; }

.cal-nav {
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
}

.cal-back {
  border: 1px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #f3f4f6;
  color: var(--text-3);
  font-size: 12px;
}

.cal-day.ok {
  background: var(--ok-bg);
  color: var(--ok-deep);
  font-weight: 700;
}

.cal-day.today { border: 2px solid var(--primary); color: var(--primary); }

.cal-tip { grid-column: 1 / -1; text-align: center; color: var(--text-3); font-size: 12px; padding: 8px 0; }

.stat-cell {
  background: var(--ok-bg);
  border-radius: 10px;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.stat-cell span { font-size: 11px; color: var(--ok-deep); opacity: .85; }

.stat-cell b {
  font-size: 15px;
  font-weight: 700;
  color: var(--ok-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 信息网格（浅灰两列） */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}

.info-cell {
  background: #f7f8fa;
  border-radius: 9px;
  padding: 8px 10px;
  min-width: 0;
}

.info-cell span {
  display: block;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 2px;
}

.info-cell b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 底部标签行 */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 999px;
  padding: 3px 9px;
}

.pill.hl { color: var(--ok-deep); background: var(--ok-bg); }

.pill.blue { color: var(--primary); background: #f0f5ff; }

/* 卡内签到按钮 */
.checkin-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 0;
  cursor: pointer;
  transition: background .2s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}

.checkin-btn:active { transform: scale(.98); }

.checkin-btn:disabled {
  background: var(--ok-bg);
  color: var(--ok);
  cursor: default;
}

.checkin-btn.loading {
  background: var(--primary-deep);
  color: rgba(255, 255, 255, .75);
  cursor: wait;
}

/* 飘字 */
.acc-card { position: relative; }

.fly-points {
  position: absolute;
  left: 50%;
  bottom: 52px;
  transform: translateX(-50%);
  font-size: 19px;
  font-weight: 700;
  color: var(--ok);
  opacity: 0;
  pointer-events: none;
  z-index: 5;
}

.fly-points.animate { animation: flyUp 1s ease-out forwards; }

@keyframes flyUp {
  0%   { opacity: 0; transform: translate(-50%, 8px); }
  25%  { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* ---------- 空状态 / 页脚 ---------- */
.empty {
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  padding: 26px 0 10px;
}

.empty.hidden { display: none; }

.foot {
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
  padding-top: 6px;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(40px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  background: rgba(30, 34, 42, .92);
  color: #fff;
  font-size: 13px;
  border-radius: 8px;
  padding: 9px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 60;
  max-width: 80%;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 弹层 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 32, .45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-mask.hidden { display: none; }

.modal {
  background: var(--card);
  border-radius: 14px;
  padding: 20px 18px;
  width: 100%;
  max-width: 420px;
}

.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }

.modal-tip {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 12px;
}

.modal-tip code {
  background: var(--bg);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
}

.token-input, .name-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 10px;
  font-size: 12px;
  font-family: Consolas, monospace;
  resize: vertical;
  margin-bottom: 10px;
  outline: none;
}

.token-input:focus, .name-input:focus { border-color: var(--primary); }

.name-input { font-family: inherit; font-size: 13px; }

.modal-msg { font-size: 12px; color: #d92d20; min-height: 18px; margin-bottom: 6px; }

.modal-msg.ok { color: var(--ok); }

.modal-btns { display: flex; gap: 10px; }

.btn {
  flex: 1;
  border: none;
  border-radius: 9px;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { opacity: .6; }
.btn.ghost { background: var(--bg); color: var(--text-2); }

/* 弹层内一键提取按钮 + 分隔线 */
.extract-btn { width: 100%; margin-bottom: 12px; }

.extract-btn.loading { opacity: .7; cursor: wait; }

.modal-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 10px;
}

.modal-divider::before, .modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

/* ---------- 账户卡轮播（左右切换） ---------- */
.slider { margin-bottom: 12px; }

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-nav {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--text-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
  transition: color .15s, transform .1s;
}

.slider-nav:hover { color: var(--primary); }
.slider-nav:active { transform: scale(.92); }

.slider-viewport {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.slider-track {
  display: flex;
  transition: transform .35s ease;
}

.slider-track .acc-card {
  flex: 0 0 100%;
  min-width: 0;
  margin-bottom: 0;
}

.slider-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.slider-dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  border: none;
  padding: 0;
  background: #d3d8e0;
  cursor: pointer;
  transition: width .25s, background .25s;
  -webkit-tap-highlight-color: transparent;
}

.slider-dot.active {
  width: 20px;
  background: var(--primary);
}

/* ---------- 小屏微调 ---------- */
@media (max-width: 380px) {
  .page { padding-left: 8px; padding-right: 8px; }
  .card { padding: 12px 10px; }
  .stat-cell b { font-size: 14px; }
  .checkall-btn { padding: 9px 10px; font-size: 13px; }
}

/* ---------- 登录 / 注册视图 ---------- */
.auth-mask {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 40;
}

.auth-mask.hidden { display: none; }

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 26px 22px;
}

.auth-brand { text-align: center; margin-bottom: 18px; }

.auth-logo {
  width: 52px;
  height: 52px;
  font-size: 17px;
  border-radius: 14px;
  margin: 0 auto 10px;
}

.auth-title { font-size: 22px; font-weight: 800; }

.auth-sub { font-size: 12px; color: var(--text-3); margin-top: 4px; }

.auth-tabs {
  display: flex;
  background: var(--bg);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 14px;
}

.auth-tab {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
  padding: 8px 0;
  border-radius: 8px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.auth-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 3px rgba(30, 40, 60, .10);
}

.auth-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 10px;
  outline: none;
}

.auth-input:focus { border-color: var(--primary); }

.auth-msg { font-size: 12px; color: #d92d20; min-height: 18px; margin-bottom: 6px; }

.auth-msg.ok { color: var(--ok); }

.auth-submit { width: 100%; padding: 12px 0; font-size: 15px; }

.auth-foot {
  text-align: center;
  font-size: 11px;
  color: var(--text-3);
  margin-top: 12px;
}

/* ---------- 顶栏用户徽标 ---------- */
.user-chip {
  display: inline-flex;
  align-items: center;
  max-width: 110px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--bg);
  border-radius: 999px;
  padding: 6px 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 推荐位（云端接广/自家产品导流） ---------- */
.promo-card { margin-bottom: 12px; }

.promo-card.hidden { display: none; }

/* ---------- 公告横幅（管理后台发布） ---------- */
.notice-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  background: #fff9e6;
  border: 1px solid #f5e3a3;
  color: #7a5b00;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.notice-text { flex: 1; min-width: 0; }

.notice-close {
  border: none;
  background: none;
  color: #b08d2e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0 2px;
}

/* ---------- 旧数据导入条 ---------- */
.import-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  background: #eef3ff;
  color: #1f5ad1;
  font-size: 12px;
  border-radius: 9px;
  padding: 9px 12px;
  margin-bottom: 12px;
  line-height: 1.5;
}

.import-bar.hidden { display: none; }
