/* DouAutoPost 手机版：移动优先，配色沿用桌面端「深海蓝」主题 */
:root {
  --primary: #16325B;
  --primary-light: #2B4A7A;
  --accent: #2E8B57;
  --bg: #F4F6FA;
  --card: #FFFFFF;
  --text: #2B2B2B;
  --muted: #8A94A6;
  --border: #E2E6EF;
  --danger: #D93026;
  --warn: #E6A23C;
  --top: 52px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--text);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top); z-index: 20;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 12px; padding-top: env(safe-area-inset-top, 0px);
  box-shadow: 0 1px 6px rgba(16, 40, 80, .18);
}
.tb-title { font-size: 17px; font-weight: 600; }
.tb-actions { display: flex; gap: 4px; }
.icon-btn {
  background: transparent; border: 0; color: inherit; font-size: 17px;
  width: 34px; height: 34px; border-radius: 8px; cursor: pointer;
}
.icon-btn:active { background: rgba(255, 255, 255, .16); }

/* ---------- 顶部导航（手机端 = PC 的同一套页面，只是执行在 PC） ---------- */
/* 与顶栏一样 fixed：#view 的 padding 由 body.has-nav 让位（见下面） */
#navbar {
  position: fixed; top: calc(var(--top) + env(safe-area-inset-top, 0px));
  left: 0; right: 0; height: 44px; z-index: 19;
  display: flex; align-items: center; gap: 6px; overflow-x: auto;
  padding: 0 10px; background: var(--card); border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}
#navbar::-webkit-scrollbar { display: none; }
body.has-nav #view { padding-top: calc(var(--top) + env(safe-area-inset-top, 0px) + 54px); }
.nav-chip {
  flex: 0 0 auto; padding: 5px 12px; border-radius: 999px; font-size: 13px;
  background: #F1F5FB; color: var(--muted); cursor: pointer; white-space: nowrap;
}
.nav-chip.active { background: var(--primary); color: #fff; }
#navBiz {
  flex: 0 0 auto; height: 30px; max-width: 150px; font-size: 12.5px; border-radius: 8px;
  border: 1px solid var(--border); background: #fff; color: var(--text); padding: 0 4px;
}

/* ---------- 主体 ---------- */
#view {
  padding: calc(var(--top) + env(safe-area-inset-top, 0px) + 10px) 12px 96px;
  min-height: 100%;
}
/* 底栏出现时给列表留位置。不能用 `#bottombar:not(.hidden) ~ #view`：
   #view 在 DOM 里排在 #bottombar **前面**，兄弟选择器永远匹配不到（2026-09-20 实测）。
   所以由 app.js 的 setBar() 在 body 上挂 .has-bar。 */
body.has-bar #view { padding-bottom: 150px; }

/* ---------- 登录（统一视觉：与 C7 用户中心同款） ---------- */
.pa-wrap { max-width: 400px; margin: 8vh auto 0; padding: 0 16px; }
.pa-card { width: 100%; background: #fff; border: 1px solid rgba(22,24,29,.1); border-radius: 16px;
  padding: 32px 28px; box-shadow: 0 12px 40px rgba(16,24,40,.08); }
.pa-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; margin-bottom: 20px; }
.pa-logo { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; color: #04381F; background: linear-gradient(135deg,#0FDC78,#0BB863); }
.pa-title { font-size: 18px; font-weight: 600; }
.pa-sub { font-size: 13px; color: #6B7280; }
.pa-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; background: #F1F2F4; border-radius: 10px; padding: 4px; margin-bottom: 18px; }
.pa-seg button { height: 34px; border: 0; border-radius: 8px; background: transparent; color: #6B7280; font-size: 13.5px; cursor: pointer; }
.pa-seg button[aria-selected=true] { background: #fff; color: #16181D; font-weight: 600; box-shadow: 0 1px 2px rgba(16,24,40,.08); }
.pa-field { display: block; margin-bottom: 14px; text-align: left; }
.pa-field > span { display: block; font-size: 12.5px; color: #6B7280; margin-bottom: 6px; }
.pa-wrap .hide { display: none !important; }
input[type=password], input[type=search], input[type=text], input[type=email], input[type=tel] {
  width: 100%; height: 46px; border: 1px solid var(--border); border-radius: 10px;
  padding: 0 12px; font-size: 16px; background: #fff; color: var(--text); outline: none;
}
input:focus { border-color: var(--primary-light); }
.pa-field input { height: 44px; border-radius: 10px; padding: 0 13px; text-align: left; letter-spacing: normal;
  margin-bottom: 0; border-color: rgba(22,24,29,.1); color: #16181D; }
.pa-field input:focus { border-color: #0FDC78; box-shadow: 0 0 0 3px rgba(15,220,120,.18); }
.pa-btn { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border: 0;
  border-radius: 10px; background: #0FDC78; color: #04381F; font-size: 15px; font-weight: 600; cursor: pointer; }
.pa-btn:disabled { opacity: .6; }
.pa-row { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
/* 图形验证码（登录失败 ≥3 次才出现）：点一下换一张 */
.cap-row { display: flex; gap: 8px; }
.cap-row input { flex: 1; min-width: 0; }
.cap-img { flex: none; height: 44px; width: auto; border: 1px solid rgba(22,24,29,.1); border-radius: 10px;
  background: #fff; cursor: pointer; user-select: none; }
.pa-link { background: none; border: 0; padding: 0; color: #04381F; font-size: 13px; cursor: pointer; text-decoration: none; }
.pa-link:hover { text-decoration: underline; }
.pa-alt { margin-top: 16px; text-align: center; font-size: 13px; color: #6B7280; }
.pa-legal { margin-top: 12px; text-align: center; font-size: 11.5px; line-height: 1.7; color: #6B7280; }
.pa-err { color: #E5484D; font-size: 12.5px; min-height: 16px; margin-bottom: 8px; text-align: left; }

.btn {
  border: 0; border-radius: 10px; font-size: 15px; font-weight: 600;
  padding: 0 16px; height: 42px; cursor: pointer; background: #EEF2F8; color: var(--primary);
}
.btn:active { opacity: .82; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { background: #A9B4C8; }
.btn.ghost { background: #EEF2F8; color: var(--muted); }
.btn.wide { width: 100%; height: 46px; }
/* 38px：行内次要按钮，但要保证手指点得准（32px 偏小） */
.btn.small { height: 38px; font-size: 13.5px; padding: 0 16px; border-radius: 8px; }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 4px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 6px 13px; border-radius: 999px; font-size: 13px;
  background: #fff; border: 1px solid var(--border); color: var(--muted); cursor: pointer;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 内容卡片 ---------- */
.card {
  background: var(--card); border-radius: 12px; padding: 12px; margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(22,50,91,.06); display: flex; gap: 11px;
  border: 1.5px solid transparent;
}
.card.selected { border-color: var(--primary); background: #F7FAFF; }
.card-main { flex: 1; min-width: 0; }
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 6px; word-break: break-all; }
.thumb {
  width: 62px; height: 62px; border-radius: 9px; object-fit: cover; flex: 0 0 auto;
  background: #EEF2F8; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 12px; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.meta { color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.mt6 { margin-top: 6px; }
.meta.warn-text { color: #B8801F; }
.meta.err-text { color: var(--danger); }
.badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge {
  font-size: 11px; padding: 2px 8px; border-radius: 6px;
  background: #EEF2F8; color: var(--primary-light);
}
.badge.ok { background: #E8F5EE; color: var(--accent); }
.badge.warn { background: #FDF4E3; color: #B8801F; }
.badge.danger { background: #FCEBEA; color: var(--danger); }
.badge.risk { background: #F0EDFB; color: #6B4FBB; }

.check {
  width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border);
  flex: 0 0 auto; align-self: center; display: flex; align-items: center;
  justify-content: center; color: #fff; font-size: 13px; background: #fff;
}
.check.on { background: var(--primary); border-color: var(--primary); }

/* ---------- 账号 ---------- */
.group-title {
  font-size: 13px; color: var(--muted); margin: 16px 4px 8px; font-weight: 600;
}
.acc {
  background: var(--card); border-radius: 12px; padding: 13px; margin-bottom: 8px;
  display: flex; align-items: center; gap: 11px; border: 1.5px solid transparent;
  box-shadow: 0 1px 6px rgba(22,50,91,.06);
}
.acc.selected { border-color: var(--primary); background: #F7FAFF; }
.acc.disabled { opacity: .5; }
.acc-main { flex: 1; min-width: 0; }
.acc-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }

/* ---------- 任务 ---------- */
.task {
  background: var(--card); border-radius: 12px; padding: 12px;
  margin-bottom: 8px; box-shadow: 0 1px 6px rgba(22,50,91,.06);
}
.task-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.task-title { font-size: 14px; font-weight: 600; flex: 1; min-width: 0; word-break: break-all; }
.task-acts { display: flex; gap: 8px; margin-top: 10px; }

/* 顶部提醒条：待人工 / 失败一眼可见（手机端处理不了验证码，只能提醒回电脑） */
.alert { border-radius: 10px; padding: 11px 13px; font-size: 13.5px; line-height: 1.55; margin-bottom: 10px; }
.alert.warn { background: #FDF4E3; color: #8A5F12; border: 1px solid #F0DCB4; }
.alert.danger { background: #FCEBEA; color: #A9261C; border: 1px solid #F5CFCB; }

/* ---------- 底栏 ---------- */
#bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15;
  background: #fff; border-top: 1px solid var(--border);
  padding: 10px 12px calc(10px + var(--safe-b));
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 -2px 10px rgba(22,50,91,.06);
}
.bb-info { flex: 1; font-size: 13px; color: var(--muted); }

/* ---------- 弹层 ---------- */
.sheet-mask { position: fixed; inset: 0; background: rgba(14,35,64,.45); z-index: 30; }
#sheet .sheet-body {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 31;
  background: #fff; border-radius: 16px 16px 0 0; max-height: 86vh;
  display: flex; flex-direction: column;
}
.sheet-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.sheet-head .icon-btn { color: var(--muted); }
.sheet-content { padding: 14px 16px calc(20px + var(--safe-b)); overflow-y: auto; }
.sheet-content h3 { font-size: 16px; margin: 0 0 8px; }
.sheet-content .body-text {
  white-space: pre-wrap; font-size: 14px; line-height: 1.7;
  background: #F7F9FC; border-radius: 10px; padding: 12px; margin: 10px 0;
  word-break: break-word;
}
.shots { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.shots img { width: 118px; height: 118px; border-radius: 10px; object-fit: cover; flex: 0 0 auto; }
/* 「长按图片可存到相册」这类操作提示（手机版手工发布用） */
.hint { color: #8A94A6; font-size: 12px; margin: 6px 0 2px; }
.kv { display: flex; gap: 8px; font-size: 13px; margin: 5px 0; }
.kv .k { color: var(--muted); flex: 0 0 66px; }
.kv .v { flex: 1; word-break: break-all; }

/* ---------- 确认框 ---------- */
#confirm .dialog {
  position: fixed; z-index: 31; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(88vw, 380px); background: #fff; border-radius: 14px; padding: 20px;
}
.dlg-title { font-weight: 600; font-size: 16px; margin-bottom: 10px; }
.dlg-text { font-size: 14px; color: #4A5568; white-space: pre-wrap; margin-bottom: 18px; }
.dlg-btns { display: flex; gap: 10px; }
.dlg-btns .btn { flex: 1; }

/* ---------- 提示 ---------- */
#toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 40;
  background: rgba(14,35,64,.92); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; max-width: 84vw; text-align: center; white-space: pre-wrap;
}

/* ---------- 其它 ---------- */
.empty { text-align: center; color: var(--muted); font-size: 14px; padding: 56px 20px; }
.loading { text-align: center; color: var(--muted); font-size: 13px; padding: 14px; }
.more { width: 100%; margin: 6px 0 10px; }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin-bottom: 8px; }

/* ---------- 贴链接采集 ---------- */
/* 粘的是 APP 分享出来的**整段文案**（多行、带口令乱码），所以用 textarea 而不是单行输入 */
textarea.paste {
  width: 100%; min-height: 96px; padding: 10px 12px; resize: vertical;
  border: 1px solid var(--border); border-radius: 10px; background: var(--card);
  font: inherit; font-size: 14px; line-height: 1.5; color: var(--text);
}
textarea.paste:focus { border-color: var(--primary-light); outline: none; }
.switch { display: flex; align-items: center; gap: 8px; margin: 12px 2px 6px; font-size: 14px; color: #4A5568; }
.switch input { width: 18px; height: 18px; margin: 0; }
.sec-title { font-size: 13px; color: var(--muted); margin: 14px 2px 8px; }
.sel, select.biz-sel {
  width: 100%; height: 44px; padding: 0 10px; font-size: 15px;
  border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text);
}

.log-box {
  background: #F5F7FA; border-radius: 10px; padding: 10px 12px;
  font-size: 12.5px; color: #5A6478; line-height: 1.6;
  max-height: 148px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
